Not exposing inner cost_table to encapsulating implementation details,
making future change easier.
This commit is contained in:
@@ -11,7 +11,6 @@ use {
|
||||
instruction::CompiledInstruction, program_utils::limited_deserialize, pubkey::Pubkey,
|
||||
system_instruction::SystemInstruction, system_program, transaction::SanitizedTransaction,
|
||||
},
|
||||
std::collections::HashMap,
|
||||
};
|
||||
|
||||
const MAX_WRITABLE_ACCOUNTS: usize = 256;
|
||||
@@ -81,10 +80,6 @@ impl CostModel {
|
||||
.for_each(|(program_id, cost)| {
|
||||
self.upsert_instruction_cost(program_id, *cost);
|
||||
});
|
||||
debug!(
|
||||
"restored cost model instruction cost table from blockstore, current values: {:?}",
|
||||
self.get_instruction_cost_table()
|
||||
);
|
||||
}
|
||||
|
||||
pub fn calculate_cost(&self, transaction: &SanitizedTransaction) -> TransactionCost {
|
||||
@@ -105,10 +100,6 @@ impl CostModel {
|
||||
.upsert(program_key, cost);
|
||||
}
|
||||
|
||||
pub fn get_instruction_cost_table(&self) -> &HashMap<Pubkey, u64> {
|
||||
self.instruction_execution_cost_table.get_cost_table()
|
||||
}
|
||||
|
||||
pub fn find_instruction_cost(&self, program_key: &Pubkey) -> u64 {
|
||||
match self.instruction_execution_cost_table.get_cost(program_key) {
|
||||
Some(cost) => *cost,
|
||||
|
@@ -39,10 +39,6 @@ impl ExecuteCostTable {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_cost_table(&self) -> &HashMap<Pubkey, u64> {
|
||||
&self.table
|
||||
}
|
||||
|
||||
pub fn get_count(&self) -> usize {
|
||||
self.table.len()
|
||||
}
|
||||
|
Reference in New Issue
Block a user