Skip to content

Commit b4cc597

Browse files
committed
crc: fix test naming and comment, #6253
1 parent c1b02c2 commit b4cc597

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

stacks-node/src/burnchains/bitcoin_regtest_controller.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,7 +1512,7 @@ impl BitcoinRegtestController {
15121512
let ongoing_op = self.ongoing_block_commit.take().unwrap();
15131513

15141514
let _ = self.sortdb_mut();
1515-
let burnchain_db = self.burnchain_db.as_ref().expect("BurnchainDB not opened");
1515+
let burnchain_db = self.burnchain_db.as_ref(). expect("BurnchainDB not opened");
15161516

15171517
for txid in ongoing_op.txids.iter() {
15181518
// check if ongoing_op is in the burnchain_db *or* has been confirmed via the bitcoin RPC
@@ -3670,7 +3670,7 @@ mod tests {
36703670

36713671
#[test]
36723672
#[ignore]
3673-
fn test_build_leader_block_commit_tx_ok_rbf_while_prev_is_confirmed() {
3673+
fn test_build_leader_block_commit_tx_ok_while_prev_is_confirmed() {
36743674
if env::var("BITCOIND_TEST") != Ok("1".into()) {
36753675
return;
36763676
}
@@ -3710,45 +3710,45 @@ mod tests {
37103710
// Now tx is confirmed: prev utxo is updated and one more utxo is generated
37113711
utils::mine_tx(&btc_controller, first_tx_ok);
37123712

3713-
//re-gen signer othewise fails because it will be disposed during previous commit tx.
3713+
// re-gen signer othewise fails because it will be disposed during previous commit tx.
37143714
let mut signer = keychain.generate_op_signer();
3715-
//small change to the commit op payload
3715+
// Modify the commit operation payload slightly, so it no longer matches the confirmed version.
37163716
commit_op.burn_fee += 10;
37173717

3718-
let rbf_tx = btc_controller
3718+
let new_tx = btc_controller
37193719
.build_leader_block_commit_tx(
37203720
StacksEpochId::Epoch31,
37213721
commit_op.clone(),
37223722
&mut signer,
37233723
)
3724-
.expect("Commit tx should be rbf-ed");
3724+
.expect("Commit tx should be created!");
37253725

37263726
assert!(op_signer.is_disposed());
37273727

3728-
assert_eq!(1, rbf_tx.version);
3729-
assert_eq!(0, rbf_tx.lock_time);
3730-
assert_eq!(1, rbf_tx.input.len());
3731-
assert_eq!(4, rbf_tx.output.len());
3728+
assert_eq!(1, new_tx.version);
3729+
assert_eq!(0, new_tx.lock_time);
3730+
assert_eq!(1, new_tx.input.len());
3731+
assert_eq!(4, new_tx.output.len());
37323732

37333733
// utxos list contains the sole utxo used by prev commit operation
3734-
// because has enough amount to cover the rfb commit
3734+
// because has enough amount to cover the new commit
37353735
let used_utxos: Vec<UTXO> = btc_controller
37363736
.get_all_utxos(&miner_pubkey)
37373737
.into_iter()
37383738
.filter(|utxo| utxo.txid == first_txid)
37393739
.collect();
37403740

3741-
let input_0 = utils::txin_at_index(&rbf_tx, &op_signer, &used_utxos, 0);
3742-
assert_eq!(input_0, rbf_tx.input[0]);
3741+
let input_0 = utils::txin_at_index(&new_tx, &op_signer, &used_utxos, 0);
3742+
assert_eq!(input_0, new_tx.input[0]);
37433743

37443744
let op_return = utils::txout_opreturn(&commit_op, &config.burnchain.magic_bytes, 5_500);
37453745
let op_commit_1 = utils::txout_opdup_commit_to(&commit_op.commit_outs[0], 55_005);
37463746
let op_commit_2 = utils::txout_opdup_commit_to(&commit_op.commit_outs[1], 55_005);
37473747
let op_change = utils::txout_opdup_change_legacy(&mut signer, 4_999_730_590);
3748-
assert_eq!(op_return, rbf_tx.output[0]);
3749-
assert_eq!(op_commit_1, rbf_tx.output[1]);
3750-
assert_eq!(op_commit_2, rbf_tx.output[2]);
3751-
assert_eq!(op_change, rbf_tx.output[3]);
3748+
assert_eq!(op_return, new_tx.output[0]);
3749+
assert_eq!(op_commit_1, new_tx.output[1]);
3750+
assert_eq!(op_commit_2, new_tx.output[2]);
3751+
assert_eq!(op_change, new_tx.output[3]);
37523752
}
37533753

37543754
#[test]

0 commit comments

Comments
 (0)