Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Commit f68393a

Browse files
committed
Move code for getblock
Seems that we added the `getblock` stuff in the order we implemented it instead of in some sane order. Move the code for `getblock` so it is in the same order in code as it is listed in the `rpc-api.txt` file. Code move only, no other changes.
1 parent 6ee179c commit f68393a

File tree

15 files changed

+255
-255
lines changed

15 files changed

+255
-255
lines changed

client/src/client_sync/v17/blockchain.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@
99
//!
1010
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
1111
12-
/// Implements bitcoind JSON-RPC API method `getblockchaininfo`
13-
#[macro_export]
14-
macro_rules! impl_client_v17__getblockchaininfo {
15-
() => {
16-
impl Client {
17-
pub fn get_blockchain_info(&self) -> Result<GetBlockchainInfo> {
18-
self.call("getblockchaininfo", &[])
19-
}
20-
}
21-
};
22-
}
23-
2412
/// Implements bitcoind JSON-RPC API method `getbestblockhash`
2513
#[macro_export]
2614
macro_rules! impl_client_v17__getbestblockhash {
@@ -70,6 +58,18 @@ macro_rules! impl_client_v17__getblock {
7058
};
7159
}
7260

61+
/// Implements bitcoind JSON-RPC API method `getblockchaininfo`
62+
#[macro_export]
63+
macro_rules! impl_client_v17__getblockchaininfo {
64+
() => {
65+
impl Client {
66+
pub fn get_blockchain_info(&self) -> Result<GetBlockchainInfo> {
67+
self.call("getblockchaininfo", &[])
68+
}
69+
}
70+
};
71+
}
72+
7373
/// Implements bitcoind JSON-RPC API method `gettxout`
7474
#[macro_export]
7575
macro_rules! impl_client_v17__gettxout {

integration_test/src/v17/blockchain.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,6 @@
55
//! Specifically this is methods found under the `== Blockchain ==` section of the
66
//! API docs of `bitcoind v0.17.1`.
77
8-
/// Requires `Client` to be in scope and to implement `get_blockchain_info`.
9-
#[macro_export]
10-
macro_rules! impl_test_v17__getblockchaininfo {
11-
() => {
12-
#[test]
13-
fn get_blockchain_info() {
14-
let bitcoind = $crate::bitcoind_no_wallet();
15-
let json = bitcoind.client.get_blockchain_info().expect("getblockchaininfo");
16-
assert!(json.into_model().is_ok());
17-
}
18-
};
19-
}
20-
218
/// Requires `Client` to be in scope and to implement `get_best_block_hash`.
229
#[macro_export]
2310
macro_rules! impl_test_v17__getbestblockhash {
@@ -81,6 +68,19 @@ macro_rules! impl_test_v17__getblock_verbosity_2 {
8168
};
8269
}
8370

71+
/// Requires `Client` to be in scope and to implement `get_blockchain_info`.
72+
#[macro_export]
73+
macro_rules! impl_test_v17__getblockchaininfo {
74+
() => {
75+
#[test]
76+
fn get_blockchain_info() {
77+
let bitcoind = $crate::bitcoind_no_wallet();
78+
let json = bitcoind.client.get_blockchain_info().expect("getblockchaininfo");
79+
assert!(json.into_model().is_ok());
80+
}
81+
};
82+
}
83+
8484
/// Requires `Client` to be in scope and to implement `get_tx_out`.
8585
#[macro_export]
8686
macro_rules! impl_test_v17__gettxout {

integration_test/tests/v17_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use integration_test::*;
88
mod blockchain {
99
use super::*;
1010

11-
impl_test_v17__getblockchaininfo!();
1211
impl_test_v17__getbestblockhash!();
1312
impl_test_v17__getblock_verbosity_0!();
1413
impl_test_v17__getblock_verbosity_1!();
14+
impl_test_v17__getblockchaininfo!();
1515
}
1616

1717
// == Control ==

integration_test/tests/v18_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use integration_test::*;
88
mod blockchain {
99
use super::*;
1010

11-
impl_test_v17__getblockchaininfo!();
1211
impl_test_v17__getbestblockhash!();
1312
impl_test_v17__getblock_verbosity_0!();
1413
impl_test_v17__getblock_verbosity_1!();
14+
impl_test_v17__getblockchaininfo!();
1515
}
1616

1717
// == Control ==

integration_test/tests/v19_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use integration_test::*;
88
mod blockchain {
99
use super::*;
1010

11-
impl_test_v17__getblockchaininfo!();
1211
impl_test_v17__getbestblockhash!();
1312
impl_test_v17__getblock_verbosity_0!();
1413
impl_test_v17__getblock_verbosity_1!();
14+
impl_test_v17__getblockchaininfo!();
1515
}
1616

1717
// == Control ==

integration_test/tests/v20_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use integration_test::*;
88
mod blockchain {
99
use super::*;
1010

11-
impl_test_v17__getblockchaininfo!();
1211
impl_test_v17__getbestblockhash!();
1312
impl_test_v17__getblock_verbosity_0!();
1413
impl_test_v17__getblock_verbosity_1!();
14+
impl_test_v17__getblockchaininfo!();
1515
}
1616

1717
// == Control ==

integration_test/tests/v21_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use integration_test::*;
88
mod blockchain {
99
use super::*;
1010

11-
impl_test_v17__getblockchaininfo!();
1211
impl_test_v17__getbestblockhash!();
1312
impl_test_v17__getblock_verbosity_0!();
1413
impl_test_v17__getblock_verbosity_1!();
14+
impl_test_v17__getblockchaininfo!();
1515
}
1616

1717
// == Control ==

integration_test/tests/v22_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use integration_test::*;
88
mod blockchain {
99
use super::*;
1010

11-
impl_test_v17__getblockchaininfo!();
1211
impl_test_v17__getbestblockhash!();
1312
impl_test_v17__getblock_verbosity_0!();
1413
impl_test_v17__getblock_verbosity_1!();
14+
impl_test_v17__getblockchaininfo!();
1515
}
1616

1717
// == Control ==

integration_test/tests/v23_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use integration_test::*;
88
mod blockchain {
99
use super::*;
1010

11-
impl_test_v17__getblockchaininfo!();
1211
impl_test_v17__getbestblockhash!();
1312
impl_test_v17__getblock_verbosity_0!();
1413
impl_test_v17__getblock_verbosity_1!();
14+
impl_test_v17__getblockchaininfo!();
1515
}
1616

1717
// == Control ==

integration_test/tests/v24_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use integration_test::*;
88
mod blockchain {
99
use super::*;
1010

11-
impl_test_v17__getblockchaininfo!();
1211
impl_test_v17__getbestblockhash!();
1312
impl_test_v17__getblock_verbosity_0!();
1413
impl_test_v17__getblock_verbosity_1!();
14+
impl_test_v17__getblockchaininfo!();
1515
}
1616

1717
// == Control ==

0 commit comments

Comments
 (0)