"index_path": ".*\.redb",
"leaf_pages": \d+,
"metadata_bytes": \d+,
"outputs_traversed": 0,
"page_size": \d+,
"sat_ranges": 0,
"stored_bytes": \d+,
"tables": .*,
"transactions": \[
\{
"starting_block_count": 0,
"starting_timestamp": \d+
\}
\],
"tree_height": \d+,
"utxos_indexed": 0
\}
"#,
)
.run_and_extract_stdout();
}
#[test]
fn transactions() {
let rpc_server = test_bitcoincore_rpc::spawn();
let tempdir = TempDir::new().unwrap();
let index_path = tempdir.path().join("index.redb");
assert!(CommandBuilder::new(format!(
"--index {} index info --transactions",
index_path.display()
))
.rpc_server(&rpc_server)
.run_and_deserialize_output::<Vec<TransactionsOutput>>()
.is_empty());
rpc_server.mine_blocks(10);
let output = CommandBuilder::new(format!(
"--index {} index info --transactions",
index_path.display()
))
.rpc_server(&rpc_server)
.run_and_deserialize_output::<Vec<TransactionsOutput>>();
assert_eq!(output[0].start, 0);