Skip to content

Commit b158065

Browse files
committed
Move test code into test function
The model part of the verify_tx_out_proof test was in it's own function that the test function called. Other tests all check the model in the same test. Combine them into one function. Place it in the correct location. Remove associated import.
1 parent 7230e61 commit b158065

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

integration_test/tests/blockchain.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use bitcoin::consensus::encode;
88
use bitcoin::hex;
99
use integration_test::{Node, NodeExt as _, Wallet};
10-
use node::client::client_sync;
1110
use node::vtype::*; // All the version specific types.
1211
use node::{mtype, Input, Output};
1312

@@ -505,34 +504,29 @@ fn blockchain__scan_blocks_modelled() {
505504
let _: ScanBlocksAbort = node.client.scan_blocks_abort().expect("scanblocks abort");
506505
}
507506

508-
#[test]
509-
fn blockchain__verify_tx_out_proof__modelled() {
510-
let node = Node::with_wallet(Wallet::Default, &[]);
511-
node.fund_wallet();
512-
verify_tx_out_proof(&node).unwrap();
513-
}
514-
515507
#[test]
516508
fn blockchain__verify_chain() {
517509
let node = Node::with_wallet(Wallet::None, &[]);
518510

519511
let _: Result<VerifyChain, _> = node.client.verify_chain();
520512
}
521513

522-
fn verify_tx_out_proof(node: &Node) -> Result<(), client_sync::Error> {
514+
#[test]
515+
fn blockchain__verify_tx_out_proof__modelled() {
516+
let node = Node::with_wallet(Wallet::Default, &[]);
517+
node.fund_wallet();
518+
523519
let (_address, tx) = node.create_mined_transaction();
524520
let txid = tx.compute_txid();
525521

526-
let proof = node.client.get_tx_out_proof(&[txid])?;
522+
let proof = node.client.get_tx_out_proof(&[txid]).expect("gettxoutproof");
527523

528-
let json: VerifyTxOutProof = node.client.verify_tx_out_proof(&proof)?;
524+
let json: VerifyTxOutProof = node.client.verify_tx_out_proof(&proof).expect("verifytxoutproof");
529525
let model: Result<mtype::VerifyTxOutProof, hex::HexToArrayError> = json.into_model();
530526
let txids = model.unwrap();
531527

532528
// sanity check
533529
assert_eq!(txids.0.len(), 1);
534-
535-
Ok(())
536530
}
537531

538532
/// Create and broadcast a child transaction spending vout 0 of the given parent mempool txid.

0 commit comments

Comments
 (0)