From 49eec8b78e3f4a5d375707d0936780cc088b1a89 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sat, 29 Mar 2014 21:31:17 +0100 Subject: [PATCH] txapi cleanup --- trezorlib/tx_api.py | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/trezorlib/tx_api.py b/trezorlib/tx_api.py index d01a551a2..b1b86d8ae 100644 --- a/trezorlib/tx_api.py +++ b/trezorlib/tx_api.py @@ -12,6 +12,33 @@ except: import types_pb2 as proto_types +def op_push(i): + if i<0x4c: + return chr(i) + elif i<0xff: + return '\x4c' + chr(i) + elif i<0xffff: + return '\x4d' + struct.pack("