diff --git a/bridges/bin/millau/runtime/src/rialto_messages.rs b/bridges/bin/millau/runtime/src/rialto_messages.rs index b71eb76d90a6c..04084e0b9520c 100644 --- a/bridges/bin/millau/runtime/src/rialto_messages.rs +++ b/bridges/bin/millau/runtime/src/rialto_messages.rs @@ -166,7 +166,7 @@ mod tests { #[test] fn ensure_millau_message_lane_weights_are_correct() { - check_message_lane_weights::( + check_message_lane_weights::( bp_rialto::EXTRA_STORAGE_PROOF_SIZE, bp_millau::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX, bp_millau::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX, diff --git a/bridges/bin/millau/runtime/src/rialto_parachain_messages.rs b/bridges/bin/millau/runtime/src/rialto_parachain_messages.rs index 8d5216d96c939..1050f500fe8c1 100644 --- a/bridges/bin/millau/runtime/src/rialto_parachain_messages.rs +++ b/bridges/bin/millau/runtime/src/rialto_parachain_messages.rs @@ -172,7 +172,7 @@ mod tests { #[test] fn ensure_millau_message_lane_weights_are_correct() { - check_message_lane_weights::( + check_message_lane_weights::( bp_rialto_parachain::EXTRA_STORAGE_PROOF_SIZE, bp_millau::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX, bp_millau::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX, diff --git a/bridges/bin/rialto-parachain/runtime/src/millau_messages.rs b/bridges/bin/rialto-parachain/runtime/src/millau_messages.rs index 3c523ebfa1245..68c9cbbec6011 100644 --- a/bridges/bin/rialto-parachain/runtime/src/millau_messages.rs +++ b/bridges/bin/rialto-parachain/runtime/src/millau_messages.rs @@ -150,7 +150,11 @@ mod tests { #[test] fn ensure_millau_message_lane_weights_are_correct() { - check_message_lane_weights::( + check_message_lane_weights::< + bp_rialto_parachain::RialtoParachain, + Runtime, + WithMillauMessagesInstance, + >( bp_millau::EXTRA_STORAGE_PROOF_SIZE, bp_rialto_parachain::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX, bp_rialto_parachain::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX, diff --git a/bridges/bin/rialto/runtime/src/millau_messages.rs b/bridges/bin/rialto/runtime/src/millau_messages.rs index a7d1d19f0d8d8..a99243cc3e6a9 100644 --- a/bridges/bin/rialto/runtime/src/millau_messages.rs +++ b/bridges/bin/rialto/runtime/src/millau_messages.rs @@ -150,7 +150,7 @@ mod tests { #[test] fn ensure_millau_message_lane_weights_are_correct() { - check_message_lane_weights::( + check_message_lane_weights::( bp_millau::EXTRA_STORAGE_PROOF_SIZE, bp_rialto::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX, bp_rialto::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX, diff --git a/bridges/bin/runtime-common/src/integrity.rs b/bridges/bin/runtime-common/src/integrity.rs index bf3d239eefd64..aa698b0b95e9d 100644 --- a/bridges/bin/runtime-common/src/integrity.rs +++ b/bridges/bin/runtime-common/src/integrity.rs @@ -292,7 +292,8 @@ where /// Check that the message lane weights are correct. pub fn check_message_lane_weights< C: Chain, - T: frame_system::Config + pallet_bridge_messages::Config, + T: frame_system::Config + pallet_bridge_messages::Config, + MessagesPalletInstance: 'static, >( bridged_chain_extra_storage_proof_size: u32, this_chain_max_unrewarded_relayers: MessageNonce, @@ -303,15 +304,15 @@ pub fn check_message_lane_weights< // in other words: pass true for all known production chains runtime_includes_refund_extension: bool, ) { - type Weights = ::WeightInfo; + type Weights = >::WeightInfo; // check basic weight assumptions - pallet_bridge_messages::ensure_weights_are_correct::>(); + pallet_bridge_messages::ensure_weights_are_correct::>(); // check that weights allow us to receive messages let max_incoming_message_proof_size = bridged_chain_extra_storage_proof_size .saturating_add(messages::target::maximal_incoming_message_size(C::max_extrinsic_size())); - pallet_bridge_messages::ensure_able_to_receive_message::>( + pallet_bridge_messages::ensure_able_to_receive_message::>( C::max_extrinsic_size(), C::max_extrinsic_weight(), max_incoming_message_proof_size, @@ -321,7 +322,7 @@ pub fn check_message_lane_weights< // check that weights allow us to receive delivery confirmations let max_incoming_inbound_lane_data_proof_size = InboundLaneData::<()>::encoded_size_hint_u32(this_chain_max_unrewarded_relayers as _); - pallet_bridge_messages::ensure_able_to_receive_confirmation::>( + pallet_bridge_messages::ensure_able_to_receive_confirmation::>( C::max_extrinsic_size(), C::max_extrinsic_weight(), max_incoming_inbound_lane_data_proof_size, @@ -336,9 +337,12 @@ pub fn check_message_lane_weights< // ensures the extension will not refund weight when it doesn't need to (i.e. if pallet // weights do not account weights of refund extension). if runtime_includes_refund_extension { - assert_ne!(Weights::::receive_messages_proof_overhead_from_runtime(), Weight::zero()); assert_ne!( - Weights::::receive_messages_delivery_proof_overhead_from_runtime(), + Weights::::receive_messages_proof_overhead_from_runtime(), + Weight::zero() + ); + assert_ne!( + Weights::::receive_messages_delivery_proof_overhead_from_runtime(), Weight::zero() ); }