mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #887 from chriseth/sol_excludeStd
Exclude standard contracts by default.
This commit is contained in:
commit
8c27fccae9
@ -1905,6 +1905,7 @@ BOOST_AUTO_TEST_CASE(use_std_lib)
|
|||||||
import "mortal";
|
import "mortal";
|
||||||
contract Icarus is mortal { }
|
contract Icarus is mortal { }
|
||||||
)";
|
)";
|
||||||
|
m_addStandardSources = true;
|
||||||
u256 amount(130);
|
u256 amount(130);
|
||||||
u160 address(23);
|
u160 address(23);
|
||||||
compileAndRun(sourceCode, amount, "Icarus");
|
compileAndRun(sourceCode, amount, "Icarus");
|
||||||
|
@ -45,8 +45,7 @@ public:
|
|||||||
|
|
||||||
bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "")
|
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(m_addStandardSources);
|
||||||
dev::solidity::CompilerStack compiler(!_contractName.empty());
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
compiler.addSource("", _sourceCode);
|
compiler.addSource("", _sourceCode);
|
||||||
@ -175,6 +174,7 @@ private:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_optimize = false;
|
bool m_optimize = false;
|
||||||
|
bool m_addStandardSources = false;
|
||||||
Address m_sender;
|
Address m_sender;
|
||||||
Address m_contractAddress;
|
Address m_contractAddress;
|
||||||
eth::State m_state;
|
eth::State m_state;
|
||||||
|
Loading…
Reference in New Issue
Block a user