Skip to content

Commit b38215a

Browse files
committed
Merge #2130: fix(bdk_esplora): use get_blocks_infos instead of get_blocks
a880170 fix(bdk_esplora): use `get_blocks_infos` instead of `get_blocks` (Leonardo Lima) Pull request description: ### Description The `get_blocks` method from `esplora-client` has been deprecated on the latest release `v0.12.3`. I'm updating it to use newly added one: `get_blocks_infos` in order to fix the deprecation warning. ### Changelog notice ``` ### Changed - fix(bdk_esplora): use `get_block_infos` instead of deprecated `get_blocks` ``` ### Checklists #### All Submissions: * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) #### New Features: * [x] I've added tests for the new feature * [x] I've added docs for the new feature ACKs for top commit: luisschwab: ACK a880170 reez: ACK a880170 Tree-SHA512: 21afb07a10b1c6da519b414cd6c23aeff42d4e9f2b76ecf4c1a6f9abee1a2609c9ff6e6c81608c2497eb9831faf1687355c9428e0f3c48ca4efaa3a2003355a8
2 parents dbddc79 + a880170 commit b38215a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/esplora/src/async_ext.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ async fn fetch_latest_blocks<S: Sleeper>(
184184
client: &esplora_client::AsyncClient<S>,
185185
) -> Result<BTreeMap<u32, BlockHash>, Error> {
186186
Ok(client
187-
.get_blocks(None)
187+
.get_block_infos(None)
188188
.await?
189189
.into_iter()
190-
.map(|b| (b.time.height, b.id))
190+
.map(|b| (b.height, b.id))
191191
.collect())
192192
}
193193

crates/esplora/src/blocking_ext.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ fn fetch_latest_blocks(
170170
client: &esplora_client::BlockingClient,
171171
) -> Result<BTreeMap<u32, BlockHash>, Error> {
172172
Ok(client
173-
.get_blocks(None)?
173+
.get_block_infos(None)?
174174
.into_iter()
175-
.map(|b| (b.time.height, b.id))
175+
.map(|b| (b.height, b.id))
176176
.collect())
177177
}
178178

0 commit comments

Comments
 (0)