diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-06-13 02:19:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-13 02:19:49 +0800 |
commit | 3e1fb6b7ffed25f3f12bcf0fe474f2afc9396fe4 (patch) | |
tree | 24a9326bb17dd69cfe2420a225b9ab90bf67332a /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | 451f56ec1cd032802b52ce81ad5950a441cf5e87 (diff) | |
parent | 1dc28c065d91416caf778770ef57b73b30462b8d (diff) | |
download | dexon-solidity-3e1fb6b7ffed25f3f12bcf0fe474f2afc9396fe4.tar dexon-solidity-3e1fb6b7ffed25f3f12bcf0fe474f2afc9396fe4.tar.gz dexon-solidity-3e1fb6b7ffed25f3f12bcf0fe474f2afc9396fe4.tar.bz2 dexon-solidity-3e1fb6b7ffed25f3f12bcf0fe474f2afc9396fe4.tar.lz dexon-solidity-3e1fb6b7ffed25f3f12bcf0fe474f2afc9396fe4.tar.xz dexon-solidity-3e1fb6b7ffed25f3f12bcf0fe474f2afc9396fe4.tar.zst dexon-solidity-3e1fb6b7ffed25f3f12bcf0fe474f2afc9396fe4.zip |
Merge pull request #4085 from ethereum/calldatapad
[BREAKING] Properly pad data from calldata.
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 2afb4e1c..236d83ef 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -3457,7 +3457,7 @@ BOOST_AUTO_TEST_CASE(event_really_lots_of_data) callContractFunction("deposit()"); BOOST_REQUIRE_EQUAL(m_logs.size(), 1); BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress); - BOOST_CHECK_EQUAL(toHex(m_logs[0].data), toHex(encodeArgs(10, 0x60, 15, 4) + FixedHash<4>(dev::keccak256("deposit()")).asBytes())); + BOOST_CHECK_EQUAL(toHex(m_logs[0].data), toHex(encodeArgs(10, 0x60, 15, 4, asString(FixedHash<4>(dev::keccak256("deposit()")).asBytes())))); BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 1); BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::keccak256(string("Deposit(uint256,bytes,uint256)"))); } @@ -3964,7 +3964,8 @@ BOOST_AUTO_TEST_CASE(call_forward_bytes_length) compileAndRun(sourceCode, 0, "sender"); // No additional data, just function selector - ABI_CHECK(callContractFunction("viaCalldata()"), encodeArgs(4)); + ABI_CHECK(callContractFunction("viaCalldata()"), encodeArgs(0x20)); + // Should be this with 0.5.0: encodeArgs(4)); ABI_CHECK(callContractFunction("viaMemory()"), encodeArgs(0x20)); // Should be this with 0.5.0: encodeArgs(4)); ABI_CHECK(callContractFunction("viaStorage()"), encodeArgs(0x20)); @@ -3972,7 +3973,8 @@ BOOST_AUTO_TEST_CASE(call_forward_bytes_length) // Some additional unpadded data bytes unpadded = asBytes(string("abc")); - ABI_CHECK(callContractFunctionNoEncoding("viaCalldata()", unpadded), encodeArgs(7)); + ABI_CHECK(callContractFunctionNoEncoding("viaCalldata()", unpadded), encodeArgs(0x20)); + // Should be this with 0.5.0: encodeArgs(7)); ABI_CHECK(callContractFunctionNoEncoding("viaMemory()", unpadded), encodeArgs(0x20)); // Should be this with 0.5.0: encodeArgs(7)); ABI_CHECK(callContractFunctionNoEncoding("viaStorage()", unpadded), encodeArgs(0x20)); |