Description
Describe the bug
I just hit a panic in bdk_esplora
as I misconfigured the URL for the Esplora endpoint to a server on a different network (i.e., left it untouched when switching networks from mainnet
to signet
). This results in in hitting this expect
:
While this is just a minor inconvenience, it surfaces a much larger problem: from a quick look, there are many cases of expect
and unwrap
in the chain-syncing crates (i.e., bdk_esplora
,bdk_electrum
), and at least a few of them seem to be directly or indirectly based on remote-provided inputs that aren't validated otherwise.
This should never happen, essentially crates dealing with remote-provided data should never expect
or unwrap
. Given that all of these methods return Result<.., Error>
there really is no reason why they couldn't just return errors in these cases.
To Reproduce
For example, switch networks without switching Esplora URLs.
Expected behavior
Never panic based on remote-provided inputs
Metadata
Metadata
Assignees
Labels
Type
Projects
Status