Skip to content

Fix/5205 #5206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 7 additions & 37 deletions testnet/stacks-node/src/tests/nakamoto_integrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5185,51 +5185,21 @@ fn clarity_burn_state() {
vec![&Value::UInt(burn_block_height)],
);
result.expect_result_ok().expect("Read-only call failed");

// Submit a tx for the next block (the next block will be a new tenure, so the burn block height will increment)
let call_tx = tests::make_contract_call(
&sender_sk,
sender_nonce,
tx_fee,
&sender_addr,
contract_name,
"bar",
&[Value::UInt(burn_block_height + 1)],
);
sender_nonce += 1;
submit_tx(&http_origin, &call_tx);
}

let commits_before = commits_submitted.load(Ordering::SeqCst);
next_block_and_process_new_stacks_block(&mut btc_regtest_controller, 60, &coord_channel)
.unwrap();
next_block_and_mine_commit(
&mut btc_regtest_controller,
60,
&coord_channel,
&commits_submitted,
)
.unwrap();

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

// Assert that the contract call was successful
test_observer::get_mined_nakamoto_blocks()
.last()
.unwrap()
.tx_events
.iter()
.for_each(|event| match event {
TransactionEvent::Success(TransactionSuccessEvent { result, fee, .. }) => {
// Ignore coinbase and tenure transactions
if *fee == 0 {
return;
}

info!("Contract call result: {}", result);
result.clone().expect_result_ok().expect("Ok result");
}
_ => {
info!("Unsuccessful event: {:?}", event);
panic!("Expected a successful transaction");
}
});

// mine the interim blocks
for interim_block_ix in 0..inter_blocks_per_tenure {
info!("Mining interim block {interim_block_ix}");
Expand Down