From a12ac4b26d44a1cee755f8bd360431c9ca804e24 Mon Sep 17 00:00:00 2001 From: "Peter D. Gray" Date: Thu, 31 Jul 2025 10:24:28 -0400 Subject: [PATCH] cleanups --- releases/Next-ChangeLog.md | 13 +++--- shared/charcodes.py | 7 +-- shared/utils.py | 2 +- testing/test_ux.py | 92 ++------------------------------------ 4 files changed, 16 insertions(+), 98 deletions(-) diff --git a/releases/Next-ChangeLog.md b/releases/Next-ChangeLog.md index 1b3bd8d6..96294abc 100644 --- a/releases/Next-ChangeLog.md +++ b/releases/Next-ChangeLog.md @@ -5,21 +5,22 @@ This lists the new changes that have not yet been published in a normal release. # Shared Improvements - Both Mk4 and Q - New: Added `Bull Bitcoin` export to `Export Wallet` menu -- Enhancement: Add warning for zero value outputs if not OP_RETURNs -- Enhancement: Show QR codes of output addresses in Txn output explorer. Output explorer is offered for txns of all sizes. -- Bugfix: If all change outputs have `nValue=0` they're not shown in UX -- Bugfix: Disallow negative input/output amounts in PSBT +- Enhancement: Add warning for zero value outputs if not `OP_RETURN` +- Enhancement: Show QR codes of output addresses in Txn output explorer. Output explorer is + now offered for transactions of all sizes. +- Bugfix: If all change outputs have `nValue=0` they're not shown in UX. +- Bugfix: Disallow negative input/output amounts in PSBT. # Mk4 Specific Changes -## 5.4.? - 2025-06- +## 5.4.? - 2025-08-xx - Bugfix: Part of extended keys in stories were not always visible. # Q Specific Changes -## 1.3.?Q - 2025-06 +## 1.3.?Q - 2025-08-xx - Bugfix: Correct line positioning when 24 seed words displayed. diff --git a/shared/charcodes.py b/shared/charcodes.py index 3b1da743..f1242afd 100644 --- a/shared/charcodes.py +++ b/shared/charcodes.py @@ -109,8 +109,9 @@ if has_qwerty: # These affect how 'ux stories' are rendered; they are control # characters on the output side of things, not input. -OUT_CTRL_TITLE = '\x01' # must be first char in line: be a title line -OUT_CTRL_ADDRESS = '\x02' # must be first char in line: it's a payment address -OUT_CTRL_NOWRAP = '\x03' # must be first char in line: do not word wrap this line +# - must be first char in line +OUT_CTRL_TITLE = '\x01' # be a title line +OUT_CTRL_ADDRESS = '\x02' # it's a payment address +OUT_CTRL_NOWRAP = '\x03' # do not word wrap this line # EOF diff --git a/shared/utils.py b/shared/utils.py index 035b27a9..dc66e843 100644 --- a/shared/utils.py +++ b/shared/utils.py @@ -470,7 +470,7 @@ def word_wrap(ln, w): # Generate the lines needed to wrap one line into X "width"-long lines. # - tests in testing/test_unit.py if ln and (ln[0] == OUT_CTRL_NOWRAP): - # no need to wrap this - as requested by caller + # no need to wrap this line - as requested by caller yield ln[1:] return diff --git a/testing/test_ux.py b/testing/test_ux.py index 2d44d3a8..d7d229f8 100644 --- a/testing/test_ux.py +++ b/testing/test_ux.py @@ -1028,95 +1028,11 @@ def test_qr_share_files(fname, pick_menu_item, goto_home, is_q1, cap_menu, cap_s os.remove(f'{sim_root_dir}/MicroSD/' + fname) @pytest.mark.parametrize("word,cs_word", [ - # all words with length 8 + their longest possible checksum word - # ("abstract", "banner"), - # ("accident", "remain"), - # ("acoustic", "decrease"), - # ("announce", "involve"), - # ("artefact", "awkward"), - # ("attitude", "outdoor"), - # ("bachelor", "message"), - # ("broccoli", "explain"), - # ("business", "antenna"), - # ("category", "inquiry"), - # ("champion", "almost"), - # ("cinnamon", "episode"), - # ("congress", "mistake"), - # ("consider", "industry"), - # ("convince", "leopard"), - # ("cupboard", "original"), - # ("daughter", "mountain"), - # ("december", "receive"), - # ("decorate", "entire"), - # ("decrease", "mushroom"), - # ("describe", "buffalo"), - # ("dinosaur", "cushion"), - # ("disagree", "benefit"), - # ("discover", "attract"), - # ("disorder", "mountain"), - # ("distance", "accident"), - # ("document", "dilemma"), - # ("electric", "witness"), - # ("elephant", "cupboard"), - # ("elevator", "present"), - # ("envelope", "original"), - # ("evidence", "awkward"), - # ("exchange", "ensure"), - # ("exercise", "eternal"), - # ("favorite", "umbrella"), - # ("february", "airport"), - # ("festival", "cancel"), - # ("frequent", "garbage"), - # ("hedgehog", "employ"), - # ("hospital", "announce"), - # ("identify", "destroy"), - # ("increase", "better"), - # ("indicate", "arrest"), - # ("industry", "property"), - # ("innocent", "champion"), - # ("interest", "exhaust"), - # ("kangaroo", "present"), - # ("language", "endorse"), - # ("marriage", "immense"), - # ("material", "balcony"), - # ("mechanic", "bitter"), - # ("midnight", "unhappy"), - # ("mosquito", "mechanic"), - # ("mountain", "vehicle"), - # ("multiply", "advance"), - # ("mushroom", "leopard"), - # ("negative", "response"), - # ("ordinary", "address"), - # ("original", "account"), - # ("physical", "correct"), - # ("position", "concert"), - # ("possible", "canyon"), - # ("practice", "thought"), - # ("priority", "cabbage"), - # ("property", "puzzle"), - # ("purchase", "blanket"), - # ("question", "country"), - # ("remember", "buffalo"), - # ("resemble", "prevent"), - # ("resource", "elevator"), - # ("response", "cattle"), - # ("scissors", "mystery"), - # ("scorpion", "achieve"), - # ("security", "question"), - # ("sentence", "erosion"), - # ("shoulder", "kangaroo"), - # ("solution", "elephant"), - # ("squirrel", "chapter"), - # ("strategy", "chimney"), - # ("struggle", "volcano"), - # ("surprise", "approve"), - # ("surround", "pioneer"), - # ("together", "increase"), - # ("tomorrow", "bracket"), - # ("tortoise", "blanket"), - # ("transfer", "priority"), + # few combos with all words with length 8 + their longest possible checksum word + ("acoustic", "decrease"), + ("electric", "witness"), ("umbrella", "convince"), - # ("universe", "hamster"), + ("universe", "hamster"), ]) def test_q1_24_8char_words(set_seed_words, is_q1, goto_home, pick_menu_item, press_select, cap_story, cap_screen, word, cs_word):