aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityABIJSON.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-05-24 16:50:22 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-05-24 19:24:00 +0800
commit804e99c6339c3fc3cb42737d492b035f38384dab (patch)
tree2bc00e80fc451dd6d0ea02c9010d098be74fd01e /test/libsolidity/SolidityABIJSON.cpp
parentcf639f48f2e7be43ac47fda6d7dec765ed0893e4 (diff)
downloaddexon-solidity-804e99c6339c3fc3cb42737d492b035f38384dab.tar.gz
dexon-solidity-804e99c6339c3fc3cb42737d492b035f38384dab.tar.zst
dexon-solidity-804e99c6339c3fc3cb42737d492b035f38384dab.zip
Split out metadata test into its own file
Diffstat (limited to 'test/libsolidity/SolidityABIJSON.cpp')
-rw-r--r--test/libsolidity/SolidityABIJSON.cpp20
1 files changed, 0 insertions, 20 deletions
diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp
index 1ebccc13..f87390e1 100644
--- a/test/libsolidity/SolidityABIJSON.cpp
+++ b/test/libsolidity/SolidityABIJSON.cpp
@@ -752,26 +752,6 @@ BOOST_AUTO_TEST_CASE(function_type)
checkInterface(sourceCode, interface);
}
-BOOST_AUTO_TEST_CASE(metadata_stamp)
-{
- // Check that the metadata stamp is at the end of the runtime bytecode.
- char const* sourceCode = R"(
- pragma solidity >=0.0;
- contract test {
- function g(function(uint) external returns (uint) x) {}
- }
- )";
- BOOST_REQUIRE(m_compilerStack.compile(std::string(sourceCode)));
- bytes const& bytecode = m_compilerStack.runtimeObject("test").bytecode;
- bytes hash = dev::swarmHash(m_compilerStack.onChainMetadata("test")).asBytes();
- BOOST_REQUIRE(hash.size() == 32);
- BOOST_REQUIRE(bytecode.size() >= 2);
- size_t metadataCBORSize = (size_t(bytecode.end()[-2]) << 8) + size_t(bytecode.end()[-1]);
- BOOST_REQUIRE(metadataCBORSize < bytecode.size() - 2);
- bytes expectation = bytes{0xa1, 0x65, 'b', 'z', 'z', 'r', '0', 0x58, 0x20} + hash;
- BOOST_CHECK(std::equal(expectation.begin(), expectation.end(), bytecode.end() - metadataCBORSize - 2));
-}
-
BOOST_AUTO_TEST_SUITE_END()
}