WalletTrait

Trait WalletTrait 

Source
pub trait WalletTrait {
    type Error: From<StdError>;

    // Required methods
    fn info(&self, ctx: QueryCtx<'_>) -> Result<WalletInfo, StdError>;
    fn data(
        &self,
        ctx: QueryCtx<'_>,
        key: Binary,
    ) -> Result<Option<Binary>, StdError>;
    fn controller_rotation(
        &self,
        ctx: ExecCtx<'_>,
        new_controller: Controller,
    ) -> Result<Response, Self::Error>;
    fn auth_exec(
        &self,
        ctx: ExecCtx<'_>,
        transaction: RelayTransaction,
    ) -> Result<Response, Self::Error>;
    fn auth_exec_without_plugins(
        &self,
        ctx: ExecCtx<'_>,
        transaction: RelayTransaction,
    ) -> Result<Response, Self::Error>;
    fn controller_nonce_update(
        &self,
        ctx: ExecCtx<'_>,
    ) -> Result<Response, Self::Error>;
    fn update_data(
        &self,
        ctx: ExecCtx<'_>,
        data: Vec<(Binary, Option<Binary>)>,
    ) -> Result<Response, Self::Error>;
}
Expand description

The trait for each authenticator contract

Required Associated Types§

Required Methods§

Source

fn info(&self, ctx: QueryCtx<'_>) -> Result<WalletInfo, StdError>

Returns the wallet info

Source

fn data( &self, ctx: QueryCtx<'_>, key: Binary, ) -> Result<Option<Binary>, StdError>

Returns the data given the key

Source

fn controller_rotation( &self, ctx: ExecCtx<'_>, new_controller: Controller, ) -> Result<Response, Self::Error>

Permission: contract self (controller / plugins)

Source

fn auth_exec( &self, ctx: ExecCtx<'_>, transaction: RelayTransaction, ) -> Result<Response, Self::Error>

Permission: Open Main exec function and checks for auth from controller

Source

fn auth_exec_without_plugins( &self, ctx: ExecCtx<'_>, transaction: RelayTransaction, ) -> Result<Response, Self::Error>

Permission: Open This allows for exec of tx without called any plugins. Allowing for the removal of faulty plugins on the proxy wallet

Source

fn controller_nonce_update( &self, ctx: ExecCtx<'_>, ) -> Result<Response, Self::Error>

Permission: factory This is used by the factory in the case the wallet migrates

Source

fn update_data( &self, ctx: ExecCtx<'_>, data: Vec<(Binary, Option<Binary>)>, ) -> Result<Response, Self::Error>

Permission: Controller Updates the data stored (auto replace existing)

Implementors§