Skip to content

NO MERGE: Review suggestions for 505#664

Closed
tcharding wants to merge 14 commits into
rust-bitcoin:masterfrom
tcharding:push-pkqllvlypqtl
Closed

NO MERGE: Review suggestions for 505#664
tcharding wants to merge 14 commits into
rust-bitcoin:masterfrom
tcharding:push-pkqllvlypqtl

Conversation

@tcharding

Copy link
Copy Markdown
Member

Hey @jamillambert I hacked these patches up while reviewing #505. Feel free to grab the ones you like. You can either use git cherry-pick or do the changes manually yourself. I don't need attribution.

jamillambert and others added 13 commits July 7, 2026 14:46
There is a lint error: this expression creates a reference which is
immediately dereferenced by the compiler.

Fix it as suggested by the compiler.
In preparation for adding bitreq_http_async feature to jsonrpc move
the sync version to the client-sync feature so it is not always on
with jsonrpc.
These will both be used by the async client. Move them out of sync
client in preparation.

Edit the logging function so it doesn't panic.
Create a new folder for the upcoming async client and copy in the
existing client_sync code.

Code copy only to make the next patch easier to review.
Edit the copy of the sync client created in the previous commit to be
async. Update the readme and cargo.toml files.

Replace macros with functions. There is only one async client so the
macros are not needed anymore.

Create a new module for the bdk client that has the required RPCs in it
that return either the rust-bitcoin type or non-version specific model
types.
Explicit trumps implicit every day of the week. Remove the alias and
make the error type explicit at each call site.
This trait adds no value, remove it.
The `model::` path adds useful info, it makes it easy at a glance to
understand what is going on.
Import `types` and remove one layer of path.
This returns a `u64`, it should never have had an `into_model` impl.

ref: rust-bitcoin#663
@jamillambert

Copy link
Copy Markdown
Collaborator

Cool, thanks.

All of it looks good so far, but will go through more thoroughly and then add the improvements.

As a demo of what I think the error logic should be hack up a new
version of `get_block_header_verbose`.

Note, for later consideration: The `Error` type is too general (it
includes variants not returned by this function).
@tcharding

Copy link
Copy Markdown
Member Author

Had an insight in bed last night, check out the patch I just pushed. It allows getting rid of all the Box stuff and the funky Raw<Value> stuff. Also demos what I rekon the error boilerplate should look like (I'm not a fan of macros).

@tcharding

tcharding commented Jul 15, 2026

Copy link
Copy Markdown
Member Author

FTR the current error code around Box reads to me like text book AI slop. Yesterday I couldn't put my finger on just how crazy it was until I realized the whole solution is totally unnecessary and its a basic enum error solution.

@tcharding

Copy link
Copy Markdown
Member Author

This is not needed anymore.

@tcharding tcharding closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants