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