relay_substrate_client/calls.rs
1// Copyright 2019-2023 Parity Technologies (UK) Ltd.
2// This file is part of Parity Bridges Common.
3
4// Parity Bridges Common is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8
9// Parity Bridges Common is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License
15// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
16
17//! Basic runtime calls.
18
19use codec::{Decode, Encode};
20use scale_info::TypeInfo;
21use sp_std::{boxed::Box, vec::Vec};
22
23use xcm::{VersionedLocation, VersionedXcm};
24
25/// A minimized version of `frame-system::Call` that can be used without a runtime.
26#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
27#[allow(non_camel_case_types)]
28pub enum SystemCall {
29 /// `frame-system::Call::remark`
30 #[codec(index = 1)]
31 remark(Vec<u8>),
32}
33
34/// A minimized version of `pallet-utility::Call` that can be used without a runtime.
35#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
36#[allow(non_camel_case_types)]
37pub enum UtilityCall<Call> {
38 /// `pallet-utility::Call::batch_all`
39 #[codec(index = 2)]
40 batch_all(Vec<Call>),
41}
42
43/// A minimized version of `pallet-sudo::Call` that can be used without a runtime.
44#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
45#[allow(non_camel_case_types)]
46pub enum SudoCall<Call> {
47 /// `pallet-sudo::Call::sudo`
48 #[codec(index = 0)]
49 sudo(Box<Call>),
50}
51
52/// A minimized version of `pallet-xcm::Call`, that can be used without a runtime.
53#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
54#[allow(non_camel_case_types)]
55pub enum XcmCall {
56 /// `pallet-xcm::Call::send`
57 #[codec(index = 0)]
58 send(Box<VersionedLocation>, Box<VersionedXcm<()>>),
59}