Skip to content

Commit 1ca37f4

Browse files
committed
fix: improved naming of extra costs related to contract calls
1 parent 2f26f68 commit 1ca37f4

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

clarity/src/vm/clarity_wasm.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10157,15 +10157,15 @@ impl<D, T: CostLinker<D>> AccessCostMeter<D> for T {}
1015710157
// But these should not be conflated with a word cost.
1015810158
// We do not want to pollute the namespace with new reserved keywords that are only used for internal management.
1015910159
#[derive(Debug, Clone, Copy)]
10160-
pub enum OverheadCosts {
10160+
pub enum ContractCallOverhead {
1016110161
UserFunctionApplication,
1016210162
InnerTypeCheckCost,
1016310163
}
1016410164

10165-
impl OverheadCosts {
10165+
impl ContractCallOverhead {
1016610166
fn cost(self, epoch: &StacksEpochId, n: i64) -> CostMeter {
1016710167
match self {
10168-
OverheadCosts::UserFunctionApplication => match epoch {
10168+
ContractCallOverhead::UserFunctionApplication => match epoch {
1016910169
StacksEpochId::Epoch10 => panic!("clarity did not exist in epoch 1"),
1017010170
StacksEpochId::Epoch20 => CostMeter {
1017110171
runtime: linear(n as u64, 1000, 1000) as i64,
@@ -10198,7 +10198,7 @@ impl OverheadCosts {
1019810198
write_length: 0,
1019910199
},
1020010200
},
10201-
OverheadCosts::InnerTypeCheckCost => match epoch {
10201+
ContractCallOverhead::InnerTypeCheckCost => match epoch {
1020210202
StacksEpochId::Epoch10 => panic!("clarity did not exist in epoch 1"),
1020310203
StacksEpochId::Epoch20 => CostMeter {
1020410204
runtime: linear(n as u64, 1000, 1000) as i64,
@@ -10246,6 +10246,6 @@ fn charge_contract_call_cost_overhead(
1024610246
total_size_parameters: i64,
1024710247
function_arity: i64,
1024810248
) {
10249-
*cost_meter -= OverheadCosts::UserFunctionApplication.cost(epoch, function_arity);
10250-
*cost_meter -= OverheadCosts::InnerTypeCheckCost.cost(epoch, total_size_parameters);
10249+
*cost_meter -= ContractCallOverhead::UserFunctionApplication.cost(epoch, function_arity);
10250+
*cost_meter -= ContractCallOverhead::InnerTypeCheckCost.cost(epoch, total_size_parameters);
1025110251
}

0 commit comments

Comments
 (0)