aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-05-15 22:59:48 +0800
committerGitHub <noreply@github.com>2018-05-15 22:59:48 +0800
commit2ba0002998d12ea412f17d55b643ec85c02e6a30 (patch)
treec67243148b1b06eb6b8617fc344d0bc422874fa9 /test
parent007ecc849c917cdb5b2feaa20bbab84e0fe79104 (diff)
parentdac0029d16ffe31fba2e6241f99893ea9a26926e (diff)
downloaddexon-solidity-2ba0002998d12ea412f17d55b643ec85c02e6a30.tar
dexon-solidity-2ba0002998d12ea412f17d55b643ec85c02e6a30.tar.gz
dexon-solidity-2ba0002998d12ea412f17d55b643ec85c02e6a30.tar.bz2
dexon-solidity-2ba0002998d12ea412f17d55b643ec85c02e6a30.tar.lz
dexon-solidity-2ba0002998d12ea412f17d55b643ec85c02e6a30.tar.xz
dexon-solidity-2ba0002998d12ea412f17d55b643ec85c02e6a30.tar.zst
dexon-solidity-2ba0002998d12ea412f17d55b643ec85c02e6a30.zip
Merge pull request #4139 from ethereum/abiEncodeIsPure
ABI encoding functions are pure and should be usable in constants.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/syntaxTests/constants/abi_encoding_constant.sol7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/constants/abi_encoding_constant.sol b/test/libsolidity/syntaxTests/constants/abi_encoding_constant.sol
new file mode 100644
index 00000000..dd6968a0
--- /dev/null
+++ b/test/libsolidity/syntaxTests/constants/abi_encoding_constant.sol
@@ -0,0 +1,7 @@
+contract C {
+ bytes32 constant a = keccak256(abi.encode(1, 2));
+ bytes32 constant b = keccak256(abi.encodePacked(uint(1), a));
+ bytes32 constant c = keccak256(abi.encodeWithSelector(0x12345678, b, 2));
+ bytes32 constant d = keccak256(abi.encodeWithSignature("f()", 1, 2));
+}
+// ----