pub fn check_predicate<S>(
state: &S,
solution_set: Arc<SolutionSet>,
predicate: Arc<Predicate>,
get_program: impl GetProgram + Send + Sync + 'static,
solution_index: SolutionIndex,
config: &CheckPredicateConfig,
ctx: Ctx<'_>,
) -> Result<(Gas, Vec<DataOutput>), PredicateError<S::Error>>Expand description
Checks the predicate of the solution within the given set at the given solution_index.
Spawns a rayon task for each of the predicate’s nodes to execute in parallel once their inputs are ready.
NOTE: This assumes that the given SolutionSet and Predicate have been
independently validated using solution::check_set
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_indexrepresents the solution withinsolution_set.solutionsthat claims to solve this predicate.
Returns the total gas spent.