aboutsummaryrefslogtreecommitdiffstats
path: root/TestHelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TestHelper.cpp')
-rw-r--r--TestHelper.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp
index 5e747210..ff6939a5 100644
--- a/TestHelper.cpp
+++ b/TestHelper.cpp
@@ -504,6 +504,49 @@ void executeTests(const string& _name, const string& _testPathAppendix, std::fun
}
}
+RLPStream createRLPStreamFromTransactionFields(json_spirit::mObject& _tObj)
+{
+ //Construct Rlp of the given transaction
+ RLPStream rlpStream;
+ rlpStream.appendList(_tObj.size());
+
+ if (_tObj.count("nonce"))
+ rlpStream << bigint(_tObj["nonce"].get_str());
+
+ if (_tObj.count("gasPrice"))
+ rlpStream << bigint(_tObj["gasPrice"].get_str());
+
+ if (_tObj.count("gasLimit"))
+ rlpStream << bigint(_tObj["gasLimit"].get_str());
+
+ if (_tObj.count("to"))
+ {
+ if (_tObj["to"].get_str().empty())
+ rlpStream << "";
+ else
+ rlpStream << importByteArray(_tObj["to"].get_str());
+ }
+
+ if (_tObj.count("value"))
+ rlpStream << bigint(_tObj["value"].get_str());
+
+ if (_tObj.count("data"))
+ rlpStream << importData(_tObj);
+
+ if (_tObj.count("v"))
+ rlpStream << bigint(_tObj["v"].get_str());
+
+ if (_tObj.count("r"))
+ rlpStream << bigint(_tObj["r"].get_str());
+
+ if (_tObj.count("s"))
+ rlpStream << bigint(_tObj["s"].get_str());
+
+ if (_tObj.count("extrafield"))
+ rlpStream << bigint(_tObj["extrafield"].get_str());
+
+ return rlpStream;
+}
void processCommandLineOptions()
{