aboutsummaryrefslogtreecommitdiffstats
path: root/TestHelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TestHelper.cpp')
-rw-r--r--TestHelper.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index 2c638494..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);
+ }
}
}