pub trait UnifiedAddressMapper<AccountId> {
    // Required methods
    fn to_account_id(evm_address: &EvmAddress) -> Option<AccountId>;
    fn to_default_account_id(evm_address: &EvmAddress) -> AccountId;
    fn to_h160(account_id: &AccountId) -> Option<EvmAddress>;
    fn to_default_h160(account_id: &AccountId) -> EvmAddress;

    // Provided methods
    fn to_account_id_or_default(
        evm_address: &EvmAddress
    ) -> UnifiedAddress<AccountId> { ... }
    fn to_h160_or_default(account_id: &AccountId) -> UnifiedAddress<H160> { ... }
}
Expand description

Mapping between Native and EVM Addresses

Required Methods§

source

fn to_account_id(evm_address: &EvmAddress) -> Option<AccountId>

Gets the account id associated with given evm address, if mapped else None.

source

fn to_default_account_id(evm_address: &EvmAddress) -> AccountId

Gets the default account id which is associated with given evm address.

source

fn to_h160(account_id: &AccountId) -> Option<EvmAddress>

Gets the evm address associated with given account id, if mapped else None.

source

fn to_default_h160(account_id: &AccountId) -> EvmAddress

Gets the default evm address which is associated with given account id.

Provided Methods§

source

fn to_account_id_or_default( evm_address: &EvmAddress ) -> UnifiedAddress<AccountId>

Gets the account id associated with given evm address. If no mapping exists, then return the default evm address. Returns UnifiedAddress enum which wraps the inner account id

source

fn to_h160_or_default(account_id: &AccountId) -> UnifiedAddress<H160>

Gets the evm address associated with given account id. If no mapping exists, then return the default account id. Returns UnifiedAddress enum which wraps the inner evm address

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<H: Hasher<Out = H256>> UnifiedAddressMapper<<<MultiSignature as Verify>::Signer as IdentifyAccount>::AccountId> for HashedDefaultMappings<H>