Struct sov_accounts::Accounts
source · pub struct Accounts<C: Context> {
pub address: C::Address,
/* private fields */
}
Expand description
A module responsible for managing accounts on the rollup.
Fields§
§address: C::Address
The address of the sov-accounts module.
Trait Implementations§
source§impl<C: Context> Module for Accounts<C>
impl<C: Context> Module for Accounts<C>
§type Config = AccountConfig<C>
type Config = AccountConfig<C>
Configuration for the genesis method.
§type CallMessage = CallMessage<C>
type CallMessage = CallMessage<C>
Module defined argument to the call method.
source§fn genesis(
&self,
config: &Self::Config,
working_set: &mut WorkingSet<C::Storage>
) -> Result<(), Error>
fn genesis( &self, config: &Self::Config, working_set: &mut WorkingSet<C::Storage> ) -> Result<(), Error>
Genesis is called when a rollup is deployed and can be used to set initial state values in the module.
source§fn call(
&self,
msg: Self::CallMessage,
context: &Self::Context,
working_set: &mut WorkingSet<C::Storage>
) -> Result<CallResponse, Error>
fn call( &self, msg: Self::CallMessage, context: &Self::Context, working_set: &mut WorkingSet<C::Storage> ) -> Result<CallResponse, Error>
Call allows interaction with the module and invokes state changes.
It takes a module defined type and a context as parameters.
source§impl<C: Context> TxHooks for Accounts<C>
impl<C: Context> TxHooks for Accounts<C>
type Context = C
source§fn pre_dispatch_tx_hook(
&self,
tx: &Transaction<C>,
working_set: &mut WorkingSet<<Self::Context as Spec>::Storage>
) -> Result<<Self::Context as Spec>::Address>
fn pre_dispatch_tx_hook( &self, tx: &Transaction<C>, working_set: &mut WorkingSet<<Self::Context as Spec>::Storage> ) -> Result<<Self::Context as Spec>::Address>
Runs just before a transaction is dispatched to an appropriate module.
TODO: Why does it return address?
Does it implies that it should do signature verification.
Can other code rely on that assumption?
source§fn post_dispatch_tx_hook(
&self,
tx: &Transaction<Self::Context>,
working_set: &mut WorkingSet<<Self::Context as Spec>::Storage>
) -> Result<()>
fn post_dispatch_tx_hook( &self, tx: &Transaction<Self::Context>, working_set: &mut WorkingSet<<Self::Context as Spec>::Storage> ) -> Result<()>
Runs after the tx is dispatched to an appropriate module.
IF this hook returns error rollup panics
Auto Trait Implementations§
impl<C> RefUnwindSafe for Accounts<C>where <C as Spec>::Address: RefUnwindSafe, <C as Spec>::PublicKey: RefUnwindSafe,
impl<C> Send for Accounts<C>
impl<C> Sync for Accounts<C>
impl<C> Unpin for Accounts<C>where <C as Spec>::Address: Unpin, <C as Spec>::PublicKey: Unpin,
impl<C> UnwindSafe for Accounts<C>where <C as Spec>::Address: UnwindSafe, <C as Spec>::PublicKey: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more