diff --git a/polkadot/xcm/procedural/tests/builder_pattern.rs b/polkadot/xcm/procedural/tests/builder_pattern.rs index eab9d67121f6..a9a30611dc01 100644 --- a/polkadot/xcm/procedural/tests/builder_pattern.rs +++ b/polkadot/xcm/procedural/tests/builder_pattern.rs @@ -21,12 +21,12 @@ use xcm::latest::prelude::*; #[test] fn builder_pattern_works() { - let asset: MultiAsset = (Here, 100u128).into(); - let beneficiary: MultiLocation = AccountId32 { id: [0u8; 32], network: None }.into(); + let asset: Asset = (Here, 100u128).into(); + let beneficiary: Location = AccountId32 { id: [0u8; 32], network: None }.into(); let message: Xcm<()> = Xcm::builder() .receive_teleported_asset(asset.clone().into()) .buy_execution(asset.clone(), Unlimited) - .deposit_asset(asset.clone().into(), beneficiary) + .deposit_asset(asset.clone().into(), beneficiary.clone()) .build(); assert_eq!( message, @@ -40,8 +40,8 @@ fn builder_pattern_works() { #[test] fn default_builder_requires_buy_execution() { - let asset: MultiAsset = (Here, 100u128).into(); - let beneficiary: MultiLocation = AccountId32 { id: [0u8; 32], network: None }.into(); + let asset: Asset = (Here, 100u128).into(); + let beneficiary: Location = AccountId32 { id: [0u8; 32], network: None }.into(); // This is invalid, since it doesn't pay for fees. // This is enforced by the runtime, because the build() method doesn't exist // on the resulting type. @@ -54,14 +54,14 @@ fn default_builder_requires_buy_execution() { let message: Xcm<()> = Xcm::builder_unpaid() .unpaid_execution(Unlimited, None) .withdraw_asset(asset.clone().into()) - .deposit_asset(asset.clone().into(), beneficiary) + .deposit_asset(asset.clone().into(), beneficiary.clone()) .build(); // This works assert_eq!( message, Xcm(vec![ UnpaidExecution { weight_limit: Unlimited, check_origin: None }, WithdrawAsset(asset.clone().into()), - DepositAsset { assets: asset.clone().into(), beneficiary }, + DepositAsset { assets: asset.clone().into(), beneficiary: beneficiary.clone() }, ]) ); @@ -69,7 +69,7 @@ fn default_builder_requires_buy_execution() { // only be used when you really know what you're doing. let message: Xcm<()> = Xcm::builder_unsafe() .withdraw_asset(asset.clone().into()) - .deposit_asset(asset.clone().into(), beneficiary) + .deposit_asset(asset.clone().into(), beneficiary.clone()) .build(); assert_eq!( message, diff --git a/polkadot/xcm/src/v4/mod.rs b/polkadot/xcm/src/v4/mod.rs index 62f504f58318..cbb64c324843 100644 --- a/polkadot/xcm/src/v4/mod.rs +++ b/polkadot/xcm/src/v4/mod.rs @@ -362,7 +362,7 @@ impl XcmContext { /// /// This is the inner XCM format and is version-sensitive. Messages are typically passed using the /// outer XCM format, known as `VersionedXcm`. -#[derive(Derivative, Encode, Decode, TypeInfo, xcm_procedural::XcmWeightInfoTrait)] +#[derive(Derivative, Encode, Decode, TypeInfo, xcm_procedural::XcmWeightInfoTrait, xcm_procedural::Builder)] #[derivative(Clone(bound = ""), Eq(bound = ""), PartialEq(bound = ""), Debug(bound = ""))] #[codec(encode_bound())] #[codec(decode_bound())] @@ -376,6 +376,7 @@ pub enum Instruction { /// Kind: *Command*. /// /// Errors: + #[builder(loads_holding)] WithdrawAsset(Assets), /// Asset(s) (`assets`) have been received into the ownership of this system on the `origin` @@ -389,6 +390,7 @@ pub enum Instruction { /// Kind: *Trusted Indication*. /// /// Errors: + #[builder(loads_holding)] ReserveAssetDeposited(Assets), /// Asset(s) (`assets`) have been destroyed on the `origin` system and equivalent assets should @@ -402,6 +404,7 @@ pub enum Instruction { /// Kind: *Trusted Indication*. /// /// Errors: + #[builder(loads_holding)] ReceiveTeleportedAsset(Assets), /// Respond with information that the local system is expecting. @@ -726,6 +729,7 @@ pub enum Instruction { /// Kind: *Command* /// /// Errors: + #[builder(loads_holding)] ClaimAsset { assets: Assets, ticket: Location }, /// Always throws an error of type `Trap`.