Skip to content

Commit

Permalink
feat: update pallet directory name
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutoshvarma committed Sep 21, 2023
1 parent 2dbc09b commit f9014ed
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ fn static_lookup_works() {

// mapping should work if available
assert_eq!(
<UnifiedAccounts as StaticLookup>::lookup(MultiAddress::Address20(alice_eth.into())).unwrap(),
<UnifiedAccounts as StaticLookup>::lookup(MultiAddress::Address20(alice_eth.into()))
.unwrap(),
ALICE
);

// should use default if not mapping
assert_eq!(
<UnifiedAccounts as StaticLookup>::lookup(MultiAddress::Address20(bob_eth.into())).unwrap(),
<UnifiedAccounts as StaticLookup>::lookup(MultiAddress::Address20(bob_eth.into()))
.unwrap(),
bob_default_account_id
);
});
Expand Down Expand Up @@ -235,13 +237,15 @@ fn account_default_claim_works() {
<TestRuntime as Config>::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!(
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit f9014ed

Please sign in to comment.