Skip to content

Commit 219406f

Browse files
axicchriseth
authored andcommitted
Add CLI option to soltest to always use ABIEncoderV2
1 parent b43d75c commit 219406f

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

test/Options.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Options::Options()
5555
}
5656
else if (string(suite.argv[i]) == "--optimize")
5757
optimize = true;
58+
else if (string(suite.argv[i]) == "--abiencoderv2")
59+
useABIEncoderV2 = true;
5860
else if (string(suite.argv[i]) == "--evm-version")
5961
{
6062
evmVersionString = i + 1 < suite.argc ? suite.argv[i + 1] : "INVALID";

test/Options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ struct Options: boost::noncopyable
4141
bool optimize = false;
4242
bool disableIPC = false;
4343
bool disableSMT = false;
44+
bool useABIEncoderV2 = false;
4445

4546
void validate() const;
4647
solidity::EVMVersion evmVersion() const;

test/libsolidity/SolidityExecutionFramework.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ class SolidityExecutionFramework: public dev::test::ExecutionFramework
6565
)
6666
{
6767
// Silence compiler version warning
68-
std::string sourceCode = "pragma solidity >=0.0;\n" + _sourceCode;
68+
std::string sourceCode = "pragma solidity >=0.0;\n";
69+
if (dev::test::Options::get().useABIEncoderV2 && _sourceCode.find("pragma experimental ABIEncoderV2;") == std::string::npos)
70+
sourceCode += "pragma experimental ABIEncoderV2;\n";
71+
sourceCode += _sourceCode;
6972
m_compiler.reset(false);
7073
m_compiler.addSource("", sourceCode);
7174
m_compiler.setLibraries(_libraryAddresses);

0 commit comments

Comments
 (0)