event-msg

Simple, embedded news post vehicle for EVM smart contracts
Log | Files | Refs

commit cd1a752a47016aafa9fbfe7740393001b9f74b06
parent da18d4f2d209cd85e6bd59540212d325a7ff5ee7
Author: lash <dev@holbrook.no>
Date:   Sat, 18 Feb 2023 07:32:53 +0000

Add python support for add and set codec

Diffstat:
Mpython/eth_event_msg/__init__.py | 29+++++++++++++++++++++++++++++
Mpython/eth_event_msg/data/Msg.bin | 4++--
Mpython/tests/test_basic.py | 32++++++++++++++++++++++++++++++++
Msolidity/Msg.sol | 8+++++++-
4 files changed, 70 insertions(+), 3 deletions(-)

diff --git a/python/eth_event_msg/__init__.py b/python/eth_event_msg/__init__.py @@ -70,6 +70,35 @@ class EventMsg(TxFactory): return tx + def set_msg_codec(self, contract_address, sender_address, v, tx_format=TxFormat.JSONRPC): + enc = ABIContractEncoder() + enc.method('setMsgCodec') + enc.typ(ABIContractType.UINT256) + enc.uint256(v) + data = enc.get() + tx = self.template(sender_address, contract_address, use_nonce=True) + tx = self.set_code(tx, data) + tx = self.finalize(tx, tx_format) + return tx + + + def add_codec(self, contract_address, sender_address, codec_hashlength, codec_code, codec_prefix, tx_format=TxFormat.JSONRPC): + enc = ABIContractEncoder() + enc.method('addCodec') + enc.typ(ABIContractType.UINT8) + enc.typ(ABIContractType.UINT64) + enc.typ(ABIContractType.STRING) + enc.uintn(codec_hashlength, 8) + enc.uintn(codec_code, 64) + enc.string(codec_prefix) + data = enc.get() + tx = self.template(sender_address, contract_address, use_nonce=True) + tx = self.set_code(tx, data) + tx = self.finalize(tx, tx_format) + return tx + + + def get_msg(self, contract_address, sender_address=ZERO_ADDRESS, id_generator=None): return self.call_noarg('getMsg', contract_address, sender_address=sender_address, id_generator=id_generator) diff --git a/python/eth_event_msg/data/Msg.bin b/python/eth_event_msg/data/Msg.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b5062000065602060126040518060400160405280600681526020017f7368613235360000000000000000000000000000000000000000000000000000815250620000e9640100000000026401000000009004565b6200008060126200040d640100000000026401000000009004565b602067ffffffffffffffff8111156200009e576200009d62000504565b5b6040519080825280601f01601f191660200182016040528015620000d15781602001600182028036833780820191505090505b5060029081620000e2919062000784565b5062000bbd565b6000600160ff16600354161462000137576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200012e90620008cc565b60405180910390fd5b606081905060108151111562000184576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200017b906200093e565b60405180910390fd5b6200018e6200049e565b6000600790505b60008160ff1610620001f2576000600882620001b291906200099c565b60ff1660ff9060020a029050600086821667ffffffffffffffff161115620001db5750620001f2565b8180620001e890620009e2565b9250505062000195565b60018162000201919062000a10565b826020019060ff16908160ff1681525050600881600762000223919062000a4c565b6200022f91906200099c565b60ff168567ffffffffffffffff169060020a02780100000000000000000000000000000000000000000000000002826080019077ffffffffffffffffffffffffffffffffffffffffffffffff1916908177ffffffffffffffffffffffffffffffffffffffffffffffff1916815250508251826040019060ff16908160ff168152505082620002bd9062000adb565b82606001906fffffffffffffffffffffffffffffffff191690816fffffffffffffffffffffffffffffffff19168152505085826000019060ff16908160ff1681525050816000808767ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a8154816fffffffffffffffffffffffffffffffff02191690837001000000000000000000000000000000009004021790555060808201518160000160136101000a81548167ffffffffffffffff0219169083780100000000000000000000000000000000000000000000000090040217905550905050505050505050565b6000600160ff1660035416146200045b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620004529062000b9b565b60405180910390fd5b6000806000838152602001908152602001600020905060008160000160009054906101000a900460ff1660ff16116200049357600080fd5b816001819055505050565b6040518060a00160405280600060ff168152602001600060ff168152602001600060ff16815260200160006fffffffffffffffffffffffffffffffff19168152602001600077ffffffffffffffffffffffffffffffffffffffffffffffff191681525090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200058657607f821691505b6020821081036200059c576200059b6200053e565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302620006097fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620005c7565b620006158683620005c7565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620006626200065c62000656846200062d565b62000637565b6200062d565b9050919050565b6000819050919050565b6200067e8362000641565b620006966200068d8262000669565b848454620005d7565b825550505050565b600090565b620006ad6200069e565b620006ba81848462000673565b505050565b5b81811015620006e257620006d6600082620006a3565b600181019050620006c0565b5050565b601f8211156200073157620006fb81620005a2565b6200070684620005b7565b8101602085101562000716578190505b6200072e6200072585620005b7565b830182620006bf565b50505b505050565b60008160020a8304905092915050565b6000620007596000198460080262000736565b1980831691505092915050565b600062000774838362000746565b9150826002028217905092915050565b6200078f8262000533565b67ffffffffffffffff811115620007ab57620007aa62000504565b5b620007b782546200056d565b620007c4828285620006e6565b600060209050601f831160018114620007fc5760008415620007e7578287015190505b620007f3858262000766565b86555062000863565b601f1984166200080c86620005a2565b60005b8281101562000836578489015182556001820191506020850194506020810190506200080f565b8683101562000856578489015162000852601f89168262000746565b8355505b6001600288020188555050505b505050505050565b600082825260208201905092915050565b7f4552525f5345414c5f434f4445434c4953540000000000000000000000000000600082015250565b6000620008b46012836200086b565b9150620008c1826200087c565b602082019050919050565b60006020820190508181036000830152620008e781620008a5565b9050919050565b7f4552525f5052454649585f544f4f5f4c4f4e4700000000000000000000000000600082015250565b6000620009266013836200086b565b91506200093382620008ee565b602082019050919050565b60006020820190508181036000830152620009598162000917565b9050919050565b600060ff82169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000620009a98262000960565b9150620009b68362000960565b9250828202620009c68162000960565b9150808214620009db57620009da6200096d565b5b5092915050565b6000620009ef8262000960565b91506000820362000a055762000a046200096d565b5b600182039050919050565b600062000a1d8262000960565b915062000a2a8362000960565b9250828201905060ff81111562000a465762000a456200096d565b5b92915050565b600062000a598262000960565b915062000a668362000960565b9250828203905060ff81111562000a825762000a816200096d565b5b92915050565b6000819050602082019050919050565b60007fffffffffffffffffffffffffffffffff0000000000000000000000000000000082169050919050565b600062000ad2825162000a98565b80915050919050565b600062000ae88262000533565b8262000af48462000a88565b905062000b018162000ac4565b9250601082101562000b445762000b3f7fffffffffffffffffffffffffffffffff0000000000000000000000000000000083601003600802620005c7565b831692505b5050919050565b7f4552525f5345414c5f434f444543000000000000000000000000000000000000600082015250565b600062000b83600e836200086b565b915062000b908262000b4b565b602082019050919050565b6000602082019050818103600083015262000bb68162000b74565b9050919050565b6120168062000bcd6000396000f3fe608060405234801561001057600080fd5b50600436106100d1576000357c0100000000000000000000000000000000000000000000000000000000900480639a7c5e9f1161008e5780639a7c5e9f146101be578063ad0dec2f146101da578063b238d6031461020a578063b5fdeb231461023e578063c5bec6fc1461025c578063ccc094c21461028c576100d1565b806318cbbcfc146100d65780632c1758c1146100f457806331a5995d146101245780635344299a14610142578063779ab6671461015e57806386fe212d1461018e575b600080fd5b6100de6102a8565b6040516100eb91906112a2565b60405180910390f35b61010e600480360381019061010991906112fd565b6102ad565b60405161011b9190611345565b60405180910390f35b61012c6102df565b60405161013991906112a2565b60405180910390f35b61015c600480360381019061015791906114a6565b6102e5565b005b610178600480360381019061017391906114a6565b610332565b604051610185919061156e565b60405180910390f35b6101a860048036038101906101a391906112fd565b6105dc565b6040516101b591906112a2565b60405180910390f35b6101d860048036038101906101d391906112fd565b6106c2565b005b6101f460048036038101906101ef91906114a6565b61074f565b60405161020191906115e5565b60405180910390f35b610224600480360381019061021f91906112fd565b610a25565b604051610235959493929190611699565b60405180910390f35b610246610ac4565b60405161025391906115e5565b60405180910390f35b610276600480360381019061027191906114a6565b610b5e565b60405161028391906115e5565b60405180910390f35b6102a660048036038101906102a191906117f9565b610f17565b005b600381565b6000600382106102bc57600080fd5b600082036102d057600380541490506102da565b8160035483161490505b919050565b60035481565b6000806000600154815260200190815260200160002090508060000160009054906101000a900460ff1660ff1682511461031e57600080fd5b816002908161032d9190611a7a565b505050565b60606000606080600061034486610b5e565b9150600080600154815260200190815260200160002093508360000160029054906101000a900460ff1660ff16905060018251826103829190611b7b565b61038c9190611b7b565b67ffffffffffffffff8111156103a5576103a461137b565b5b6040519080825280601f01601f1916602001820160405280156103d75781602001600182028036833780820191505090505b50925060005b81811015610491578460000160039054906101000a900470010000000000000000000000000000000002816010811061041957610418611baf565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000284828151811061044f5761044e611baf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808061048990611bde565b9150506103dd565b50603a7f0100000000000000000000000000000000000000000000000000000000000000028382815181106104c9576104c8611baf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808061050390611bde565b91505060005b82518110156105cf5782818151811061052557610524611baf565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f01000000000000000000000000000000000000000000000000000000000000000284828461057c9190611b7b565b8151811061058d5761058c611baf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806105c790611bde565b915050610509565b5082945050505050919050565b600060108210610621576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061890611c72565b60405180910390fd5b6000600354831614610668576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065f90611cde565b60405180910390fd5b81600360008282541792505081905550600380541415157f6b7e2e653f93b645d4ed7292d6429f96637084363e477c8aaea1a43ed13c284e6003546040516106b091906112a2565b60405180910390a26003549050919050565b6000600160ff16600354161461070d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070490611d4a565b60405180910390fd5b6000806000838152602001908152602001600020905060008160000160009054906101000a900460ff1660ff161161074457600080fd5b816001819055505050565b606060006060600080600154815260200190815260200160002091508160000160019054906101000a900460ff1660ff168260000160009054906101000a900460ff1660ff1685516107a19190611b7b565b6107ab9190611b7b565b67ffffffffffffffff8111156107c4576107c361137b565b5b6040519080825280601f01601f1916602001820160405280156107f65781602001600182028036833780820191505090505b50905060005b8260000160019054906101000a900460ff1660ff168110156108cc578260000160139054906101000a9004780100000000000000000000000000000000000000000000000002816008811061085457610853611baf565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000282828151811061088a57610889611baf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806108c490611bde565b9150506107fc565b8260000160009054906101000a900460ff167f01000000000000000000000000000000000000000000000000000000000000000282828151811061091357610912611baf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808061094d90611bde565b91505060005b8551811015610a195785818151811061096f5761096e611baf565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028382846109c69190611b7b565b815181106109d7576109d6611baf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610a1190611bde565b915050610953565b50819350505050919050565b60006020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060000160029054906101000a900460ff16908060000160039054906101000a900470010000000000000000000000000000000002908060000160139054906101000a9004780100000000000000000000000000000000000000000000000002905085565b6060610b5960028054610ad690611897565b80601f0160208091040260200160405190810160405280929190818152602001828054610b0290611897565b8015610b4f5780601f10610b2457610100808354040283529160200191610b4f565b820191906000526020600020905b815481529060010190602001808311610b3257829003601f168201915b505050505061074f565b905090565b60608060008060028551610b729190611d6a565b67ffffffffffffffff811115610b8b57610b8a61137b565b5b6040519080825280601f01601f191660200182016040528015610bbd5781602001600182028036833780820191505090505b5092506000905060005b6020811015610f0b57600460f0878381518110610be757610be6611baf565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090041660ff16908060020a82049150509250600a8360ff161015610ce657603083610c7d9190611dac565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110610cb257610cb1611baf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610d58565b605783610cf39190611dac565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110610d2857610d27611baf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600f868281518110610d6d57610d6c611baf565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004169250600a8360ff161015610e6b57603083610df69190611dac565b7f01000000000000000000000000000000000000000000000000000000000000000284600184610e269190611b7b565b81518110610e3757610e36611baf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610ee9565b605783610e789190611dac565b7f01000000000000000000000000000000000000000000000000000000000000000284600184610ea89190611b7b565b81518110610eb957610eb8611baf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600282610ef69190611b7b565b91508080610f0390611bde565b915050610bc7565b50829350505050919050565b6000600160ff166003541614610f62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5990611e2d565b60405180910390fd5b6060819050601081511115610fac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa390611e99565b60405180910390fd5b610fb4611223565b6000600790505b60008160ff1610611010576000600882610fd59190611eb9565b60ff1660ff9060020a029050600086821667ffffffffffffffff161115610ffc5750611010565b818061100790611ef6565b92505050610fbb565b60018161101d9190611dac565b826020019060ff16908160ff1681525050600881600761103d9190611f1f565b6110479190611eb9565b60ff168567ffffffffffffffff169060020a02780100000000000000000000000000000000000000000000000002826080019077ffffffffffffffffffffffffffffffffffffffffffffffff1916908177ffffffffffffffffffffffffffffffffffffffffffffffff1916815250508251826040019060ff16908160ff1681525050826110d390611f79565b82606001906fffffffffffffffffffffffffffffffff191690816fffffffffffffffffffffffffffffffff19168152505085826000019060ff16908160ff1681525050816000808767ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a8154816fffffffffffffffffffffffffffffffff02191690837001000000000000000000000000000000009004021790555060808201518160000160136101000a81548167ffffffffffffffff0219169083780100000000000000000000000000000000000000000000000090040217905550905050505050505050565b6040518060a00160405280600060ff168152602001600060ff168152602001600060ff16815260200160006fffffffffffffffffffffffffffffffff19168152602001600077ffffffffffffffffffffffffffffffffffffffffffffffff191681525090565b6000819050919050565b61129c81611289565b82525050565b60006020820190506112b76000830184611293565b92915050565b6000604051905090565b600080fd5b600080fd5b6112da81611289565b81146112e557600080fd5b50565b6000813590506112f7816112d1565b92915050565b600060208284031215611313576113126112c7565b5b6000611321848285016112e8565b91505092915050565b60008115159050919050565b61133f8161132a565b82525050565b600060208201905061135a6000830184611336565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6113b38261136a565b810181811067ffffffffffffffff821117156113d2576113d161137b565b5b80604052505050565b60006113e56112bd565b90506113f182826113aa565b919050565b600067ffffffffffffffff8211156114115761141061137b565b5b61141a8261136a565b9050602081019050919050565b82818337600083830152505050565b6000611449611444846113f6565b6113db565b90508281526020810184848401111561146557611464611365565b5b611470848285611427565b509392505050565b600082601f83011261148d5761148c611360565b5b813561149d848260208601611436565b91505092915050565b6000602082840312156114bc576114bb6112c7565b5b600082013567ffffffffffffffff8111156114da576114d96112cc565b5b6114e684828501611478565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561152957808201518184015260208101905061150e565b60008484015250505050565b6000611540826114ef565b61154a81856114fa565b935061155a81856020860161150b565b6115638161136a565b840191505092915050565b600060208201905081810360008301526115888184611535565b905092915050565b600081519050919050565b600082825260208201905092915050565b60006115b782611590565b6115c1818561159b565b93506115d181856020860161150b565b6115da8161136a565b840191505092915050565b600060208201905081810360008301526115ff81846115ac565b905092915050565b600060ff82169050919050565b61161d81611607565b82525050565b60007fffffffffffffffffffffffffffffffff0000000000000000000000000000000082169050919050565b61165881611623565b82525050565b60007fffffffffffffffff00000000000000000000000000000000000000000000000082169050919050565b6116938161165e565b82525050565b600060a0820190506116ae6000830188611614565b6116bb6020830187611614565b6116c86040830186611614565b6116d5606083018561164f565b6116e2608083018461168a565b9695505050505050565b6116f581611607565b811461170057600080fd5b50565b600081359050611712816116ec565b92915050565b600067ffffffffffffffff82169050919050565b61173581611718565b811461174057600080fd5b50565b6000813590506117528161172c565b92915050565b600067ffffffffffffffff8211156117735761177261137b565b5b61177c8261136a565b9050602081019050919050565b600061179c61179784611758565b6113db565b9050828152602081018484840111156117b8576117b7611365565b5b6117c3848285611427565b509392505050565b600082601f8301126117e0576117df611360565b5b81356117f0848260208601611789565b91505092915050565b600080600060608486031215611812576118116112c7565b5b600061182086828701611703565b935050602061183186828701611743565b925050604084013567ffffffffffffffff811115611852576118516112cc565b5b61185e868287016117cb565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806118af57607f821691505b6020821081036118c2576118c1611868565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b60006008830261192d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826118ed565b61193786836118ed565b95508019841693508086168417925050509392505050565b6000819050919050565b600061197461196f61196a84611289565b61194f565b611289565b9050919050565b6000819050919050565b61198e83611959565b6119a261199a8261197b565b8484546118fd565b825550505050565b600090565b6119b76119aa565b6119c2818484611985565b505050565b5b818110156119e6576119db6000826119af565b6001810190506119c8565b5050565b601f821115611a2b576119fc816118c8565b611a05846118dd565b81016020851015611a14578190505b611a28611a20856118dd565b8301826119c7565b50505b505050565b60008160020a8304905092915050565b6000611a5160001984600802611a30565b1980831691505092915050565b6000611a6a8383611a40565b9150826002028217905092915050565b611a8382611590565b67ffffffffffffffff811115611a9c57611a9b61137b565b5b611aa68254611897565b611ab18282856119ea565b600060209050601f831160018114611ae45760008415611ad2578287015190505b611adc8582611a5e565b865550611b44565b601f198416611af2866118c8565b60005b82811015611b1a57848901518255600182019150602085019450602081019050611af5565b86831015611b375784890151611b33601f891682611a40565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611b8682611289565b9150611b9183611289565b9250828201905080821115611ba957611ba8611b4c565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611be982611289565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c1b57611c1a611b4c565b5b600182019050919050565b7f4552525f494e56414c49445f5354415445000000000000000000000000000000600082015250565b6000611c5c6011836114fa565b9150611c6782611c26565b602082019050919050565b60006020820190508181036000830152611c8b81611c4f565b9050919050565b7f4552525f414c52454144595f4c4f434b45440000000000000000000000000000600082015250565b6000611cc86012836114fa565b9150611cd382611c92565b602082019050919050565b60006020820190508181036000830152611cf781611cbb565b9050919050565b7f4552525f5345414c5f434f444543000000000000000000000000000000000000600082015250565b6000611d34600e836114fa565b9150611d3f82611cfe565b602082019050919050565b60006020820190508181036000830152611d6381611d27565b9050919050565b6000611d7582611289565b9150611d8083611289565b9250828202611d8e81611289565b91508282048414831517611da557611da4611b4c565b5b5092915050565b6000611db782611607565b9150611dc283611607565b9250828201905060ff811115611ddb57611dda611b4c565b5b92915050565b7f4552525f5345414c5f434f4445434c4953540000000000000000000000000000600082015250565b6000611e176012836114fa565b9150611e2282611de1565b602082019050919050565b60006020820190508181036000830152611e4681611e0a565b9050919050565b7f4552525f5052454649585f544f4f5f4c4f4e4700000000000000000000000000600082015250565b6000611e836013836114fa565b9150611e8e82611e4d565b602082019050919050565b60006020820190508181036000830152611eb281611e76565b9050919050565b6000611ec482611607565b9150611ecf83611607565b9250828202611edd81611607565b9150808214611eef57611eee611b4c565b5b5092915050565b6000611f0182611607565b915060008203611f1457611f13611b4c565b5b600182039050919050565b6000611f2a82611607565b9150611f3583611607565b9250828203905060ff811115611f4e57611f4d611b4c565b5b92915050565b6000819050602082019050919050565b6000611f708251611623565b80915050919050565b6000611f8482611590565b82611f8e84611f54565b9050611f9981611f64565b92506010821015611fd957611fd47fffffffffffffffffffffffffffffffff00000000000000000000000000000000836010036008026118ed565b831692505b505091905056fea264697066735822122021af19aa70e591f4696eeb5a45ef013f2371031795cb4e3f363caee6534aa25264736f6c63430008110033 -\ No newline at end of file +60806040523480156200001157600080fd5b5062000065602060126040518060400160405280600681526020017f7368613235360000000000000000000000000000000000000000000000000000815250620000e9640100000000026401000000009004565b6200008060126200040d640100000000026401000000009004565b602067ffffffffffffffff8111156200009e576200009d62000977565b5b6040519080825280601f01601f191660200182016040528015620000d15781602001600182028036833780820191505090505b5060029081620000e2919062000bf7565b506200119a565b6000600160ff16600354161462000137576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200012e9062000d3f565b60405180910390fd5b606081905060108151111562000184576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200017b9062000db1565b60405180910390fd5b6200018e62000911565b6000600790505b60008160ff1610620001f2576000600882620001b2919062000e0f565b60ff1660ff9060020a029050600086821667ffffffffffffffff161115620001db5750620001f2565b8180620001e89062000e55565b9250505062000195565b60018162000201919062000e83565b826020019060ff16908160ff1681525050600881600762000223919062000ebf565b6200022f919062000e0f565b60ff168567ffffffffffffffff169060020a02780100000000000000000000000000000000000000000000000002826080019077ffffffffffffffffffffffffffffffffffffffffffffffff1916908177ffffffffffffffffffffffffffffffffffffffffffffffff1916815250508251826040019060ff16908160ff168152505082620002bd9062000f4e565b82606001906fffffffffffffffffffffffffffffffff191690816fffffffffffffffffffffffffffffffff19168152505085826000019060ff16908160ff1681525050816000808767ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a8154816fffffffffffffffffffffffffffffffff02191690837001000000000000000000000000000000009004021790555060808201518160000160136101000a81548167ffffffffffffffff0219169083780100000000000000000000000000000000000000000000000090040217905550905050505050505050565b6000600160ff1660035416146200045b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000452906200100e565b60405180910390fd5b6000806000838152602001908152602001600020905060008160000160009054906101000a900460ff1660ff16116200049357600080fd5b816001819055508060000160009054906101000a900460ff1660ff1667ffffffffffffffff811115620004cb57620004ca62000977565b5b6040519080825280601f01601f191660200182016040528015620004fe5781602001600182028036833780820191505090505b50600290816200050f919062000bf7565b507f502ae868d71f78c5d099f033dd3007a4f58aebb3a2816544fe690f8b9604b56c6200054a62000565640100000000026401000000009004565b604051620005599190620010bf565b60405180910390a15050565b606062000613600280546200057a90620009e0565b80601f0160208091040260200160405190810160405280929190818152602001828054620005a890620009e0565b8015620005f95780601f10620005cd57610100808354040283529160200191620005f9565b820191906000526020600020905b815481529060010190602001808311620005db57829003601f168201915b505050505062000618640100000000026401000000009004565b905090565b606060006060600080600154815260200190815260200160002091508160000160019054906101000a900460ff1660ff168260000160009054906101000a900460ff1660ff1685516200066c9190620010e3565b620006789190620010e3565b67ffffffffffffffff81111562000694576200069362000977565b5b6040519080825280601f01601f191660200182016040528015620006c75781602001600182028036833780820191505090505b50905060005b8260000160019054906101000a900460ff1660ff16811015620007a7578260000160139054906101000a900478010000000000000000000000000000000000000000000000000281600881106200072957620007286200111e565b5b1a7f0100000000000000000000000000000000000000000000000000000000000000028282815181106200076257620007616200111e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806200079e906200114d565b915050620006cd565b8260000160009054906101000a900460ff167f010000000000000000000000000000000000000000000000000000000000000002828281518110620007f157620007f06200111e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806200082d906200114d565b91505060005b855181101562000905578581815181106200085357620008526200111e565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002838284620008ac9190620010e3565b81518110620008c057620008bf6200111e565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080620008fc906200114d565b91505062000833565b50819350505050919050565b6040518060a00160405280600060ff168152602001600060ff168152602001600060ff16815260200160006fffffffffffffffffffffffffffffffff19168152602001600077ffffffffffffffffffffffffffffffffffffffffffffffff191681525090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620009f957607f821691505b60208210810362000a0f5762000a0e620009b1565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b60006008830262000a7c7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000a3a565b62000a88868362000a3a565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b600062000ad562000acf62000ac98462000aa0565b62000aaa565b62000aa0565b9050919050565b6000819050919050565b62000af18362000ab4565b62000b0962000b008262000adc565b84845462000a4a565b825550505050565b600090565b62000b2062000b11565b62000b2d81848462000ae6565b505050565b5b8181101562000b555762000b4960008262000b16565b60018101905062000b33565b5050565b601f82111562000ba45762000b6e8162000a15565b62000b798462000a2a565b8101602085101562000b89578190505b62000ba162000b988562000a2a565b83018262000b32565b50505b505050565b60008160020a8304905092915050565b600062000bcc6000198460080262000ba9565b1980831691505092915050565b600062000be7838362000bb9565b9150826002028217905092915050565b62000c0282620009a6565b67ffffffffffffffff81111562000c1e5762000c1d62000977565b5b62000c2a8254620009e0565b62000c3782828562000b59565b600060209050601f83116001811462000c6f576000841562000c5a578287015190505b62000c66858262000bd9565b86555062000cd6565b601f19841662000c7f8662000a15565b60005b8281101562000ca95784890151825560018201915060208501945060208101905062000c82565b8683101562000cc9578489015162000cc5601f89168262000bb9565b8355505b6001600288020188555050505b505050505050565b600082825260208201905092915050565b7f4552525f5345414c5f434f4445434c4953540000000000000000000000000000600082015250565b600062000d2760128362000cde565b915062000d348262000cef565b602082019050919050565b6000602082019050818103600083015262000d5a8162000d18565b9050919050565b7f4552525f5052454649585f544f4f5f4c4f4e4700000000000000000000000000600082015250565b600062000d9960138362000cde565b915062000da68262000d61565b602082019050919050565b6000602082019050818103600083015262000dcc8162000d8a565b9050919050565b600060ff82169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062000e1c8262000dd3565b915062000e298362000dd3565b925082820262000e398162000dd3565b915080821462000e4e5762000e4d62000de0565b5b5092915050565b600062000e628262000dd3565b91506000820362000e785762000e7762000de0565b5b600182039050919050565b600062000e908262000dd3565b915062000e9d8362000dd3565b9250828201905060ff81111562000eb95762000eb862000de0565b5b92915050565b600062000ecc8262000dd3565b915062000ed98362000dd3565b9250828203905060ff81111562000ef55762000ef462000de0565b5b92915050565b6000819050602082019050919050565b60007fffffffffffffffffffffffffffffffff0000000000000000000000000000000082169050919050565b600062000f45825162000f0b565b80915050919050565b600062000f5b82620009a6565b8262000f678462000efb565b905062000f748162000f37565b9250601082101562000fb75762000fb27fffffffffffffffffffffffffffffffff000000000000000000000000000000008360100360080262000a3a565b831692505b5050919050565b7f4552525f5345414c5f434f444543000000000000000000000000000000000000600082015250565b600062000ff6600e8362000cde565b9150620010038262000fbe565b602082019050919050565b60006020820190508181036000830152620010298162000fe7565b9050919050565b600082825260208201905092915050565b60005b838110156200106157808201518184015260208101905062001044565b60008484015250505050565b6000601f19601f8301169050919050565b60006200108b82620009a6565b62001097818562001030565b9350620010a981856020860162001041565b620010b4816200106d565b840191505092915050565b60006020820190508181036000830152620010db81846200107e565b905092915050565b6000620010f08262000aa0565b9150620010fd8362000aa0565b925082820190508082111562001118576200111762000de0565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006200115a8262000aa0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036200118f576200118e62000de0565b5b600182019050919050565b61210280620011aa6000396000f3fe608060405234801561001057600080fd5b50600436106100d1576000357c0100000000000000000000000000000000000000000000000000000000900480639a7c5e9f1161008e5780639a7c5e9f146101be578063ad0dec2f146101da578063b238d6031461020a578063b5fdeb231461023e578063c5bec6fc1461025c578063ccc094c21461028c576100d1565b806318cbbcfc146100d65780632c1758c1146100f457806331a5995d146101245780635344299a14610142578063779ab6671461015e57806386fe212d1461018e575b600080fd5b6100de6102a8565b6040516100eb919061138e565b60405180910390f35b61010e600480360381019061010991906113e9565b6102ad565b60405161011b9190611431565b60405180910390f35b61012c6102df565b604051610139919061138e565b60405180910390f35b61015c60048036038101906101579190611592565b6102e5565b005b61017860048036038101906101739190611592565b610370565b604051610185919061165a565b60405180910390f35b6101a860048036038101906101a391906113e9565b61061a565b6040516101b5919061138e565b60405180910390f35b6101d860048036038101906101d391906113e9565b610700565b005b6101f460048036038101906101ef9190611592565b61083b565b60405161020191906116d1565b60405180910390f35b610224600480360381019061021f91906113e9565b610b11565b604051610235959493929190611785565b60405180910390f35b610246610bb0565b60405161025391906116d1565b60405180910390f35b61027660048036038101906102719190611592565b610c4a565b60405161028391906116d1565b60405180910390f35b6102a660048036038101906102a191906118e5565b611003565b005b600381565b6000600382106102bc57600080fd5b600082036102d057600380541490506102da565b8160035483161490505b919050565b60035481565b6000806000600154815260200190815260200160002090508060000160009054906101000a900460ff1660ff1682511461031e57600080fd5b816002908161032d9190611b66565b507f502ae868d71f78c5d099f033dd3007a4f58aebb3a2816544fe690f8b9604b56c610357610bb0565b60405161036491906116d1565b60405180910390a15050565b60606000606080600061038286610c4a565b9150600080600154815260200190815260200160002093508360000160029054906101000a900460ff1660ff16905060018251826103c09190611c67565b6103ca9190611c67565b67ffffffffffffffff8111156103e3576103e2611467565b5b6040519080825280601f01601f1916602001820160405280156104155781602001600182028036833780820191505090505b50925060005b818110156104cf578460000160039054906101000a900470010000000000000000000000000000000002816010811061045757610456611c9b565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000284828151811061048d5761048c611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806104c790611cca565b91505061041b565b50603a7f01000000000000000000000000000000000000000000000000000000000000000283828151811061050757610506611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808061054190611cca565b91505060005b825181101561060d5782818151811061056357610562611c9b565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028482846105ba9190611c67565b815181106105cb576105ca611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808061060590611cca565b915050610547565b5082945050505050919050565b60006010821061065f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065690611d5e565b60405180910390fd5b60006003548316146106a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069d90611dca565b60405180910390fd5b81600360008282541792505081905550600380541415157f6b7e2e653f93b645d4ed7292d6429f96637084363e477c8aaea1a43ed13c284e6003546040516106ee919061138e565b60405180910390a26003549050919050565b6000600160ff16600354161461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074290611e36565b60405180910390fd5b6000806000838152602001908152602001600020905060008160000160009054906101000a900460ff1660ff161161078257600080fd5b816001819055508060000160009054906101000a900460ff1660ff1667ffffffffffffffff8111156107b7576107b6611467565b5b6040519080825280601f01601f1916602001820160405280156107e95781602001600182028036833780820191505090505b50600290816107f89190611b66565b507f502ae868d71f78c5d099f033dd3007a4f58aebb3a2816544fe690f8b9604b56c610822610bb0565b60405161082f91906116d1565b60405180910390a15050565b606060006060600080600154815260200190815260200160002091508160000160019054906101000a900460ff1660ff168260000160009054906101000a900460ff1660ff16855161088d9190611c67565b6108979190611c67565b67ffffffffffffffff8111156108b0576108af611467565b5b6040519080825280601f01601f1916602001820160405280156108e25781602001600182028036833780820191505090505b50905060005b8260000160019054906101000a900460ff1660ff168110156109b8578260000160139054906101000a900478010000000000000000000000000000000000000000000000000281600881106109405761093f611c9b565b5b1a7f01000000000000000000000000000000000000000000000000000000000000000282828151811061097657610975611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806109b090611cca565b9150506108e8565b8260000160009054906101000a900460ff167f0100000000000000000000000000000000000000000000000000000000000000028282815181106109ff576109fe611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610a3990611cca565b91505060005b8551811015610b0557858181518110610a5b57610a5a611c9b565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002838284610ab29190611c67565b81518110610ac357610ac2611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080610afd90611cca565b915050610a3f565b50819350505050919050565b60006020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060000160029054906101000a900460ff16908060000160039054906101000a900470010000000000000000000000000000000002908060000160139054906101000a9004780100000000000000000000000000000000000000000000000002905085565b6060610c4560028054610bc290611983565b80601f0160208091040260200160405190810160405280929190818152602001828054610bee90611983565b8015610c3b5780601f10610c1057610100808354040283529160200191610c3b565b820191906000526020600020905b815481529060010190602001808311610c1e57829003601f168201915b505050505061083b565b905090565b60608060008060028551610c5e9190611e56565b67ffffffffffffffff811115610c7757610c76611467565b5b6040519080825280601f01601f191660200182016040528015610ca95781602001600182028036833780820191505090505b5092506000905060005b6020811015610ff757600460f0878381518110610cd357610cd2611c9b565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090041660ff16908060020a82049150509250600a8360ff161015610dd257603083610d699190611e98565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110610d9e57610d9d611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610e44565b605783610ddf9190611e98565b7f010000000000000000000000000000000000000000000000000000000000000002848381518110610e1457610e13611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600f868281518110610e5957610e58611c9b565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004169250600a8360ff161015610f5757603083610ee29190611e98565b7f01000000000000000000000000000000000000000000000000000000000000000284600184610f129190611c67565b81518110610f2357610f22611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610fd5565b605783610f649190611e98565b7f01000000000000000000000000000000000000000000000000000000000000000284600184610f949190611c67565b81518110610fa557610fa4611c9b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b600282610fe29190611c67565b91508080610fef90611cca565b915050610cb3565b50829350505050919050565b6000600160ff16600354161461104e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104590611f19565b60405180910390fd5b6060819050601081511115611098576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108f90611f85565b60405180910390fd5b6110a061130f565b6000600790505b60008160ff16106110fc5760006008826110c19190611fa5565b60ff1660ff9060020a029050600086821667ffffffffffffffff1611156110e857506110fc565b81806110f390611fe2565b925050506110a7565b6001816111099190611e98565b826020019060ff16908160ff16815250506008816007611129919061200b565b6111339190611fa5565b60ff168567ffffffffffffffff169060020a02780100000000000000000000000000000000000000000000000002826080019077ffffffffffffffffffffffffffffffffffffffffffffffff1916908177ffffffffffffffffffffffffffffffffffffffffffffffff1916815250508251826040019060ff16908160ff1681525050826111bf90612065565b82606001906fffffffffffffffffffffffffffffffff191690816fffffffffffffffffffffffffffffffff19168152505085826000019060ff16908160ff1681525050816000808767ffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a8154816fffffffffffffffffffffffffffffffff02191690837001000000000000000000000000000000009004021790555060808201518160000160136101000a81548167ffffffffffffffff0219169083780100000000000000000000000000000000000000000000000090040217905550905050505050505050565b6040518060a00160405280600060ff168152602001600060ff168152602001600060ff16815260200160006fffffffffffffffffffffffffffffffff19168152602001600077ffffffffffffffffffffffffffffffffffffffffffffffff191681525090565b6000819050919050565b61138881611375565b82525050565b60006020820190506113a3600083018461137f565b92915050565b6000604051905090565b600080fd5b600080fd5b6113c681611375565b81146113d157600080fd5b50565b6000813590506113e3816113bd565b92915050565b6000602082840312156113ff576113fe6113b3565b5b600061140d848285016113d4565b91505092915050565b60008115159050919050565b61142b81611416565b82525050565b60006020820190506114466000830184611422565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61149f82611456565b810181811067ffffffffffffffff821117156114be576114bd611467565b5b80604052505050565b60006114d16113a9565b90506114dd8282611496565b919050565b600067ffffffffffffffff8211156114fd576114fc611467565b5b61150682611456565b9050602081019050919050565b82818337600083830152505050565b6000611535611530846114e2565b6114c7565b90508281526020810184848401111561155157611550611451565b5b61155c848285611513565b509392505050565b600082601f8301126115795761157861144c565b5b8135611589848260208601611522565b91505092915050565b6000602082840312156115a8576115a76113b3565b5b600082013567ffffffffffffffff8111156115c6576115c56113b8565b5b6115d284828501611564565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156116155780820151818401526020810190506115fa565b60008484015250505050565b600061162c826115db565b61163681856115e6565b93506116468185602086016115f7565b61164f81611456565b840191505092915050565b600060208201905081810360008301526116748184611621565b905092915050565b600081519050919050565b600082825260208201905092915050565b60006116a38261167c565b6116ad8185611687565b93506116bd8185602086016115f7565b6116c681611456565b840191505092915050565b600060208201905081810360008301526116eb8184611698565b905092915050565b600060ff82169050919050565b611709816116f3565b82525050565b60007fffffffffffffffffffffffffffffffff0000000000000000000000000000000082169050919050565b6117448161170f565b82525050565b60007fffffffffffffffff00000000000000000000000000000000000000000000000082169050919050565b61177f8161174a565b82525050565b600060a08201905061179a6000830188611700565b6117a76020830187611700565b6117b46040830186611700565b6117c1606083018561173b565b6117ce6080830184611776565b9695505050505050565b6117e1816116f3565b81146117ec57600080fd5b50565b6000813590506117fe816117d8565b92915050565b600067ffffffffffffffff82169050919050565b61182181611804565b811461182c57600080fd5b50565b60008135905061183e81611818565b92915050565b600067ffffffffffffffff82111561185f5761185e611467565b5b61186882611456565b9050602081019050919050565b600061188861188384611844565b6114c7565b9050828152602081018484840111156118a4576118a3611451565b5b6118af848285611513565b509392505050565b600082601f8301126118cc576118cb61144c565b5b81356118dc848260208601611875565b91505092915050565b6000806000606084860312156118fe576118fd6113b3565b5b600061190c868287016117ef565b935050602061191d8682870161182f565b925050604084013567ffffffffffffffff81111561193e5761193d6113b8565b5b61194a868287016118b7565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061199b57607f821691505b6020821081036119ae576119ad611954565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b60008160020a8302905092915050565b600060088302611a197fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826119d9565b611a2386836119d9565b95508019841693508086168417925050509392505050565b6000819050919050565b6000611a60611a5b611a5684611375565b611a3b565b611375565b9050919050565b6000819050919050565b611a7a83611a45565b611a8e611a8682611a67565b8484546119e9565b825550505050565b600090565b611aa3611a96565b611aae818484611a71565b505050565b5b81811015611ad257611ac7600082611a9b565b600181019050611ab4565b5050565b601f821115611b1757611ae8816119b4565b611af1846119c9565b81016020851015611b00578190505b611b14611b0c856119c9565b830182611ab3565b50505b505050565b60008160020a8304905092915050565b6000611b3d60001984600802611b1c565b1980831691505092915050565b6000611b568383611b2c565b9150826002028217905092915050565b611b6f8261167c565b67ffffffffffffffff811115611b8857611b87611467565b5b611b928254611983565b611b9d828285611ad6565b600060209050601f831160018114611bd05760008415611bbe578287015190505b611bc88582611b4a565b865550611c30565b601f198416611bde866119b4565b60005b82811015611c0657848901518255600182019150602085019450602081019050611be1565b86831015611c235784890151611c1f601f891682611b2c565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611c7282611375565b9150611c7d83611375565b9250828201905080821115611c9557611c94611c38565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611cd582611375565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611d0757611d06611c38565b5b600182019050919050565b7f4552525f494e56414c49445f5354415445000000000000000000000000000000600082015250565b6000611d486011836115e6565b9150611d5382611d12565b602082019050919050565b60006020820190508181036000830152611d7781611d3b565b9050919050565b7f4552525f414c52454144595f4c4f434b45440000000000000000000000000000600082015250565b6000611db46012836115e6565b9150611dbf82611d7e565b602082019050919050565b60006020820190508181036000830152611de381611da7565b9050919050565b7f4552525f5345414c5f434f444543000000000000000000000000000000000000600082015250565b6000611e20600e836115e6565b9150611e2b82611dea565b602082019050919050565b60006020820190508181036000830152611e4f81611e13565b9050919050565b6000611e6182611375565b9150611e6c83611375565b9250828202611e7a81611375565b91508282048414831517611e9157611e90611c38565b5b5092915050565b6000611ea3826116f3565b9150611eae836116f3565b9250828201905060ff811115611ec757611ec6611c38565b5b92915050565b7f4552525f5345414c5f434f4445434c4953540000000000000000000000000000600082015250565b6000611f036012836115e6565b9150611f0e82611ecd565b602082019050919050565b60006020820190508181036000830152611f3281611ef6565b9050919050565b7f4552525f5052454649585f544f4f5f4c4f4e4700000000000000000000000000600082015250565b6000611f6f6013836115e6565b9150611f7a82611f39565b602082019050919050565b60006020820190508181036000830152611f9e81611f62565b9050919050565b6000611fb0826116f3565b9150611fbb836116f3565b9250828202611fc9816116f3565b9150808214611fdb57611fda611c38565b5b5092915050565b6000611fed826116f3565b91506000820361200057611fff611c38565b5b600182039050919050565b6000612016826116f3565b9150612021836116f3565b9250828203905060ff81111561203a57612039611c38565b5b92915050565b6000819050602082019050919050565b600061205c825161170f565b80915050919050565b60006120708261167c565b8261207a84612040565b905061208581612050565b925060108210156120c5576120c07fffffffffffffffffffffffffffffffff00000000000000000000000000000000836010036008026119d9565b831692505b505091905056fea2646970667358221220906e4ff6a2af990af2e64f7b02bc54df4a073d9e2ad53885e1d78c0e72e6315d64736f6c63430008110033 +\ No newline at end of file diff --git a/python/tests/test_basic.py b/python/tests/test_basic.py @@ -12,6 +12,7 @@ from chainlib.connection import RPCConnection from chainlib.eth.tx import receipt from chainlib.eth.address import to_checksum_address from hexathon import strip_0x +from hexathon import same as same_hex # local imports from eth_event_msg import EventMsg @@ -74,6 +75,10 @@ class Test(EthTesterCase): r = self.conn.do(o) self.assertEqual(r['status'], 1) + lg = r['logs'][0]['topics'][0] + logg.debug('log {}'.format(lg)) + self.assertTrue(same_hex(lg, '502ae868d71f78c5d099f033dd3007a4f58aebb3a2816544fe690f8b9604b56c')) + o = c.get_msg(self.address, sender_address=self.accounts[0]) r = self.conn.do(o) mh = c.parse_to_hash(r) @@ -81,6 +86,33 @@ class Test(EthTesterCase): self.assertEqual(mh[4:68], hash_of_foo) + def test_change_codec(self): + nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc) + c = EventMsg(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle) + + (tx_hash, o) = c.set_msg(self.address, self.accounts[0], hash_of_foo) + self.conn.do(o) + + (tx_hash, o) = c.add_codec(self.address, self.accounts[0], 32, 0xe3, 'ipfs') + self.conn.do(o) + o = receipt(tx_hash) + r = self.conn.do(o) + self.assertEqual(r['status'], 1) + + (tx_hash, o) = c.set_msg_codec(self.address, self.accounts[0], 0xe3) + self.conn.do(o) + o = receipt(tx_hash) + r = self.conn.do(o) + self.assertEqual(r['status'], 1) + + o = c.get_msg(self.address, sender_address=self.accounts[0]) + r = self.conn.do(o) + mh = c.parse_to_hash(r) + self.assertEqual(mh[:4], 'e320') + self.assertEqual(mh[4:68], strip_0x(ZERO_CONTENT)) + + + if __name__ == '__main__': unittest.main() diff --git a/solidity/Msg.sol b/solidity/Msg.sol @@ -1,6 +1,8 @@ pragma solidity >=0.6.0; -contract Msg { +// SPDX-License-Identifier: GPL-3.0-or-later + +contract EventMsg { struct MultiHash { uint8 l; @@ -35,6 +37,7 @@ contract Msg { require(_digest.length == _hsh.l); currentMsg = _digest; + emit Msg(getMsg()); } function getMsg() public view returns(bytes memory) { @@ -75,6 +78,9 @@ contract Msg { require(_hsh.l > 0); msgCodec = _codec; + currentMsg = new bytes(_hsh.l); + + emit Msg(getMsg()); } // Implements Sealer