Skip to content

Commit 7c073fa

Browse files
committed
Cannot assume stacks transaction will get mined AFTER the burn block is mined
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent 63ee6a4 commit 7c073fa

File tree

1 file changed

+7
-37
lines changed

1 file changed

+7
-37
lines changed

testnet/stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5185,51 +5185,21 @@ fn clarity_burn_state() {
51855185
vec![&Value::UInt(burn_block_height)],
51865186
);
51875187
result.expect_result_ok().expect("Read-only call failed");
5188-
5189-
// Submit a tx for the next block (the next block will be a new tenure, so the burn block height will increment)
5190-
let call_tx = tests::make_contract_call(
5191-
&sender_sk,
5192-
sender_nonce,
5193-
tx_fee,
5194-
&sender_addr,
5195-
contract_name,
5196-
"bar",
5197-
&[Value::UInt(burn_block_height + 1)],
5198-
);
5199-
sender_nonce += 1;
5200-
submit_tx(&http_origin, &call_tx);
52015188
}
52025189

52035190
let commits_before = commits_submitted.load(Ordering::SeqCst);
5204-
next_block_and_process_new_stacks_block(&mut btc_regtest_controller, 60, &coord_channel)
5205-
.unwrap();
5191+
next_block_and_mine_commit(
5192+
&mut btc_regtest_controller,
5193+
60,
5194+
&coord_channel,
5195+
&commits_submitted,
5196+
)
5197+
.unwrap();
52065198

52075199
let info = get_chain_info(&naka_conf);
52085200
burn_block_height = info.burn_block_height as u128;
52095201
info!("Expecting burn block height to be {}", burn_block_height);
52105202

5211-
// Assert that the contract call was successful
5212-
test_observer::get_mined_nakamoto_blocks()
5213-
.last()
5214-
.unwrap()
5215-
.tx_events
5216-
.iter()
5217-
.for_each(|event| match event {
5218-
TransactionEvent::Success(TransactionSuccessEvent { result, fee, .. }) => {
5219-
// Ignore coinbase and tenure transactions
5220-
if *fee == 0 {
5221-
return;
5222-
}
5223-
5224-
info!("Contract call result: {}", result);
5225-
result.clone().expect_result_ok().expect("Ok result");
5226-
}
5227-
_ => {
5228-
info!("Unsuccessful event: {:?}", event);
5229-
panic!("Expected a successful transaction");
5230-
}
5231-
});
5232-
52335203
// mine the interim blocks
52345204
for interim_block_ix in 0..inter_blocks_per_tenure {
52355205
info!("Mining interim block {interim_block_ix}");

0 commit comments

Comments
 (0)