aztec-nr - noir_aztec::authwit::account

Struct AccountActions

pub struct AccountActions<Context>
{ /* private fields */ }

Implementations

impl<Context> AccountActions<Context>

pub fn init( context: Context, is_valid_impl: fn(&mut PrivateContext, Field) -> bool, ) -> Self

impl AccountActions<&mut PrivateContext>

pub fn entrypoint( self, app_payload: AppPayload, fee_payload: FeePayload, cancellable: bool, )

Verifies that the app_hash and fee_hash are authorized and then executes them.

Executes the fee_payload and app_payload in sequence. Will execute the fee_payload as part of the setup, and then enter the app phase.

@param app_payload The payload that contains the calls to be executed in the app phase. @param fee_payload The payload that contains the calls to be executed in the setup phase.

pub fn verify_private_authwit(self, inner_hash: Field) -> Field

Verifies that the msg_sender is authorized to consume inner_hash by the account.

Computes the message_hash using the msg_sender, chain_id, version and inner_hash. Then executes the is_valid_impl function to verify that the message is authorized.

Will revert if the message is not authorized.

@param inner_hash The hash of the message that the msg_sender is trying to consume.