pub trait AddressMapping<AccountId> {
    // Required methods
    fn into_account_id(evm: &H160) -> AccountId;
    fn get_evm_address(account_id: &AccountId) -> Option<H160>;
    fn get_or_create_evm_address(account_id: &AccountId) -> H160;
    fn get_default_evm_address(account_id: &AccountId) -> H160;
    fn is_linked(account_id: &AccountId, evm: &H160) -> bool;
}
Expand description

A mapping between AccountId and EvmAddress.

Required Methods§

fn into_account_id(evm: &H160) -> AccountId

Returns the AccountId used go generate the given EvmAddress.

fn get_evm_address(account_id: &AccountId) -> Option<H160>

Returns the EvmAddress associated with a given AccountId or the underlying EvmAddress of the AccountId. Returns None if there is no EvmAddress associated with the AccountId and there is no underlying EvmAddress in the AccountId.

fn get_or_create_evm_address(account_id: &AccountId) -> H160

Returns the EVM address associated with an account ID and generates an account mapping if no association exists.

fn get_default_evm_address(account_id: &AccountId) -> H160

Returns the default EVM address associated with an account ID.

fn is_linked(account_id: &AccountId, evm: &H160) -> bool

Returns true if a given AccountId is associated with a given EvmAddress and false if is not.

Implementors§