aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/test_framework/mininode.py
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@chaincode.com>2015-12-08 17:25:28 -0500
committerAlex Morcos <morcos@chaincode.com>2016-02-10 15:35:33 -0500
commitda6ad5f684b91975cae3f37495ccbd041499e86b (patch)
tree04ef32caaaf2b838295f39cffbdd87468f3657c9 /qa/rpc-tests/test_framework/mininode.py
parentc6c2f0fd782ccf607027414012f45c8f48561a30 (diff)
Add RPC test exercising BIP68 (mempool only)
Diffstat (limited to 'qa/rpc-tests/test_framework/mininode.py')
-rwxr-xr-xqa/rpc-tests/test_framework/mininode.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py
index 9d0fb713a1..259dba71c3 100755
--- a/qa/rpc-tests/test_framework/mininode.py
+++ b/qa/rpc-tests/test_framework/mininode.py
@@ -230,6 +230,14 @@ def ser_int_vector(l):
r += struct.pack("<i", i)
return r
+# Deserialize from a hex string representation (eg from RPC)
+def FromHex(obj, hex_string):
+ obj.deserialize(cStringIO.StringIO(binascii.unhexlify(hex_string)))
+ return obj
+
+# Convert a binary-serializable object to hex (eg for submission via RPC)
+def ToHex(obj):
+ return binascii.hexlify(obj.serialize()).decode('utf-8')
# Objects that map to bitcoind objects, which can be serialized/deserialized