mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add CLI option to soltest to always use ABIEncoderV2
This commit is contained in:
parent
b43d75cee7
commit
219406f45b
@ -55,6 +55,8 @@ Options::Options()
|
|||||||
}
|
}
|
||||||
else if (string(suite.argv[i]) == "--optimize")
|
else if (string(suite.argv[i]) == "--optimize")
|
||||||
optimize = true;
|
optimize = true;
|
||||||
|
else if (string(suite.argv[i]) == "--abiencoderv2")
|
||||||
|
useABIEncoderV2 = true;
|
||||||
else if (string(suite.argv[i]) == "--evm-version")
|
else if (string(suite.argv[i]) == "--evm-version")
|
||||||
{
|
{
|
||||||
evmVersionString = i + 1 < suite.argc ? suite.argv[i + 1] : "INVALID";
|
evmVersionString = i + 1 < suite.argc ? suite.argv[i + 1] : "INVALID";
|
||||||
|
@ -41,6 +41,7 @@ struct Options: boost::noncopyable
|
|||||||
bool optimize = false;
|
bool optimize = false;
|
||||||
bool disableIPC = false;
|
bool disableIPC = false;
|
||||||
bool disableSMT = false;
|
bool disableSMT = false;
|
||||||
|
bool useABIEncoderV2 = false;
|
||||||
|
|
||||||
void validate() const;
|
void validate() const;
|
||||||
solidity::EVMVersion evmVersion() const;
|
solidity::EVMVersion evmVersion() const;
|
||||||
|
@ -65,7 +65,10 @@ public:
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Silence compiler version warning
|
// Silence compiler version warning
|
||||||
std::string sourceCode = "pragma solidity >=0.0;\n" + _sourceCode;
|
std::string sourceCode = "pragma solidity >=0.0;\n";
|
||||||
|
if (dev::test::Options::get().useABIEncoderV2 && _sourceCode.find("pragma experimental ABIEncoderV2;") == std::string::npos)
|
||||||
|
sourceCode += "pragma experimental ABIEncoderV2;\n";
|
||||||
|
sourceCode += _sourceCode;
|
||||||
m_compiler.reset(false);
|
m_compiler.reset(false);
|
||||||
m_compiler.addSource("", sourceCode);
|
m_compiler.addSource("", sourceCode);
|
||||||
m_compiler.setLibraries(_libraryAddresses);
|
m_compiler.setLibraries(_libraryAddresses);
|
||||||
|
Loading…
Reference in New Issue
Block a user