forked from rust-bitcoin/corepc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhidden.rs
More file actions
46 lines (42 loc) · 1.36 KB
/
hidden.rs
File metadata and controls
46 lines (42 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// 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 `v0.17`.
//!
//! 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 `waitforblock`.
#[macro_export]
macro_rules! impl_client_v17__wait_for_block {
() => {
impl Client {
pub fn wait_for_block(&self, hash: &bitcoin::BlockHash) -> Result<WaitForBlock> {
self.call("waitforblock", &[into_json(hash)?])
}
}
};
}
/// Implements Bitcoin Core JSON-RPC API method `waitforblockheight`.
#[macro_export]
macro_rules! impl_client_v17__wait_for_block_height {
() => {
impl Client {
pub fn wait_for_block_height(&self, height: u64) -> Result<WaitForBlockHeight> {
self.call("waitforblockheight", &[into_json(height)?])
}
}
};
}
/// Implements Bitcoin Core JSON-RPC API method `waitfornewblock`.
#[macro_export]
macro_rules! impl_client_v17__wait_for_new_block {
() => {
impl Client {
pub fn wait_for_new_block(&self) -> Result<WaitForNewBlock> {
self.call("waitfornewblock", &[])
}
}
};
}