You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is no way of translating foreign consensus xcm origins to AccountIds. There are two scenarios at hand where this will be useful:
1. Transacting on Hydration from Kusama accounts
E.g. Adding KSM to Omnipool from Kusama treasury. It will be assigned the ownership of the LP position so it can trustlessly control it. But also any signed origin, parachain, etc. should be able to operate on Hydration remotely from Kusama.
2. BSX listing
Similar case as above, BSX can be listed from Basilisk treasury and controlled remotely via XCM.
Will be done via GlobalConsensusParachainConvertsFor once we upgrade to newer SDK.
#[test]fnassert_kusama_root_account(){// Initialize the Externalities environment
sp_io::TestExternalities::new_empty().execute_with(|| {let ksm_root_location = Location::new(2,[GlobalConsensus(Kusama)]);let ksm_root_account = GlobalConsensusConvertsFor::<UniversalLocation,AccountId>::convert_location(&ksm_root_location).expect("Failed to convert location");// // Example treasury account, replace with the actual expected valuelet expected_account = AccountId::from_ss58check("5G4KKqSKDkiMGiPzCQY12dSB15aBikyNQJL9VDmbMH4SxiWD").expect("Invalid SS58 address format");assert_eq!(ksm_root_account, expected_account);// // Example of a wrong accountlet wrong_account = AccountId::from_ss58check("5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY").expect("Invalid SS58 address format");assert_ne!(ksm_root_account, wrong_account);});}
The text was updated successfully, but these errors were encountered:
green-jay
changed the title
Add LocationToAccountId converter for GlobalConsensus(..) xcm origin
Add LocationToAccountId converter for GlobalConsensus(..)
Jan 10, 2025
Description
Currently there is no way of translating foreign consensus xcm origins to AccountIds. There are two scenarios at hand where this will be useful:
1. Transacting on Hydration from Kusama accounts
E.g. Adding KSM to Omnipool from Kusama treasury. It will be assigned the ownership of the LP position so it can trustlessly control it. But also any signed origin, parachain, etc. should be able to operate on Hydration remotely from Kusama.
2. BSX listing
Similar case as above, BSX can be listed from Basilisk treasury and controlled remotely via XCM.
Will be done via
GlobalConsensusParachainConvertsFor
once we upgrade to newer SDK.Tasklist:
Future work:
Auxiliary info
Relevant configuration:
hydration-node/runtime/hydradx/src/xcm.rs
Line 414 in 4c3a2d7
We could use/inspire by GlobalConsensusConvertsFor for Kusama and GlobalConsensusParachainConvertsFor for Parachains on Kusama.
Test snippet (failing currently, should pass):
The text was updated successfully, but these errors were encountered: