diff --git a/tests/device_tests/test_msg_getaddress_segwit_native.py b/tests/device_tests/test_msg_getaddress_segwit_native.py index a9ddc68ea..f10536532 100644 --- a/tests/device_tests/test_msg_getaddress_segwit_native.py +++ b/tests/device_tests/test_msg_getaddress_segwit_native.py @@ -45,29 +45,33 @@ VECTORS = ( # coin, path, script_type, address proto.InputScriptType.SPENDWITNESS, "bc1qktmhrsmsenepnnfst8x6j27l0uqv7ggrg8x38q", ), - ( + pytest.param( "Testnet", "86'/1'/0'/0/0", proto.InputScriptType.SPENDTAPROOT, "tb1pswrqtykue8r89t9u4rprjs0gt4qzkdfuursfnvqaa3f2yql07zmq8s8a5u", + marks=pytest.mark.skip_t1, ), - ( + pytest.param( "Testnet", "86'/1'/0'/1/0", proto.InputScriptType.SPENDTAPROOT, "tb1pn2d0yjeedavnkd8z8lhm566p0f2utm3lgvxrsdehnl94y34txmts5s7t4c", + marks=pytest.mark.skip_t1, ), - ( + pytest.param( "Bitcoin", "86'/0'/0'/0/0", proto.InputScriptType.SPENDTAPROOT, "bc1ptxs597p3fnpd8gwut5p467ulsydae3rp9z75hd99w8k3ljr9g9rqx6ynaw", + marks=pytest.mark.skip_t1, ), - ( + pytest.param( "Bitcoin", "86'/0'/0'/1/0", proto.InputScriptType.SPENDTAPROOT, "bc1pgypgja2hmcx2l6s2ssq75k6ev68ved6nujcspt47dgvkp8euc70s6uegk6", + marks=pytest.mark.skip_t1, ), pytest.param( "Groestlcoin", @@ -86,6 +90,13 @@ VECTORS = ( # coin, path, script_type, address ) +BIP86_VECTORS = ( # path, address for "abandon ... abandon about" seed + ("86'/0'/0'/0/0", "bc1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxqkedrcr"), + ("86'/0'/0'/0/1", "bc1p4qhjn9zdvkux4e44uhx8tc55attvtyu358kutcqkudyccelu0was9fqzwh"), + ("86'/0'/0'/1/0", "bc1p3qkhfews2uk44qtvauqyr2ttdsw7svhkl9nkm9s9c3x4ax5h60wqwruhk7"), +) + + @pytest.mark.parametrize("show_display", (True, False)) @pytest.mark.parametrize("coin, path, script_type, address", VECTORS) def test_show_segwit(client, show_display, coin, path, script_type, address): @@ -102,6 +113,26 @@ def test_show_segwit(client, show_display, coin, path, script_type, address): ) +# Tests https://github.com/bitcoin/bips/blob/master/bip-0086.mediawiki#test-vectors +@pytest.mark.skip_t1 +@pytest.mark.setup_client( + mnemonic="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about" +) +@pytest.mark.parametrize("path, address", BIP86_VECTORS) +def test_bip86(client, path, address): + assert ( + btc.get_address( + client, + "Bitcoin", + parse_path(path), + False, + None, + script_type=proto.InputScriptType.SPENDTAPROOT, + ) + == address + ) + + @pytest.mark.multisig def test_show_multisig_3(client): nodes = [ diff --git a/tests/ui_tests/fixtures.json b/tests/ui_tests/fixtures.json index e3764ceb9..57ac63b62 100644 --- a/tests/ui_tests/fixtures.json +++ b/tests/ui_tests/fixtures.json @@ -379,6 +379,9 @@ "test_msg_getaddress_segwit.py-test_show_multisig_3": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1", "test_msg_getaddress_segwit.py-test_show_segwit": "8fee331410c7b921ea9bca379bd8c626672e9a8f87e99eca3e8786b27a10814c", "test_msg_getaddress_segwit.py-test_show_segwit_altcoin": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1", +"test_msg_getaddress_segwit_native.py::test_bip86[86'-0'-0'-0-0-bc1p5cyxnuxmeuwuvkwfem96lqzs-5349234d": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1", +"test_msg_getaddress_segwit_native.py::test_bip86[86'-0'-0'-0-1-bc1p4qhjn9zdvkux4e44uhx8tc55-a80c1366": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1", +"test_msg_getaddress_segwit_native.py::test_bip86[86'-0'-0'-1-0-bc1p3qkhfews2uk44qtvauqyr2tt-656ac0ef": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1", "test_msg_getaddress_segwit_native.py::test_multisig_missing[False]": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1", "test_msg_getaddress_segwit_native.py::test_multisig_missing[True]": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1", "test_msg_getaddress_segwit_native.py::test_show_multisig_3": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1",