cosmos-sdk/docs/uml/svg/transaction_flow.svg

48 lines
13 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="586px" preserveAspectRatio="none" style="width:1089px;height:586px;" version="1.1" viewBox="0 0 1089 586" width="1089px" zoomAndPan="magnify"><defs><filter height="300%" id="f1fk3fcjhssuz0" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><rect fill="#FFFFFF" filter="url(#f1fk3fcjhssuz0)" height="46.2656" style="stroke:#000000;stroke-width:2.0;" width="397" x="392" y="250.9609"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="23" x2="23" y1="88.2969" y2="502.0234"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="194.5" x2="194.5" y1="88.2969" y2="502.0234"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="360" x2="360" y1="88.2969" y2="502.0234"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="438" x2="438" y1="88.2969" y2="502.0234"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="591.5" x2="591.5" y1="88.2969" y2="502.0234"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="849" x2="849" y1="88.2969" y2="502.0234"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="986" x2="986" y1="88.2969" y2="502.0234"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="31" x="5" y="84.9951">User</text><ellipse cx="23.5" cy="15" fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" rx="8" ry="8" style="stroke:#A80036;stroke-width:2.0;"/><path d="M23.5,23 L23.5,50 M10.5,31 L36.5,31 M23.5,50 L10.5,65 M23.5,50 L36.5,65 " fill="none" filter="url(#f1fk3fcjhssuz0)" style="stroke:#A80036;stroke-width:2.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="31" x="5" y="514.0186">User</text><ellipse cx="23.5" cy="527.3203" fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" rx="8" ry="8" style="stroke:#A80036;stroke-width:2.0;"/><path d="M23.5,535.3203 L23.5,562.3203 M10.5,543.3203 L36.5,543.3203 M23.5,562.3203 L10.5,577.3203 M23.5,562.3203 L36.5,577.3203 " fill="none" filter="url(#f1fk3fcjhssuz0)" style="stroke:#A80036;stroke-width:2.0;"/><rect fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="78" x="153.5" y="53"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="64" x="160.5" y="72.9951">baseApp</text><rect fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="78" x="153.5" y="501.0234"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="64" x="160.5" y="521.0186">baseApp</text><rect fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="59" x="329" y="53"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="45" x="336" y="72.9951">router</text><rect fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="59" x="329" y="501.0234"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="45" x="336" y="521.0186">router</text><rect fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="68" x="402" y="53"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="54" x="409" y="72.9951">handler</text><rect fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="68" x="402" y="501.0234"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="54" x="409" y="521.0186">handler</text><rect fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="91" x="544.5" y="53"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="77" x="551.5" y="72.9951">msgServer</text><rect fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="91" x="544.5" y="501.0234"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="77" x="551.5" y="521.0186">msgServer</text><rect fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="66" x="814" y="53"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="52" x="821" y="72.9951">keeper</text><rect fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="66" x="814" y="501.0234"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="52" x="821" y="521.0186">keeper</text><rect fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="181" x="894" y="53"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="167" x="901" y="72.9951">Context.EventManager</text><rect fill="#FEFECE" filter="url(#f1fk3fcjhssuz0)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="181" x="894" y="501.0234"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="167" x="901" y="521.0186">Context.EventManager</text><polygon fill="#A80036" points="182.5,115.4297,192.5,119.4297,182.5,123.4297,186.5,119.4297" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="23.5" x2="188.5" y1="119.4297" y2="119.4297"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="147" x="30.5" y="114.3638">Transaction Type&lt;Tx&gt;</text><polygon fill="#A80036" points="348.5,144.5625,358.5,148.5625,348.5,152.5625,352.5,148.5625" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="194.5" x2="354.5" y1="148.5625" y2="148.5625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="142" x="201.5" y="143.4966">Route(ctx, msgRoute)</text><polygon fill="#A80036" points="205.5,173.6953,195.5,177.6953,205.5,181.6953,201.5,177.6953" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="199.5" x2="359.5" y1="177.6953" y2="177.6953"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="48" x="211.5" y="172.6294">handler</text><polygon fill="#A80036" points="426,202.8281,436,206.8281,426,210.8281,430,206.8281" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="194.5" x2="432" y1="206.8281" y2="206.8281"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="177" x="201.5" y="201.7622">Msg&lt;Tx&gt;(Context, Msg(...))</text><polygon fill="#A80036" points="580,231.9609,590,235.9609,580,239.9609,584,235.9609" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="438" x2="586" y1="235.9609" y2="235.9609"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="130" x="445" y="230.895">&lt;Tx&gt;(Context, Msg)</text><path d="M392,250.9609 L458,250.9609 L458,257.9609 L448,267.9609 L392,267.9609 L392,250.9609 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.0;"/><rect fill="none" height="46.2656" style="stroke:#000000;stroke-width:2.0;" width="397" x="392" y="250.9609"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="21" x="407" y="264.0278">alt</text><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="311" x="473" y="263.1714">[addresses invalid, denominations wrong, etc.]</text><polygon fill="#A80036" points="449,285.2266,439,289.2266,449,293.2266,445,289.2266" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="443" x2="591" y1="289.2266" y2="289.2266"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="31" x="455" y="284.1606">error</text><polygon fill="#A80036" points="837,321.3594,847,325.3594,837,329.3594,841,325.3594" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="592" x2="843" y1="325.3594" y2="325.3594"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="201" x="599" y="320.2935">perform action, update context</text><polygon fill="#A80036" points="603,350.4922,593,354.4922,603,358.4922,599,354.4922" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="597" x2="848" y1="354.4922" y2="354.4922"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="117" x="609" y="349.4263">results, error code</text><polygon fill="#A80036" points="974.5,379.625,984.5,383.625,974.5,387.625,978.5,383.625" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="592" x2="980.5" y1="383.625" y2="383.625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="134" x="599" y="378.5591">Emit relevant events</text><line style="stroke:#A80036;stroke-width:1.0;" x1="592" x2="634" y1="412.7578" y2="412.7578"/><line style="stroke:#A80036;stroke-width:1.0;" x1="634" x2="634" y1="412.7578" y2="425.7578"/><line style="stroke:#A80036;stroke-width:1.0;" x1="593" x2="634" y1="425.7578" y2="425.7578"/><polygon fill="#A80036" points="603,421.7578,593,425.7578,603,429.7578,599,425.7578" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="243" x="599" y="407.6919">maybe wrap results in more structure</text><polygon fill="#A80036" points="449,450.8906,439,454.8906,449,458.8906,445,454.8906" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="443" x2="591" y1="454.8906" y2="454.8906"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="110" x="455" y="449.8247">result, error code</text><polygon fill="#A80036" points="205.5,480.0234,195.5,484.0234,205.5,488.0234,201.5,484.0234" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="199.5" x2="437" y1="484.0234" y2="484.0234"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="117" x="211.5" y="478.9575">results, error code</text><!--MD5=[454ec0ad4cfc81e26ef812238e126589]
@startuml
'https://plantuml.com/sequence-diagram
actor User
User -> baseApp : Transaction Type<Tx>
baseApp -> router : Route(ctx, msgRoute)
router - -> baseApp : handler
baseApp -> handler: Msg<Tx>(Context, Msg(...))
handler -> msgServer : <Tx>(Context, Msg)
alt addresses invalid, denominations wrong, etc.
msgServer - -> handler : error
end
msgServer -> keeper : perform action, update context
keeper - -> msgServer : results, error code
msgServer -> Context.EventManager : Emit relevant events
msgServer -> msgServer : maybe wrap results in more structure
msgServer - -> handler : result, error code
baseApp <- - handler : results, error code
@enduml
@startuml
actor User
User -> baseApp : Transaction Type<Tx>
baseApp -> router : Route(ctx, msgRoute)
router - -> baseApp : handler
baseApp -> handler: Msg<Tx>(Context, Msg(...))
handler -> msgServer : <Tx>(Context, Msg)
alt addresses invalid, denominations wrong, etc.
msgServer - -> handler : error
end
msgServer -> keeper : perform action, update context
keeper - -> msgServer : results, error code
msgServer -> Context.EventManager : Emit relevant events
msgServer -> msgServer : maybe wrap results in more structure
msgServer - -> handler : result, error code
baseApp <- - handler : results, error code
@enduml
PlantUML version 1.2021.5beta3(Unknown compile time)
(GPL source distribution)
Java Runtime: Java(TM) SE Runtime Environment
JVM: Java HotSpot(TM) 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>