From 40e1d39f8bc84a3fecd5c4fdde6bb11a3c43aa84 Mon Sep 17 00:00:00 2001 From: microproofs Date: Wed, 2 Aug 2023 11:16:14 -0400 Subject: [PATCH] Add placeholders for cost model --- crates/uplc/src/machine/cost_model.rs | 40 +++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/crates/uplc/src/machine/cost_model.rs b/crates/uplc/src/machine/cost_model.rs index 07174450..61ddb173 100644 --- a/crates/uplc/src/machine/cost_model.rs +++ b/crates/uplc/src/machine/cost_model.rs @@ -145,8 +145,15 @@ impl MachineCosts { mem: 100, cpu: 23000, }, - constr: todo!(), - case: todo!(), + // Placeholder values + constr: ExBudget { + mem: 40000000, + cpu: 400000000000, + }, + case: ExBudget { + mem: 40000000, + cpu: 400000000000, + }, } } } @@ -184,8 +191,15 @@ impl Default for MachineCosts { mem: 100, cpu: 23000, }, - constr: todo!(), - case: todo!(), + // Placeholder values + constr: ExBudget { + mem: 40000000, + cpu: 400000000000, + }, + case: ExBudget { + mem: 40000000, + cpu: 400000000000, + }, } } } @@ -2238,8 +2252,22 @@ pub fn initialize_cost_model(version: &Language, costs: &[i64]) -> CostModel { .get("cek_builtin_cost-exBudgetCPU") .unwrap_or(&30000000000), }, - constr: todo!(), - case: todo!(), + constr: ExBudget { + mem: *cost_map + .get("cek_constr_cost-exBudgetmem") + .unwrap_or(&30000000000), + cpu: *cost_map + .get("cek_constr_cost-exBudgetCPU") + .unwrap_or(&30000000000), + }, + case: ExBudget { + mem: *cost_map + .get("cek_case_cost-exBudgetmem") + .unwrap_or(&30000000000), + cpu: *cost_map + .get("cek_case_cost-exBudgetCPU") + .unwrap_or(&30000000000), + }, }, builtin_costs: BuiltinCosts { add_integer: CostingFun {