diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-03-27 18:40:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-27 18:40:06 +0800 |
commit | 32f08989dbacb7d839ebc916ac995ecc08eee6eb (patch) | |
tree | 89dfb9711bad71fc6dbdec2a4641ba7967d44dc4 /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | ba209fe485ba40ea3926800bc90932bec40cd16f (diff) | |
parent | 2c56e530467c088c5096d95422313ca211786eca (diff) | |
download | dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.tar dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.tar.gz dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.tar.bz2 dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.tar.lz dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.tar.xz dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.tar.zst dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.zip |
Merge pull request #3646 from ethereum/blockhash-global
Move blockhash from block.blockhash to global level.
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 44dc40f7..a866e46c 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -1805,6 +1805,18 @@ BOOST_AUTO_TEST_CASE(uncalled_blockhash) BOOST_CHECK(result[0] != 0 || result[1] != 0 || result[2] != 0); } +BOOST_AUTO_TEST_CASE(blockhash_shadow_resolution) +{ + char const* code = R"( + contract C { + function blockhash(uint256 blockNumber) public returns(bytes32) { bytes32 x; return x; } + function f() public returns(bytes32) { return blockhash(3); } + } + )"; + compileAndRun(code, 0, "C"); + ABI_CHECK(callContractFunction("f()"), encodeArgs(0)); +} + BOOST_AUTO_TEST_CASE(log0) { char const* sourceCode = R"( |