mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 01:47:55 +00:00
0524aa51d3
Added a proc macro to be able to write XCMs using the builder pattern.
This means we go from having to do this:
```rust
let message: Xcm<()> = Xcm(vec![
WithdrawAsset(assets),
BuyExecution { fees: asset, weight_limit: Unlimited },
DepositAsset { assets, beneficiary },
]);
```
to this:
```rust
let message: Xcm<()> = Xcm::builder()
.withdraw_asset(assets)
.buy_execution(asset, Unlimited),
.deposit_asset(assets, beneficiary)
.build();
```
---------
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: command-bot <>
25 lines
498 B
Plaintext
25 lines
498 B
Plaintext
# Schema: Parity PR Documentation Schema (prdoc)
|
|
# See doc at https://github.com/paritytech/prdoc
|
|
|
|
title: Add a builder pattern to create XCM programs
|
|
|
|
doc:
|
|
- audience: Core Dev
|
|
description: |
|
|
XCMs can now be built using a builder pattern like so:
|
|
Xcm::builder()
|
|
.withdraw_asset(assets)
|
|
.buy_execution(fees, weight_limit)
|
|
.deposit_asset(assets, beneficiary)
|
|
.build();
|
|
|
|
migrations:
|
|
db: []
|
|
|
|
runtime: []
|
|
|
|
crates:
|
|
- name: xcm
|
|
|
|
host_functions: []
|