What changed, and why it matters
This commit only updates a test file. It rewrites comments and adds two assertions to verify that backing out of seed word entry leaves the first word saved and clears the second word. There is no change to the actual application code that users run, so it cannot directly affect security.
No security action needed. Review the related production code change that this test likely accompanies, because the test itself only validates behavior.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies tests/test_flows_seed.py. It updates docstrings in two test methods (test_back_from_seed_entry_first_word and test_back_from_seed_entry_via_seed_select) to describe behavior more generically, and adds assertions checking pending_mnemonic_word state after a BACK navigation. No production code is altered.
Changed components
tests/test_flows_seed.pyInspect captured patch +9 / −6
diff --git a/tests/test_flows_seed.py b/tests/test_flows_seed.py
index 601e7a4..578f009 100644
--- a/tests/test_flows_seed.py
+++ b/tests/test_flows_seed.py
@@ -506,8 +506,8 @@ class TestSeedEntryBackFlows(FlowTest):
def test_back_from_seed_entry_first_word(self):
"""
- Seeds Menu → Load a Seed → Enter 12/24-word → BACK on first word →
- should return to LoadSeedView, NOT MainMenuView.
+ Pressing BACK on the first word of mnemonic entry should return to
+ the View that initiated the mnemonic entry process.
"""
for seed_type in [seed_views.LoadSeedView.TYPE_12WORD, seed_views.LoadSeedView.TYPE_24WORD]:
self.run_sequence([
@@ -534,13 +534,16 @@ class TestSeedEntryBackFlows(FlowTest):
FlowStep(seed_views.SeedMnemonicEntryView), # Returns to word #1
])
+ # Verify we're back on word #1: word at index 0 should still be set
+ # from the previous entry, while word at index 1 should be unset.
+ assert self.controller.storage.get_pending_mnemonic_word(0) == "abandon"
+ assert self.controller.storage.get_pending_mnemonic_word(1) is None
+
def test_back_from_seed_entry_via_seed_select(self):
"""
- When entering a seed via SeedSelectSeedView (e.g. during sign message flow),
- pressing BACK on the first word should return to SeedSelectSeedView, NOT
- MainMenuView. Crucially, resume_main_flow must remain valid since the user
- is still within that flow.
+ Backing out of mnemonic entry during an active flow must preserve
+ `resume_main_flow` so the user remains within that flow.
"""
from seedsigner.controller import Controller
from seedsigner.models.settings import SettingsConstants
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.