From 472e853f0a334b6314bee90ca24daa37dd407f45 Mon Sep 17 00:00:00 2001 From: Andrew Kozlik Date: Fri, 17 Jul 2020 17:39:43 +0200 Subject: [PATCH] core/tests: Fix unit tests to work with BasicApprover in sign_tx. --- ...pps.bitcoin.segwit.bip143.native_p2wpkh.py | 9 +++--- ...ps.bitcoin.segwit.bip143.p2wpkh_in_p2sh.py | 9 +++--- ...pps.bitcoin.segwit.signtx.native_p2wpkh.py | 28 +++++++++++-------- ...bitcoin.segwit.signtx.native_p2wpkh_grs.py | 7 +++-- ...ps.bitcoin.segwit.signtx.p2wpkh_in_p2sh.py | 10 +++++-- ...itcoin.segwit.signtx.p2wpkh_in_p2sh_grs.py | 7 +++-- .../test_apps.bitcoin.signtx.fee_threshold.py | 8 ++++-- core/tests/test_apps.bitcoin.signtx.py | 4 ++- core/tests/test_apps.bitcoin.signtx_grs.py | 4 ++- core/tests/test_apps.bitcoin.zcash.zip243.py | 3 +- 10 files changed, 56 insertions(+), 33 deletions(-) diff --git a/core/tests/test_apps.bitcoin.segwit.bip143.native_p2wpkh.py b/core/tests/test_apps.bitcoin.segwit.bip143.native_p2wpkh.py index e3e4e97331..80f4cfc6b4 100644 --- a/core/tests/test_apps.bitcoin.segwit.bip143.native_p2wpkh.py +++ b/core/tests/test_apps.bitcoin.segwit.bip143.native_p2wpkh.py @@ -1,6 +1,7 @@ from common import * from apps.bitcoin.scripts import output_derive_script +from apps.bitcoin.sign_tx.approvers import BasicApprover from apps.bitcoin.sign_tx.bitcoin import Bitcoin from apps.bitcoin.writers import get_tx_hash from apps.common import coins @@ -47,7 +48,7 @@ class TestSegwitBip143NativeP2WPKH(unittest.TestCase): def test_prevouts(self): coin = coins.by_name(self.tx.coin_name) - bip143 = Bitcoin(self.tx, None, coin) + bip143 = Bitcoin(self.tx, None, coin, BasicApprover(self.tx, coin)) bip143.hash143_add_input(self.inp1) bip143.hash143_add_input(self.inp2) prevouts_hash = get_tx_hash(bip143.h_prevouts, double=coin.sign_hash_double) @@ -55,7 +56,7 @@ class TestSegwitBip143NativeP2WPKH(unittest.TestCase): def test_sequence(self): coin = coins.by_name(self.tx.coin_name) - bip143 = Bitcoin(self.tx, None, coin) + bip143 = Bitcoin(self.tx, None, coin, BasicApprover(self.tx, coin)) bip143.hash143_add_input(self.inp1) bip143.hash143_add_input(self.inp2) sequence_hash = get_tx_hash(bip143.h_sequence, double=coin.sign_hash_double) @@ -65,7 +66,7 @@ class TestSegwitBip143NativeP2WPKH(unittest.TestCase): seed = bip39.seed('alcohol woman abuse must during monitor noble actual mixed trade anger aisle', '') coin = coins.by_name(self.tx.coin_name) - bip143 = Bitcoin(self.tx, None, coin) + bip143 = Bitcoin(self.tx, None, coin, BasicApprover(self.tx, coin)) for txo in [self.out1, self.out2]: txo_bin = TxOutputBinType() @@ -80,7 +81,7 @@ class TestSegwitBip143NativeP2WPKH(unittest.TestCase): seed = bip39.seed('alcohol woman abuse must during monitor noble actual mixed trade anger aisle', '') coin = coins.by_name(self.tx.coin_name) - bip143 = Bitcoin(self.tx, None, coin) + bip143 = Bitcoin(self.tx, None, coin, BasicApprover(self.tx, coin)) bip143.hash143_add_input(self.inp1) bip143.hash143_add_input(self.inp2) diff --git a/core/tests/test_apps.bitcoin.segwit.bip143.p2wpkh_in_p2sh.py b/core/tests/test_apps.bitcoin.segwit.bip143.p2wpkh_in_p2sh.py index 65d7451ae5..38252b8dc1 100644 --- a/core/tests/test_apps.bitcoin.segwit.bip143.p2wpkh_in_p2sh.py +++ b/core/tests/test_apps.bitcoin.segwit.bip143.p2wpkh_in_p2sh.py @@ -1,6 +1,7 @@ from common import * from apps.bitcoin.scripts import output_derive_script +from apps.bitcoin.sign_tx.approvers import BasicApprover from apps.bitcoin.sign_tx.bitcoin import Bitcoin from apps.bitcoin.writers import get_tx_hash from apps.common import coins @@ -39,14 +40,14 @@ class TestSegwitBip143(unittest.TestCase): def test_bip143_prevouts(self): coin = coins.by_name(self.tx.coin_name) - bip143 = Bitcoin(self.tx, None, coin) + bip143 = Bitcoin(self.tx, None, coin, BasicApprover(self.tx, coin)) bip143.hash143_add_input(self.inp1) prevouts_hash = get_tx_hash(bip143.h_prevouts, double=coin.sign_hash_double) self.assertEqual(hexlify(prevouts_hash), b'b0287b4a252ac05af83d2dcef00ba313af78a3e9c329afa216eb3aa2a7b4613a') def test_bip143_sequence(self): coin = coins.by_name(self.tx.coin_name) - bip143 = Bitcoin(self.tx, None, coin) + bip143 = Bitcoin(self.tx, None, coin, BasicApprover(self.tx, coin)) bip143.hash143_add_input(self.inp1) sequence_hash = get_tx_hash(bip143.h_sequence, double=coin.sign_hash_double) self.assertEqual(hexlify(sequence_hash), b'18606b350cd8bf565266bc352f0caddcf01e8fa789dd8a15386327cf8cabe198') @@ -54,7 +55,7 @@ class TestSegwitBip143(unittest.TestCase): def test_bip143_outputs(self): seed = bip39.seed('alcohol woman abuse must during monitor noble actual mixed trade anger aisle', '') coin = coins.by_name(self.tx.coin_name) - bip143 = Bitcoin(self.tx, None, coin) + bip143 = Bitcoin(self.tx, None, coin, BasicApprover(self.tx, coin)) for txo in [self.out1, self.out2]: txo_bin = TxOutputBinType() @@ -68,7 +69,7 @@ class TestSegwitBip143(unittest.TestCase): def test_bip143_preimage_testdata(self): seed = bip39.seed('alcohol woman abuse must during monitor noble actual mixed trade anger aisle', '') coin = coins.by_name(self.tx.coin_name) - bip143 = Bitcoin(self.tx, None, coin) + bip143 = Bitcoin(self.tx, None, coin, BasicApprover(self.tx, coin)) bip143.hash143_add_input(self.inp1) for txo in [self.out1, self.out2]: txo_bin = TxOutputBinType() diff --git a/core/tests/test_apps.bitcoin.segwit.signtx.native_p2wpkh.py b/core/tests/test_apps.bitcoin.segwit.signtx.native_p2wpkh.py index edcdd85e22..a333fffaaa 100644 --- a/core/tests/test_apps.bitcoin.segwit.signtx.native_p2wpkh.py +++ b/core/tests/test_apps.bitcoin.segwit.signtx.native_p2wpkh.py @@ -20,6 +20,7 @@ from apps.common import coins from apps.common.keychain import Keychain from apps.bitcoin.keychain import get_namespaces_for_coin from apps.bitcoin.sign_tx import helpers, bitcoin +from apps.bitcoin.sign_tx.approvers import BasicApprover EMPTY_SERIALIZED = TxRequestSerializedType(serialized_tx=bytearray()) @@ -77,9 +78,6 @@ class TestSignSegwitTxNativeP2WPKH(unittest.TestCase): TxRequest(request_type=TXINPUT, details=TxRequestDetailsType(request_index=0, tx_hash=None), serialized=EMPTY_SERIALIZED), TxAck(tx=TransactionType(inputs=[inp1])), - helpers.UiConfirmForeignAddress(address_n=inp1.address_n), - True, - TxRequest(request_type=TXMETA, details=TxRequestDetailsType(request_index=None, tx_hash=inp1.prev_hash), serialized=EMPTY_SERIALIZED), TxAck(tx=ptx1), @@ -92,6 +90,9 @@ class TestSignSegwitTxNativeP2WPKH(unittest.TestCase): TxRequest(request_type=TXOUTPUT, details=TxRequestDetailsType(request_index=1, tx_hash=inp1.prev_hash), serialized=EMPTY_SERIALIZED), TxAck(tx=TransactionType(bin_outputs=[pout2])), + helpers.UiConfirmForeignAddress(address_n=inp1.address_n), + True, + TxRequest(request_type=TXOUTPUT, details=TxRequestDetailsType(request_index=0, tx_hash=None), serialized=EMPTY_SERIALIZED), TxAck(tx=TransactionType(outputs=[out1])), @@ -146,7 +147,8 @@ class TestSignSegwitTxNativeP2WPKH(unittest.TestCase): ns = get_namespaces_for_coin(coin) keychain = Keychain(seed, coin.curve_name, ns) - signer = bitcoin.Bitcoin(tx, keychain, coin).signer() + approver = BasicApprover(tx, coin) + signer = bitcoin.Bitcoin(tx, keychain, coin, approver).signer() for request, response in chunks(messages, 2): res = signer.send(request) self.assertEqual(res, response) @@ -202,9 +204,6 @@ class TestSignSegwitTxNativeP2WPKH(unittest.TestCase): TxRequest(request_type=TXINPUT, details=TxRequestDetailsType(request_index=0, tx_hash=None), serialized=EMPTY_SERIALIZED), TxAck(tx=TransactionType(inputs=[inp1])), - helpers.UiConfirmForeignAddress(address_n=inp1.address_n), - True, - TxRequest(request_type=TXMETA, details=TxRequestDetailsType(request_index=None, tx_hash=inp1.prev_hash), serialized=EMPTY_SERIALIZED), TxAck(tx=ptx1), @@ -217,6 +216,9 @@ class TestSignSegwitTxNativeP2WPKH(unittest.TestCase): TxRequest(request_type=TXOUTPUT, details=TxRequestDetailsType(request_index=1, tx_hash=inp1.prev_hash), serialized=EMPTY_SERIALIZED), TxAck(tx=TransactionType(bin_outputs=[pout2])), + helpers.UiConfirmForeignAddress(address_n=inp1.address_n), + True, + TxRequest(request_type=TXOUTPUT, details=TxRequestDetailsType(request_index=0, tx_hash=None), serialized=EMPTY_SERIALIZED), TxAck(tx=TransactionType(outputs=[out1])), @@ -269,7 +271,8 @@ class TestSignSegwitTxNativeP2WPKH(unittest.TestCase): ns = get_namespaces_for_coin(coin) keychain = Keychain(seed, coin.curve_name, ns) - signer = bitcoin.Bitcoin(tx, keychain, coin).signer() + approver = BasicApprover(tx, coin) + signer = bitcoin.Bitcoin(tx, keychain, coin, approver).signer() for request, response in chunks(messages, 2): self.assertEqual(signer.send(request), response) with self.assertRaises(StopIteration): @@ -317,9 +320,6 @@ class TestSignSegwitTxNativeP2WPKH(unittest.TestCase): TxRequest(request_type=TXINPUT, details=TxRequestDetailsType(request_index=0, tx_hash=None), serialized=EMPTY_SERIALIZED), TxAck(tx=TransactionType(inputs=[inp1])), - helpers.UiConfirmForeignAddress(address_n=inp1.address_n), - True, - TxRequest(request_type=TXMETA, details=TxRequestDetailsType(request_index=None, tx_hash=inp1.prev_hash), serialized=EMPTY_SERIALIZED), TxAck(tx=ptx1), @@ -332,6 +332,9 @@ class TestSignSegwitTxNativeP2WPKH(unittest.TestCase): TxRequest(request_type=TXOUTPUT, details=TxRequestDetailsType(request_index=1, tx_hash=inp1.prev_hash), serialized=EMPTY_SERIALIZED), TxAck(tx=TransactionType(bin_outputs=[pout2])), + helpers.UiConfirmForeignAddress(address_n=inp1.address_n), + True, + TxRequest(request_type=TXOUTPUT, details=TxRequestDetailsType(request_index=0, tx_hash=None), serialized=EMPTY_SERIALIZED), TxAck(tx=TransactionType(outputs=[out1])), None @@ -339,7 +342,8 @@ class TestSignSegwitTxNativeP2WPKH(unittest.TestCase): ns = get_namespaces_for_coin(coin) keychain = Keychain(seed, coin.curve_name, ns) - signer = bitcoin.Bitcoin(tx, keychain, coin).signer() + approver = BasicApprover(tx, coin) + signer = bitcoin.Bitcoin(tx, keychain, coin, approver).signer() for request, response in chunks(messages, 2): if response is None: with self.assertRaises(wire.DataError): diff --git a/core/tests/test_apps.bitcoin.segwit.signtx.native_p2wpkh_grs.py b/core/tests/test_apps.bitcoin.segwit.signtx.native_p2wpkh_grs.py index a10552aa90..c0d05629ae 100644 --- a/core/tests/test_apps.bitcoin.segwit.signtx.native_p2wpkh_grs.py +++ b/core/tests/test_apps.bitcoin.segwit.signtx.native_p2wpkh_grs.py @@ -19,6 +19,7 @@ from apps.common import coins from apps.common.keychain import Keychain from apps.bitcoin.keychain import get_namespaces_for_coin from apps.bitcoin.sign_tx import bitcoinlike, helpers +from apps.bitcoin.sign_tx.approvers import BasicApprover EMPTY_SERIALIZED = TxRequestSerializedType(serialized_tx=bytearray()) @@ -147,7 +148,8 @@ class TestSignSegwitTxNativeP2WPKH_GRS(unittest.TestCase): ns = get_namespaces_for_coin(coin) keychain = Keychain(seed, coin.curve_name, ns) - signer = bitcoinlike.Bitcoinlike(tx, keychain, coin).signer() + approver = BasicApprover(tx, coin) + signer = bitcoinlike.Bitcoinlike(tx, keychain, coin, approver).signer() for request, response in chunks(messages, 2): self.assertEqual(signer.send(request), response) with self.assertRaises(StopIteration): @@ -269,7 +271,8 @@ class TestSignSegwitTxNativeP2WPKH_GRS(unittest.TestCase): ns = get_namespaces_for_coin(coin) keychain = Keychain(seed, coin.curve_name, ns) - signer = bitcoinlike.Bitcoinlike(tx, keychain, coin).signer() + approver = BasicApprover(tx, coin) + signer = bitcoinlike.Bitcoinlike(tx, keychain, coin, approver).signer() for request, response in chunks(messages, 2): self.assertEqual(signer.send(request), response) with self.assertRaises(StopIteration): diff --git a/core/tests/test_apps.bitcoin.segwit.signtx.p2wpkh_in_p2sh.py b/core/tests/test_apps.bitcoin.segwit.signtx.p2wpkh_in_p2sh.py index 499b58b77e..9bba798849 100644 --- a/core/tests/test_apps.bitcoin.segwit.signtx.p2wpkh_in_p2sh.py +++ b/core/tests/test_apps.bitcoin.segwit.signtx.p2wpkh_in_p2sh.py @@ -20,6 +20,7 @@ from apps.common import coins from apps.common.keychain import Keychain from apps.bitcoin.keychain import get_namespaces_for_coin from apps.bitcoin.sign_tx import bitcoin, helpers +from apps.bitcoin.sign_tx.approvers import BasicApprover EMPTY_SERIALIZED = TxRequestSerializedType(serialized_tx=bytearray()) @@ -143,7 +144,8 @@ class TestSignSegwitTxP2WPKHInP2SH(unittest.TestCase): ns = get_namespaces_for_coin(coin) keychain = Keychain(seed, coin.curve_name, ns) - signer = bitcoin.Bitcoin(tx, keychain, coin).signer() + approver = BasicApprover(tx, coin) + signer = bitcoin.Bitcoin(tx, keychain, coin, approver).signer() for request, response in chunks(messages, 2): self.assertEqual(signer.send(request), response) with self.assertRaises(StopIteration): @@ -273,7 +275,8 @@ class TestSignSegwitTxP2WPKHInP2SH(unittest.TestCase): ns = get_namespaces_for_coin(coin) keychain = Keychain(seed, coin.curve_name, ns) - signer = bitcoin.Bitcoin(tx, keychain, coin).signer() + approver = BasicApprover(tx, coin) + signer = bitcoin.Bitcoin(tx, keychain, coin, approver).signer() for request, response in chunks(messages, 2): self.assertEqual(signer.send(request), response) with self.assertRaises(StopIteration): @@ -355,7 +358,8 @@ class TestSignSegwitTxP2WPKHInP2SH(unittest.TestCase): ns = get_namespaces_for_coin(coin) keychain = Keychain(seed, coin.curve_name, ns) - signer = bitcoin.Bitcoin(tx, keychain, coin).signer() + approver = BasicApprover(tx, coin) + signer = bitcoin.Bitcoin(tx, keychain, coin, approver).signer() i = 0 messages_count = int(len(messages) / 2) for request, response in chunks(messages, 2): diff --git a/core/tests/test_apps.bitcoin.segwit.signtx.p2wpkh_in_p2sh_grs.py b/core/tests/test_apps.bitcoin.segwit.signtx.p2wpkh_in_p2sh_grs.py index e8a4b0775c..d24482968a 100644 --- a/core/tests/test_apps.bitcoin.segwit.signtx.p2wpkh_in_p2sh_grs.py +++ b/core/tests/test_apps.bitcoin.segwit.signtx.p2wpkh_in_p2sh_grs.py @@ -19,6 +19,7 @@ from apps.common import coins from apps.common.keychain import Keychain from apps.bitcoin.keychain import get_namespaces_for_coin from apps.bitcoin.sign_tx import bitcoinlike, helpers +from apps.bitcoin.sign_tx.approvers import BasicApprover EMPTY_SERIALIZED = TxRequestSerializedType(serialized_tx=bytearray()) @@ -147,7 +148,8 @@ class TestSignSegwitTxP2WPKHInP2SH_GRS(unittest.TestCase): ns = get_namespaces_for_coin(coin) keychain = Keychain(seed, coin.curve_name, ns) - signer = bitcoinlike.Bitcoinlike(tx, keychain, coin).signer() + approver = BasicApprover(tx, coin) + signer = bitcoinlike.Bitcoinlike(tx, keychain, coin, approver).signer() for request, response in chunks(messages, 2): self.assertEqual(signer.send(request), response) with self.assertRaises(StopIteration): @@ -277,7 +279,8 @@ class TestSignSegwitTxP2WPKHInP2SH_GRS(unittest.TestCase): ns = get_namespaces_for_coin(coin) keychain = Keychain(seed, coin.curve_name, ns) - signer = bitcoinlike.Bitcoinlike(tx, keychain, coin).signer() + approver = BasicApprover(tx, coin) + signer = bitcoinlike.Bitcoinlike(tx, keychain, coin, approver).signer() for request, response in chunks(messages, 2): self.assertEqual(signer.send(request), response) with self.assertRaises(StopIteration): diff --git a/core/tests/test_apps.bitcoin.signtx.fee_threshold.py b/core/tests/test_apps.bitcoin.signtx.fee_threshold.py index f3fe636d0f..8059ccdcf8 100644 --- a/core/tests/test_apps.bitcoin.signtx.fee_threshold.py +++ b/core/tests/test_apps.bitcoin.signtx.fee_threshold.py @@ -17,6 +17,7 @@ from trezor.messages import OutputScriptType from apps.common import coins from apps.common.keychain import Keychain from apps.bitcoin.sign_tx import bitcoin, helpers +from apps.bitcoin.sign_tx.approvers import BasicApprover EMPTY_SERIALIZED = TxRequestSerializedType(serialized_tx=bytearray()) @@ -140,8 +141,6 @@ class TestSignTxFeeThreshold(unittest.TestCase): TxRequest(request_type=TXINPUT, details=TxRequestDetailsType(request_index=0, tx_hash=None), serialized=EMPTY_SERIALIZED), TxAck(tx=TransactionType(inputs=[inp1])), - helpers.UiConfirmForeignAddress(address_n=inp1.address_n), - True, TxRequest(request_type=TXMETA, details=TxRequestDetailsType(request_index=None, tx_hash=unhexlify('d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882')), serialized=EMPTY_SERIALIZED), TxAck(tx=ptx1), TxRequest(request_type=TXINPUT, details=TxRequestDetailsType(request_index=0, tx_hash=unhexlify('d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882')), serialized=EMPTY_SERIALIZED), @@ -150,6 +149,8 @@ class TestSignTxFeeThreshold(unittest.TestCase): TxAck(tx=TransactionType(inputs=[pinp2])), TxRequest(request_type=TXOUTPUT, details=TxRequestDetailsType(request_index=0, tx_hash=unhexlify('d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882')), serialized=EMPTY_SERIALIZED), TxAck(tx=TransactionType(bin_outputs=[pout1])), + helpers.UiConfirmForeignAddress(address_n=inp1.address_n), + True, TxRequest(request_type=TXOUTPUT, details=TxRequestDetailsType(request_index=0, tx_hash=None), serialized=EMPTY_SERIALIZED), TxAck(tx=TransactionType(outputs=[out1])), helpers.UiConfirmOutput(out1, coin_bitcoin), @@ -162,7 +163,8 @@ class TestSignTxFeeThreshold(unittest.TestCase): seed = bip39.seed('alcohol woman abuse must during monitor noble actual mixed trade anger aisle', '') keychain = Keychain(seed, coin_bitcoin.curve_name, [[]]) - signer = bitcoin.Bitcoin(tx, keychain, coin_bitcoin).signer() + approver = BasicApprover(tx, coin_bitcoin) + signer = bitcoin.Bitcoin(tx, keychain, coin_bitcoin, approver).signer() for request, response in chunks(messages, 2): res = signer.send(request) self.assertEqual(res, response) diff --git a/core/tests/test_apps.bitcoin.signtx.py b/core/tests/test_apps.bitcoin.signtx.py index e78a7434b9..be508b221a 100644 --- a/core/tests/test_apps.bitcoin.signtx.py +++ b/core/tests/test_apps.bitcoin.signtx.py @@ -18,6 +18,7 @@ from apps.common import coins from apps.common.keychain import Keychain from apps.bitcoin.keychain import get_namespaces_for_coin from apps.bitcoin.sign_tx import bitcoin, helpers +from apps.bitcoin.sign_tx.approvers import BasicApprover EMPTY_SERIALIZED = TxRequestSerializedType(serialized_tx=bytearray()) @@ -100,7 +101,8 @@ class TestSignTx(unittest.TestCase): seed = bip39.seed('alcohol woman abuse must during monitor noble actual mixed trade anger aisle', '') ns = get_namespaces_for_coin(coin_bitcoin) keychain = Keychain(seed, coin_bitcoin.curve_name, ns) - signer = bitcoin.Bitcoin(tx, keychain, coin_bitcoin).signer() + approver = BasicApprover(tx, coin_bitcoin) + signer = bitcoin.Bitcoin(tx, keychain, coin_bitcoin, approver).signer() for request, response in chunks(messages, 2): res = signer.send(request) diff --git a/core/tests/test_apps.bitcoin.signtx_grs.py b/core/tests/test_apps.bitcoin.signtx_grs.py index 852fdf7ee7..db540a300c 100644 --- a/core/tests/test_apps.bitcoin.signtx_grs.py +++ b/core/tests/test_apps.bitcoin.signtx_grs.py @@ -18,6 +18,7 @@ from apps.common import coins from apps.common.keychain import Keychain from apps.bitcoin.keychain import get_namespaces_for_coin from apps.bitcoin.sign_tx import bitcoinlike, helpers +from apps.bitcoin.sign_tx.approvers import BasicApprover EMPTY_SERIALIZED = TxRequestSerializedType(serialized_tx=bytearray()) @@ -96,7 +97,8 @@ class TestSignTx_GRS(unittest.TestCase): seed = bip39.seed(' '.join(['all'] * 12), '') ns = get_namespaces_for_coin(coin) keychain = Keychain(seed, coin.curve_name, ns) - signer = bitcoinlike.Bitcoinlike(tx, keychain, coin).signer() + approver = BasicApprover(tx, coin) + signer = bitcoinlike.Bitcoinlike(tx, keychain, coin, approver).signer() for request, response in chunks(messages, 2): self.assertEqual(signer.send(request), response) with self.assertRaises(StopIteration): diff --git a/core/tests/test_apps.bitcoin.zcash.zip243.py b/core/tests/test_apps.bitcoin.zcash.zip243.py index 3289848168..5b311a8a21 100644 --- a/core/tests/test_apps.bitcoin.zcash.zip243.py +++ b/core/tests/test_apps.bitcoin.zcash.zip243.py @@ -6,6 +6,7 @@ from trezor.messages.TxOutputBinType import TxOutputBinType from apps.common import coins from apps.bitcoin.writers import get_tx_hash +from apps.bitcoin.sign_tx.approvers import BasicApprover if not utils.BITCOIN_ONLY: from apps.bitcoin.sign_tx.zcash import Zcashlike @@ -190,7 +191,7 @@ class TestZcashZip243(unittest.TestCase): branch_id=v["branch_id"], ) - zip243 = Zcashlike(tx, None, coin) + zip243 = Zcashlike(tx, None, coin, BasicApprover(tx, coin)) for i in v["inputs"]: txi = TxInputType()