diff options
author | bitshift <bitshift@posteo.org> | 2018-03-06 02:24:33 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-03-27 10:30:03 +0800 |
commit | be35a65eb3966965e30b6b582f7722338e558013 (patch) | |
tree | 4784a52616f22bf96a388af7591ead908bad4617 /test/libsolidity/SolidityExpressionCompiler.cpp | |
parent | ed632025fe5995d093472b1e7660087e943f2ca6 (diff) | |
download | dexon-solidity-be35a65eb3966965e30b6b582f7722338e558013.tar dexon-solidity-be35a65eb3966965e30b6b582f7722338e558013.tar.gz dexon-solidity-be35a65eb3966965e30b6b582f7722338e558013.tar.bz2 dexon-solidity-be35a65eb3966965e30b6b582f7722338e558013.tar.lz dexon-solidity-be35a65eb3966965e30b6b582f7722338e558013.tar.xz dexon-solidity-be35a65eb3966965e30b6b582f7722338e558013.tar.zst dexon-solidity-be35a65eb3966965e30b6b582f7722338e558013.zip |
Adds unit tests for moved function.
Diffstat (limited to 'test/libsolidity/SolidityExpressionCompiler.cpp')
-rw-r--r-- | test/libsolidity/SolidityExpressionCompiler.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/libsolidity/SolidityExpressionCompiler.cpp b/test/libsolidity/SolidityExpressionCompiler.cpp index c8adfc6e..90d8265c 100644 --- a/test/libsolidity/SolidityExpressionCompiler.cpp +++ b/test/libsolidity/SolidityExpressionCompiler.cpp @@ -503,12 +503,15 @@ BOOST_AUTO_TEST_CASE(blockhash) char const* sourceCode = R"( contract test { function f() { - block.blockhash(3); + blockhash(3); } } )"; - bytes code = compileFirstExpression(sourceCode, {}, {}, - {make_shared<MagicVariableDeclaration>("block", make_shared<MagicType>(MagicType::Kind::Block))}); + + auto blockhashFun = make_shared<FunctionType>(strings{"uint256"}, strings{"bytes32"}, + FunctionType::Kind::BlockHash, false, StateMutability::View); + + bytes code = compileFirstExpression(sourceCode, {}, {}, {make_shared<MagicVariableDeclaration>("blockhash", blockhashFun)}); bytes expectation({byte(Instruction::PUSH1), 0x03, byte(Instruction::BLOCKHASH)}); |