aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-01-29 17:41:04 +0800
committerchriseth <c@ethdev.com>2015-01-29 17:41:04 +0800
commit8c27fccae9c10c78292dc7c9a3a2d73e33a2efde (patch)
tree70479b16bd29d16d1ae20e21d9b1b544f626f138
parent1ea693f3ff2fc10a8f8a94a3e2e2bf862a6d27b8 (diff)
parentf054a4af7b56559dccf7406b34b38e05c2b54d5a (diff)
downloaddexon-solidity-8c27fccae9c10c78292dc7c9a3a2d73e33a2efde.tar.gz
dexon-solidity-8c27fccae9c10c78292dc7c9a3a2d73e33a2efde.tar.zst
dexon-solidity-8c27fccae9c10c78292dc7c9a3a2d73e33a2efde.zip
Merge pull request #887 from chriseth/sol_excludeStd
Exclude standard contracts by default.
-rw-r--r--SolidityEndToEndTest.cpp1
-rw-r--r--solidityExecutionFramework.h4
2 files changed, 3 insertions, 2 deletions
diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp
index 1450095a..9f7a72a4 100644
--- a/SolidityEndToEndTest.cpp
+++ b/SolidityEndToEndTest.cpp
@@ -1905,6 +1905,7 @@ BOOST_AUTO_TEST_CASE(use_std_lib)
import "mortal";
contract Icarus is mortal { }
)";
+ m_addStandardSources = true;
u256 amount(130);
u160 address(23);
compileAndRun(sourceCode, amount, "Icarus");
diff --git a/solidityExecutionFramework.h b/solidityExecutionFramework.h
index 208e9ae8..7dad9ad4 100644
--- a/solidityExecutionFramework.h
+++ b/solidityExecutionFramework.h
@@ -45,8 +45,7 @@ public:
bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "")
{
- // add standard sources only if contract name is given
- dev::solidity::CompilerStack compiler(!_contractName.empty());
+ dev::solidity::CompilerStack compiler(m_addStandardSources);
try
{
compiler.addSource("", _sourceCode);
@@ -175,6 +174,7 @@ private:
protected:
bool m_optimize = false;
+ bool m_addStandardSources = false;
Address m_sender;
Address m_contractAddress;
eth::State m_state;