Trait t3rn_primitives::threevm::AddressMapping
source · pub trait AddressMapping<AccountId> {
// Required methods
fn into_account_id(evm: &EvmAddress) -> AccountId;
fn get_evm_address(account_id: &AccountId) -> Option<EvmAddress>;
fn get_or_create_evm_address(account_id: &AccountId) -> EvmAddress;
fn get_default_evm_address(account_id: &AccountId) -> EvmAddress;
fn is_linked(account_id: &AccountId, evm: &EvmAddress) -> bool;
}
Expand description
A mapping between AccountId
and EvmAddress
.
Required Methods§
sourcefn into_account_id(evm: &EvmAddress) -> AccountId
fn into_account_id(evm: &EvmAddress) -> AccountId
Returns the AccountId used go generate the given EvmAddress.
sourcefn get_evm_address(account_id: &AccountId) -> Option<EvmAddress>
fn get_evm_address(account_id: &AccountId) -> Option<EvmAddress>
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.
sourcefn get_or_create_evm_address(account_id: &AccountId) -> EvmAddress
fn get_or_create_evm_address(account_id: &AccountId) -> EvmAddress
Returns the EVM address associated with an account ID and generates an account mapping if no association exists.
sourcefn get_default_evm_address(account_id: &AccountId) -> EvmAddress
fn get_default_evm_address(account_id: &AccountId) -> EvmAddress
Returns the default EVM address associated with an account ID.
sourcefn is_linked(account_id: &AccountId, evm: &EvmAddress) -> bool
fn is_linked(account_id: &AccountId, evm: &EvmAddress) -> bool
Returns true if a given AccountId is associated with a given EvmAddress and false if is not.