Unittest for cost tracker after process_and_record_transactions

This commit is contained in:
Christian Kamm
2022-04-08 15:35:16 +02:00
committed by Tao Zhu
parent 924b8ea1eb
commit 2ed29771f2
2 changed files with 133 additions and 0 deletions

View File

@ -111,6 +111,14 @@ impl CostTracker {
self.remove_transaction_cost(tx_cost);
}
pub fn block_cost(&self) -> u64 {
self.block_cost
}
pub fn transaction_count(&self) -> u64 {
self.transaction_count
}
pub fn report_stats(&self, bank_slot: Slot) {
// skip reporting if block is empty
if self.transaction_count == 0 {