Skip to content

Commit fd21983

Browse files
committed
Rename the client_async module to bdk_client
The client is only designed for BDK and is not a general purpose async client. Rename it to bdk_client to make the purpose clear.
1 parent fe506f4 commit fd21983

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// SPDX-License-Identifier: CC0-1.0
22

3-
//! Async JSON-RPC clients for specific versions of Bitcoin Core.
3+
//! Async JSON-RPC clients for Bitcoin Core v25 to v30.
44
5-
pub mod bdk_client;
5+
pub mod rpcs;
66
mod error;
77

88
use std::fmt;
99
use std::fs::File;
1010
use std::io::{BufRead, BufReader};
1111
use std::path::PathBuf;
1212

13-
pub use crate::client_async::error::Error;
13+
pub use crate::bdk_client::error::Error;
1414

1515
/// Crate-specific Result type.
1616
///
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
// SPDX-License-Identifier: CC0-1.0
22

3-
//! Async JSON-RPC client with the RPC set used by BDK for Core versions 25 to 30.
3+
//! RPC set used by BDK.
4+
//! All functions return the version nonspecific, strongly typed types.
45
56
use bitcoin::{block, Block, BlockHash, Transaction, Txid};
67

7-
use crate::client_async::{into_json, Client, Result};
8+
use crate::bdk_client::{into_json, Client, Result};
89
use crate::types::model::{GetBlockFilter, GetBlockHeaderVerbose, GetBlockVerboseOne};
910

1011
impl Client {
@@ -15,13 +16,13 @@ impl Client {
1516
Ok(json.into_model()?.0)
1617
}
1718

18-
/// Gets block count.
19+
/// Gets the block count.
1920
pub async fn get_block_count(&self) -> Result<u64> {
2021
let json: crate::types::v25::GetBlockCount = self.call("getblockcount", &[]).await?;
2122
Ok(json.into_model().0)
2223
}
2324

24-
/// Gets block hash for a height.
25+
/// Gets the block hash for a height.
2526
pub async fn get_block_hash(&self, height: u32) -> Result<BlockHash> {
2627
let json: crate::types::v25::GetBlockHash =
2728
self.call("getblockhash", &[into_json(height)?]).await?;
@@ -34,14 +35,14 @@ impl Client {
3435
Ok(json.into_model()?.0)
3536
}
3637

37-
/// Gets block header by blockhash.
38+
/// Gets the block header by blockhash.
3839
pub async fn get_block_header(&self, hash: &BlockHash) -> Result<block::Header> {
3940
let json: crate::types::v25::GetBlockHeader =
4041
self.call("getblockheader", &[into_json(hash)?, into_json(false)?]).await?;
4142
Ok(json.into_model()?.0)
4243
}
4344

44-
/// Gets block header with verbose output.
45+
/// Gets the block header with verbose output.
4546
pub async fn get_block_header_verbose(
4647
&self,
4748
hash: &BlockHash,
@@ -74,20 +75,20 @@ impl Client {
7475
}
7576
}
7677

77-
/// Gets block filter for a blockhash.
78+
/// Gets the block filter for a blockhash.
7879
pub async fn get_block_filter(&self, hash: &BlockHash) -> Result<GetBlockFilter> {
7980
let json: crate::types::v25::GetBlockFilter =
8081
self.call("getblockfilter", &[into_json(hash)?]).await?;
8182
Ok(json.into_model()?)
8283
}
8384

84-
/// Gets transaction IDs currently in the mempool.
85+
/// Gets the transaction IDs currently in the mempool.
8586
pub async fn get_raw_mempool(&self) -> Result<Vec<Txid>> {
8687
let json: crate::types::v25::GetRawMempool = self.call("getrawmempool", &[]).await?;
8788
Ok(json.into_model()?.0)
8889
}
8990

90-
/// Gets raw transaction by txid.
91+
/// Gets the raw transaction by txid.
9192
pub async fn get_raw_transaction(&self, txid: &Txid) -> Result<Transaction> {
9293
let json: crate::types::v25::GetRawTransaction =
9394
self.call("getrawtransaction", &[into_json(txid)?]).await?;

client/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ pub extern crate types;
1313
pub mod client_sync;
1414

1515
#[cfg(feature = "client-async")]
16-
pub mod client_async;
16+
pub mod bdk_client;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
use bitcoin::address::KnownHrp;
99
use bitcoin::{Address, CompressedPublicKey, PrivateKey};
10-
use corepc_client::client_async::{Auth, Client, Error as AsyncClientError};
10+
use corepc_client::bdk_client::{Auth, Client, Error as AsyncClientError};
1111
use integration_test::{Node, NodeExt as _, Wallet};
1212
use node::mtype;
1313

0 commit comments

Comments
 (0)