Skip to content

Commit

Permalink
chore: remove deprecated get_header() function
Browse files Browse the repository at this point in the history
  • Loading branch information
notmandatory authored and tnull committed Jan 31, 2024
1 parent 40485ca commit 43daefc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
10 changes: 0 additions & 10 deletions src/async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,6 @@ impl AsyncClient {
}
}

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

/// Get a [`BlockHeader`] given a particular block hash.
pub async fn get_header_by_hash(&self, block_hash: &BlockHash) -> Result<BlockHeader, Error> {
let resp = self
Expand Down
10 changes: 0 additions & 10 deletions src/blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,6 @@ impl BlockingClient {
self.get_response_json(&format!("/tx/{}/status", txid))
}

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

/// Get a [`BlockHeader`] given a particular block hash.
pub fn get_header_by_hash(&self, block_hash: &BlockHash) -> Result<BlockHeader, Error> {
self.get_response_hex(&format!("/block/{}/header", block_hash))
Expand Down

0 comments on commit 43daefc

Please sign in to comment.