Skip to content

Commit 68b9d2b

Browse files
committed
Deprecate get_height
This deprecates `get_height` to improve alignment with the Esplora API.
1 parent fdea18b commit 68b9d2b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/async.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ impl AsyncClient {
113113
Ok(Some(resp.error_for_status()?.json().await?))
114114
}
115115

116+
#[deprecated(
117+
since = "0.1.2",
118+
note = "Deprecated to improve alignment with Esplora API. Users should use `get_block_hash` and `get_header_by_hash` methods directly."
119+
)]
116120
/// Get a [`BlockHeader`] given a particular block height.
117121
pub async fn get_header(&self, block_height: u32) -> Result<BlockHeader, Error> {
118122
let block_hash = self.get_block_hash(block_height).await?;

src/blocking.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ impl BlockingClient {
127127
}
128128

129129
/// Get a [`BlockHeader`] given a particular block height.
130+
#[deprecated(
131+
since = "0.1.2",
132+
note = "Deprecated to improve alignment with Esplora API. Users should use `get_block_hash` and `get_header_by_hash` methods directly."
133+
)]
130134
pub fn get_header(&self, block_height: u32) -> Result<BlockHeader, Error> {
131135
let block_hash = self.get_block_hash(block_height)?;
132136
self.get_header_by_hash(&block_hash)

0 commit comments

Comments
 (0)