Unittest for cost tracker after process_and_record_transactions

(cherry picked from commit 2ed29771f2)
This commit is contained in:
Christian Kamm
2022-04-08 15:35:16 +02:00
committed by Tao Zhu
parent 9ae13f26e5
commit 55e64910f7
2 changed files with 133 additions and 0 deletions

View File

@ -156,6 +156,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 {