|
7 | 7 | use bitcoin::consensus::encode; |
8 | 8 | use bitcoin::hex; |
9 | 9 | use integration_test::{Node, NodeExt as _, Wallet}; |
10 | | -use node::client::client_sync; |
11 | 10 | use node::vtype::*; // All the version specific types. |
12 | 11 | use node::{mtype, Input, Output}; |
13 | 12 |
|
@@ -505,34 +504,29 @@ fn blockchain__scan_blocks_modelled() { |
505 | 504 | let _: ScanBlocksAbort = node.client.scan_blocks_abort().expect("scanblocks abort"); |
506 | 505 | } |
507 | 506 |
|
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 | | - |
515 | 507 | #[test] |
516 | 508 | fn blockchain__verify_chain() { |
517 | 509 | let node = Node::with_wallet(Wallet::None, &[]); |
518 | 510 |
|
519 | 511 | let _: Result<VerifyChain, _> = node.client.verify_chain(); |
520 | 512 | } |
521 | 513 |
|
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 | + |
523 | 519 | let (_address, tx) = node.create_mined_transaction(); |
524 | 520 | let txid = tx.compute_txid(); |
525 | 521 |
|
526 | | - let proof = node.client.get_tx_out_proof(&[txid])?; |
| 522 | + let proof = node.client.get_tx_out_proof(&[txid]).expect("gettxoutproof"); |
527 | 523 |
|
528 | | - let json: VerifyTxOutProof = node.client.verify_tx_out_proof(&proof)?; |
| 524 | + let json: VerifyTxOutProof = node.client.verify_tx_out_proof(&proof).expect("verifytxoutproof"); |
529 | 525 | let model: Result<mtype::VerifyTxOutProof, hex::HexToArrayError> = json.into_model(); |
530 | 526 | let txids = model.unwrap(); |
531 | 527 |
|
532 | 528 | // sanity check |
533 | 529 | assert_eq!(txids.0.len(), 1); |
534 | | - |
535 | | - Ok(()) |
536 | 530 | } |
537 | 531 |
|
538 | 532 | /// Create and broadcast a child transaction spending vout 0 of the given parent mempool txid. |
|
0 commit comments