Trait ZkappHandler

Source
pub trait ZkappHandler {
    type Z: ZkappApplication;
    type AccountUpdate: AccountUpdateInterface;
    type Account: AccountInterface;
    type Bool: BoolInterface;
    type W: WitnessGenerator<Fp>;
    type GlobalState: GlobalStateInterface;

    // Required methods
    fn check_account_precondition(
        account_update: &Self::AccountUpdate,
        account: &Self::Account,
        new_account: Self::Bool,
        local_state: &mut LocalState<Self::Z>,
        w: &mut Self::W,
    );
    fn check_protocol_state_precondition(
        protocol_state_predicate: &ZkAppPreconditions,
        global_state: &mut Self::GlobalState,
        w: &mut Self::W,
    ) -> Self::Bool;
    fn check_valid_while_precondition(
        valid_while: &Numeric<Slot>,
        global_state: &mut Self::GlobalState,
        w: &mut Self::W,
    ) -> Self::Bool;
    fn init_account(
        account_update: &Self::AccountUpdate,
        account: Self::Account,
    ) -> Self::Account;
}

Required Associated Types§

Required Methods§

Source

fn check_account_precondition( account_update: &Self::AccountUpdate, account: &Self::Account, new_account: Self::Bool, local_state: &mut LocalState<Self::Z>, w: &mut Self::W, )

Source

fn check_protocol_state_precondition( protocol_state_predicate: &ZkAppPreconditions, global_state: &mut Self::GlobalState, w: &mut Self::W, ) -> Self::Bool

Source

fn check_valid_while_precondition( valid_while: &Numeric<Slot>, global_state: &mut Self::GlobalState, w: &mut Self::W, ) -> Self::Bool

Source

fn init_account( account_update: &Self::AccountUpdate, account: Self::Account, ) -> Self::Account

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§