Skip to content

Implement From<ChecksumError> for DecodeError#221

Closed
stevenroose wants to merge 1 commit intorust-bitcoin:masterfrom
stevenroose:checksumerror
Closed

Implement From<ChecksumError> for DecodeError#221
stevenroose wants to merge 1 commit intorust-bitcoin:masterfrom
stevenroose:checksumerror

Conversation

@stevenroose
Copy link
Contributor

Noticed this was missing.

@apoelstra
Copy link
Member

Yeah, concept ACK being consistent here. We should have one or both. Will assume that we should go with "both" unless @clarkmoody steps in and says otherwise.

But personally I've been moving away from these From impls. It's not a lot of extra code to add .map_err(DecodeError::Checksum) before ?, makes it waaay easier to grep for (and git log -S for) where each variant is used, and it keeps the public API tighter.

I also increasingly think that ? being a single character was a mistake for Rust, because it makes it incredibly easy to propagate errors without adding any useful context. If I'm already using .map_err everywhere it's a smaller difference between adding context and not.

@clarkmoody
Copy link
Member

Concept ACK from me.

Personally, I like the ? operator 😉

apoelstra added a commit that referenced this pull request Aug 2, 2025
7a3f493 ci: update checkout and cache to v4; runner to ubuntu-latest. (Andrew Poelstra)
62a9d53 add weekly cronjob to update nightly-version (Andrew Poelstra)
4c00b93 introduce nightly-version file (copied from rust-bitcoin) and use it in CI (Andrew Poelstra)
720992b clippy: fix new lifetime lint (Andrew Poelstra (aider))

Pull request description:

  Right now I can't test #220 or #221 locally because clippy is failing with the latest nightly.
  
  I can disable the local clippy check but I'd prefer to fix it here.
  
  Should unblock both those PRs.


ACKs for top commit:
  clarkmoody:
    ACK 7a3f493


Tree-SHA512: 725177b18bce543c6c114ce0ee6ef04bc6862c440a2fff9b99d607b912f6ab2c0eab22ecf03abc89332519aa9ffc4ddd624d16abfce0c6d4fefad53a87eb5249
@apoelstra
Copy link
Member

concept ACK -- if you rebase on #223 I can do a tested ACK.

tcharding added a commit to tcharding/rust-bech32 that referenced this pull request Jan 16, 2026
Picked changes up from rust-bitcoin#221.

Add an impl of `From<ChecksumError> for DecodeError` since we already
have one for the other variant.
@tcharding
Copy link
Member

I picked this up: #235

@tcharding tcharding closed this Jan 16, 2026
apoelstra added a commit that referenced this pull request Jan 26, 2026
2dc8580 Implement From<ChecksumError> for DecodeError (Tobin C. Harding)

Pull request description:

  Picked changes up from #221.
  
  Add an impl of `From<ChecksumError> for DecodeError` since we already have one for the other variant.


ACKs for top commit:
  apoelstra:
    ACK 2dc8580; successfully ran local tests


Tree-SHA512: 67aa251925c607b75454218c19bbbe78f7c838143caae8c4a825bab276443a90a6670ee2741a8e869771983ed41fe5807ec68e92eb0785392fca92d46c1d59fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants