From 60df691bb2d78d2059b656ce5a716005deffb892 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 2 Apr 2014 19:31:47 +0200 Subject: [PATCH] make txapi class more universal --- trezorlib/tx_api.py | 49 +++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/trezorlib/tx_api.py b/trezorlib/tx_api.py index 6fc8ef004..e042f91ed 100644 --- a/trezorlib/tx_api.py +++ b/trezorlib/tx_api.py @@ -12,32 +12,41 @@ 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("