Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions client/src/client_sync/v17/hidden.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
//!
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `estimaterawfee`.
#[macro_export]
macro_rules! impl_client_v17__estimate_raw_fee {
() => {
impl Client {
pub fn estimate_raw_fee(&self, conf_target: u32) -> Result<EstimateRawFee> {
self.call("estimaterawfee", &[conf_target.into()])
}
}
};
}

/// Implements Bitcoin Core JSON-RPC API method `waitforblock`.
#[macro_export]
macro_rules! impl_client_v17__wait_for_block {
Expand Down
1 change: 1 addition & 0 deletions client/src/client_sync/v17/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ crate::impl_client_v17__generate!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand Down
1 change: 1 addition & 0 deletions client/src/client_sync/v18/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ crate::impl_client_v17__generate!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand Down
1 change: 1 addition & 0 deletions client/src/client_sync/v19/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ crate::impl_client_v17__generate_to_address!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand Down
1 change: 1 addition & 0 deletions client/src/client_sync/v20/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ crate::impl_client_v20__generate_to_descriptor!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand Down
1 change: 1 addition & 0 deletions client/src/client_sync/v21/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v21__add_peer_address!();
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand Down
26 changes: 26 additions & 0 deletions client/src/client_sync/v22/hidden.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: CC0-1.0

//! Macros for implementing JSON-RPC methods on a client.
//!
//! Specifically this is `== Hidden ==` methods that are not listed in the
//! API docs of Bitcoin Core `v22`.
//!
//! All macros require `Client` to be in scope.
//!
//! See, or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.
/// Implements Bitcoin Core JSON-RPC API method `addconnection`.
#[macro_export]
macro_rules! impl_client_v22__add_connection {
() => {
impl Client {
pub fn add_connection(
&self,
address: &str,
connection_type: &str,
) -> Result<AddConnection> {
self.call("addconnection", &[into_json(address)?, into_json(connection_type)?])
}
}
};
}
3 changes: 3 additions & 0 deletions client/src/client_sync/v22/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//!
//! We ignore option arguments unless they effect the shape of the returned JSON data.

mod hidden;
mod signer;
mod wallet;

Expand Down Expand Up @@ -69,7 +70,9 @@ crate::impl_client_v20__generate_to_descriptor!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v22__add_connection!();
crate::impl_client_v21__add_peer_address!();
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand Down
2 changes: 2 additions & 0 deletions client/src/client_sync/v23/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ crate::impl_client_v20__generate_to_descriptor!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v22__add_connection!();
crate::impl_client_v21__add_peer_address!();
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand Down
2 changes: 2 additions & 0 deletions client/src/client_sync/v24/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ crate::impl_client_v20__generate_to_descriptor!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v22__add_connection!();
crate::impl_client_v21__add_peer_address!();
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand Down
2 changes: 2 additions & 0 deletions client/src/client_sync/v25/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ crate::impl_client_v20__generate_to_descriptor!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v22__add_connection!();
crate::impl_client_v21__add_peer_address!();
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand Down
2 changes: 2 additions & 0 deletions client/src/client_sync/v26/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ crate::impl_client_v20__generate_to_descriptor!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v22__add_connection!();
crate::impl_client_v21__add_peer_address!();
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand Down
30 changes: 30 additions & 0 deletions client/src/client_sync/v27/hidden.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: CC0-1.0

//! Macros for implementing JSON-RPC methods on a client.
//!
//! Specifically this is `== Hidden ==` methods that are not listed in the
//! API docs of Bitcoin Core `v29`.
//!
//! All macros require `Client` to be in scope.
//!
//! See, or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `addconnection`.
#[macro_export]
macro_rules! impl_client_v27__add_connection {
() => {
impl Client {
pub fn add_connection(
&self,
address: &str,
connection_type: &str,
v2transport: bool,
) -> Result<AddConnection> {
self.call(
"addconnection",
&[into_json(address)?, into_json(connection_type)?, into_json(v2transport)?],
)
}
}
};
}
4 changes: 4 additions & 0 deletions client/src/client_sync/v27/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//!
//! We ignore option arguments unless they effect the shape of the returned JSON data.

pub mod hidden;

use std::collections::BTreeMap;
use std::path::Path;

Expand Down Expand Up @@ -74,7 +76,9 @@ crate::impl_client_v20__generate_to_descriptor!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v27__add_connection!();
crate::impl_client_v21__add_peer_address!();
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand Down
2 changes: 2 additions & 0 deletions client/src/client_sync/v28/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ crate::impl_client_v20__generate_to_descriptor!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v27__add_connection!();
crate::impl_client_v21__add_peer_address!();
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand Down
44 changes: 44 additions & 0 deletions client/src/client_sync/v29/hidden.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// SPDX-License-Identifier: CC0-1.0

//! Macros for implementing JSON-RPC methods on a client.
//!
//! Specifically this is `== Hidden ==` methods that are not listed in the
//! API docs of Bitcoin Core `v29`.
//!
//! All macros require `Client` to be in scope.
//!
//! See, or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `getorphantxs` verbosity level 0.
#[macro_export]
macro_rules! impl_client_v29__get_orphan_txs {
() => {
impl Client {
pub fn get_orphan_txs(&self) -> Result<GetOrphanTxs> { self.call("getorphantxs", &[]) }
}
};
}

/// Implements Bitcoin Core JSON-RPC API method `getorphantxs` verbosity level 1.
#[macro_export]
macro_rules! impl_client_v29__get_orphan_txs_verbosity_1 {
() => {
impl Client {
pub fn get_orphan_txs_verbosity_1(&self) -> Result<GetOrphanTxsVerboseOne> {
self.call("getorphantxs", &[into_json(1)?])
}
}
};
}

/// Implements Bitcoin Core JSON-RPC API method `getorphantxs` verbosity level 2.
#[macro_export]
macro_rules! impl_client_v29__get_orphan_txs_verbosity_2 {
() => {
impl Client {
pub fn get_orphan_txs_verbosity_2(&self) -> Result<GetOrphanTxsVerboseTwo> {
self.call("getorphantxs", &[into_json(2)?])
}
}
};
}
6 changes: 6 additions & 0 deletions client/src/client_sync/v29/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! We ignore option arguments unless they effect the shape of the returned JSON data.

pub mod blockchain;
pub mod hidden;
pub mod util;

use std::collections::BTreeMap;
Expand Down Expand Up @@ -77,7 +78,12 @@ crate::impl_client_v20__generate_to_descriptor!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v29__get_orphan_txs_verbosity_2!();
crate::impl_client_v29__get_orphan_txs_verbosity_1!();
crate::impl_client_v29__get_orphan_txs!();
crate::impl_client_v27__add_connection!();
crate::impl_client_v21__add_peer_address!();
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand Down
5 changes: 5 additions & 0 deletions client/src/client_sync/v30/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ crate::impl_client_v23__save_mempool!();
crate::impl_client_v25__scan_blocks!();
crate::impl_client_v17__verify_chain!();
crate::impl_client_v17__verify_tx_out_proof!();
crate::impl_client_v17__estimate_raw_fee!();
crate::impl_client_v17__wait_for_block!();
crate::impl_client_v17__wait_for_block_height!();
crate::impl_client_v17__wait_for_new_block!();
Expand All @@ -77,6 +78,10 @@ crate::impl_client_v20__generate_to_descriptor!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v29__get_orphan_txs_verbosity_2!();
crate::impl_client_v29__get_orphan_txs_verbosity_1!();
crate::impl_client_v29__get_orphan_txs!();
Comment on lines +81 to +83
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My assumption is that using the v29 macros here in v30 is correct. However, I'm not 100% sure.

crate::impl_client_v27__add_connection!();
crate::impl_client_v21__add_peer_address!();

// == Mining ==
Expand Down
Loading