Remove SOURCE_PARACHAIN_PARA_ID (#1716)

* Remove SOURCE_PARACHAIN_PARA_ID

Remove SubstrateParachainsPipeline::SOURCE_PARACHAIN_PARA_ID

* Avoid duplicate ChainBase and ParachainBase implementations

* Replace ChainShadow with UnderlyingChainProvider
This commit is contained in:
Serban Iorga
2022-12-14 12:29:09 +02:00
committed by Bastian Köcher
parent 7d55a0ffe2
commit bde1629f86
27 changed files with 154 additions and 272 deletions
+7 -40
View File
@@ -16,8 +16,9 @@
//! Types used to connect to the Westend chain.
use frame_support::weights::Weight;
use relay_substrate_client::{Chain, ChainBase, ChainWithBalances, ChainWithGrandpa, RelayChain};
use relay_substrate_client::{
Chain, ChainWithBalances, ChainWithGrandpa, RelayChain, UnderlyingChainProvider,
};
use sp_core::storage::StorageKey;
use std::time::Duration;
@@ -31,24 +32,8 @@ pub type SyncHeader = relay_substrate_client::SyncHeader<bp_westend::Header>;
#[derive(Debug, Clone, Copy)]
pub struct Westend;
impl ChainBase for Westend {
type BlockNumber = bp_westend::BlockNumber;
type Hash = bp_westend::Hash;
type Hasher = bp_westend::Hasher;
type Header = bp_westend::Header;
type AccountId = bp_westend::AccountId;
type Balance = bp_westend::Balance;
type Index = bp_westend::Nonce;
type Signature = bp_westend::Signature;
fn max_extrinsic_size() -> u32 {
bp_westend::Westend::max_extrinsic_size()
}
fn max_extrinsic_weight() -> Weight {
bp_westend::Westend::max_extrinsic_weight()
}
impl UnderlyingChainProvider for Westend {
type Chain = bp_westend::Westend;
}
impl Chain for Westend {
@@ -83,26 +68,8 @@ impl ChainWithBalances for Westend {
#[derive(Debug, Clone, Copy)]
pub struct Westmint;
// Westmint seems to use the same configuration as all Polkadot-like chains, so we'll use Westend
// primitives here.
impl ChainBase for Westmint {
type BlockNumber = bp_westend::BlockNumber;
type Hash = bp_westend::Hash;
type Hasher = bp_westend::Hasher;
type Header = bp_westend::Header;
type AccountId = bp_westend::AccountId;
type Balance = bp_westend::Balance;
type Index = bp_westend::Nonce;
type Signature = bp_westend::Signature;
fn max_extrinsic_size() -> u32 {
bp_westend::Westend::max_extrinsic_size()
}
fn max_extrinsic_weight() -> Weight {
bp_westend::Westend::max_extrinsic_weight()
}
impl UnderlyingChainProvider for Westmint {
type Chain = bp_westend::Westmint;
}
// Westmint seems to use the same configuration as all Polkadot-like chains, so we'll use Westend