mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 00:37:57 +00:00
b3841b6b71
Adding on top of the new builder pattern for creating XCM programs, I'm adding some more APIs: ```rust let paying_fees: Xcm<()> = Xcm::builder() // Only allow paying for fees .withdraw_asset() // First instruction has to load the holding register .buy_execution() // Second instruction has to be `buy_execution` .build(); let paying_fees_invalid: Xcm<()> = Xcm::builder() .withdraw_asset() .build(); // Invalid, need to pay for fees let not_paying_fees: Xcm<()> = Xcm::builder_unpaid() .unpaid_execution() // Needed .withdraw_asset() .deposit_asset() .build(); let all_goes: Xcm<()> = Xcm::builder_unsafe() // You can do anything .withdraw_asset() .deposit_asset() .build(); ``` The invalid bits are because the methods don't even exist on the types that you'd want to call them on. --------- Co-authored-by: command-bot <>
25 lines
829 B
Plaintext
25 lines
829 B
Plaintext
# Schema: Parity PR Documentation Schema (prdoc)
|
|
# See doc at https://github.com/paritytech/prdoc
|
|
|
|
title: Different builder pattern constructors for XCM
|
|
|
|
doc:
|
|
- audience: Core Dev
|
|
description: |
|
|
The `builder()` constructor for XCM programs now only allows building messages that pay for fees,
|
|
i.e. messages that would pass the `AllowTopLevelPaidExecutionFrom` barrier.
|
|
Another constructor, `builder_unpaid()` requires an explicit `UnpaidExecution` instruction before
|
|
anything else.
|
|
For building messages without any restriction, `builder_unsafe` can be used.
|
|
This has been named like that since in general the other two should be used instead, but it's okay
|
|
to use it for teaching purposes or for experimenting.
|
|
|
|
migrations:
|
|
db: []
|
|
|
|
runtime: []
|
|
|
|
crates: []
|
|
|
|
host_functions: []
|