bp_bridge_hub_rococo/
lib.rs1#![warn(missing_docs)]
20#![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::{
29 dispatch::DispatchClass,
30 sp_runtime::{MultiAddress, MultiSigner, RuntimeDebug, StateVersion},
31};
32
33#[derive(RuntimeDebug)]
35pub struct BridgeHubRococo;
36
37impl Chain for BridgeHubRococo {
38 const ID: ChainId = *b"bhro";
39
40 type BlockNumber = BlockNumber;
41 type Hash = Hash;
42 type Hasher = Hasher;
43 type Header = Header;
44
45 type AccountId = AccountId;
46 type Balance = Balance;
47 type Nonce = Nonce;
48 type Signature = Signature;
49
50 const STATE_VERSION: StateVersion = StateVersion::V1;
51
52 fn max_extrinsic_size() -> u32 {
53 *BlockLength::get().max.get(DispatchClass::Normal)
54 }
55
56 fn max_extrinsic_weight() -> Weight {
57 BlockWeightsForAsyncBacking::get()
58 .get(DispatchClass::Normal)
59 .max_extrinsic
60 .unwrap_or(Weight::MAX)
61 }
62}
63
64impl Parachain for BridgeHubRococo {
65 const PARACHAIN_ID: u32 = BRIDGE_HUB_ROCOCO_PARACHAIN_ID;
66 const MAX_HEADER_SIZE: u32 = MAX_BRIDGE_HUB_HEADER_SIZE;
67}
68
69impl ChainWithMessages for BridgeHubRococo {
70 const WITH_CHAIN_MESSAGES_PALLET_NAME: &'static str =
71 WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME;
72
73 const MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX: MessageNonce =
74 MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX;
75 const MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX: MessageNonce =
76 MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
77}
78
79pub type AccountSigner = MultiSigner;
81
82pub type Address = MultiAddress<AccountId, ()>;
84
85pub const BRIDGE_HUB_ROCOCO_PARACHAIN_ID: u32 = 1013;
87
88pub const WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME: &str = "BridgeRococoMessages";
90
91pub const WITH_BRIDGE_HUB_ROCOCO_RELAYERS_PALLET_NAME: &str = "BridgeRelayers";
94
95pub const WITH_BRIDGE_ROCOCO_TO_WESTEND_MESSAGES_PALLET_INDEX: u8 = 51;
97pub const WITH_BRIDGE_ROCOCO_TO_BULLETIN_MESSAGES_PALLET_INDEX: u8 = 61;
99
100decl_bridge_finality_runtime_apis!(bridge_hub_rococo);
101decl_bridge_messages_runtime_apis!(bridge_hub_rococo, LegacyLaneId);
102
103frame_support::parameter_types! {
104 pub const BridgeHubRococoBaseXcmFeeInRocs: u128 = 72_091_666;
108
109 pub const BridgeHubRococoBaseDeliveryFeeInRocs: u128 = 297_685_840;
112
113 pub const BridgeHubRococoBaseConfirmationFeeInRocs: u128 = 56_782_099;
116}
117
118#[derive(Decode, Encode)]
120pub enum RuntimeCall {
121 #[codec(index = 52)]
123 XcmOverBridgeHubWestend(bp_xcm_bridge_hub::XcmBridgeHubCall),
124}