Function essential_check::solution::check_predicate
source · pub async fn check_predicate<SA, SB>(
pre_state: &SA,
post_state: &SB,
solution: Arc<Solution>,
predicate: Arc<Predicate>,
solution_data_index: SolutionDataIndex,
config: &CheckPredicateConfig,
transient_data: Arc<TransientData>,
) -> Result<(Utility, Gas), PredicateError<SA::Error>>Expand description
Checks a solution against a single predicate using the solution data at the given index.
Reads all pre and post state slots into memory, then checks all constraints.
NOTE: This assumes that the given Solution and Predicate have been
independently validated using solution::check
and predicate::check respectively.
§Arguments
pre_statemust provide access to state prior to mutations being applied.post_statemust provide access to state post mutations being applied.solution_data_indexrepresents the data withinsolution.datathat claims to solve this predicate.
Returns the utility score of the solution alongside the total gas spent.