1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-25 17:09:44 +00:00

fix(tests): Fix device tests after having disabled testnet for BIP-45 paths.

This commit is contained in:
Andrew Kozlik 2021-06-24 15:31:49 +02:00 committed by Martin Milata
parent c067618828
commit e3faece811
2 changed files with 34 additions and 30 deletions

View File

@ -26,6 +26,9 @@ from .signtx import request_finished, request_input, request_meta, request_outpu
B = proto.ButtonRequestType
TX_API = TxCache("Testnet")
# NOTE: This test case was migrated from Testnet to Bitcoin, because we
# disabled testnet for BIP-45 paths. So we are still using the Testnet TxCache
# here, but everything else has been changed to Bitcoin mainnet.
TXHASH_16c6c8 = bytes.fromhex(
"16c6c8471b8db7a628f2b2bb86bfeefae1766463ce8692438c7fd3fce3f43ce5"
@ -40,25 +43,25 @@ TXHASH_b0946d = bytes.fromhex(
class TestMultisigChange:
node_ext1 = bip32.deserialize(
"tpubDADHV9u9Y6gkggintTdMjJE3be58zKNLhpxBQyuEM6Pwx3sN9JVLmMCMN4DNVwL9AKec27z5TaWcWuHzMXiGAtcra5DjwWbvppGX4gaEGVN"
"xpub69qexv5TppjJQtXwSGeGXNtgGWyUzvsHACMt4Rr61Be4CmCf55eFcuXX828aySNuNR7hQYUCvUgZpioNxfs2HTAZWUUSFywhErg7JfTPv3Y"
)
# m/1 => 02c0d0c5fee952620757c6128dbf327c996cd72ed3358d15d6518a1186099bc15e
# m/2 => 0375b9dfaad928ce1a7eed88df7c084e67d99e9ab74332419458a9a45779706801
node_ext2 = bip32.deserialize(
"tpubDADHV9u9Y6gkhWXBmDJ6TUhZajLWjvKukRe2w9FfhdbQpUux8Z8jnPHNAZqFRgHPg9sR7YR93xThM32M7NfRu8S5WyDtext7S62sqxeJNkd"
"xpub69qexv5TppjJRiLLK2K1FZNCFcErkXprCo3jabCXMiqX5CFF4LHedwcXvXkTuBL9tFLWVxuGWrdeerXjiWpC1gynTNUaySDsr8SU5xMpj5R"
)
# m/1 => 0388460dc439f4c8f5bcfc268c36e11b4375cad5c3535c336cfdf8c32c3afad5c1
# m/2 => 03a04f945d5a3685729dde697d574076de4bdf38e904f813b22a851548e1110fc0
node_ext3 = bip32.deserialize(
"tpubDADHV9u9Y6gkmM5ohWRGTswrc6fr7soH7e2D2ic5a86PDUaHc5Ln9EbER69cEr5bDZPa7EXguJ1MhWVzPZpZWVdG5fvoF3hfirXvRbpCCBg"
"xpub69qexv5TppjJVYtxFKSBFxcVGyaC8VJDa1RugAYwEDLVUBuaXrVgznvQB44piM8MRerfVf1pNCBK1L1NzhyKd4Ay25BVZX3S8twWfZDxmz7"
)
# m/1 => 02e0c21e2a7cf00b94c5421725acff97f9826598b91f2340c5ddda730caca7d648
# m/2 => 03928301ffb8c0d7a364b794914c716ba3107cc78a6fe581028b0d8638b22e8573
node_int = bip32.deserialize(
"tpubDADHV9u9Y6gke2Vw3rWE8KRXmeK8PTtsF5B3Cqjo6h3SoiyRtzxjnDVG1knxrqB8BpP1dMAd6MR3Ps5UXibiFDtQuWVPXLkJ3HvttZYbH12"
"xpub69qexv5TppjJNEK5bfX8vQ6ASXDUQ5PohSajrHgeknHZ4SJipn7edmpRmiiBLLDtPur71mekZFazhgas8rkUMnS7quk5qp64TLLV8ShrxZJ"
)
# m/1 => 03f91460d79e4e463d7d90cb75254bcd62b515a99a950574c721efdc5f711dff35
# m/2 => 038caebd6f753bbbd2bb1f3346a43cd32140648583673a31d62f2dfb56ad0ab9e3
@ -174,13 +177,13 @@ class TestMultisigChange:
@pytest.mark.setup_client(mnemonic=MNEMONIC12)
def test_external_external(self, client):
out1 = proto.TxOutputType(
address="muevUcG1Bb8eM2nGUGhqmeujHRX7YXjSEu",
address="1F8yBZB2NZhPZvJekhjTwjhQRRvQeTjjXr",
amount=40000000,
script_type=proto.OutputScriptType.PAYTOADDRESS,
)
out2 = proto.TxOutputType(
address="mwdrpMVSJxxsM8f8xbnCHn9ERaRT1NG1UX",
address="1H7uXJQTVwXca2BXF2opTrvuZapk8Cm8zY",
amount=44000000,
script_type=proto.OutputScriptType.PAYTOADDRESS,
)
@ -189,7 +192,7 @@ class TestMultisigChange:
client.set_expected_responses(self._responses(self.inp1, self.inp2))
_, serialized_tx = btc.sign_tx(
client,
"Testnet",
"Bitcoin",
[self.inp1, self.inp2],
[out1, out2],
prev_txes=TX_API,
@ -205,7 +208,7 @@ class TestMultisigChange:
@pytest.mark.setup_client(mnemonic=MNEMONIC12)
def test_external_internal(self, client):
out1 = proto.TxOutputType(
address="muevUcG1Bb8eM2nGUGhqmeujHRX7YXjSEu",
address="1F8yBZB2NZhPZvJekhjTwjhQRRvQeTjjXr",
amount=40000000,
script_type=proto.OutputScriptType.PAYTOADDRESS,
)
@ -222,7 +225,7 @@ class TestMultisigChange:
)
_, serialized_tx = btc.sign_tx(
client,
"Testnet",
"Bitcoin",
[self.inp1, self.inp2],
[out1, out2],
prev_txes=TX_API,
@ -244,7 +247,7 @@ class TestMultisigChange:
)
out2 = proto.TxOutputType(
address="mwdrpMVSJxxsM8f8xbnCHn9ERaRT1NG1UX",
address="1H7uXJQTVwXca2BXF2opTrvuZapk8Cm8zY",
amount=44000000,
script_type=proto.OutputScriptType.PAYTOADDRESS,
)
@ -255,7 +258,7 @@ class TestMultisigChange:
)
_, serialized_tx = btc.sign_tx(
client,
"Testnet",
"Bitcoin",
[self.inp1, self.inp2],
[out1, out2],
prev_txes=TX_API,
@ -271,13 +274,13 @@ class TestMultisigChange:
@pytest.mark.setup_client(mnemonic=MNEMONIC12)
def test_multisig_external_external(self, client):
out1 = proto.TxOutputType(
address="2N2aFoogGntQFFwdUVPfRmutXD22ThcNTsR",
address="3B23k4kFBRtu49zvpG3Z9xuFzfpHvxBcwt",
amount=40000000,
script_type=proto.OutputScriptType.PAYTOADDRESS,
)
out2 = proto.TxOutputType(
address="2NFJjQcU8mw4Z3ywpbek8HL1VoJ27GDrkHw",
address="3PkXLsY7AUZCrCKGvX8FfP2EawowUBMbcg",
amount=44000000,
script_type=proto.OutputScriptType.PAYTOADDRESS,
)
@ -286,7 +289,7 @@ class TestMultisigChange:
client.set_expected_responses(self._responses(self.inp1, self.inp2))
_, serialized_tx = btc.sign_tx(
client,
"Testnet",
"Bitcoin",
[self.inp1, self.inp2],
[out1, out2],
prev_txes=TX_API,
@ -316,7 +319,7 @@ class TestMultisigChange:
)
out2 = proto.TxOutputType(
address="2NFJjQcU8mw4Z3ywpbek8HL1VoJ27GDrkHw",
address="3PkXLsY7AUZCrCKGvX8FfP2EawowUBMbcg",
amount=44000000,
script_type=proto.OutputScriptType.PAYTOADDRESS,
)
@ -327,7 +330,7 @@ class TestMultisigChange:
)
_, serialized_tx = btc.sign_tx(
client,
"Testnet",
"Bitcoin",
[self.inp1, self.inp2],
[out1, out2],
prev_txes=TX_API,
@ -350,7 +353,7 @@ class TestMultisigChange:
)
out1 = proto.TxOutputType(
address="2N2aFoogGntQFFwdUVPfRmutXD22ThcNTsR",
address="3B23k4kFBRtu49zvpG3Z9xuFzfpHvxBcwt",
amount=40000000,
script_type=proto.OutputScriptType.PAYTOADDRESS,
)
@ -368,7 +371,7 @@ class TestMultisigChange:
)
_, serialized_tx = btc.sign_tx(
client,
"Testnet",
"Bitcoin",
[self.inp1, self.inp2],
[out1, out2],
prev_txes=TX_API,
@ -391,7 +394,7 @@ class TestMultisigChange:
)
out1 = proto.TxOutputType(
address="2N2aFoogGntQFFwdUVPfRmutXD22ThcNTsR",
address="3B23k4kFBRtu49zvpG3Z9xuFzfpHvxBcwt",
amount=40000000,
script_type=proto.OutputScriptType.PAYTOADDRESS,
)
@ -407,7 +410,7 @@ class TestMultisigChange:
client.set_expected_responses(self._responses(self.inp1, self.inp2))
_, serialized_tx = btc.sign_tx(
client,
"Testnet",
"Bitcoin",
[self.inp1, self.inp2],
[out1, out2],
prev_txes=TX_API,
@ -437,7 +440,7 @@ class TestMultisigChange:
)
out2 = proto.TxOutputType(
address="2NFJjQcU8mw4Z3ywpbek8HL1VoJ27GDrkHw",
address="3PkXLsY7AUZCrCKGvX8FfP2EawowUBMbcg",
amount=65000000,
script_type=proto.OutputScriptType.PAYTOADDRESS,
)
@ -446,7 +449,7 @@ class TestMultisigChange:
client.set_expected_responses(self._responses(self.inp1, self.inp3))
_, serialized_tx = btc.sign_tx(
client,
"Testnet",
"Bitcoin",
[self.inp1, self.inp3],
[out1, out2],
prev_txes=TX_API,

View File

@ -271,6 +271,7 @@
"test_msg_getaddress_show.py::test_show_multisig_xpubs[InputScriptType.SPENDP2SHWITNESS-1-3P-82103d63": "afcf421cbb68a5808e8184674dceb09152a08cdc1b04f9f59807be2221e1842a",
"test_msg_getaddress_show.py::test_show_multisig_xpubs[InputScriptType.SPENDWITNESS-2-bc1qqn-5a90fe2a": "5e0dc7790e1dea0839c8d5f44d1a9fb3463364866987cecda6eff01a2dd4fd1b",
"test_msg_getaddress_show.py::test_show_multisig_xpubs[InputScriptType.SPENDWITNESS-2-bc1qqn-b8a7ece8": "c34ab5baa05e59ca95c5ece02b816b0cc82a67f79462612da0d014d0724dd2fc",
"test_msg_getaddress_show.py::test_show_unrecognized_path": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586",
"test_msg_getecdhsessionkey.py-test_ecdh": "75fe462e6afa73742949ede4f3529d2e0ec08f8f1b67c04a57189c8657fcbdcd",
"test_msg_getentropy.py::test_entropy[128]": "a722fa2048fa3102889ec05558d25f837a364ef2a118e85975683e10a56f1356",
"test_msg_getentropy.py::test_entropy[129]": "a722fa2048fa3102889ec05558d25f837a364ef2a118e85975683e10a56f1356",
@ -640,14 +641,14 @@
"test_multisig.py-test_2_of_3": "2be92556edf4ff8eed340d535f379ee6915eae34fef25d669ce865848e7b4705",
"test_multisig.py-test_attack_change_input": "89859fea184df09ce96df5281d405c0e85c87ba7efbafa4b3fdf7d9402c0fc44",
"test_multisig.py-test_missing_pubkey": "a69ccaba89fdb284243c476a5fae3551e8aacf52a59e73f41a1e9f0a38ab93f0",
"test_multisig_change.py-test_external_external": "0f9bc8153070c4bad85bf7ae9d1d30843752538b4d1f8964bc748015a07f00bc",
"test_multisig_change.py-test_external_internal": "f60554e040d8965b8f3efdf9eea1f940b64b5844f12d1ee802abbec8d15ea9bf",
"test_multisig_change.py-test_internal_external": "f6b695c7bd338a6d465d81c7ace92f8021b01932a42e6b8e52ec4261f10bcf33",
"test_multisig_change.py-test_multisig_change_match_first": "05b894da12a881b5000eea56eef50b3c3be619fc43474ebcbed8e3129d64929b",
"test_multisig_change.py-test_multisig_change_match_second": "a095e5f0e53c76850f6fee94623cf724e2aa2a61442aa771a4e7ee81370111f5",
"test_multisig_change.py-test_multisig_external_external": "ddecdadd659b0d1360a6a255c6f9dbf2c5b813039877b76d4062ddab765e1912",
"test_multisig_change.py-test_multisig_mismatch_change": "7cb243b20be31a587dced4aaaf782a2d8487595369dde66aacb1b9a76e89c4fe",
"test_multisig_change.py-test_multisig_mismatch_inputs": "64741bd84c5394e719125c1fbe8c34ef866ac63ca24ee1299e4268c59a199466",
"test_multisig_change.py-test_external_external": "c0f0e105f7361b79718c0f5e208a4cafaa18ab1c18289da4e8bba0be4938aa00",
"test_multisig_change.py-test_external_internal": "b8a981257afddcd57dfa6510632c1ecc38935b7d466dadc3ef2c05a02a3c059a",
"test_multisig_change.py-test_internal_external": "05bcf4ed8f908c2228d82075d1b40df43ced865e9e09df400a3a955f636ac2d1",
"test_multisig_change.py-test_multisig_change_match_first": "8216c87b1956e6852421bcea3b7fff6457e0e7726d6eec5312d1126a23635cbb",
"test_multisig_change.py-test_multisig_change_match_second": "a4974ba1b357d8ecd146e8a6112c13829e2812b5425cc7b8f2d417a05f99de51",
"test_multisig_change.py-test_multisig_external_external": "a7a18c6ff1a3afaf501abb7459c7ded8dc591dd406034e13f5ca83ffe9d4bab7",
"test_multisig_change.py-test_multisig_mismatch_change": "f25b0a640bf10c502f3c6484cebe4df4ad05a8e679891d40f863b9d40fc6a8b5",
"test_multisig_change.py-test_multisig_mismatch_inputs": "dc8960fe817c15b5262aaa2f6a83b37db7e27e196e8abdf7f76d47e4f68a6fec",
"test_nonstandard_paths.py::test_getaddress[m-1195487518-6-255-script_types3]": "4e1ff4e743e91769318fa032d10343c08ee016820df26c1b2a7c6e41b342b24c",
"test_nonstandard_paths.py::test_getaddress[m-1195487518-script_types2]": "fc89fc6ed34c87e94e45a4a0aeab1904009da2f52c5a54ca427209ae7ec0c968",
"test_nonstandard_paths.py::test_getaddress[m-3'-100'-4-255-script_types1]": "d16eecce052da865fe42416a7ab742f567cf7b508d1bb137de46116a513db52c",