Sync Westmint to Millau (#1482)

* sync Westmint to Millau

* "Westend parachains at Millau" dashboard
This commit is contained in:
Svyatoslav Nikolsky
2022-06-29 15:59:50 +03:00
committed by Bastian Köcher
parent d11d9fd0b7
commit 852f629d78
7 changed files with 160 additions and 2 deletions
+49 -1
View File
@@ -17,7 +17,7 @@
//! Types used to connect to the Westend chain.
use frame_support::weights::Weight;
use relay_substrate_client::{Chain, ChainBase, ChainWithBalances, ChainWithGrandpa};
use relay_substrate_client::{Chain, ChainBase, ChainWithBalances, ChainWithGrandpa, RelayChain};
use sp_core::storage::StorageKey;
use std::time::Duration;
@@ -65,6 +65,12 @@ impl Chain for Westend {
type WeightToFee = bp_westend::WeightToFee;
}
impl RelayChain for Westend {
const PARAS_PALLET_NAME: &'static str = bp_westend::PARAS_PALLET_NAME;
const PARACHAINS_FINALITY_PALLET_NAME: &'static str =
bp_westend::WITH_WESTEND_BRIDGE_PARAS_PALLET_NAME;
}
impl ChainWithGrandpa for Westend {
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str =
bp_westend::WITH_WESTEND_GRANDPA_PALLET_NAME;
@@ -75,3 +81,45 @@ impl ChainWithBalances for Westend {
StorageKey(bp_westend::account_info_storage_key(account_id))
}
}
/// Westmint parachain definition
#[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()
}
}
// Westmint seems to use the same configuration as all Polkadot-like chains, so we'll use Westend
// primitives here.
impl Chain for Westmint {
const NAME: &'static str = "Westmint";
const TOKEN_ID: Option<&'static str> = None;
const BEST_FINALIZED_HEADER_ID_METHOD: &'static str =
bp_westend::BEST_FINALIZED_WESTMINT_HEADER_METHOD;
const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(6);
const STORAGE_PROOF_OVERHEAD: u32 = bp_westend::EXTRA_STORAGE_PROOF_SIZE;
const MAXIMAL_ENCODED_ACCOUNT_ID_SIZE: u32 = bp_westend::MAXIMAL_ENCODED_ACCOUNT_ID_SIZE;
type SignedBlock = bp_westend::SignedBlock;
type Call = bp_westend::Call;
type WeightToFee = bp_westend::WeightToFee;
}