Skip to content

Commit ed5dbb7

Browse files
committed
test: reproduce stall behaviour, #6225
1 parent 1fec25e commit ed5dbb7

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3487,6 +3487,38 @@ mod tests {
34873487
);
34883488
}
34893489

3490+
#[test]
3491+
#[ignore]
3492+
fn test_get_utxos_none_due_to_filter_block_height() {
3493+
if env::var("BITCOIND_TEST") != Ok("1".into()) {
3494+
return;
3495+
}
3496+
3497+
let miner_pubkey = utils::create_miner1_pubkey();
3498+
3499+
let mut config = utils::create_config();
3500+
config.burnchain.local_mining_public_key = Some(miner_pubkey.to_hex());
3501+
3502+
let mut btcd_controller = BitcoinCoreController::new(config.clone());
3503+
btcd_controller
3504+
.start_bitcoind()
3505+
.expect("bitcoind should be started!");
3506+
3507+
let btc_controller = BitcoinRegtestController::new(config.clone(), None);
3508+
btc_controller.bootstrap_chain(101); // one utxo exists
3509+
3510+
//NOTE: Operation stall if burn block at block_height doesn't exist
3511+
let future_block_height = 102;
3512+
let utxos = btc_controller.get_utxos(
3513+
StacksEpochId::Epoch31,
3514+
&miner_pubkey,
3515+
1,
3516+
None,
3517+
future_block_height);
3518+
assert!(utxos.is_none(),
3519+
"None because utxos for future block height don't exist");
3520+
}
3521+
34903522
#[test]
34913523
#[ignore]
34923524
fn test_build_leader_block_commit_tx_ok_with_new_commit_op() {

0 commit comments

Comments
 (0)