diff --git a/chain-extensions/unified-accounts/src/lib.rs b/chain-extensions/unified-accounts/src/lib.rs index b4c60a18af..57d73a9922 100644 --- a/chain-extensions/unified-accounts/src/lib.rs +++ b/chain-extensions/unified-accounts/src/lib.rs @@ -58,14 +58,14 @@ where GetEvmAddress => { let account_id: T::AccountId = env.read_as()?; // charge weight - env.charge_weight(UAWeight::::uam_to_h160())?; + env.charge_weight(UAWeight::::to_h160())?; // write to buffer UA::to_h160(&account_id).using_encoded(|r| env.write(r, false, None))?; } GetEvmAddressOrDefault => { let account_id: T::AccountId = env.read_as()?; // charge weight - env.charge_weight(UAWeight::::uam_to_h160_or_default())?; + env.charge_weight(UAWeight::::to_h160_or_default())?; let evm_address = if let Some(h160) = UA::to_h160(&account_id) { UnifiedAddress::Mapped(h160) @@ -78,14 +78,14 @@ where GetNativeAddress => { let evm_address: EvmAddress = env.read_as()?; // charge weight - env.charge_weight(UAWeight::::uam_to_account_id())?; + env.charge_weight(UAWeight::::to_account_id())?; // write to buffer UA::to_account_id(&evm_address).using_encoded(|r| env.write(r, false, None))?; } GetNativeAddressOrDefault => { let evm_address: EvmAddress = env.read_as()?; // charge weight - env.charge_weight(UAWeight::::uam_to_account_id_or_default())?; + env.charge_weight(UAWeight::::to_account_id_or_default())?; // read the storage item let native_address = if let Some(native) = UA::to_account_id(&evm_address) { diff --git a/chain-extensions/xvm/src/lib.rs b/chain-extensions/xvm/src/lib.rs index 6fb194bedc..ac232e4cc0 100644 --- a/chain-extensions/xvm/src/lib.rs +++ b/chain-extensions/xvm/src/lib.rs @@ -100,7 +100,7 @@ where if value > 0 { // `UA::to_h160`. actual_weight.saturating_accrue( - ::WeightInfo::uam_to_h160(), + ::WeightInfo::to_h160(), ); if UA::to_h160(&source).is_none() { diff --git a/pallets/unified-accounts/src/benchmarking.rs b/pallets/unified-accounts/src/benchmarking.rs index f40dbc31ce..bec5f65d59 100644 --- a/pallets/unified-accounts/src/benchmarking.rs +++ b/pallets/unified-accounts/src/benchmarking.rs @@ -85,7 +85,7 @@ mod benchmarks { } #[benchmark] - fn uam_to_account_id() { + fn to_account_id() { let caller: T::AccountId = whitelisted_caller(); let evm_address = T::DefaultNativeToEvm::into_h160(caller.clone()); // claim mapping @@ -100,7 +100,7 @@ mod benchmarks { } #[benchmark] - fn uam_to_account_id_or_default() { + fn to_account_id_or_default() { let caller: T::AccountId = whitelisted_caller(); let evm_address = T::DefaultNativeToEvm::into_h160(caller.clone()); // claim mapping @@ -117,7 +117,7 @@ mod benchmarks { } #[benchmark] - fn uam_to_h160() { + fn to_h160() { let caller: T::AccountId = whitelisted_caller(); // claim mapping assert_ok!(Pallet::::claim_default_evm_address( @@ -131,7 +131,7 @@ mod benchmarks { } #[benchmark] - fn uam_to_h160_or_default() { + fn to_h160_or_default() { let caller: T::AccountId = whitelisted_caller(); // claim mapping assert_ok!(Pallet::::claim_default_evm_address( diff --git a/pallets/unified-accounts/src/weights.rs b/pallets/unified-accounts/src/weights.rs index 4838a8d0e4..6b0602a59d 100644 --- a/pallets/unified-accounts/src/weights.rs +++ b/pallets/unified-accounts/src/weights.rs @@ -51,10 +51,10 @@ use core::marker::PhantomData; pub trait WeightInfo { fn claim_evm_address() -> Weight; fn claim_default_evm_address() -> Weight; - fn uam_to_account_id() -> Weight; - fn uam_to_account_id_or_default() -> Weight; - fn uam_to_h160() -> Weight; - fn uam_to_h160_or_default() -> Weight; + fn to_account_id() -> Weight; + fn to_account_id_or_default() -> Weight; + fn to_h160() -> Weight; + fn to_h160_or_default() -> Weight; } /// Weights for pallet_unified_accounts using the Substrate node and recommended hardware. @@ -94,7 +94,7 @@ impl WeightInfo for SubstrateWeight { } /// Storage: UnifiedAccounts EvmToNative (r:1 w:0) /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) - fn uam_to_account_id() -> Weight { + fn to_account_id() -> Weight { // Proof Size summary in bytes: // Measured: `170` // Estimated: `3533` @@ -104,7 +104,7 @@ impl WeightInfo for SubstrateWeight { } /// Storage: UnifiedAccounts EvmToNative (r:1 w:0) /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) - fn uam_to_account_id_or_default() -> Weight { + fn to_account_id_or_default() -> Weight { // Proof Size summary in bytes: // Measured: `170` // Estimated: `3533` @@ -114,7 +114,7 @@ impl WeightInfo for SubstrateWeight { } /// Storage: UnifiedAccounts NativeToEvm (r:1 w:0) /// Proof: UnifiedAccounts NativeToEvm (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) - fn uam_to_h160() -> Weight { + fn to_h160() -> Weight { // Proof Size summary in bytes: // Measured: `170` // Estimated: `3533` @@ -124,7 +124,7 @@ impl WeightInfo for SubstrateWeight { } /// Storage: UnifiedAccounts NativeToEvm (r:1 w:0) /// Proof: UnifiedAccounts NativeToEvm (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) - fn uam_to_h160_or_default() -> Weight { + fn to_h160_or_default() -> Weight { // Proof Size summary in bytes: // Measured: `170` // Estimated: `3533` @@ -170,7 +170,7 @@ impl WeightInfo for () { } /// Storage: UnifiedAccounts EvmToNative (r:1 w:0) /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) - fn uam_to_account_id() -> Weight { + fn to_account_id() -> Weight { // Proof Size summary in bytes: // Measured: `170` // Estimated: `3533` @@ -180,7 +180,7 @@ impl WeightInfo for () { } /// Storage: UnifiedAccounts EvmToNative (r:1 w:0) /// Proof: UnifiedAccounts EvmToNative (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) - fn uam_to_account_id_or_default() -> Weight { + fn to_account_id_or_default() -> Weight { // Proof Size summary in bytes: // Measured: `170` // Estimated: `3533` @@ -190,7 +190,7 @@ impl WeightInfo for () { } /// Storage: UnifiedAccounts NativeToEvm (r:1 w:0) /// Proof: UnifiedAccounts NativeToEvm (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) - fn uam_to_h160() -> Weight { + fn to_h160() -> Weight { // Proof Size summary in bytes: // Measured: `170` // Estimated: `3533` @@ -200,7 +200,7 @@ impl WeightInfo for () { } /// Storage: UnifiedAccounts NativeToEvm (r:1 w:0) /// Proof: UnifiedAccounts NativeToEvm (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) - fn uam_to_h160_or_default() -> Weight { + fn to_h160_or_default() -> Weight { // Proof Size summary in bytes: // Measured: `170` // Estimated: `3533`