-
Notifications
You must be signed in to change notification settings - Fork 171
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
Light refactor of Electrum seed support #571
Conversation
src/seedsigner/views/psbt_views.py
Outdated
status_headline=None, | ||
text=f"Some features disabled for Electrum seeds", | ||
show_back_button=False, | ||
) | ||
from seedsigner.views.seed_views import SeedMnemonicEntryView | ||
self.controller.storage.init_pending_mnemonic(num_words=12, is_electrum=True) | ||
return Destination(SeedMnemonicEntryView) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you meant this to direct to the new SeedElectrumMnemonicStartView since removed the warning screen above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from seedsigner.views.seed_views import SeedElectrumMnemonicStartView
return Destination(SeedElectrumMnemonicStartView)
src/seedsigner/views/tools_views.py
Outdated
self.controller.storage.init_pending_mnemonic(num_words=12, is_electrum=True) | ||
return Destination(SeedMnemonicEntryView) | ||
from seedsigner.views.seed_views import SeedElectrumWarningView | ||
return Destination(SeedElectrumWarningView) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you meant to call SeedElectrumMnemonicStartView here, perhaps renamed it in the middle of the refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I get for being too dependent on VSCode to just magically get things right...
(...okay, and for not having enough FlowTest scenarios to catch things!)
As of f06666e ACK tested Everything is working for me:
|
Ooh, I should add the "custom extension" wrinkle to the FlowTest. |
courtesy of @newtonick!
c43d4c6
to
134476f
Compare
I've retested this w/ a modified version on top of 6d114f7:
w/ that said, I repeat my ACK tested from earlier today w/ same manual tests performed. |
src/seedsigner/views/psbt_views.py
Outdated
status_headline=None, | ||
text=f"Some features disabled for Electrum seeds", | ||
show_back_button=False, | ||
) | ||
from seedsigner.views.seed_views import SeedMnemonicEntryView | ||
self.controller.storage.init_pending_mnemonic(num_words=12, is_electrum=True) | ||
return Destination(SeedMnemonicEntryView) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from seedsigner.views.seed_views import SeedElectrumMnemonicStartView
return Destination(SeedElectrumMnemonicStartView)
tACK |
Description
Light refactor of #513:
View
should only ever invoke a singleScreen
. Pulled the Electrum seed warning screen into its ownView
. Also gain some modest DRY efficiency and easier future maintenance this way.SettingsEntry
for the Electrum seed option used adisplay_name
value that was way too long to fit in the button list (Settings -> Advanced) that would leave a rendering artifact on the far right edge (scroll past the Electrum option to the bottom of the list).ElectrumSeed
mnemonic validation.Housekeeping, more robust testing:
ElectrumSeed.override_script
.ElectrumSeed
:Reversions:
SeedQREncoder
that were probably added at an earlier phase when Electrum seed + SeedQR was being considered. Downstream effect of this reversion includesseed_views.py
,test_encodepsbtqr.py
,test_seedqr.py
.Misc:
bool
return fromSeed._generate_seed
as it is never used.Seed
:wallet_type
->sig_type
; the term "wallet" is just too overused and poorly specified in bitcoin. Note:embit_utils
does still usewallet_type
but in order to keep this ever-larger PR in check and since it's older, existing code, I left that refactor for another day.Settings list issue before the fix in this PR:
After:
New/Updated screenshots:
After moving part of the long settings name into
help_text
:This pull request is categorized as a:
Checklist
pytest
and made sure all unit tests pass before sumbitting the PRIf you modified or added functionality/workflow, did you add new unit tests?
I have tested this PR on the following platforms/os:
Note: Keep your changes limited in scope; if you uncover other issues or improvements along the way, ideally submit those as a separate PR. The more complicated the PR the harder to review, test, and merge.