Skip to content

Commit bab4647

Browse files
committed
fix(tests): move hidden RPC tests, fix modelled suffixes
1 parent 7756c42 commit bab4647

2 files changed

Lines changed: 65 additions & 65 deletions

File tree

integration_test/tests/blockchain.rs

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -613,68 +613,3 @@ fn create_child_spending_parent(node: &Node, parent_txid: bitcoin::Txid) -> bitc
613613

614614
child_txid
615615
}
616-
617-
#[test]
618-
fn blockchain__sync_with_validation_interface_queue__modelled() {
619-
let node = Node::with_wallet(Wallet::Default, &[]);
620-
node.fund_wallet();
621-
622-
// Create activity that causes validation callbacks.
623-
let (_address, _txid) = node.create_mempool_transaction();
624-
625-
let _: () = node
626-
.client
627-
.sync_with_validation_interface_queue()
628-
.expect("syncwithvalidationinterfacequeue");
629-
}
630-
631-
#[test]
632-
fn blockchain__reconsider_block__modelled() {
633-
let node = Node::with_wallet(Wallet::Default, &[]);
634-
node.fund_wallet();
635-
636-
node.mine_a_block();
637-
node.mine_a_block();
638-
639-
let tip_before = node.client.best_block_hash().expect("bestblockhash");
640-
let height_before = node.client.get_block_count().expect("getblockcount").0;
641-
642-
node.client.invalidate_block(tip_before).expect("invalidateblock");
643-
644-
let tip_after_invalidate =
645-
node.client.best_block_hash().expect("bestblockhash after invalidate");
646-
let height_after_invalidate = node.client.get_block_count().expect("getblockcount").0;
647-
648-
assert_ne!(
649-
tip_after_invalidate, tip_before,
650-
"tip should change after invalidating the tip block"
651-
);
652-
assert_eq!(
653-
height_after_invalidate,
654-
height_before - 1,
655-
"height should decrease by 1 after invalidating the tip block"
656-
);
657-
658-
node.client.reconsider_block(tip_before).expect("reconsiderblock");
659-
660-
let tip_after_reconsider =
661-
node.client.best_block_hash().expect("bestblockhash after reconsider");
662-
let height_after_reconsider = node.client.get_block_count().expect("getblockcount").0;
663-
664-
assert_eq!(
665-
tip_after_reconsider, tip_before,
666-
"tip should return to the previously invalidated block after reconsiderblock"
667-
);
668-
assert_eq!(
669-
height_after_reconsider, height_before,
670-
"height should return to the original height after reconsiderblock"
671-
);
672-
}
673-
674-
#[test]
675-
#[cfg(not(feature = "v19_and_below"))]
676-
fn blockchain__mock_scheduler__modelled() {
677-
let node = Node::with_wallet(Wallet::Default, &[]);
678-
679-
let _: () = node.client.mock_scheduler(1).expect("mockscheduler");
680-
}

integration_test/tests/hidden.rs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,68 @@ fn hidden__get_orphan_txs__modelled() {
173173
}
174174
}
175175
}
176+
177+
#[test]
178+
fn hidden__sync_with_validation_interface_queue() {
179+
let node = Node::with_wallet(Wallet::Default, &[]);
180+
node.fund_wallet();
181+
182+
// Create activity that causes validation callbacks.
183+
let (_address, _txid) = node.create_mempool_transaction();
184+
185+
let _: () = node
186+
.client
187+
.sync_with_validation_interface_queue()
188+
.expect("syncwithvalidationinterfacequeue");
189+
}
190+
191+
#[test]
192+
fn hidden__reconsider_block() {
193+
let node = Node::with_wallet(Wallet::Default, &[]);
194+
node.fund_wallet();
195+
196+
node.mine_a_block();
197+
node.mine_a_block();
198+
199+
let tip_before = node.client.best_block_hash().expect("bestblockhash");
200+
let height_before = node.client.get_block_count().expect("getblockcount").0;
201+
202+
node.client.invalidate_block(tip_before).expect("invalidateblock");
203+
204+
let tip_after_invalidate =
205+
node.client.best_block_hash().expect("bestblockhash after invalidate");
206+
let height_after_invalidate = node.client.get_block_count().expect("getblockcount").0;
207+
208+
assert_ne!(
209+
tip_after_invalidate, tip_before,
210+
"tip should change after invalidating the tip block"
211+
);
212+
assert_eq!(
213+
height_after_invalidate,
214+
height_before - 1,
215+
"height should decrease by 1 after invalidating the tip block"
216+
);
217+
218+
node.client.reconsider_block(tip_before).expect("reconsiderblock");
219+
220+
let tip_after_reconsider =
221+
node.client.best_block_hash().expect("bestblockhash after reconsider");
222+
let height_after_reconsider = node.client.get_block_count().expect("getblockcount").0;
223+
224+
assert_eq!(
225+
tip_after_reconsider, tip_before,
226+
"tip should return to the previously invalidated block after reconsiderblock"
227+
);
228+
assert_eq!(
229+
height_after_reconsider, height_before,
230+
"height should return to the original height after reconsiderblock"
231+
);
232+
}
233+
234+
#[test]
235+
#[cfg(not(feature = "v19_and_below"))]
236+
fn hidden__mock_scheduler() {
237+
let node = Node::with_wallet(Wallet::Default, &[]);
238+
239+
let _: () = node.client.mock_scheduler(1).expect("mockscheduler");
240+
}

0 commit comments

Comments
 (0)