Skip to content

Commit 5edaa24

Browse files
committed
Add verify tool
Add a tool to help verify that what we have done is correct. Adds crate that when run produces: ```bash Verifying support for Bitcoin Core v17 Checking he documented methods are correct for this version of Core ... ✓ The documented status is correct ... ✓ ``` Run the tool for v17 module and fix the few mistakes it found - WIN! Then fix up the docs in v18 and run the tool to verify the v18 stuff is correct.
1 parent d36d8fe commit 5edaa24

File tree

17 files changed

+1378
-177
lines changed

17 files changed

+1378
-177
lines changed

Cargo-minimal.lock

+58
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
# It is not intended for manual editing.
33
version = 3
44

5+
[[package]]
6+
name = "aho-corasick"
7+
version = "1.1.3"
8+
source = "registry+https://github.com/rust-lang/crates.io-index"
9+
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
10+
dependencies = [
11+
"memchr",
12+
]
13+
14+
[[package]]
15+
name = "anyhow"
16+
version = "1.0.94"
17+
source = "registry+https://github.com/rust-lang/crates.io-index"
18+
checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7"
19+
520
[[package]]
621
name = "arrayvec"
722
version = "0.7.4"
@@ -169,6 +184,12 @@ version = "0.4.18"
169184
source = "registry+https://github.com/rust-lang/crates.io-index"
170185
checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de"
171186

187+
[[package]]
188+
name = "memchr"
189+
version = "2.7.4"
190+
source = "registry+https://github.com/rust-lang/crates.io-index"
191+
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
192+
172193
[[package]]
173194
name = "minreq"
174195
version = "2.11.2"
@@ -198,6 +219,35 @@ dependencies = [
198219
"proc-macro2",
199220
]
200221

222+
[[package]]
223+
name = "regex"
224+
version = "1.11.1"
225+
source = "registry+https://github.com/rust-lang/crates.io-index"
226+
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
227+
dependencies = [
228+
"aho-corasick",
229+
"memchr",
230+
"regex-automata",
231+
"regex-syntax",
232+
]
233+
234+
[[package]]
235+
name = "regex-automata"
236+
version = "0.4.9"
237+
source = "registry+https://github.com/rust-lang/crates.io-index"
238+
checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
239+
dependencies = [
240+
"aho-corasick",
241+
"memchr",
242+
"regex-syntax",
243+
]
244+
245+
[[package]]
246+
name = "regex-syntax"
247+
version = "0.8.5"
248+
source = "registry+https://github.com/rust-lang/crates.io-index"
249+
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
250+
201251
[[package]]
202252
name = "ryu"
203253
version = "1.0.18"
@@ -283,6 +333,14 @@ version = "1.0.8"
283333
source = "registry+https://github.com/rust-lang/crates.io-index"
284334
checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
285335

336+
[[package]]
337+
name = "verify"
338+
version = "0.1.0"
339+
dependencies = [
340+
"anyhow",
341+
"regex",
342+
]
343+
286344
[[package]]
287345
name = "winapi"
288346
version = "0.3.9"

Cargo-recent.lock

+58
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
# It is not intended for manual editing.
33
version = 3
44

5+
[[package]]
6+
name = "aho-corasick"
7+
version = "1.1.3"
8+
source = "registry+https://github.com/rust-lang/crates.io-index"
9+
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
10+
dependencies = [
11+
"memchr",
12+
]
13+
14+
[[package]]
15+
name = "anyhow"
16+
version = "1.0.94"
17+
source = "registry+https://github.com/rust-lang/crates.io-index"
18+
checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7"
19+
520
[[package]]
621
name = "arrayvec"
722
version = "0.7.4"
@@ -169,6 +184,12 @@ version = "0.4.18"
169184
source = "registry+https://github.com/rust-lang/crates.io-index"
170185
checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de"
171186

187+
[[package]]
188+
name = "memchr"
189+
version = "2.7.4"
190+
source = "registry+https://github.com/rust-lang/crates.io-index"
191+
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
192+
172193
[[package]]
173194
name = "minreq"
174195
version = "2.11.2"
@@ -198,6 +219,35 @@ dependencies = [
198219
"proc-macro2",
199220
]
200221

222+
[[package]]
223+
name = "regex"
224+
version = "1.11.1"
225+
source = "registry+https://github.com/rust-lang/crates.io-index"
226+
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
227+
dependencies = [
228+
"aho-corasick",
229+
"memchr",
230+
"regex-automata",
231+
"regex-syntax",
232+
]
233+
234+
[[package]]
235+
name = "regex-automata"
236+
version = "0.4.9"
237+
source = "registry+https://github.com/rust-lang/crates.io-index"
238+
checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
239+
dependencies = [
240+
"aho-corasick",
241+
"memchr",
242+
"regex-syntax",
243+
]
244+
245+
[[package]]
246+
name = "regex-syntax"
247+
version = "0.8.5"
248+
source = "registry+https://github.com/rust-lang/crates.io-index"
249+
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
250+
201251
[[package]]
202252
name = "ryu"
203253
version = "1.0.18"
@@ -283,6 +333,14 @@ version = "1.0.8"
283333
source = "registry+https://github.com/rust-lang/crates.io-index"
284334
checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
285335

336+
[[package]]
337+
name = "verify"
338+
version = "0.1.0"
339+
dependencies = [
340+
"anyhow",
341+
"regex",
342+
]
343+
286344
[[package]]
287345
name = "winapi"
288346
version = "0.3.9"

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = ["client", "types", "jsonrpc"]
2+
members = ["client", "types", "jsonrpc", "verify"]
33
exclude = ["integration_test", "node"]
44
resolver = "2"
55

integration_test/tests/blockchain.rs

+15-12
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,25 @@ fn get_block_header_verbose() { // verbose = true
7676
// optional as suggested in the docs but to no avail.
7777
#[test]
7878
#[cfg(feature = "0_17_1")]
79+
fn get_block_stats() {
80+
get_block_stats_by_height();
81+
get_block_stats_by_hash();
82+
}
83+
7984
fn get_block_stats_by_height() {
8085
let node = Node::new_no_wallet();
8186
let json = node.client.get_block_stats_by_height(0).expect("getblockstats");
8287
assert!(json.into_model().is_ok());
8388
}
8489

85-
// FIXME: Same as get_block_stats_by_height above.
86-
#[test]
87-
#[cfg(feature = "0_17_1")]
8890
fn get_block_stats_by_hash() { // verbose = true
8991
let node = Node::new_no_wallet();
9092
let block_hash = best_block_hash();
9193
let json = node.client.get_block_stats_by_block_hash(&block_hash).expect("getblockstats");
9294
assert!(json.into_model().is_ok());
9395
}
9496

97+
9598
#[test]
9699
fn get_block_stats_by_height_txindex() {
97100
let node = Node::new_no_wallet_txindex();
@@ -130,37 +133,37 @@ fn get_difficulty() {
130133

131134
#[test]
132135
#[cfg(feature = "TODO")]
133-
fn get_mempool_ancestors() {}
136+
fn get_mempool_ancestors() { todo!() }
134137

135138
#[test]
136139
#[cfg(feature = "TODO")]
137-
fn get_mempool_descendants() {}
140+
fn get_mempool_descendants() { todo!() }
138141

139142
#[test]
140143
#[cfg(feature = "TODO")]
141-
fn get_mempool_entry() {}
144+
fn get_mempool_entry() { todo!() }
142145

143146
#[test]
144147
#[cfg(feature = "TODO")]
145-
fn get_mempool_info() {}
148+
fn get_mempool_info() { todo!() }
146149

147150
#[test]
148151
#[cfg(feature = "TODO")]
149-
fn get_raw_mempool() {}
152+
fn get_raw_mempool() { todo!() }
150153

151154
#[test]
152155
#[cfg(feature = "TODO")]
153-
fn get_tx_out() {}
156+
fn get_tx_out() { todo!() }
154157

155158
#[test]
156159
#[cfg(feature = "TODO")]
157-
fn get_tx_out_proof() {}
160+
fn get_tx_out_proof() { todo!() }
158161

159162
#[test]
160163
#[cfg(feature = "TODO")]
161-
fn get_tx_out_set_info() {}
164+
fn get_tx_out_set_info() { todo!() }
162165

163166
#[test]
164167
#[cfg(feature = "TODO")]
165-
fn verify_tx_out_proof() {}
168+
fn verify_tx_out_proof() { todo!() }
166169

types/src/v17/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
//! | lockunspent | omitted |
185185
//! | move | omitted |
186186
//! | removeprunedfunds | omitted |
187-
//! | rescanblockchain | done |
187+
//! | rescanblockchain | done (untested) |
188188
//! | sendfrom | omitted |
189189
//! | sendmany | done (untested) |
190190
//! | sendtoaddress | done |
@@ -207,7 +207,7 @@
207207
//!
208208
//! | JSON-PRC Method Name | Status |
209209
//! |:-----------------------------------|:---------------:|
210-
//! | getzmqnotifications` | done (untested) |
210+
//! | getzmqnotifications | done (untested) |
211211
//!
212212
//! </details>
213213
//!
@@ -260,4 +260,5 @@ pub use self::{
260260
SignErrorData, SignMessage, SignRawTransactionWithWallet, TransactionCategory,
261261
WalletCreateFundedPsbt, WalletProcessPsbt,
262262
},
263+
zmq::GetZmqNotifications,
263264
};

0 commit comments

Comments
 (0)