Files
pezkuwi-subxt/polkadot/xcm/procedural/Cargo.toml
T
Francisco Aguirre 0524aa51d3 XCM builder pattern (#2107)
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 <>
2023-11-08 06:39:40 +01:00

21 lines
376 B
TOML

[package]
name = "xcm-procedural"
description = "Procedural macros for XCM"
authors.workspace = true
edition.workspace = true
license.workspace = true
version = "1.0.0"
publish = true
[lib]
proc-macro = true
[dependencies]
proc-macro2 = "1.0.56"
quote = "1.0.28"
syn = "2.0.38"
Inflector = "0.11.4"
[dev-dependencies]
trybuild = { version = "1.0.74", features = ["diff"] }