SFT-5768: fixed lint and removed view_text parameter since it was never used
What changed, and why it matters
This commit is a routine code cleanup. It removes an unused 'view_text' parameter from a warning screen and fixes a minor text linting issue. There is no security-relevant change.
No action required; this is a benign refactoring change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch removes the view_text parameter from SeedWarningFlow and its only call site in ViewSeedWordsFlow, hardcoding the previously default value ‘View’ in the user-facing prompt. It also breaks a long string literal to satisfy lint rules and removes stale commented-out code. No functional or security behavior is altered.
Changed components
ports/stm32/boards/Passport/modules/flows/seed_warning_flow.pyports/stm32/boards/Passport/modules/flows/view_seed_words_flow.pyInspect captured patch +6 / −12
diff --git a/ports/stm32/boards/Passport/modules/flows/seed_warning_flow.py b/ports/stm32/boards/Passport/modules/flows/seed_warning_flow.py
index 86b36b2..5d05e2e 100644
--- a/ports/stm32/boards/Passport/modules/flows/seed_warning_flow.py
+++ b/ports/stm32/boards/Passport/modules/flows/seed_warning_flow.py
@@ -13,8 +13,7 @@ class SeedWarningFlow(Flow):
info_type_text=None,
initial=False,
allow_skip=True,
- key_manager=False,
- view_text="View"):
+ key_manager=False):
self.mention_passphrase = mention_passphrase
self.action_text = action_text or "display your seed words"
self.continue_text = continue_text or "funds"
@@ -22,7 +21,6 @@ class SeedWarningFlow(Flow):
self.allow_skip = allow_skip
self.initial = initial
self.key_manager = key_manager
- self.view_text = view_text or "View"
initial_state = self.show_skippable if (initial and allow_skip) else self.show_intro
super().__init__(initial_state=initial_state, name='SeedWarningFlow')
@@ -59,7 +57,8 @@ Would you like to view them now?'''
else:
text = 'Passport is about to {}'.format(self.action_text)
else:
- text = 'Foundation and other legitimate companies will never ask you to share these words outside of Passport.'
+ text = 'Foundation and other legitimate companies will never ask you ' \
+ 'to share these words outside of Passport.'
# Empty microns have no action, so backing out isn't allowed
left_micron = microns.Back if self.allow_skip else None
@@ -124,17 +123,13 @@ Would you like to view them now?'''
from pages import QuestionPage
import microns
- # text = 'Anyone requesting you expose {} outside Passport ' \
- # 'will gain full control over your {}. Take care.' \
- # .format(self.info_type_text, self.continue_text)
- text = 'Anyone with access to your seed words gains full control over your funds. {} your seed words now?'.format(self.view_text)
+ text = 'Anyone with access to your seed words gains full ' \
+ 'control over your funds. View your seed words now?'
left_micron = microns.Cancel
if not self.allow_skip:
left_micron = None
- # else:
- # text += '\n\nContinue?'
result = await QuestionPage(text, left_micron=left_micron).show()
self.set_result(result)
diff --git a/ports/stm32/boards/Passport/modules/flows/view_seed_words_flow.py b/ports/stm32/boards/Passport/modules/flows/view_seed_words_flow.py
index f53904e..e9bf1b7 100644
--- a/ports/stm32/boards/Passport/modules/flows/view_seed_words_flow.py
+++ b/ports/stm32/boards/Passport/modules/flows/view_seed_words_flow.py
@@ -136,8 +136,7 @@ class ViewSeedWordsFlow(Flow):
mention_passphrase=self.mention_passphrase,
initial=self.initial,
allow_skip=self.allow_skip,
- key_manager=self.key_manager,
- view_text="Export").run()
+ key_manager=self.key_manager).run()
if not result:
self.back()
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.