aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorRhett Aultman <roadriverrail@gmail.com>2016-12-16 23:54:18 +0800
committerRhett Aultman <rhett.aultman@meraki.net>2017-01-17 01:32:57 +0800
commitf8914c6b281f398d6084f10708233bf79d633ef0 (patch)
tree99ffe783e3ddd61ffab296afabbf1c93933bb47a /test/libsolidity
parentf10bf36ae3681169be7c75dac32567f1746c529d (diff)
downloaddexon-solidity-f8914c6b281f398d6084f10708233bf79d633ef0.tar.gz
dexon-solidity-f8914c6b281f398d6084f10708233bf79d633ef0.tar.zst
dexon-solidity-f8914c6b281f398d6084f10708233bf79d633ef0.zip
Fix contract lookup in tests
The fully-qualified name of a contract with no source unit is :<Name> instead of just <Name>, so the test system needed to be adjusted accordingly.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityABIJSON.cpp4
-rw-r--r--test/libsolidity/SolidityExecutionFramework.h6
2 files changed, 7 insertions, 3 deletions
diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp
index 043d74ed..a54e9b7e 100644
--- a/test/libsolidity/SolidityABIJSON.cpp
+++ b/test/libsolidity/SolidityABIJSON.cpp
@@ -762,8 +762,8 @@ BOOST_AUTO_TEST_CASE(metadata_stamp)
}
)";
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();
+ 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]);
diff --git a/test/libsolidity/SolidityExecutionFramework.h b/test/libsolidity/SolidityExecutionFramework.h
index 03e3a881..00e8330c 100644
--- a/test/libsolidity/SolidityExecutionFramework.h
+++ b/test/libsolidity/SolidityExecutionFramework.h
@@ -67,7 +67,11 @@ public:
);
BOOST_ERROR("Compiling contract failed");
}
- eth::LinkerObject obj = m_compiler.object(_contractName);
+ eth::LinkerObject obj;
+ if (_contractName.empty())
+ obj = m_compiler.object(_contractName);
+ else
+ obj = m_compiler.object(":" + _contractName);
BOOST_REQUIRE(obj.linkReferences.empty());
sendMessage(obj.bytecode + _arguments, true, _value);
return m_output;