forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow clear_origin in safe xcm builder (paritytech#4777)
Fixes paritytech#3770 Added `clear_origin` as an allowed command after commands that load the holdings register, in the safe xcm builder. Checklist - [x] My PR includes a detailed description as outlined in the "Description" section above - [x] My PR follows the [labeling requirements](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md#Process) of this project (at minimum one label for T required) - [x] I have made corresponding changes to the documentation (if applicable) - [x] I have added tests that prove my fix is effective or that my feature works (if applicable) --------- Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com> Co-authored-by: gupnik <mail.guptanikhil@gmail.com>
- Loading branch information
1 parent
3a0bc2c
commit f07463e
Showing
3 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 | ||
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json | ||
|
||
title: XCM builder pattern allows clear_origin before buy_execution. | ||
|
||
doc: | ||
- audience: Runtime Dev | ||
description: | | ||
Added clear_origin as an allowed command after commands that load the holdings register, in the safe xcm builder. | ||
Previously, although it's logically allowed, an XCM could not be built like this: | ||
```rust | ||
let xcm = Xcm::builder() | ||
.withdraw_asset((Parent, 100u128)) | ||
.clear_origin() | ||
.buy_execution((Parent, 1u128)) | ||
.deposit_asset(All, [0u8; 32]) | ||
.build(); | ||
``` | ||
You had to use the unsafe_builder. | ||
Now, it's allowed using the default builder. | ||
|
||
crates: | ||
- name: "xcm-procedural" | ||
bump: minor | ||
- name: "staging-xcm" | ||
bump: minor | ||
|