Skip to content

Commit

Permalink
feat: apply code suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutoshvarma committed Oct 23, 2023
1 parent 7a46c49 commit 880d595
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions chain-extensions/unified-accounts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use pallet_contracts::chain_extension::{
ChainExtension, Environment, Ext, InitState, Result as DispatchResult, RetVal,
};
use pallet_evm::AddressMapping;
use pallet_unified_accounts::{EvmToNative, NativeToEvm};
use parity_scale_codec::Encode;
pub use unified_accounts_chain_extension_types::Command::{self, *};

Expand Down Expand Up @@ -65,7 +64,7 @@ where
env.charge_weight(base_weight)?;

// read the storage item
let mapped = NativeToEvm::<T>::get(account_id.clone());
let mapped = UA::to_h160(&account_id);

let is_mapped = mapped.is_some();
let evm_address = mapped.unwrap_or_else(|| {
Expand All @@ -90,7 +89,7 @@ where
env.charge_weight(base_weight)?;

// read the storage item
let mapped = EvmToNative::<T>::get(evm_address.clone());
let mapped = UA::to_account_id(&evm_address);

let is_mapped = mapped.is_some();
let native_address = mapped.unwrap_or_else(|| {
Expand Down

0 comments on commit 880d595

Please sign in to comment.