mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Statemine primitives (#1625)
* Statemine primitives * ref issue in TODO * fix TODO
This commit is contained in:
committed by
Bastian Köcher
parent
2c0b6b73e0
commit
3e00c5c022
@@ -24,13 +24,6 @@ use bp_runtime::decl_bridge_finality_runtime_apis;
|
||||
/// Kusama Chain
|
||||
pub type Kusama = PolkadotLike;
|
||||
|
||||
/// The target length of a session (how often authorities change) on Kusama measured in of number of
|
||||
/// blocks.
|
||||
///
|
||||
/// Note that since this is a target sessions may change before/after this time depending on network
|
||||
/// conditions.
|
||||
pub const SESSION_LENGTH: BlockNumber = time_units::HOURS;
|
||||
|
||||
/// Name of the With-Kusama GRANDPA pallet instance that is deployed at bridged chains.
|
||||
pub const WITH_KUSAMA_GRANDPA_PALLET_NAME: &str = "BridgeKusamaGrandpa";
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@ edition = "2021"
|
||||
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
smallvec = "1.7"
|
||||
|
||||
# Bridge Dependencies
|
||||
|
||||
bp-polkadot-core = { path = "../polkadot-core", default-features = false }
|
||||
|
||||
@@ -24,13 +24,6 @@ use bp_runtime::decl_bridge_finality_runtime_apis;
|
||||
/// Polkadot Chain
|
||||
pub type Polkadot = PolkadotLike;
|
||||
|
||||
/// The target length of a session (how often authorities change) on Polkadot measured in of number
|
||||
/// of blocks.
|
||||
///
|
||||
/// Note that since this is a target sessions may change before/after this time depending on network
|
||||
/// conditions.
|
||||
pub const SESSION_LENGTH: BlockNumber = 4 * time_units::HOURS;
|
||||
|
||||
/// Name of the With-Polkadot GRANDPA pallet instance that is deployed at bridged chains.
|
||||
pub const WITH_POLKADOT_GRANDPA_PALLET_NAME: &str = "BridgePolkadotGrandpa";
|
||||
|
||||
|
||||
@@ -24,13 +24,6 @@ use bp_runtime::decl_bridge_finality_runtime_apis;
|
||||
/// Rococo Chain
|
||||
pub type Rococo = PolkadotLike;
|
||||
|
||||
/// The target length of a session (how often authorities change) on Rococo measured in of number
|
||||
/// of blocks.
|
||||
///
|
||||
/// Note that since this is a target sessions may change before/after this time depending on network
|
||||
/// conditions.
|
||||
pub const SESSION_LENGTH: BlockNumber = time_units::HOURS;
|
||||
|
||||
/// Name of the With-Rococo GRANDPA pallet instance that is deployed at bridged chains.
|
||||
pub const WITH_ROCOCO_GRANDPA_PALLET_NAME: &str = "BridgeRococoGrandpa";
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
[package]
|
||||
name = "bp-statemine"
|
||||
description = "Primitives of Statemine runtime."
|
||||
version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
|
||||
# Bridge Dependencies
|
||||
|
||||
bp-polkadot-core = { path = "../polkadot-core", default-features = false }
|
||||
|
||||
# Substrate Based Dependencies
|
||||
|
||||
sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"bp-polkadot-core/std",
|
||||
"sp-version/std",
|
||||
]
|
||||
@@ -0,0 +1,38 @@
|
||||
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity Bridges Common.
|
||||
|
||||
// Parity Bridges Common is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity Bridges Common is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
// RuntimeApi generated functions
|
||||
#![allow(clippy::too_many_arguments)]
|
||||
|
||||
pub use bp_polkadot_core::*;
|
||||
|
||||
use sp_version::RuntimeVersion;
|
||||
|
||||
/// Statemine Chain.
|
||||
pub type Statemine = PolkadotLike;
|
||||
|
||||
/// Known Statemine runtime version.
|
||||
pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
spec_name: sp_version::create_runtime_str!("statemine"),
|
||||
impl_name: sp_version::create_runtime_str!("statemine"),
|
||||
authoring_version: 1,
|
||||
spec_version: 9300,
|
||||
impl_version: 0,
|
||||
apis: sp_version::create_apis_vec![[]],
|
||||
transaction_version: 8,
|
||||
state_version: 1,
|
||||
};
|
||||
@@ -7,8 +7,6 @@ edition = "2021"
|
||||
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
|
||||
# Bridge Dependencies
|
||||
|
||||
@@ -18,15 +16,11 @@ bp-runtime = { path = "../runtime", default-features = false }
|
||||
# Substrate Based Dependencies
|
||||
|
||||
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"bp-polkadot-core/std",
|
||||
"bp-runtime/std",
|
||||
"codec/std",
|
||||
"scale-info/std",
|
||||
"sp-api/std",
|
||||
"sp-runtime/std",
|
||||
]
|
||||
|
||||
@@ -18,34 +18,12 @@
|
||||
// RuntimeApi generated functions
|
||||
#![allow(clippy::too_many_arguments)]
|
||||
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
pub use bp_polkadot_core::*;
|
||||
use bp_runtime::decl_bridge_finality_runtime_apis;
|
||||
|
||||
/// Westend Chain
|
||||
pub type Westend = PolkadotLike;
|
||||
|
||||
/// Westend Runtime `Call` enum.
|
||||
///
|
||||
/// We are not currently submitting any Westend transactions => it is empty.
|
||||
#[derive(codec::Encode, codec::Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
|
||||
pub enum Call {}
|
||||
|
||||
impl sp_runtime::traits::Dispatchable for Call {
|
||||
type RuntimeOrigin = ();
|
||||
type Config = ();
|
||||
type Info = ();
|
||||
type PostInfo = ();
|
||||
|
||||
fn dispatch(
|
||||
self,
|
||||
_origin: Self::RuntimeOrigin,
|
||||
) -> sp_runtime::DispatchResultWithInfo<Self::PostInfo> {
|
||||
unimplemented!("The Call is not expected to be dispatched.")
|
||||
}
|
||||
}
|
||||
|
||||
/// Name of the parachains pallet at the Westend runtime.
|
||||
pub const PARAS_PALLET_NAME: &str = "Paras";
|
||||
|
||||
@@ -54,13 +32,6 @@ pub const WITH_WESTEND_GRANDPA_PALLET_NAME: &str = "BridgeWestendGrandpa";
|
||||
/// Name of the With-Westend parachains bridge pallet instance that is deployed at bridged chains.
|
||||
pub const WITH_WESTEND_BRIDGE_PARAS_PALLET_NAME: &str = "BridgeWestendParachains";
|
||||
|
||||
/// The target length of a session (how often authorities change) on Westend measured in of number
|
||||
/// of blocks.
|
||||
///
|
||||
/// Note that since this is a target sessions may change before/after this time depending on network
|
||||
/// conditions.
|
||||
pub const SESSION_LENGTH: BlockNumber = 10 * time_units::MINUTES;
|
||||
|
||||
/// Maximal number of GRANDPA authorities at Westend.
|
||||
///
|
||||
/// Corresponds to the `MaxAuthorities` constant value from the Westend runtime configuration.
|
||||
|
||||
@@ -24,13 +24,6 @@ use bp_runtime::decl_bridge_finality_runtime_apis;
|
||||
/// Wococo Chain
|
||||
pub type Wococo = PolkadotLike;
|
||||
|
||||
/// The target length of a session (how often authorities change) on Wococo measured in of number
|
||||
/// of blocks.
|
||||
///
|
||||
/// Note that since this is a target sessions may change before/after this time depending on network
|
||||
/// conditions.
|
||||
pub const SESSION_LENGTH: BlockNumber = time_units::MINUTES;
|
||||
|
||||
/// Name of the With-Wococo GRANDPA pallet instance that is deployed at bridged chains.
|
||||
pub const WITH_WOCOCO_GRANDPA_PALLET_NAME: &str = "BridgeWococoGrandpa";
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ bp-polkadot-core = { path = "../../primitives/polkadot-core" }
|
||||
bp-rialto = { path = "../../primitives/chain-rialto" }
|
||||
bp-rialto-parachain = { path = "../../primitives/chain-rialto-parachain" }
|
||||
bp-runtime = { path = "../../primitives/runtime" }
|
||||
bp-statemine = { path = "../../primitives/chain-statemine" }
|
||||
bp-westend = { path = "../../primitives/chain-westend" }
|
||||
bridge-runtime-common = { path = "../../bin/runtime-common" }
|
||||
messages-relay = { path = "../messages" }
|
||||
@@ -36,6 +37,7 @@ parachains-relay = { path = "../parachains" }
|
||||
relay-millau-client = { path = "../client-millau" }
|
||||
relay-rialto-client = { path = "../client-rialto" }
|
||||
relay-rialto-parachain-client = { path = "../client-rialto-parachain" }
|
||||
relay-statemine-client = { path = "../client-statemine" }
|
||||
relay-substrate-client = { path = "../client-substrate" }
|
||||
relay-utils = { path = "../utils" }
|
||||
relay-westend-client = { path = "../client-westend" }
|
||||
|
||||
@@ -93,7 +93,6 @@ impl CliChain for Millau {
|
||||
const RUNTIME_VERSION: Option<RuntimeVersion> = Some(millau_runtime::VERSION);
|
||||
|
||||
type KeyPair = sp_core::sr25519::Pair;
|
||||
type MessagePayload = Vec<u8>;
|
||||
|
||||
fn ss58_format() -> u16 {
|
||||
millau_runtime::SS58Prefix::get() as u16
|
||||
|
||||
@@ -30,6 +30,7 @@ pub mod westend_parachains_to_millau;
|
||||
mod millau;
|
||||
mod rialto;
|
||||
mod rialto_parachain;
|
||||
mod statemine;
|
||||
mod westend;
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -76,7 +76,6 @@ impl CliChain for Rialto {
|
||||
const RUNTIME_VERSION: Option<RuntimeVersion> = Some(rialto_runtime::VERSION);
|
||||
|
||||
type KeyPair = sp_core::sr25519::Pair;
|
||||
type MessagePayload = Vec<u8>;
|
||||
|
||||
fn ss58_format() -> u16 {
|
||||
rialto_runtime::SS58Prefix::get() as u16
|
||||
|
||||
@@ -79,7 +79,6 @@ impl CliChain for RialtoParachain {
|
||||
const RUNTIME_VERSION: Option<RuntimeVersion> = Some(rialto_parachain_runtime::VERSION);
|
||||
|
||||
type KeyPair = sp_core::sr25519::Pair;
|
||||
type MessagePayload = Vec<u8>;
|
||||
|
||||
fn ss58_format() -> u16 {
|
||||
rialto_parachain_runtime::SS58Prefix::get() as u16
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity Bridges Common.
|
||||
|
||||
// Parity Bridges Common is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity Bridges Common is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Statemine chain specification for CLI.
|
||||
|
||||
use crate::cli::CliChain;
|
||||
use relay_statemine_client::Statemine;
|
||||
use sp_version::RuntimeVersion;
|
||||
|
||||
impl CliChain for Statemine {
|
||||
const RUNTIME_VERSION: Option<RuntimeVersion> = Some(bp_statemine::VERSION);
|
||||
|
||||
type KeyPair = sp_core::sr25519::Pair;
|
||||
|
||||
fn ss58_format() -> u16 {
|
||||
sp_core::crypto::Ss58AddressFormat::from(
|
||||
sp_core::crypto::Ss58AddressFormatRegistry::KusamaAccount,
|
||||
)
|
||||
.into()
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,6 @@ impl CliChain for Westend {
|
||||
const RUNTIME_VERSION: Option<RuntimeVersion> = None;
|
||||
|
||||
type KeyPair = sp_core::sr25519::Pair;
|
||||
type MessagePayload = Vec<u8>;
|
||||
|
||||
fn ss58_format() -> u16 {
|
||||
sp_core::crypto::Ss58AddressFormat::from(
|
||||
@@ -38,7 +37,6 @@ impl CliChain for Westmint {
|
||||
const RUNTIME_VERSION: Option<RuntimeVersion> = None;
|
||||
|
||||
type KeyPair = sp_core::sr25519::Pair;
|
||||
type MessagePayload = Vec<u8>;
|
||||
|
||||
fn ss58_format() -> u16 {
|
||||
sp_core::crypto::Ss58AddressFormat::from(
|
||||
|
||||
@@ -172,11 +172,6 @@ pub trait CliChain: relay_substrate_client::Chain {
|
||||
/// In case of chains supporting multiple cryptos, pick one used by the CLI.
|
||||
type KeyPair: sp_core::crypto::Pair;
|
||||
|
||||
/// Bridge Message Payload type.
|
||||
///
|
||||
/// TODO [#854] This should be removed in favor of target-specifc types.
|
||||
type MessagePayload;
|
||||
|
||||
/// Numeric value of SS58 format.
|
||||
fn ss58_format() -> u16;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
[package]
|
||||
name = "relay-statemine-client"
|
||||
version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.1.5" }
|
||||
relay-substrate-client = { path = "../client-substrate" }
|
||||
relay-utils = { path = "../utils" }
|
||||
scale-info = { version = "2.1.1", features = ["derive"] }
|
||||
|
||||
# Bridge dependencies
|
||||
|
||||
bp-polkadot-core = { path = "../../primitives/polkadot-core" }
|
||||
bp-statemine = { path = "../../primitives/chain-statemine" }
|
||||
|
||||
# Substrate Dependencies
|
||||
|
||||
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
@@ -0,0 +1,112 @@
|
||||
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity Bridges Common.
|
||||
|
||||
// Parity Bridges Common is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity Bridges Common is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Types used to connect to the Statemine chain.
|
||||
|
||||
use codec::Encode;
|
||||
use frame_support::weights::Weight;
|
||||
use relay_substrate_client::{
|
||||
Chain, ChainBase, ChainWithTransactions, Error as SubstrateError, SignParam,
|
||||
UnsignedTransaction,
|
||||
};
|
||||
use sp_core::Pair;
|
||||
use sp_runtime::{generic::SignedPayload, traits::IdentifyAccount};
|
||||
use std::time::Duration;
|
||||
|
||||
pub mod runtime;
|
||||
|
||||
/// Statemine chain definition
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct Statemine;
|
||||
|
||||
impl ChainBase for Statemine {
|
||||
type BlockNumber = bp_statemine::BlockNumber;
|
||||
type Hash = bp_statemine::Hash;
|
||||
type Hasher = bp_statemine::Hasher;
|
||||
type Header = bp_statemine::Header;
|
||||
|
||||
type AccountId = bp_statemine::AccountId;
|
||||
type Balance = bp_statemine::Balance;
|
||||
type Index = bp_statemine::Nonce;
|
||||
type Signature = bp_statemine::Signature;
|
||||
|
||||
fn max_extrinsic_size() -> u32 {
|
||||
bp_statemine::Statemine::max_extrinsic_size()
|
||||
}
|
||||
|
||||
fn max_extrinsic_weight() -> Weight {
|
||||
bp_statemine::Statemine::max_extrinsic_weight()
|
||||
}
|
||||
}
|
||||
|
||||
impl Chain for Statemine {
|
||||
const NAME: &'static str = "Statemine";
|
||||
const TOKEN_ID: Option<&'static str> = Some("kusama");
|
||||
const BEST_FINALIZED_HEADER_ID_METHOD: &'static str = "<unused>";
|
||||
const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(6);
|
||||
const STORAGE_PROOF_OVERHEAD: u32 = bp_statemine::EXTRA_STORAGE_PROOF_SIZE;
|
||||
|
||||
type SignedBlock = bp_statemine::SignedBlock;
|
||||
type Call = runtime::Call;
|
||||
}
|
||||
|
||||
impl ChainWithTransactions for Statemine {
|
||||
type AccountKeyPair = sp_core::sr25519::Pair;
|
||||
type SignedTransaction = runtime::UncheckedExtrinsic;
|
||||
|
||||
fn sign_transaction(
|
||||
param: SignParam<Self>,
|
||||
unsigned: UnsignedTransaction<Self>,
|
||||
) -> Result<Self::SignedTransaction, SubstrateError> {
|
||||
let raw_payload = SignedPayload::new(
|
||||
unsigned.call.clone(),
|
||||
bp_statemine::SignedExtensions::new(
|
||||
param.spec_version,
|
||||
param.transaction_version,
|
||||
unsigned.era,
|
||||
param.genesis_hash,
|
||||
unsigned.nonce,
|
||||
unsigned.tip,
|
||||
),
|
||||
)
|
||||
.expect("SignedExtension never fails.");
|
||||
let signature = raw_payload.using_encoded(|payload| param.signer.sign(payload));
|
||||
let signer: sp_runtime::MultiSigner = param.signer.public().into();
|
||||
let (call, extra, _) = raw_payload.deconstruct();
|
||||
|
||||
Ok(runtime::UncheckedExtrinsic::new_signed(
|
||||
call,
|
||||
signer.into_account().into(),
|
||||
signature.into(),
|
||||
extra,
|
||||
))
|
||||
}
|
||||
|
||||
fn is_signed(tx: &Self::SignedTransaction) -> bool {
|
||||
tx.signature.is_some()
|
||||
}
|
||||
|
||||
fn is_signed_by(signer: &Self::AccountKeyPair, tx: &Self::SignedTransaction) -> bool {
|
||||
tx.signature
|
||||
.as_ref()
|
||||
.map(|(address, _, _)| *address == bp_statemine::Address::Id(signer.public().into()))
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
fn parse_transaction(_tx: Self::SignedTransaction) -> Option<UnsignedTransaction<Self>> {
|
||||
unimplemented!("not used on Statemine")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity Bridges Common.
|
||||
|
||||
// Parity Bridges Common is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity Bridges Common is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Types that are specific to the Statemine runtime.
|
||||
|
||||
use codec::{Decode, Encode};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::FixedU128;
|
||||
|
||||
/// Unchecked Statemine extrinsic.
|
||||
pub type UncheckedExtrinsic = bp_polkadot_core::UncheckedExtrinsic<Call>;
|
||||
|
||||
/// Statemine Runtime `Call` enum.
|
||||
///
|
||||
/// The enum represents a subset of possible `Call`s we can send to Statemine chain.
|
||||
/// Ideally this code would be auto-generated from metadata, because we want to
|
||||
/// avoid depending directly on the ENTIRE runtime just to get the encoding of `Dispatchable`s.
|
||||
///
|
||||
/// All entries here (like pretty much in the entire file) must be kept in sync with Statemine
|
||||
/// `construct_runtime`, so that we maintain SCALE-compatibility.
|
||||
///
|
||||
/// See: [link](https://github.com/paritytech/cumulus/blob/master/parachains/runtimes/assets/statemine/src/lib.rs)
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
|
||||
pub enum Call {
|
||||
/// With-Statemint bridge pallet.
|
||||
// TODO (https://github.com/paritytech/parity-bridges-common/issues/1626):
|
||||
// must be updated when we'll make appropriate changes in the Statemine runtime
|
||||
#[codec(index = 42)]
|
||||
WithStatemintBridgePallet(WithStatemintBridgePalletCall),
|
||||
}
|
||||
|
||||
/// Calls of the with-Statemint bridge pallet.
|
||||
// TODO (https://github.com/paritytech/parity-bridges-common/issues/1626):
|
||||
// must be updated when we'll make appropriate changes in the Statemine runtime
|
||||
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
|
||||
#[allow(non_camel_case_types)]
|
||||
pub enum WithStatemintBridgePalletCall {
|
||||
#[codec(index = 42)]
|
||||
update_dot_to_ksm_conversion_rate(FixedU128),
|
||||
}
|
||||
|
||||
impl sp_runtime::traits::Dispatchable for Call {
|
||||
type RuntimeOrigin = ();
|
||||
type Config = ();
|
||||
type Info = ();
|
||||
type PostInfo = ();
|
||||
|
||||
fn dispatch(
|
||||
self,
|
||||
_origin: Self::RuntimeOrigin,
|
||||
) -> sp_runtime::DispatchResultWithInfo<Self::PostInfo> {
|
||||
unimplemented!("The Call is not expected to be dispatched.")
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ impl Chain for Westend {
|
||||
const STORAGE_PROOF_OVERHEAD: u32 = bp_westend::EXTRA_STORAGE_PROOF_SIZE;
|
||||
|
||||
type SignedBlock = bp_westend::SignedBlock;
|
||||
type Call = bp_westend::Call;
|
||||
type Call = ();
|
||||
}
|
||||
|
||||
impl RelayChain for Westend {
|
||||
@@ -117,5 +117,5 @@ impl Chain for Westmint {
|
||||
const STORAGE_PROOF_OVERHEAD: u32 = bp_westend::EXTRA_STORAGE_PROOF_SIZE;
|
||||
|
||||
type SignedBlock = bp_westend::SignedBlock;
|
||||
type Call = bp_westend::Call;
|
||||
type Call = ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user