feat!: Add Error::Model variant#56
Merged
ValuedMammal merged 3 commits intoMay 14, 2026
Merged
Conversation
- 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
Error::Model variant
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.
e7917f3 to
43be0c0
Compare
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.
Description
Consolidates
into_model()error handling in theErrorenum. 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. Apub(crate) fn model<E>(e: E) -> Selfconstructor is added toErrorto keep call sites clean. All five affected call sites in client.rs and client/v28.rs are updated accordingly.Changelog notice
Added
Error::Model(Box<dyn core::error::Error + Send + Sync + 'static>)variant.Removed
Error::GetBlockVerboseOne,Error::GetBlockHeaderVerbose, andError::GetBlockFiltervariants are removed and replaced byError::Modelimpl From<GetBlockVerboseOneError> for Erroris removed.Result<T>type alias