aboutsummaryrefslogtreecommitdiffstats
path: root/TestHelper.cpp
diff options
context:
space:
mode:
authorPaweł Bylica <chfast@gmail.com>2015-06-11 00:01:03 +0800
committerPaweł Bylica <chfast@gmail.com>2015-06-11 00:01:03 +0800
commit5d534416b1115e54e86aaa04e248f88f6d34cd41 (patch)
tree8adb81f80ff0099c836618cfd200df0a3f2bd48d /TestHelper.cpp
parent7557e4b73f66aaf03e7f274036bac18792a480f4 (diff)
parentbcecae082219abb99157aca5afe9440fac20b516 (diff)
downloaddexon-solidity-5d534416b1115e54e86aaa04e248f88f6d34cd41.tar
dexon-solidity-5d534416b1115e54e86aaa04e248f88f6d34cd41.tar.gz
dexon-solidity-5d534416b1115e54e86aaa04e248f88f6d34cd41.tar.bz2
dexon-solidity-5d534416b1115e54e86aaa04e248f88f6d34cd41.tar.lz
dexon-solidity-5d534416b1115e54e86aaa04e248f88f6d34cd41.tar.xz
dexon-solidity-5d534416b1115e54e86aaa04e248f88f6d34cd41.tar.zst
dexon-solidity-5d534416b1115e54e86aaa04e248f88f6d34cd41.zip
Merge remote-tracking branch 'upstream/develop' into evmjit-develop
Conflicts: evmjit/libevmjit-cpp/JitVM.cpp evmjit/libevmjit-cpp/JitVM.h
Diffstat (limited to 'TestHelper.cpp')
-rw-r--r--TestHelper.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index 476d1ecf..f7da0238 100644
--- a/TestHelper.cpp
+++ b/TestHelper.cpp
@@ -262,7 +262,21 @@ void ImportTest::importTransaction(json_spirit::mObject& _o)
{
RLPStream transactionRLPStream = createRLPStreamFromTransactionFields(_o);
RLP transactionRLP(transactionRLPStream.out());
- m_transaction = Transaction(transactionRLP.data(), CheckTransaction::Everything);
+ try
+ {
+ m_transaction = Transaction(transactionRLP.data(), CheckTransaction::Everything);
+ }
+ catch (InvalidSignature)
+ {
+ // create unsigned transaction
+ m_transaction = _o["to"].get_str().empty() ?
+ Transaction(toInt(_o["value"]), toInt(_o["gasPrice"]), toInt(_o["gasLimit"]), importData(_o), toInt(_o["nonce"])) :
+ Transaction(toInt(_o["value"]), toInt(_o["gasPrice"]), toInt(_o["gasLimit"]), Address(_o["to"].get_str()), importData(_o), toInt(_o["nonce"]));
+ }
+ catch (Exception& _e)
+ {
+ cnote << "invalid transaction" << boost::diagnostic_information(_e);
+ }
}
}
@@ -328,7 +342,7 @@ void ImportTest::exportTest(bytes const& _output, State const& _statePost)
{
// export output
- m_TestObject["out"] = _output.size() > 4096 ? "#" + toString(_output.size()) : toHex(_output, 2, HexPrefix::Add);
+ m_TestObject["out"] = (_output.size() > 4096 && !Options::get().fulloutput) ? "#" + toString(_output.size()) : toHex(_output, 2, HexPrefix::Add);
// export logs
m_TestObject["logs"] = exportLog(_statePost.pending().size() ? _statePost.log(0) : LogEntries());
@@ -567,8 +581,7 @@ void userDefinedTest(std::function<void(json_spirit::mValue&, bool)> doTests)
auto& filename = Options::get().singleTestFile;
auto& testname = Options::get().singleTestName;
- int currentVerbosity = g_logVerbosity;
- g_logVerbosity = 12;
+ VerbosityHolder sentinel(12);
try
{
cnote << "Testing user defined test: " << filename;
@@ -588,19 +601,16 @@ void userDefinedTest(std::function<void(json_spirit::mValue&, bool)> doTests)
oSingleTest[pos->first] = pos->second;
json_spirit::mValue v_singleTest(oSingleTest);
- doTests(v_singleTest, false);
+ doTests(v_singleTest, test::Options::get().fillTests);
}
catch (Exception const& _e)
{
BOOST_ERROR("Failed Test with Exception: " << diagnostic_information(_e));
- g_logVerbosity = currentVerbosity;
}
catch (std::exception const& _e)
{
BOOST_ERROR("Failed Test with Exception: " << _e.what());
- g_logVerbosity = currentVerbosity;
}
- g_logVerbosity = currentVerbosity;
}
void executeTests(const string& _name, const string& _testPathAppendix, const boost::filesystem::path _pathToFiller, std::function<void(json_spirit::mValue&, bool)> doTests)
@@ -760,6 +770,8 @@ Options::Options()
else
singleTestName = std::move(name1);
}
+ else if (arg == "--fulloutput")
+ fulloutput = true;
}
}
@@ -769,7 +781,6 @@ Options const& Options::get()
return instance;
}
-
LastHashes lastHashes(u256 _currentBlockNumber)
{
LastHashes ret;