1#![warn(missing_docs)]
20#![cfg_attr(not(feature = "std"), no_std)]
21
22pub use bp_polkadot_core::*;
23
24use bp_header_chain::ChainWithGrandpa;
25use bp_runtime::{decl_bridge_finality_runtime_apis, Chain, ChainId};
26use frame_support::{sp_runtime::StateVersion, weights::Weight};
27
28pub struct Kusama;
30
31impl Chain for Kusama {
32 const ID: ChainId = *b"ksma";
33
34 type BlockNumber = BlockNumber;
35 type Hash = Hash;
36 type Hasher = Hasher;
37 type Header = Header;
38
39 type AccountId = AccountId;
40 type Balance = Balance;
41 type Nonce = Nonce;
42 type Signature = Signature;
43
44 const STATE_VERSION: StateVersion = StateVersion::V0;
45
46 fn max_extrinsic_size() -> u32 {
47 max_extrinsic_size()
48 }
49
50 fn max_extrinsic_weight() -> Weight {
51 max_extrinsic_weight()
52 }
53}
54
55impl ChainWithGrandpa for Kusama {
56 const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str = WITH_KUSAMA_GRANDPA_PALLET_NAME;
57 const MAX_AUTHORITIES_COUNT: u32 = MAX_AUTHORITIES_COUNT;
58 const REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY: u32 =
59 REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY;
60 const MAX_MANDATORY_HEADER_SIZE: u32 = MAX_MANDATORY_HEADER_SIZE;
61 const AVERAGE_HEADER_SIZE: u32 = AVERAGE_HEADER_SIZE;
62}
63
64pub use bp_polkadot_core::CommonTransactionExtension as TransactionExtension;
66
67pub const PARAS_PALLET_NAME: &str = "Paras";
69
70pub const WITH_KUSAMA_GRANDPA_PALLET_NAME: &str = "BridgeKusamaGrandpa";
72pub const WITH_KUSAMA_BRIDGE_PARACHAINS_PALLET_NAME: &str = "BridgeKusamaParachains";
74
75pub const MAX_NESTED_PARACHAIN_HEAD_DATA_SIZE: u32 = 128;
81
82decl_bridge_finality_runtime_apis!(kusama, grandpa);