pub trait SpecificCostContextTrait<CostType: CostTypeTrait> {
// Required methods
fn to_cost_map(cost: CostType) -> OrderedHashMap<CostTokenType, i64>;
fn get_withdraw_gas_values(
&self,
branch_cost: &BranchCost,
wallet_value: &CostType,
future_wallet_value: CostType
) -> OrderedHashMap<CostTokenType, i64>;
fn get_branch_align_values(
&self,
wallet_value: &CostType,
branch_requirement: &CostType
) -> OrderedHashMap<CostTokenType, i64>;
fn get_branch_requirement(
&self,
wallet_at_fn: &dyn Fn(&StatementIdx) -> WalletInfo<CostType>,
idx: &StatementIdx,
branch_info: &BranchInfo,
branch_cost: &BranchCost
) -> WalletInfo<CostType>;
}
Required Methods§
sourcefn to_cost_map(cost: CostType) -> OrderedHashMap<CostTokenType, i64>
fn to_cost_map(cost: CostType) -> OrderedHashMap<CostTokenType, i64>
Converts a CostType
to a OrderedHashMap from CostTokenType to i64.
sourcefn get_withdraw_gas_values(
&self,
branch_cost: &BranchCost,
wallet_value: &CostType,
future_wallet_value: CostType
) -> OrderedHashMap<CostTokenType, i64>
fn get_withdraw_gas_values( &self, branch_cost: &BranchCost, wallet_value: &CostType, future_wallet_value: CostType ) -> OrderedHashMap<CostTokenType, i64>
Computes the value that should be withdrawn and added to the wallet for each token type.
sourcefn get_branch_align_values(
&self,
wallet_value: &CostType,
branch_requirement: &CostType
) -> OrderedHashMap<CostTokenType, i64>
fn get_branch_align_values( &self, wallet_value: &CostType, branch_requirement: &CostType ) -> OrderedHashMap<CostTokenType, i64>
Computes the value that should be reduced from the wallet for each token type.
sourcefn get_branch_requirement(
&self,
wallet_at_fn: &dyn Fn(&StatementIdx) -> WalletInfo<CostType>,
idx: &StatementIdx,
branch_info: &BranchInfo,
branch_cost: &BranchCost
) -> WalletInfo<CostType>
fn get_branch_requirement( &self, wallet_at_fn: &dyn Fn(&StatementIdx) -> WalletInfo<CostType>, idx: &StatementIdx, branch_info: &BranchInfo, branch_cost: &BranchCost ) -> WalletInfo<CostType>
Returns the required value for the wallet for a single branch.
Object Safety§
This trait is not object safe.