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