[Refactor] use _Seed_cls to handle seed type#807
Open
notTanveer wants to merge 2 commits intoSeedSigner:devfrom
Open
[Refactor] use _Seed_cls to handle seed type#807notTanveer wants to merge 2 commits intoSeedSigner:devfrom
notTanveer wants to merge 2 commits intoSeedSigner:devfrom
Conversation
kdmukai
reviewed
Aug 27, 2025
kdmukai
reviewed
Aug 27, 2025
Contributor
|
PR description should document the fact that |
alvroble
reviewed
Aug 27, 2025
4 tasks
Contributor
Author
|
updated the PR: |
notTanveer
added a commit
to notTanveer/seedsigner
that referenced
this pull request
Aug 29, 2025
notTanveer
added a commit
to notTanveer/seedsigner
that referenced
this pull request
Aug 29, 2025
alvroble
reviewed
Aug 29, 2025
| seed = self._pending_Seed_cls(self._pending_mnemonic) | ||
| return seed.get_fingerprint(network) | ||
| except InvalidSeedException: | ||
| return None |
Contributor
There was a problem hiding this comment.
This new approach LGTM now
Collaborator
|
@notTanveer can you add to the top comment/description the reason/context for this change? Is this related to this comment? #800 (comment) |
Contributor
Author
updated the PR description |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses this comment.
Description
Added
_pending_Seed_clsreference to handle both Seed and ElectrumSeed.Removed unused
validate_mnemonic()function.Updated
init_pending_mnemonicto accept seed_class instead ofis_electrum, making the code more extensible for future seed types (e.g., Shamir Secret, [Feature] Add SLIP-39 Shamir's secret sharing import support for SeedSigner #636).Reason for Change
eliminates conditional logic throughout the codebase. instead of checking boolean flags and then deciding which class to instantiate, we directly store the class and follows the same pattern as Destination class and makes the code cleaner and less error prone.
This pull request is categorized as a:
Checklist
pytestand 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: