Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tao-stones committed Feb 1, 2023
1 parent 3a702c7 commit 658eddd
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions ledger/src/blockstore_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use {
},
solana_sdk::{
clock::{Slot, MAX_PROCESSING_AGE},
feature_set::self,
feature_set,
genesis_config::GenesisConfig,
hash::Hash,
pubkey::Pubkey,
Expand Down Expand Up @@ -343,30 +343,31 @@ fn execute_batches(
})
.collect::<Vec<_>>();

if bank.feature_set.is_active(&feature_set::apply_cost_tracker_during_replay::id()) {
if bank
.feature_set
.is_active(&feature_set::apply_cost_tracker_during_replay::id())
{
let mut cost_tracker = bank.write_cost_tracker().unwrap();
for tx_cost in &tx_costs {
match cost_tracker.try_add(tx_cost) {
Ok(_block_cost) => (),
Err(e) => {
match e {
CostTrackerError::WouldExceedBlockMaxLimit => {
return Err(TransactionError::WouldExceedMaxBlockCostLimit);
}
CostTrackerError::WouldExceedVoteMaxLimit => {
return Err(TransactionError::WouldExceedMaxVoteCostLimit);
}
CostTrackerError::WouldExceedAccountMaxLimit => {
return Err(TransactionError::WouldExceedMaxAccountCostLimit);
}
CostTrackerError::WouldExceedAccountDataBlockLimit => {
return Err(TransactionError::WouldExceedAccountDataBlockLimit);
}
CostTrackerError::WouldExceedAccountDataTotalLimit => {
return Err(TransactionError::WouldExceedAccountDataTotalLimit);
}
Err(e) => match e {
CostTrackerError::WouldExceedBlockMaxLimit => {
return Err(TransactionError::WouldExceedMaxBlockCostLimit);
}
}
CostTrackerError::WouldExceedVoteMaxLimit => {
return Err(TransactionError::WouldExceedMaxVoteCostLimit);
}
CostTrackerError::WouldExceedAccountMaxLimit => {
return Err(TransactionError::WouldExceedMaxAccountCostLimit);
}
CostTrackerError::WouldExceedAccountDataBlockLimit => {
return Err(TransactionError::WouldExceedAccountDataBlockLimit);
}
CostTrackerError::WouldExceedAccountDataTotalLimit => {
return Err(TransactionError::WouldExceedAccountDataTotalLimit);
}
},
}
}
}
Expand Down

0 comments on commit 658eddd

Please sign in to comment.