1- extern crate alloc;
2- use alloc:: sync:: Arc ;
3-
41use crate :: {
52 asset_hub, polimec, AssetHubEvent , AssetHubOrigin , AssetHubRuntime , AssetHubWestendNet , AssetHubXcmPallet ,
63 PolimecAccountId , PolimecEvent , PolimecNet , PolimecRuntime , ALICE ,
7- } ; // Make sure ALICE and BOB are pub in accounts
4+ } ;
85use parity_scale_codec:: Encode ;
96use sp_runtime:: traits:: Hash ;
10- use xcm:: { v4:: prelude:: * , DoubleEncoded } ;
7+ use xcm:: { v4:: prelude:: * , DoubleEncoded , VersionedLocation , VersionedXcm } ;
118use xcm_emulator:: { Chain , ConvertLocation , TestExt } ;
129
1310fn polimec_location ( ) -> Location {
@@ -28,14 +25,10 @@ fn transact_from_asset_hub_to_polimec_works() {
2825
2926 AssetHubXcmPallet :: send (
3027 AssetHubOrigin :: signed ( AssetHubWestendNet :: account_id_of ( ALICE ) ) ,
31- Box :: new ( xcm :: VersionedLocation :: V4 ( polimec_location ( ) ) ) ,
32- Box :: new ( xcm :: VersionedXcm :: V4 ( Xcm ( vec ! [
28+ Box :: new ( VersionedLocation :: V4 ( polimec_location ( ) ) ) ,
29+ Box :: new ( VersionedXcm :: V4 ( Xcm ( vec ! [
3330 Instruction :: BuyExecution {
34- fees: Asset {
35- id: Location { parents: 1 , interior: Here . into( ) } . into( ) ,
36- fun: Fungibility :: Fungible ( 1_000_000_000 ) ,
37- }
38- . into( ) ,
31+ fees: Asset { id: Location :: parent( ) . into( ) , fun: Fungibility :: Fungible ( 1_000_000_000 ) } . into( ) ,
3932 weight_limit: WeightLimit :: Unlimited ,
4033 } ,
4134 Instruction :: Transact {
@@ -66,12 +59,11 @@ fn transact_from_asset_hub_to_polimec_works() {
6659 let sender_sovereign_account: PolimecAccountId =
6760 polimec_runtime:: xcm_config:: LocationToAccountId :: convert_location ( & Location {
6861 parents : 1 ,
69- interior : Junctions :: X2 ( Arc :: new ( [
70- Parachain ( asset_hub:: PARA_ID ) ,
71- AccountId32 { network : None , id : alice_westend. encode ( ) [ ..] . try_into ( ) . unwrap ( ) } ,
72- ] ) ) ,
62+ interior : Junctions :: X2 (
63+ [ Parachain ( asset_hub:: PARA_ID ) , AccountId32 { network : None , id : alice_westend. into ( ) } ] . into ( ) ,
64+ ) ,
7365 } )
74- . expect ( "Failed to convert location to account id " ) ;
66+ . expect ( "Failed to convert Location to AccountId32 " ) ;
7567
7668 let expected_hash = <AssetHubRuntime as frame_system:: Config >:: Hashing :: hash ( & MESSAGE ) ;
7769
@@ -84,6 +76,6 @@ fn transact_from_asset_hub_to_polimec_works() {
8476 )
8577 } ) ;
8678
87- assert ! ( contains_remark, "Expected a remark event in PolimecNet events" ) ;
79+ assert ! ( contains_remark, "Expected a remark event in Polimec events" ) ;
8880 } ) ;
8981}
0 commit comments