Skip to content

Commit cb0f920

Browse files
committed
refactor(api): rename BlockInformation -> BlockInfo
Signed-off-by: valued mammal <[email protected]>
1 parent e4d9e4b commit cb0f920

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub struct BlockTime {
9090

9191
/// Information about a bitcoin [`Block`].
9292
#[derive(Debug, Clone, Deserialize)]
93-
pub struct BlockInformation {
93+
pub struct BlockInfo {
9494
/// The block's [`BlockHash`].
9595
pub id: BlockHash,
9696
/// The block's height.
@@ -119,7 +119,7 @@ pub struct BlockInformation {
119119
pub difficulty: f64,
120120
}
121121

122-
impl PartialEq for BlockInformation {
122+
impl PartialEq for BlockInfo {
123123
fn eq(&self, other: &Self) -> bool {
124124
let Self { difficulty: d1, .. } = self;
125125
let Self { difficulty: d2, .. } = other;
@@ -139,7 +139,7 @@ impl PartialEq for BlockInformation {
139139
&& ((d1.is_nan() && d2.is_nan()) || (d1 == d2))
140140
}
141141
}
142-
impl Eq for BlockInformation {}
142+
impl Eq for BlockInfo {}
143143

144144
#[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
145145
pub struct BlockSummary {

src/async.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use log::{debug, error, info, trace};
2727
use reqwest::{header, Client, Response};
2828

2929
use crate::{
30-
AddressStats, BlockInformation, BlockStatus, BlockSummary, Builder, Error, MempoolRecentTx,
30+
AddressStats, BlockInfo, BlockStatus, BlockSummary, Builder, Error, MempoolRecentTx,
3131
MempoolStats, MerkleProof, OutputStatus, ScriptHashStats, Tx, TxStatus, Utxo,
3232
BASE_BACKOFF_MILLIS, RETRYABLE_ERROR_CODES,
3333
};
@@ -477,7 +477,7 @@ impl<S: Sleeper> AsyncClient<S> {
477477
}
478478

479479
/// Get a summary about a [`Block`], given it's [`BlockHash`].
480-
pub async fn get_block_info(&self, blockhash: &BlockHash) -> Result<BlockInformation, Error> {
480+
pub async fn get_block_info(&self, blockhash: &BlockHash) -> Result<BlockInfo, Error> {
481481
let path = format!("/block/{blockhash}");
482482

483483
self.get_response_json(&path).await

src/blocking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use bitcoin::hex::{DisplayHex, FromHex};
2828
use bitcoin::{Address, Block, BlockHash, MerkleBlock, Script, Transaction, Txid};
2929

3030
use crate::{
31-
AddressStats, BlockInformation, BlockStatus, BlockSummary, Builder, Error, MempoolRecentTx,
31+
AddressStats, BlockInfo, BlockStatus, BlockSummary, Builder, Error, MempoolRecentTx,
3232
MempoolStats, MerkleProof, OutputStatus, ScriptHashStats, Tx, TxStatus, Utxo,
3333
BASE_BACKOFF_MILLIS, RETRYABLE_ERROR_CODES,
3434
};
@@ -405,7 +405,7 @@ impl BlockingClient {
405405
}
406406

407407
/// Get a summary about a [`Block`], given it's [`BlockHash`].
408-
pub fn get_block_info(&self, blockhash: &BlockHash) -> Result<BlockInformation, Error> {
408+
pub fn get_block_info(&self, blockhash: &BlockHash) -> Result<BlockInfo, Error> {
409409
let path = format!("/block/{blockhash}");
410410

411411
self.get_response_json(&path)

0 commit comments

Comments
 (0)