diff --git a/crates/uplc/src/machine/cost_model.rs b/crates/uplc/src/machine/cost_model.rs index 98be17e7..0131d0e1 100644 --- a/crates/uplc/src/machine/cost_model.rs +++ b/crates/uplc/src/machine/cost_model.rs @@ -47,6 +47,17 @@ impl Default for ExBudget { } } +impl std::ops::Sub for ExBudget { + type Output = Self; + + fn sub(self, rhs: Self) -> Self::Output { + ExBudget { + mem: self.mem - rhs.mem, + cpu: self.cpu - rhs.cpu, + } + } +} + #[derive(Default)] pub struct CostModel { pub machine_costs: MachineCosts,