mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 22:51:03 +00:00
Contracts expose pallet-xcm (#1248)
This PR introduces: - XCM host functions `xcm_send`, `xcm_execute` - An Xcm trait into the config. that proxy these functions to to `pallet_xcm`, or disable their usage by using `()`. - A mock_network and xcm_test files to test the newly added xcm-related functions. --------- Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> Co-authored-by: Sasha Gryaznov <hi@agryaznov.com> Co-authored-by: command-bot <> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com> Co-authored-by: Alexander Theißen <alex.theissen@me.com>
This commit is contained in:
@@ -403,6 +403,14 @@ pub mod pallet {
|
||||
/// its type appears in the metadata. Only valid value is `()`.
|
||||
#[pallet::constant]
|
||||
type Environment: Get<Environment<Self>>;
|
||||
|
||||
/// A type that exposes XCM APIs, allowing contracts to interact with other parachains, and
|
||||
/// execute XCM programs.
|
||||
type Xcm: xcm_builder::Controller<
|
||||
OriginFor<Self>,
|
||||
<Self as frame_system::Config>::RuntimeCall,
|
||||
BlockNumberFor<Self>,
|
||||
>;
|
||||
}
|
||||
|
||||
#[pallet::hooks]
|
||||
@@ -1004,6 +1012,8 @@ pub mod pallet {
|
||||
/// in this error. Note that this usually shouldn't happen as deploying such contracts
|
||||
/// is rejected.
|
||||
NoChainExtension,
|
||||
/// Failed to decode the XCM program.
|
||||
XCMDecodeFailed,
|
||||
/// A contract with the same AccountId already exists.
|
||||
DuplicateContract,
|
||||
/// A contract self destructed in its constructor.
|
||||
|
||||
Reference in New Issue
Block a user