mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
Westend<>Rococo Headers Relay (#875)
* Add modules for Rococo<>Westend header sync * Use mock Westend and Rococo finaltiy tx calls * Add Westend<>Rococo variants to `init_bridge` * Add Westend<>Rococo variants to `relay_headers` * Simplify the Rococo and Westend signing params * Add `submit_finality_proof` mock Call variant * Add note to more closely match `initialize` Call variant * Accidentally committed `cargo-expand`ed code 🤦 * Add `initialize` Call variant to Rococo mock * Fix call enums. * Add explainatory comment. * clippy. * Add issue number. * De-duplicate metrics customisation. * Add comments to Rococo/Westend runtimes. * Add scale-encoding compatibility test. * Fix tests. * Clippy. Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
This commit is contained in:
committed by
Bastian Köcher
parent
a69026af44
commit
bca83fd020
@@ -10,6 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
parity-scale-codec = { version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
|
||||
# Bridge Dependencies
|
||||
bp-header-chain = { path = "../header-chain", default-features = false }
|
||||
bp-messages = { path = "../messages", default-features = false }
|
||||
bp-polkadot-core = { path = "../polkadot-core", default-features = false }
|
||||
bp-runtime = { path = "../runtime", default-features = false }
|
||||
@@ -23,6 +24,7 @@ sp-version = { git = "https://github.com/paritytech/substrate", branch = "master
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"bp-header-chain/std",
|
||||
"bp-messages/std",
|
||||
"bp-polkadot-core/std",
|
||||
"bp-runtime/std",
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#![allow(clippy::unnecessary_mut_passed)]
|
||||
|
||||
use bp_messages::{LaneId, MessageNonce, UnrewardedRelayersState, Weight};
|
||||
use bp_runtime::Chain;
|
||||
use sp_std::prelude::*;
|
||||
use sp_version::RuntimeVersion;
|
||||
|
||||
@@ -42,9 +43,33 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
transaction_version: 5,
|
||||
};
|
||||
|
||||
/// Westend Runtime `Call` enum.
|
||||
///
|
||||
/// The enum represents a subset of possible `Call`s we can send to Westend 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 Westend
|
||||
/// `construct_runtime`, so that we maintain SCALE-compatibility.
|
||||
///
|
||||
/// See: https://github.com/paritytech/polkadot/blob/master/runtime/westend/src/lib.rs
|
||||
#[derive(parity_scale_codec::Encode, parity_scale_codec::Decode, Debug, PartialEq, Eq, Clone)]
|
||||
pub enum Call {
|
||||
MockModule,
|
||||
/// Rococo bridge pallet.
|
||||
#[codec(index = 40)]
|
||||
BridgeGrandpaRococo(BridgeGrandpaRococoCall),
|
||||
}
|
||||
|
||||
#[derive(parity_scale_codec::Encode, parity_scale_codec::Decode, Debug, PartialEq, Eq, Clone)]
|
||||
#[allow(non_camel_case_types)]
|
||||
pub enum BridgeGrandpaRococoCall {
|
||||
#[codec(index = 0)]
|
||||
submit_finality_proof(
|
||||
<PolkadotLike as Chain>::Header,
|
||||
bp_header_chain::justification::GrandpaJustification<<PolkadotLike as Chain>::Header>,
|
||||
),
|
||||
#[codec(index = 1)]
|
||||
initialize(bp_header_chain::InitializationData<<PolkadotLike as Chain>::Header>),
|
||||
}
|
||||
|
||||
impl sp_runtime::traits::Dispatchable for Call {
|
||||
|
||||
Reference in New Issue
Block a user