Skip to content

feat!: Add Error::Model variant#56

Merged
ValuedMammal merged 3 commits into
bitcoindevkit:masterfrom
ValuedMammal:feat/error_model
May 14, 2026
Merged

feat!: Add Error::Model variant#56
ValuedMammal merged 3 commits into
bitcoindevkit:masterfrom
ValuedMammal:feat/error_model

Conversation

@ValuedMammal
Copy link
Copy Markdown
Collaborator

@ValuedMammal ValuedMammal commented May 11, 2026

Description

Consolidates into_model() error handling in the Error enum. Previously, each RPC method that called .into_model() produced a distinct, version-specific error variant (GetBlockVerboseOne, GetBlockHeaderVerbose, GetBlockFilter), requiring version-gated imports and the potential of future API churn.

This PR removes those three variants and introduces a single Error::Model(Box<dyn core::error::Error + Send + Sync + 'static>) variant as a catch-all for all .into_model() failures. A pub(crate) fn model<E>(e: E) -> Self constructor is added to Error to keep call sites clean. All five affected call sites in client.rs and client/v28.rs are updated accordingly.

Changelog notice

Added

  • Added Error::Model(Box<dyn core::error::Error + Send + Sync + 'static>) variant.

Removed

  • Error::GetBlockVerboseOne, Error::GetBlockHeaderVerbose, and Error::GetBlockFilter variants are removed and replaced by Error::Model
  • impl From<GetBlockVerboseOneError> for Error is removed.
  • Removed public Result<T> type alias

- Update setup-rbmt action to cargo-rbmt-0.2.1
- Exclude stable toolchain + Cargo-minimal.lock matrix combination
- Bump jsonrpc to 0.20.0
- Bump bitcoind to 0.38.0
- Update stable toolchain to 1.95.0, nightly to floating tag
@ValuedMammal ValuedMammal changed the title Add Error::Model variant feat!: Add Error::Model variant May 11, 2026
Create a vendored composite action `.github/actions/setup-rbmt`
that reads the version from the rbmt-version file, falls back to
`master`, installs `cargo-rbmt` from the canonical
rust-bitcoin-maintainer-tools repo, then runs `cargo rbmt toolchains`.

Update `cont_integration.yml` check and test jobs to use
`.github/actions/setup-rbmt` instead of the external pinned SHA.
Previously, each RPC method that called `.into_model()` produced
a distinct, version-specific error variant (`GetBlockVerboseOne`,
`GetBlockHeaderVerbose`, `GetBlockFilter`), requiring version-gated
imports and the potential of future API churn.

Remove those variants and consolidate all `.into_model()` errors into
a single `Error::Model` variant.

A `pub(crate) fn model<E>(e: E) -> Self` constructor is added to `Error`
to keep call sites clean.
@ValuedMammal ValuedMammal requested a review from tvpeter May 12, 2026 01:31
Copy link
Copy Markdown
Collaborator

@tvpeter tvpeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 43be0c0

You might need to rebase and also tag #27 as depending on this PR, so others can follow them sequentially.

Thank you.

@ValuedMammal ValuedMammal merged commit ea3e0a4 into bitcoindevkit:master May 14, 2026
9 checks passed
@ValuedMammal ValuedMammal deleted the feat/error_model branch May 22, 2026 13:35
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.

2 participants