bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Remove duplicated InsufficientFunds error member

Open e1a0a0ea opened this issue 9 months ago • 5 comments

closes #1440

Description

  • Replace CreateTxError::InsufficientFunds use by coin_selection::Error::InsufficientFunds
  • Remove InsufficientFunds member from CreateTxError enum
  • Rename coin_selection::Error to coin_selection::CoinSelectionError

Notes to the reviewers

  • We could also keep both members but rename one of them to avoid confusion

Checklists

All Submissions:

  • [X] I've signed all my commits
  • [X] I followed the contribution guidelines
  • [X] I ran cargo fmt and cargo clippy before committing

e1a0a0ea avatar May 13 '24 07:05 e1a0a0ea

I tend to favor the name Error and qualifying it with its containing module, i.e. coin_selection::Error.

ValuedMammal avatar May 13 '24 13:05 ValuedMammal

Please also setup commit signing, see: https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification

notmandatory avatar May 13 '24 14:05 notmandatory

Maybe this belongs here better, basically, can this be disabled in anything but Network::Bitcoin?

https://github.com/bitcoindevkit/bdk/issues/1440#issuecomment-2108275322

matthiasdebernardini avatar May 13 '24 17:05 matthiasdebernardini

Maybe this belongs here better, basically, can this be disabled in anything but Network::Bitcoin?

#1440 (comment)

I personally don't think it's a good idea to "error-gate" based on the bitcoin::Network type, I would expect all behaviors that happen on mainnet (production per se) to happen on others, and even some nasty behaviors we may catch while testing on testnet/signet being prevented to land on mainnet code 😅.

oleonardolima avatar May 13 '24 19:05 oleonardolima

That's a good point, @oleonardolima maybe the juice is not worth the squeeze on making this change.

matthiasdebernardini avatar May 13 '24 21:05 matthiasdebernardini

Please rebase again and fixup commits into one commit then this should be ready to merge.

notmandatory avatar Jun 01 '24 22:06 notmandatory