From 77374a46cef6308c58465f5197919d9ac67cb666 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 28 Jan 2015 13:39:04 +0100 Subject: Cleaner solution to provide standard sources. --- solidityExecutionFramework.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'solidityExecutionFramework.h') diff --git a/solidityExecutionFramework.h b/solidityExecutionFramework.h index 271a594c..208e9ae8 100644 --- a/solidityExecutionFramework.h +++ b/solidityExecutionFramework.h @@ -45,10 +45,12 @@ public: bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") { - dev::solidity::CompilerStack compiler; + // add standard sources only if contract name is given + dev::solidity::CompilerStack compiler(!_contractName.empty()); try { - compiler.compile(_sourceCode, m_optimize); + compiler.addSource("", _sourceCode); + compiler.compile(m_optimize); } catch(boost::exception const& _e) { -- cgit