aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-06-29 23:41:59 +0800
committerchriseth <chris@ethereum.org>2018-07-03 07:02:00 +0800
commitf7a9c4203e35439de6ff4bdd94c7083c16b73e43 (patch)
treeae55099d02be2a04c769cf4868f57239365d1583 /test/libsolidity/SolidityEndToEndTest.cpp
parent4649f9202a93f7573d7fb425fbcbdd50e6d4407c (diff)
downloaddexon-solidity-f7a9c4203e35439de6ff4bdd94c7083c16b73e43.tar.gz
dexon-solidity-f7a9c4203e35439de6ff4bdd94c7083c16b73e43.tar.zst
dexon-solidity-f7a9c4203e35439de6ff4bdd94c7083c16b73e43.zip
Disallow packed encoding of literals.
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 31842777..85848d88 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -2082,7 +2082,7 @@ BOOST_AUTO_TEST_CASE(packed_keccak256)
function a(bytes32 input) returns (bytes32 hash) {
uint24 b = 65536;
uint c = 256;
- return keccak256(abi.encodePacked(8, input, b, input, c));
+ return keccak256(abi.encodePacked(uint8(8), input, b, input, c));
}
}
)";
@@ -2134,7 +2134,7 @@ BOOST_AUTO_TEST_CASE(packed_sha256)
function a(bytes32 input) returns (bytes32 hash) {
uint24 b = 65536;
uint c = 256;
- return sha256(abi.encodePacked(8, input, b, input, c));
+ return sha256(abi.encodePacked(uint8(8), input, b, input, c));
}
}
)";
@@ -2161,7 +2161,7 @@ BOOST_AUTO_TEST_CASE(packed_ripemd160)
function a(bytes32 input) returns (bytes32 hash) {
uint24 b = 65536;
uint c = 256;
- return ripemd160(abi.encodePacked(8, input, b, input, c));
+ return ripemd160(abi.encodePacked(uint8(8), input, b, input, c));
}
}
)";
@@ -3578,7 +3578,7 @@ BOOST_AUTO_TEST_CASE(keccak256_multiple_arguments_with_numeric_literals)
contract c {
function foo(uint a, uint16 b) returns (bytes32 d)
{
- d = keccak256(abi.encodePacked(a, b, 145));
+ d = keccak256(abi.encodePacked(a, b, uint8(145)));
}
}
)";
@@ -3603,7 +3603,7 @@ BOOST_AUTO_TEST_CASE(keccak256_multiple_arguments_with_string_literals)
}
function bar(uint a, uint16 b) returns (bytes32 d)
{
- d = keccak256(abi.encodePacked(a, b, 145, "foo"));
+ d = keccak256(abi.encodePacked(a, b, uint8(145), "foo"));
}
}
)";