fp_evm

Trait AccountProvider

Source
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§

Source

type AccountId

The account identifier type.

Represent the account itself in accounts records.

Source

type Nonce: AtLeast32Bit

Account nonce type.

The number that helps to ensure that each transaction in the network is unique for particular account.

Required Methods§

Source

fn create_account(who: &Self::AccountId)

Creates a new account in accounts records.

The account associated with new created address EVM.

Source

fn remove_account(who: &Self::AccountId)

Removes an account from accounts records.

The account associated with removed address from EVM.

Source

fn account_nonce(who: &Self::AccountId) -> Self::Nonce

Return current account nonce value.

Used to represent account basic information in EVM format.

Source

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.

Implementors§