Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix typo in showing multisig XPUBS. #1431

Merged
merged 1 commit into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/apps/bitcoin/get_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 9 additions & 7 deletions legacy/firmware/layout2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions tests/device_tests/test_msg_getaddress_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
12 changes: 6 additions & 6 deletions tests/ui_tests/fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down