Skip to content
  • Francisco Aguirre's avatar
    XCM builder pattern (#2107) · 0524aa51
    Francisco Aguirre authored
    
    
    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: default avatarKeith Yeung <[email protected]>
    Co-authored-by: command-bot <>
    0524aa51