def test_contract_multiply7_function_signature(): multiply7 = Function( 'multiply7', inputs=[{'type': 'int256', 'name': 'a'}], outputs=[{'type': 'int256', 'name': 'result'}], ) assert multiply7.abi_signature == 3707058097 assert multiply7.encoded_abi_signature == '\xdc\xf57\xb1' assert multiply7.get_call_data((3,)) == 'dcf537b10000000000000000000000000000000000000000000000000000000000000003'
def test_contract_add_function_signature(): add = Function( "add", inputs=[{'type': 'int256', 'name': 'a'}, {'type': 'int256', 'name': 'b'}], outputs=[{'type': 'int256', 'name': 'result'}], ) assert add.abi_signature == 2784215611 assert add.encoded_abi_signature == '\xa5\xf3\xc2;' assert add.get_call_data((3, 4)) == 'a5f3c23b00000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004'
def test_contract_return13_function_signature(): return13 = Function("return13", inputs=[], outputs=[{ 'type': 'int256', 'name': 'result' }]) assert return13.abi_signature == 371289913 assert return13.encoded_abi_signature == b'\x16!o9' assert return13.get_call_data([]) == b'16216f39'
def test_contract_multiply7_function_signature(): multiply7 = Function( 'multiply7', inputs=[{ 'type': 'int256', 'name': 'a' }], outputs=[{ 'type': 'int256', 'name': 'result' }], ) assert multiply7.abi_signature == 3707058097 assert multiply7.encoded_abi_signature == b'\xdc\xf57\xb1' assert multiply7.get_call_data( (3, ) ) == b'dcf537b10000000000000000000000000000000000000000000000000000000000000003'
def test_contract_add_function_signature(): add = Function( "add", inputs=[{ 'type': 'int256', 'name': 'a' }, { 'type': 'int256', 'name': 'b' }], outputs=[{ 'type': 'int256', 'name': 'result' }], ) assert add.abi_signature == 2784215611 assert add.encoded_abi_signature == b'\xa5\xf3\xc2;' assert add.get_call_data( (3, 4) ) == b'a5f3c23b00000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004'
def test_contract_return13_function_signature(): return13 = Function("return13", inputs=[], outputs=[{'type': 'int256', 'name': 'result'}]) assert return13.abi_signature == 371289913 assert return13.encoded_abi_signature == '\x16!o9' assert return13.get_call_data([]) == '16216f39'