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 19, 2023
1 parent c5b1f07 commit 6744d84
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions chain-extensions/unified-accounts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ std = [
# Astar
"astar-primitives/std",
"pallet-unified-accounts/std",
"unified-accounts-chain-extension-types/std"
]
8 changes: 3 additions & 5 deletions pallets/unified-accounts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
use astar_primitives::{
ethereum_checked::AccountMapping,
evm::{EvmAddress, UnifiedAddressMapper},
Balance,
};
use frame_support::{
pallet_prelude::*,
Expand Down Expand Up @@ -101,9 +102,6 @@ mod tests;
/// ECDSA Signature type, with last bit for recovering address
type EvmSignature = [u8; 65];

type BalanceOf<T> =
<<T as Config>::Currency as FungibleInspect<<T as frame_system::Config>::AccountId>>::Balance;

#[frame_support::pallet]
pub mod pallet {
use super::*;
Expand All @@ -128,7 +126,7 @@ pub mod pallet {
/// Two storage items with values sizes, sizeof(AccountId) and sizeof(H160)
/// respectively
#[pallet::constant]
type AccountMappingStorageFee: Get<BalanceOf<Self>>;
type AccountMappingStorageFee: Get<Balance>;
/// Weight information for the extrinsics in this module
type WeightInfo: WeightInfo;
}
Expand Down Expand Up @@ -277,7 +275,7 @@ impl<T: Config> Pallet<T> {
}

/// Charge the (exact) storage fee (polietly) from the user and burn it
fn charge_storage_fee(who: &T::AccountId) -> Result<BalanceOf<T>, DispatchError> {
fn charge_storage_fee(who: &T::AccountId) -> Result<Balance, DispatchError> {
T::Currency::burn_from(who, T::AccountMappingStorageFee::get(), Exact, Polite)
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/src/unified_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn unified_accounts_chain_extension_works() {
//
connect_accounts(&ALICE, &alith_secret_key());

// ALICE mapped h160 address should alith
// ALICE mapped h160 address should be alith
assert_eq!(
call_wasm_contract_method::<Option<H160>>(
contract_id.clone(),
Expand Down

0 comments on commit 6744d84

Please sign in to comment.