diff --git a/Cargo.toml b/Cargo.toml index b13062e82f..645317cb4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -278,7 +278,7 @@ pallet-xc-asset-config = { path = "./pallets/xc-asset-config", default-features pallet-xvm = { path = "./pallets/xvm", default-features = false } pallet-xcm = { path = "./pallets/pallet-xcm", default-features = false } pallet-ethereum-checked = { path = "./pallets/ethereum-checked", default-features = false } -pallet-unified-accounts = { path = "./pallets/account", default-features = false } +pallet-unified-accounts = { path = "./pallets/unified-accounts", default-features = false } astar-primitives = { path = "./primitives", default-features = false } diff --git a/pallets/account/Cargo.toml b/pallets/unified-accounts/Cargo.toml similarity index 100% rename from pallets/account/Cargo.toml rename to pallets/unified-accounts/Cargo.toml diff --git a/pallets/account/src/benchmarking.rs b/pallets/unified-accounts/src/benchmarking.rs similarity index 100% rename from pallets/account/src/benchmarking.rs rename to pallets/unified-accounts/src/benchmarking.rs diff --git a/pallets/account/src/impls.rs b/pallets/unified-accounts/src/impls.rs similarity index 100% rename from pallets/account/src/impls.rs rename to pallets/unified-accounts/src/impls.rs diff --git a/pallets/account/src/lib.rs b/pallets/unified-accounts/src/lib.rs similarity index 100% rename from pallets/account/src/lib.rs rename to pallets/unified-accounts/src/lib.rs diff --git a/pallets/account/src/mock.rs b/pallets/unified-accounts/src/mock.rs similarity index 100% rename from pallets/account/src/mock.rs rename to pallets/unified-accounts/src/mock.rs diff --git a/pallets/account/src/tests.rs b/pallets/unified-accounts/src/tests.rs similarity index 95% rename from pallets/account/src/tests.rs rename to pallets/unified-accounts/src/tests.rs index 888afd2f3f..30f3c40eb2 100644 --- a/pallets/account/src/tests.rs +++ b/pallets/unified-accounts/src/tests.rs @@ -102,13 +102,15 @@ fn static_lookup_works() { // mapping should work if available assert_eq!( - ::lookup(MultiAddress::Address20(alice_eth.into())).unwrap(), + ::lookup(MultiAddress::Address20(alice_eth.into())) + .unwrap(), ALICE ); // should use default if not mapping assert_eq!( - ::lookup(MultiAddress::Address20(bob_eth.into())).unwrap(), + ::lookup(MultiAddress::Address20(bob_eth.into())) + .unwrap(), bob_default_account_id ); }); @@ -235,13 +237,15 @@ fn account_default_claim_works() { ::DefaultAccountMapping::into_h160(ALICE.into()); // claim default account - assert_ok!(UnifiedAccounts::claim_default_evm_address(RuntimeOrigin::signed( - ALICE - ))); - System::assert_last_event(RuntimeEvent::UnifiedAccounts(crate::Event::AccountClaimed { - account_id: ALICE.clone(), - evm_address: alice_default_evm.clone(), - })); + assert_ok!(UnifiedAccounts::claim_default_evm_address( + RuntimeOrigin::signed(ALICE) + )); + System::assert_last_event(RuntimeEvent::UnifiedAccounts( + crate::Event::AccountClaimed { + account_id: ALICE.clone(), + evm_address: alice_default_evm.clone(), + }, + )); // check UnifiedAddressMapper's mapping works assert_eq!( diff --git a/tests/integration/src/setup.rs b/tests/integration/src/setup.rs index 5f5f5c2758..97d0b74fc9 100644 --- a/tests/integration/src/setup.rs +++ b/tests/integration/src/setup.rs @@ -23,8 +23,8 @@ pub use frame_support::{ traits::{OnFinalize, OnIdle, OnInitialize}, weights::Weight, }; -pub use pallet_unified_accounts::UnifiedAddressMapper; pub use pallet_evm::AddressMapping; +pub use pallet_unified_accounts::UnifiedAddressMapper; pub use sp_core::{H160, H256, U256}; pub use sp_runtime::{AccountId32, MultiAddress}; @@ -108,9 +108,9 @@ mod shibuya { pub fn claim_default_accounts(account: AccountId) { let default_h160 = UnifiedAccounts::to_default_h160(&account); - assert_ok!(UnifiedAccounts::claim_default_evm_address(RuntimeOrigin::signed( - account.clone() - ))); + assert_ok!(UnifiedAccounts::claim_default_evm_address( + RuntimeOrigin::signed(account.clone()) + )); assert_eq!(UnifiedAccounts::to_h160(&account).unwrap(), default_h160); } }