refactor(electrum): remove unwrap()s and expect()s - #1981
Merged
evanlinjin merged 3 commits intoJul 18, 2025
Conversation
tnull
reviewed
Jun 26, 2025
tnull
left a comment
Contributor
There was a problem hiding this comment.
Thank you for looking into this! One comment.
LagginTimes
force-pushed
the
fix_electrum_panics
branch
3 times, most recently
from
June 26, 2025 20:11
4c3254b to
4277bfe
Compare
evanlinjin
reviewed
Jul 3, 2025
LagginTimes
force-pushed
the
fix_electrum_panics
branch
from
July 4, 2025 19:54
4277bfe to
e3e4939
Compare
evanlinjin
reviewed
Jul 10, 2025
Member
|
I created a commit on top which cleans up some of the logic so that we return a more explicit error when we cannot find a point of agreement (a.k.a. wrong network): 7c1cc80. Feel free to cherry-pick this across if you find that it is appropriate. I think it would make sense to include a sync-with-wrong-network test to make sure we hit this error. |
LagginTimes
force-pushed
the
fix_electrum_panics
branch
from
July 11, 2025 19:33
e3e4939 to
0fdbe9d
Compare
LagginTimes
force-pushed
the
fix_electrum_panics
branch
from
July 13, 2025 18:47
612afa2 to
b24ae6d
Compare
16 tasks
6 tasks
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.
Partially resolves bitcoindevkit/bdk_wallet#30.
Description
This PR eliminates all
unwrap()andexpect()calls frombdk_electrum_client, replacing them with proper error handling. Given that all public methods already returnResult, we now propagate error messages instead of panicking.Changelog notice
unwrap()s andexpect()s frombdk_electrum_client.rs.Checklists
All Submissions:
cargo +nightly fmtandcargo clippybefore committing