Skip to content

Commit 8f77164

Browse files
committed
merged with develop
2 parents f07179d + 1b875da commit 8f77164

File tree

4 files changed

+9
-24
lines changed

4 files changed

+9
-24
lines changed

stackslib/src/chainstate/nakamoto/miner.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,8 @@ impl BlockBuilder for NakamotoBlockBuilder {
738738
}
739739

740740
let cost_before = clarity_tx.cost_so_far();
741-
let (fee, receipt) = match StacksChainState::process_transaction(
741+
742+
let (_fee, receipt) = match StacksChainState::process_transaction(
742743
clarity_tx,
743744
tx,
744745
quiet,
@@ -750,6 +751,7 @@ impl BlockBuilder for NakamotoBlockBuilder {
750751
return parse_process_transaction_error(clarity_tx, tx, e);
751752
}
752753
};
754+
753755
let cost_after = clarity_tx.cost_so_far();
754756
let mut soft_limit_reached = false;
755757
// We only attempt to apply the soft limit to non-boot code contract calls.
@@ -770,7 +772,7 @@ impl BlockBuilder for NakamotoBlockBuilder {
770772

771773
// save
772774
self.txs.push(tx.clone());
773-
TransactionResult::success_with_soft_limit(tx, fee, receipt, soft_limit_reached)
775+
TransactionResult::success_with_soft_limit(tx, receipt, soft_limit_reached)
774776
};
775777

776778
self.bytes_so_far += tx_len;

stackslib/src/chainstate/stacks/miner.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,12 @@ impl TransactionResult {
468468
/// This method logs "transaction success" as a side effect.
469469
pub fn success(
470470
transaction: &StacksTransaction,
471-
fee: u64,
472471
receipt: StacksTransactionReceipt,
473472
) -> TransactionResult {
474473
Self::log_transaction_success(transaction);
475474
Self::Success(TransactionSuccess {
476475
tx: transaction.clone(),
477-
fee,
476+
fee: transaction.get_tx_fee(),
478477
receipt,
479478
soft_limit_reached: false,
480479
})
@@ -484,14 +483,13 @@ impl TransactionResult {
484483
/// This method logs "transaction success" as a side effect.
485484
pub fn success_with_soft_limit(
486485
transaction: &StacksTransaction,
487-
fee: u64,
488486
receipt: StacksTransactionReceipt,
489487
soft_limit_reached: bool,
490488
) -> TransactionResult {
491489
Self::log_transaction_success(transaction);
492490
Self::Success(TransactionSuccess {
493491
tx: transaction.clone(),
494-
fee,
492+
fee: transaction.get_tx_fee(),
495493
receipt,
496494
soft_limit_reached,
497495
})
@@ -1062,7 +1060,7 @@ impl<'a> StacksMicroblockBuilder<'a> {
10621060

10631061
let quiet = !cfg!(test);
10641062
match StacksChainState::process_transaction(clarity_tx, &tx, quiet, ast_rules, None) {
1065-
Ok((fee, receipt)) => Ok(TransactionResult::success(&tx, fee, receipt)),
1063+
Ok((_fee, receipt)) => Ok(TransactionResult::success(&tx, receipt)),
10661064
Err(e) => {
10671065
let (is_problematic, e) =
10681066
TransactionResult::is_problematic(&tx, e, clarity_tx.get_epoch());
@@ -2885,7 +2883,7 @@ impl BlockBuilder for StacksBlockBuilder {
28852883
self.txs.push(tx.clone());
28862884
self.total_anchored_fees += fee;
28872885

2888-
TransactionResult::success(tx, fee, receipt)
2886+
TransactionResult::success(tx, receipt)
28892887
} else {
28902888
// building up the microblocks
28912889
if tx.anchor_mode != TransactionAnchorMode::OffChainOnly
@@ -2975,7 +2973,7 @@ impl BlockBuilder for StacksBlockBuilder {
29752973
self.micro_txs.push(tx.clone());
29762974
self.total_streamed_fees += fee;
29772975

2978-
TransactionResult::success(tx, fee, receipt)
2976+
TransactionResult::success(tx, receipt)
29792977
};
29802978

29812979
self.bytes_so_far += tx_len;

stackslib/src/chainstate/stacks/tests/block_construction.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4999,7 +4999,6 @@ fn paramaterized_mempool_walk_test(
49994999
// Generate any success result
50005000
TransactionResult::success(
50015001
&available_tx.tx.tx,
5002-
available_tx.tx.metadata.tx_fee,
50035002
StacksTransactionReceipt::from_stx_transfer(
50045003
available_tx.tx.tx.clone(),
50055004
vec![],

stackslib/src/core/tests/mod.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ fn mempool_walk_over_fork() {
278278
// Generate any success result
279279
TransactionResult::success(
280280
&available_tx.tx.tx,
281-
available_tx.tx.metadata.tx_fee,
282281
StacksTransactionReceipt::from_stx_transfer(
283282
available_tx.tx.tx.clone(),
284283
vec![],
@@ -316,7 +315,6 @@ fn mempool_walk_over_fork() {
316315
// Generate any success result
317316
TransactionResult::success(
318317
&available_tx.tx.tx,
319-
available_tx.tx.metadata.tx_fee,
320318
StacksTransactionReceipt::from_stx_transfer(
321319
available_tx.tx.tx.clone(),
322320
vec![],
@@ -353,7 +351,6 @@ fn mempool_walk_over_fork() {
353351
// Generate any success result
354352
TransactionResult::success(
355353
&available_tx.tx.tx,
356-
available_tx.tx.metadata.tx_fee,
357354
StacksTransactionReceipt::from_stx_transfer(
358355
available_tx.tx.tx.clone(),
359356
vec![],
@@ -395,7 +392,6 @@ fn mempool_walk_over_fork() {
395392
// Generate any success result
396393
TransactionResult::success(
397394
&available_tx.tx.tx,
398-
available_tx.tx.metadata.tx_fee,
399395
StacksTransactionReceipt::from_stx_transfer(
400396
available_tx.tx.tx.clone(),
401397
vec![],
@@ -435,7 +431,6 @@ fn mempool_walk_over_fork() {
435431
// Generate any success result
436432
TransactionResult::success(
437433
&available_tx.tx.tx,
438-
available_tx.tx.metadata.tx_fee,
439434
StacksTransactionReceipt::from_stx_transfer(
440435
available_tx.tx.tx.clone(),
441436
vec![],
@@ -661,7 +656,6 @@ fn test_iterate_candidates_consider_no_estimate_tx_prob() {
661656
// Generate any success result
662657
TransactionResult::success(
663658
&available_tx.tx.tx,
664-
available_tx.tx.metadata.tx_fee,
665659
StacksTransactionReceipt::from_stx_transfer(
666660
available_tx.tx.tx.clone(),
667661
vec![],
@@ -698,7 +692,6 @@ fn test_iterate_candidates_consider_no_estimate_tx_prob() {
698692
// Generate any success result
699693
TransactionResult::success(
700694
&available_tx.tx.tx,
701-
available_tx.tx.metadata.tx_fee,
702695
StacksTransactionReceipt::from_stx_transfer(
703696
available_tx.tx.tx.clone(),
704697
vec![],
@@ -735,7 +728,6 @@ fn test_iterate_candidates_consider_no_estimate_tx_prob() {
735728
// Generate any success result
736729
TransactionResult::success(
737730
&available_tx.tx.tx,
738-
available_tx.tx.metadata.tx_fee,
739731
StacksTransactionReceipt::from_stx_transfer(
740732
available_tx.tx.tx.clone(),
741733
vec![],
@@ -844,7 +836,6 @@ fn test_iterate_candidates_skipped_transaction() {
844836
// Generate any success result
845837
TransactionResult::success(
846838
&available_tx.tx.tx,
847-
available_tx.tx.metadata.tx_fee,
848839
StacksTransactionReceipt::from_stx_transfer(
849840
available_tx.tx.tx.clone(),
850841
vec![],
@@ -959,7 +950,6 @@ fn test_iterate_candidates_processing_error_transaction() {
959950
// Generate any success result
960951
TransactionResult::success(
961952
&available_tx.tx.tx,
962-
available_tx.tx.metadata.tx_fee,
963953
StacksTransactionReceipt::from_stx_transfer(
964954
available_tx.tx.tx.clone(),
965955
vec![],
@@ -1074,7 +1064,6 @@ fn test_iterate_candidates_problematic_transaction() {
10741064
// Generate any success result
10751065
TransactionResult::success(
10761066
&available_tx.tx.tx,
1077-
available_tx.tx.metadata.tx_fee,
10781067
StacksTransactionReceipt::from_stx_transfer(
10791068
available_tx.tx.tx.clone(),
10801069
vec![],
@@ -1226,7 +1215,6 @@ fn test_iterate_candidates_concurrent_write_lock() {
12261215
// Generate any success result
12271216
TransactionResult::success(
12281217
&available_tx.tx.tx,
1229-
available_tx.tx.metadata.tx_fee,
12301218
StacksTransactionReceipt::from_stx_transfer(
12311219
available_tx.tx.tx.clone(),
12321220
vec![],
@@ -2725,7 +2713,6 @@ fn test_filter_txs_by_type() {
27252713
// Generate any success result
27262714
TransactionResult::success(
27272715
&available_tx.tx.tx,
2728-
available_tx.tx.metadata.tx_fee,
27292716
StacksTransactionReceipt::from_stx_transfer(
27302717
available_tx.tx.tx.clone(),
27312718
vec![],
@@ -2760,7 +2747,6 @@ fn test_filter_txs_by_type() {
27602747
// Generate any success result
27612748
TransactionResult::success(
27622749
&available_tx.tx.tx,
2763-
available_tx.tx.metadata.tx_fee,
27642750
StacksTransactionReceipt::from_stx_transfer(
27652751
available_tx.tx.tx.clone(),
27662752
vec![],

0 commit comments

Comments
 (0)