|
|
|
@ -30,7 +30,6 @@ from apps.common import coins
|
|
|
|
|
from apps.common.keychain import Keychain
|
|
|
|
|
from apps.bitcoin.keychain import get_schemas_for_coin
|
|
|
|
|
from apps.bitcoin.sign_tx import helpers, bitcoin
|
|
|
|
|
from apps.bitcoin.sign_tx.approvers import BasicApprover
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EMPTY_SERIALIZED = TxRequestSerializedType(serialized_tx=bytearray())
|
|
|
|
@ -160,8 +159,7 @@ class TestSignSegwitTxNativeP2WPKH(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
ns = get_schemas_for_coin(coin)
|
|
|
|
|
keychain = Keychain(seed, coin.curve_name, ns)
|
|
|
|
|
approver = BasicApprover(tx, coin)
|
|
|
|
|
signer = bitcoin.Bitcoin(tx, keychain, coin, approver).signer()
|
|
|
|
|
signer = bitcoin.Bitcoin(tx, keychain, coin, None).signer()
|
|
|
|
|
for request, response in chunks(messages, 2):
|
|
|
|
|
res = signer.send(request)
|
|
|
|
|
if isinstance(res, tuple):
|
|
|
|
@ -289,8 +287,7 @@ class TestSignSegwitTxNativeP2WPKH(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
ns = get_schemas_for_coin(coin)
|
|
|
|
|
keychain = Keychain(seed, coin.curve_name, ns)
|
|
|
|
|
approver = BasicApprover(tx, coin)
|
|
|
|
|
signer = bitcoin.Bitcoin(tx, keychain, coin, approver).signer()
|
|
|
|
|
signer = bitcoin.Bitcoin(tx, keychain, coin, None).signer()
|
|
|
|
|
for request, expected_response in chunks(messages, 2):
|
|
|
|
|
response = signer.send(request)
|
|
|
|
|
if isinstance(response, tuple):
|
|
|
|
@ -350,8 +347,7 @@ class TestSignSegwitTxNativeP2WPKH(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
ns = get_schemas_for_coin(coin)
|
|
|
|
|
keychain = Keychain(seed, coin.curve_name, ns)
|
|
|
|
|
approver = BasicApprover(tx, coin)
|
|
|
|
|
signer = bitcoin.Bitcoin(tx, keychain, coin, approver).signer()
|
|
|
|
|
signer = bitcoin.Bitcoin(tx, keychain, coin, None).signer()
|
|
|
|
|
for request, expected_response in chunks(messages, 2):
|
|
|
|
|
if expected_response is None:
|
|
|
|
|
with self.assertRaises(wire.DataError):
|
|
|
|
|