From 6dba94baba1d076c059b92c75b79d0fcb8a870fc Mon Sep 17 00:00:00 2001 From: Andrew Kozlik Date: Mon, 25 Jan 2021 14:17:50 +0100 Subject: [PATCH] fix: Improve wording when showing multisig XPUBS. --- core/src/apps/bitcoin/get_address.py | 2 +- legacy/firmware/layout2.c | 16 +++++++++------- tests/device_tests/test_msg_getaddress_show.py | 12 ++++++------ tests/ui_tests/fixtures.json | 12 ++++++------ 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/core/src/apps/bitcoin/get_address.py b/core/src/apps/bitcoin/get_address.py index a7b64d4f00b..94acab5fd46 100644 --- a/core/src/apps/bitcoin/get_address.py +++ b/core/src/apps/bitcoin/get_address.py @@ -37,7 +37,7 @@ async def show_xpubs( ) xpub = node.serialize_public(xpub_magic) desc = "XPUB #%d" % (i + 1) - desc += " (yours)" if i == multisig_index else " (others)" + desc += " (yours)" if i == multisig_index else " (cosigner)" if await show_xpub(ctx, xpub, desc=desc, cancel=cancel): return True return False diff --git a/legacy/firmware/layout2.c b/legacy/firmware/layout2.c index 352ebef3444..e89026bf02a 100644 --- a/legacy/firmware/layout2.c +++ b/legacy/firmware/layout2.c @@ -811,7 +811,7 @@ void layoutXPUBMultisig(const char *xpub, int index, int page, bool ours) { oledClear(); } layoutLast = layoutXPUBMultisig; - char desc[] = "XPUB #__ _/2 (______)"; + char desc[] = "XPUB #__ _/2 (________)"; if (index + 1 >= 10) { desc[6] = '0' + (((index + 1) / 10) % 10); desc[7] = '0' + ((index + 1) % 10); @@ -829,12 +829,14 @@ void layoutXPUBMultisig(const char *xpub, int index, int page, bool ours) { desc[19] = ')'; desc[20] = 0; } else { - desc[14] = 'o'; - desc[15] = 't'; - desc[16] = 'h'; - desc[17] = 'e'; - desc[18] = 'r'; - desc[19] = 's'; + desc[14] = 'c'; + desc[15] = 'o'; + desc[16] = 's'; + desc[17] = 'i'; + desc[18] = 'g'; + desc[19] = 'n'; + desc[20] = 'e'; + desc[21] = 'r'; } _layout_xpub(xpub, desc, page); layoutButtonNo(_("Next"), NULL); diff --git a/tests/device_tests/test_msg_getaddress_show.py b/tests/device_tests/test_msg_getaddress_show.py index 6113f960fb3..25dfa5443d5 100644 --- a/tests/device_tests/test_msg_getaddress_show.py +++ b/tests/device_tests/test_msg_getaddress_show.py @@ -187,28 +187,28 @@ def input_flow(): client.debug.press_no() yield # show XPUB#1 lines1 = client.debug.wait_layout().lines - assert lines1[0] == "XPUB #1 " + ("(yours)" if i == 0 else "(others)") + assert lines1[0] == "XPUB #1 " + ("(yours)" if i == 0 else "(cosigner)") client.debug.swipe_up() lines2 = client.debug.wait_layout().lines - assert lines2[0] == "XPUB #1 " + ("(yours)" if i == 0 else "(others)") + assert lines2[0] == "XPUB #1 " + ("(yours)" if i == 0 else "(cosigner)") assert "".join(lines1[1:] + lines2[1:]) == xpubs[0] client.debug.press_no() yield # show XPUB#2 lines1 = client.debug.wait_layout().lines - assert lines1[0] == "XPUB #2 " + ("(yours)" if i == 1 else "(others)") + assert lines1[0] == "XPUB #2 " + ("(yours)" if i == 1 else "(cosigner)") client.debug.swipe_up() lines2 = client.debug.wait_layout().lines - assert lines2[0] == "XPUB #2 " + ("(yours)" if i == 1 else "(others)") + assert lines2[0] == "XPUB #2 " + ("(yours)" if i == 1 else "(cosigner)") assert "".join(lines1[1:] + lines2[1:]) == xpubs[1] client.debug.press_no() yield # show XPUB#3 lines1 = client.debug.wait_layout().lines - assert lines1[0] == "XPUB #3 " + ("(yours)" if i == 2 else "(others)") + assert lines1[0] == "XPUB #3 " + ("(yours)" if i == 2 else "(cosigner)") client.debug.swipe_up() lines2 = client.debug.wait_layout().lines - assert lines2[0] == "XPUB #3 " + ("(yours)" if i == 2 else "(others)") + assert lines2[0] == "XPUB #3 " + ("(yours)" if i == 2 else "(cosigner)") assert "".join(lines1[1:] + lines2[1:]) == xpubs[2] client.debug.press_yes() diff --git a/tests/ui_tests/fixtures.json b/tests/ui_tests/fixtures.json index 3ac1ae5aade..87bab0be498 100644 --- a/tests/ui_tests/fixtures.json +++ b/tests/ui_tests/fixtures.json @@ -178,12 +178,12 @@ "test_msg_getaddress_show.py::test_show[m-84h-0h-12h-0-0-3-bc1qduvap743hcl7twn8u6f9l0u8y7x83-f4d2fe44": "b72f75dc5f8f4e7ff2254c20ba8006425920267d5b7d3c1dccbe31e5b0f64ce6", "test_msg_getaddress_show.py::test_show_multisig_15": "28693cd1a8581f13128ebf4961195873cb044171baef85a3802f90999f828a1a", "test_msg_getaddress_show.py::test_show_multisig_3": "52e77c417eab7ab63b4e27f80e2d8cae54f638ba5851f19c5941f41de3e9d00e", -"test_msg_getaddress_show.py::test_show_multisig_xpubs[1-0-33TU5DyVi2kFSGQUfmZxNHgPDPqruwdes-17e6fede": "81612fcacbf8460bfae23e328f4091b932d89d203344bf5c95db8f33fb378e7a", -"test_msg_getaddress_show.py::test_show_multisig_xpubs[1-0-33TU5DyVi2kFSGQUfmZxNHgPDPqruwdes-41b4bcf4": "81612fcacbf8460bfae23e328f4091b932d89d203344bf5c95db8f33fb378e7a", -"test_msg_getaddress_show.py::test_show_multisig_xpubs[3-2-bc1qqn9s63wly66rhzyz36hwzsa83augj-6f544d0f": "c930a71ecd1bf2afef72dae9964c42c141c20c6f761c4449d1ee4ea65b34bd2b", -"test_msg_getaddress_show.py::test_show_multisig_xpubs[3-2-bc1qqn9s63wly66rhzyz36hwzsa83augj-7314fc58": "7a7b92e0c93526140ed64b6ca15ceb2b261a5952281bcbc13207cd2ca2c4d069", -"test_msg_getaddress_show.py::test_show_multisig_xpubs[4-1-3PwoNRb1v7HxofcH6xfiq52nFrDarsn1a-a16dbad4": "b4a2e561589b91c07f55ab74ecfc896f631042dcf51358b1eddf8ddc51c5aefc", -"test_msg_getaddress_show.py::test_show_multisig_xpubs[4-1-3PwoNRb1v7HxofcH6xfiq52nFrDarsn1a-f0fc74c3": "7dd5bd20f798d49eb3472d5f09e40586473d16b0db45bec06d1d59d9a1c8b23b", +"test_msg_getaddress_show.py::test_show_multisig_xpubs[1-0-33TU5DyVi2kFSGQUfmZxNHgPDPqruwdes-17e6fede": "af083d58ee4e15abd5bf42e6ce3e0028e47a6a9e46bceac6fd34ea4c4624d1d5", +"test_msg_getaddress_show.py::test_show_multisig_xpubs[1-0-33TU5DyVi2kFSGQUfmZxNHgPDPqruwdes-41b4bcf4": "af083d58ee4e15abd5bf42e6ce3e0028e47a6a9e46bceac6fd34ea4c4624d1d5", +"test_msg_getaddress_show.py::test_show_multisig_xpubs[3-2-bc1qqn9s63wly66rhzyz36hwzsa83augj-6f544d0f": "5e0dc7790e1dea0839c8d5f44d1a9fb3463364866987cecda6eff01a2dd4fd1b", +"test_msg_getaddress_show.py::test_show_multisig_xpubs[3-2-bc1qqn9s63wly66rhzyz36hwzsa83augj-7314fc58": "c34ab5baa05e59ca95c5ece02b816b0cc82a67f79462612da0d014d0724dd2fc", +"test_msg_getaddress_show.py::test_show_multisig_xpubs[4-1-3PwoNRb1v7HxofcH6xfiq52nFrDarsn1a-a16dbad4": "eb3811e31b207cb9d47246cf8eeecaa79bab18fe1cb680b8ed92bc01b2895fa8", +"test_msg_getaddress_show.py::test_show_multisig_xpubs[4-1-3PwoNRb1v7HxofcH6xfiq52nFrDarsn1a-f0fc74c3": "afcf421cbb68a5808e8184674dceb09152a08cdc1b04f9f59807be2221e1842a", "test_msg_getecdhsessionkey.py-test_ecdh": "75fe462e6afa73742949ede4f3529d2e0ec08f8f1b67c04a57189c8657fcbdcd", "test_msg_getentropy.py::test_entropy[128]": "a722fa2048fa3102889ec05558d25f837a364ef2a118e85975683e10a56f1356", "test_msg_getentropy.py::test_entropy[129]": "a722fa2048fa3102889ec05558d25f837a364ef2a118e85975683e10a56f1356",