diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-02-12 17:03:43 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-02-12 17:03:46 +0100 |
| commit | 80d1f2e48364f05b2cdf44239b3a1faa0277e58e (patch) | |
| tree | 39fc8fe0304591eebc89b30b6f53cd328983962f /qa/rpc-tests/test_framework | |
| parent | Merge #7520: LibreSSL doesn't define OPENSSL_VERSION, use LIBRESSL_VERSION_TE... (diff) | |
| parent | fix sdaftuar's nits again (diff) | |
| download | discoin-80d1f2e48364f05b2cdf44239b3a1faa0277e58e.tar.xz discoin-80d1f2e48364f05b2cdf44239b3a1faa0277e58e.zip | |
Merge #7184: Implement SequenceLocks functions for BIP 68
b043c4b fix sdaftuar's nits again (Alex Morcos)
a51c79b Bug fix to RPC test (Alex Morcos)
da6ad5f Add RPC test exercising BIP68 (mempool only) (Suhas Daftuar)
c6c2f0f Implement SequenceLocks functions (Alex Morcos)
Diffstat (limited to 'qa/rpc-tests/test_framework')
| -rwxr-xr-x | qa/rpc-tests/test_framework/mininode.py | 8 |
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 2135570b8..81bb439ce 100755 --- a/qa/rpc-tests/test_framework/mininode.py +++ b/qa/rpc-tests/test_framework/mininode.py @@ -231,6 +231,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 |