Refactor API and clean up house#157
Refactor API and clean up house#157luisschwab wants to merge 13 commits intobitcoindevkit:masterfrom
Conversation
1872024 to
dbbe555
Compare
Pull Request Test Coverage Report for Build 22006096792Details
💛 - Coveralls |
BlockSummary and PrevOut, rename scripthash_txs to get_scripthash_txsBlockSummary and PrevOut, rename scripthash_txs to get_scripthash_txs
oleonardolima
left a comment
There was a problem hiding this comment.
utACK eccf30d
I'm also wondering on how disruptive it'll be on downstream, see VM's comment, though it'll be in a major release.
|
Makes sense. We can remove the deprecated function on v14. |
eccf30d to
530ebea
Compare
BlockSummary and PrevOut, rename scripthash_txs to get_scripthash_txs|
I'll rebase this one since we decided to deprecate |
Removes `BlockSummary`, as it omitted information returned by Esplora. This removes `get_blocks` and adds `get_block_infos` (`get_blocks` was deprecated in v0.12.3).
530ebea to
35c42b7
Compare
f2a2a16 to
8337a89
Compare
df3b306 to
754558c
Compare
This commit: - Renames `Tx` to `EsploraTx`: more explicit. `Tx` is not precise about what it is. - Remove `EsploraTx::fee`, since the field is already public. - Implements `From<EsploraTx>`/`From<&EsploraTx>` to `Transaction` conversions. - Reorders structs into logical groups: Transaction, Block, Address, ScriptHash, UTXO, and Mempool. - Improves documentation. - Updates copyright notice to `2020-2026`.
This commit:
- Reorders methods into logical groups: transaction, block, address,
script hash, and mempool.
- Improves documentation throughout: clearer summaries, consistent
style, and proper intra-doc links.
- Moves `Sleeper`, `DefaultSleeper`, and `is_status_retryable` to the
top of the file for better readability.
- Updates return types from `Tx` to `EsploraTx` following the rename.
- Removes unused `log` imports.
- Updates copyright notice to `2020-2026`.
754558c to
9a97e86
Compare
|
@ValuedMammal rebased changing the commit messages and pinning hyper-rustls to fix MSRV |
|
We need to fix the feerate conversion bug and the get_script_hash naming inconsistency. Besides that, I haven't done a thorough review. |
Oh this got lost on the last rebase
Right. I mixed it up with the |
This commit: - Changes `get_fee_estimates` to return `HashMap<u16, FeeRate>` instead of `HashMap<u16, f64>`. - Changes `convert_fee_rate` to accept `HashMap<u16, FeeRate>` and return `Option<FeeRate>` instead of `Option<f32>`. - Adds `sat_per_vbyte_to_feerate` to `api.rs` to convert the raw `f64` sat/vbyte values returned by the Esplora API into `FeeRate`. - Updates the `feerate_parsing` test accordingly. fix(api): use `.round()` on `sat_per_vbyte_to_feerate` Only casting to `u64` would always round down. Rounding (`.round()`) and then casting to `u64` is more precise. Also updates the fee JSON on `test_feerate_parsing` with current values, which include sub-1 sat fees: ``` curl https://mempool.space/api/fee-estimates | jq 'to_entries | sort_by(.key | tonumber) | from_entries' ```
This commit:
- Rewrites crate-level docs:
- Cleaner structure
- Usage examples for async and blocking clients
- Feature table instead of a bullet list
- Improves `Builder` documentation
- Improves `Error` documentation
- Replaces `std::` with `core::` where applicable
- Updates copyright notice to `2020-2026`
Add `BlockSummary` and `get_blocks` with a deprecation warning. These should be removed for the v0.14.0 release.
9a97e86 to
39bf961
Compare
|
I've opened a draft PR on |
oleonardolima
left a comment
There was a problem hiding this comment.
I was trying to review commit-by-commit, but it's quite hard. There's multiple commits changing the same code multiple times, and some commits are mixing different scopes.
I'd suggest splitting strictly into feat, fix, refactor and docs and keep them to scope. As there's a lot LoC changed it'll make it easier and even could be splitted into smaller PRs.
| @@ -256,6 +260,7 @@ pub struct Utxo { | |||
| /// The confirmation status of the [`TxOut`]. | |||
| pub status: UtxoStatus, | |||
| /// The value of the [`TxOut`] as an [`Amount`]. | |||
There was a problem hiding this comment.
nit: in order to keep the same style.
| /// The value of the [`TxOut`] as an [`Amount`]. | |
| /// The value of the [`TxOut`], in satoshis. |
|
@oleonardolima I'll make this PR a draft for reference and break it up into smaller PRs. |
Awesome, thanks! |
This PR does a bunch of cleanup, standardizes and adds missing documentation, fixes inconsistencies and redundancies in the API, and uses
rust-bitcointypes where possible.Changelog