chia-consensus 0.36.0

Utility functions and types used by the Chia blockchain full node
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::conditions::{Condition, ParseState, SpendBundleConditions, SpendConditions};
use crate::validation_error::ValidationErr;
use clvmr::allocator::Allocator;

/// These are customization points for the condition parsing and validation. The
/// mempool wants to record additional information than plain consensus
/// validation, so it hooks into these.
pub trait SpendVisitor {
    fn new_spend(spend: &mut SpendConditions) -> Self;
    fn condition(&mut self, spend: &mut SpendConditions, c: &Condition);
    fn post_spend(&mut self, a: &Allocator, spend: &mut SpendConditions);

    fn post_process(
        a: &Allocator,
        state: &ParseState,
        bundle: &mut SpendBundleConditions,
    ) -> Result<(), ValidationErr>;
}