diff options
author | chriseth <chris@ethereum.org> | 2017-02-13 21:54:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-13 21:54:06 +0800 |
commit | e2349f9d5db80e57558ddaf7564ea57cf3b216d8 (patch) | |
tree | ba0723e33dcc1cb88100cbae20f5fe5264b4888e /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | a78667e3062bba4ace52cef6fcb3a5285c3052aa (diff) | |
parent | a82acba49ae68a960f33a2938f3d3560bf65441c (diff) | |
download | dexon-solidity-e2349f9d5db80e57558ddaf7564ea57cf3b216d8.tar.gz dexon-solidity-e2349f9d5db80e57558ddaf7564ea57cf3b216d8.tar.zst dexon-solidity-e2349f9d5db80e57558ddaf7564ea57cf3b216d8.zip |
Merge pull request #1676 from ethereum/test-modifytimestamp
Add blockTimestamp and do not rely on mining time (soltest)
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index e49db34e..ad045881 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -1482,9 +1482,15 @@ BOOST_AUTO_TEST_CASE(now) } } )"; - m_rpc.test_modifyTimestamp(0x776347e2); compileAndRun(sourceCode); - BOOST_CHECK(callContractFunction("someInfo()") == encodeArgs(true, 0x776347e3)); + u256 startBlock = m_blockNumber; + size_t startTime = blockTimestamp(startBlock); + auto ret = callContractFunction("someInfo()"); + u256 endBlock = m_blockNumber; + size_t endTime = blockTimestamp(endBlock); + BOOST_CHECK(startBlock != endBlock); + BOOST_CHECK(startTime != endTime); + BOOST_CHECK(ret == encodeArgs(true, endTime)); } BOOST_AUTO_TEST_CASE(type_conversions_cleanup) |