diff --git a/tests/common.py b/tests/common.py index 8d908bf..bd2fe14 100644 --- a/tests/common.py +++ b/tests/common.py @@ -11,7 +11,6 @@ class TrezorTest(unittest.TestCase): self.client = TrezorDebugClient(self.transport) self.client.set_debuglink(self.debug_transport) # self.client.set_buttonwait(3) - self.client.set_tx_api(TXAPIBitcoin()) # 1 2 3 4 5 6 7 8 9 10 11 12 self.mnemonic12 = 'alcohol woman abuse must during monitor noble actual mixed trade anger aisle' diff --git a/trezorctl b/trezorctl index 7472546..995752f 100755 --- a/trezorctl +++ b/trezorctl @@ -442,7 +442,6 @@ def main(): else: client = TrezorClient(transport) - client.set_tx_api(TXAPIBitcoin()) cmds = Commands(client) res = args.func(cmds, args) diff --git a/trezorlib/client.py b/trezorlib/client.py index 8b60dd5..5cb5916 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -538,7 +538,10 @@ class ProtocolMixin(object): continue tx = msg.transactions.add() - tx.CopyFrom(self.tx_api.get_tx(binascii.hexlify(inp.prev_hash))) + if self.tx_api: + tx.CopyFrom(self.tx_api.get_tx(binascii.hexlify(inp.prev_hash))) + else: + raise Exception('TX_API not defined') known_hashes.append(inp.prev_hash) return msg @@ -560,7 +563,10 @@ class ProtocolMixin(object): if inp.prev_hash in known_hashes: continue - txes[inp.prev_hash] = self.tx_api.get_tx(binascii.hexlify(inp.prev_hash)) + if self.tx_api: + txes[inp.prev_hash] = self.tx_api.get_tx(binascii.hexlify(inp.prev_hash)) + else: + raise Exception('TX_API not defined') known_hashes.append(inp.prev_hash) return txes