Trait astar_primitives::evm::UnifiedAddressMapper
source · 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§
sourcefn to_account_id(evm_address: &EvmAddress) -> Option<AccountId>
fn to_account_id(evm_address: &EvmAddress) -> Option<AccountId>
Gets the account id associated with given evm address, if mapped else None.
sourcefn to_default_account_id(evm_address: &EvmAddress) -> AccountId
fn to_default_account_id(evm_address: &EvmAddress) -> AccountId
Gets the default account id which is associated with given evm address.
sourcefn to_h160(account_id: &AccountId) -> Option<EvmAddress>
fn to_h160(account_id: &AccountId) -> Option<EvmAddress>
Gets the evm address associated with given account id, if mapped else None.
sourcefn to_default_h160(account_id: &AccountId) -> EvmAddress
fn to_default_h160(account_id: &AccountId) -> EvmAddress
Gets the default evm address which is associated with given account id.
Provided Methods§
sourcefn to_account_id_or_default(
evm_address: &EvmAddress
) -> UnifiedAddress<AccountId>
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
sourcefn to_h160_or_default(account_id: &AccountId) -> UnifiedAddress<H160>
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.