bp_bridge_hub_westend/
lib.rs1#![cfg_attr(not(feature = "std"), no_std)]
21
22pub use bp_bridge_hub_cumulus::*;
23use bp_messages::*;
24use bp_runtime::{
25 decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis, Chain, ChainId, Parachain,
26};
27use codec::{Decode, Encode};
28use frame_support::dispatch::DispatchClass;
29use sp_runtime::{RuntimeDebug, StateVersion};
30
31#[derive(RuntimeDebug)]
33pub struct BridgeHubWestend;
34
35impl Chain for BridgeHubWestend {
36 const ID: ChainId = *b"bhwd";
37
38 type BlockNumber = BlockNumber;
39 type Hash = Hash;
40 type Hasher = Hasher;
41 type Header = Header;
42
43 type AccountId = AccountId;
44 type Balance = Balance;
45 type Nonce = Nonce;
46 type Signature = Signature;
47
48 const STATE_VERSION: StateVersion = StateVersion::V1;
49
50 fn max_extrinsic_size() -> u32 {
51 *BlockLength::get().max.get(DispatchClass::Normal)
52 }
53
54 fn max_extrinsic_weight() -> Weight {
55 BlockWeightsForAsyncBacking::get()
56 .get(DispatchClass::Normal)
57 .max_extrinsic
58 .unwrap_or(Weight::MAX)
59 }
60}
61
62impl Parachain for BridgeHubWestend {
63 const PARACHAIN_ID: u32 = BRIDGE_HUB_WESTEND_PARACHAIN_ID;
64 const MAX_HEADER_SIZE: u32 = MAX_BRIDGE_HUB_HEADER_SIZE;
65}
66
67impl ChainWithMessages for BridgeHubWestend {
68 const WITH_CHAIN_MESSAGES_PALLET_NAME: &'static str =
69 WITH_BRIDGE_HUB_WESTEND_MESSAGES_PALLET_NAME;
70
71 const MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX: MessageNonce =
72 MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX;
73 const MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX: MessageNonce =
74 MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
75}
76
77pub const BRIDGE_HUB_WESTEND_PARACHAIN_ID: u32 = 1002;
79
80pub const WITH_BRIDGE_HUB_WESTEND_MESSAGES_PALLET_NAME: &str = "BridgeWestendMessages";
82
83pub const WITH_BRIDGE_HUB_WESTEND_RELAYERS_PALLET_NAME: &str = "BridgeRelayers";
86
87pub const WITH_BRIDGE_WESTEND_TO_ROCOCO_MESSAGES_PALLET_INDEX: u8 = 44;
89
90decl_bridge_finality_runtime_apis!(bridge_hub_westend);
91decl_bridge_messages_runtime_apis!(bridge_hub_westend, LegacyLaneId);
92
93frame_support::parameter_types! {
94 pub const BridgeHubWestendBaseXcmFeeInWnds: u128 = 18_191_740_000;
98
99 pub const BridgeHubWestendBaseDeliveryFeeInWnds: u128 = 89_305_927_116;
102
103 pub const BridgeHubWestendBaseConfirmationFeeInWnds: u128 = 17_034_677_116;
106}
107
108#[derive(Decode, Encode)]
110pub enum RuntimeCall {
111 #[codec(index = 45)]
113 XcmOverBridgeHubRococo(bp_xcm_bridge_hub::XcmBridgeHubCall),
114}