pub trait AccountProvider {
type AccountId;
type Nonce: AtLeast32Bit;
// Required methods
fn create_account(who: &Self::AccountId);
fn remove_account(who: &Self::AccountId);
fn account_nonce(who: &Self::AccountId) -> Self::Nonce;
fn inc_account_nonce(who: &Self::AccountId);
}
Expand description
The account provider interface abstraction layer.
Expose account related logic that pallet_evm
required to control accounts existence
in the network and their transactions uniqueness. By default, the pallet operates native
system accounts records that frame_system
provides.
The interface allow any custom account provider logic to be used instead of
just using frame_system
account provider. The accounts records should store nonce value
for each account at least.
Required Associated Types§
Required Methods§
Sourcefn create_account(who: &Self::AccountId)
fn create_account(who: &Self::AccountId)
Creates a new account in accounts records.
The account associated with new created address EVM.
Sourcefn remove_account(who: &Self::AccountId)
fn remove_account(who: &Self::AccountId)
Removes an account from accounts records.
The account associated with removed address from EVM.
Sourcefn account_nonce(who: &Self::AccountId) -> Self::Nonce
fn account_nonce(who: &Self::AccountId) -> Self::Nonce
Return current account nonce value.
Used to represent account basic information in EVM format.
Sourcefn inc_account_nonce(who: &Self::AccountId)
fn inc_account_nonce(who: &Self::AccountId)
Increment a particular account’s nonce value.
Incremented with each new transaction submitted by the 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.