Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions bin/runtime-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ pub mod messages_benchmarking;
pub mod messages_extension;
pub mod parachains_benchmarking;

#[cfg(feature = "integrity-test")]
pub mod integrity;

/// A duplication of the `FilterCall` trait.
///
/// We need this trait in order to be able to implement it for the messages pallet,
Expand Down Expand Up @@ -132,9 +129,9 @@ mod tests {
}

impl sp_runtime::traits::Dispatchable for MockCall {
type Origin = ();
type Config = ();
type Info = ();
type Origin = ();
type PostInfo = ();

fn dispatch(
Expand All @@ -149,7 +146,7 @@ mod tests {
impl BridgeRuntimeFilterCall<MockCall> for FirstFilterCall {
fn validate(call: &MockCall) -> TransactionValidity {
if call.data <= 1 {
return InvalidTransaction::Custom(1).into()
return InvalidTransaction::Custom(1).into();
}

Ok(ValidTransaction { priority: 1, ..Default::default() })
Expand All @@ -160,7 +157,7 @@ mod tests {
impl BridgeRuntimeFilterCall<MockCall> for SecondFilterCall {
fn validate(call: &MockCall) -> TransactionValidity {
if call.data <= 2 {
return InvalidTransaction::Custom(2).into()
return InvalidTransaction::Custom(2).into();
}

Ok(ValidTransaction { priority: 2, ..Default::default() })
Expand Down
15 changes: 9 additions & 6 deletions bin/runtime-common/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,24 @@ use bp_messages::{
target_chain::{DispatchMessage, MessageDispatch, ProvedLaneMessages, ProvedMessages},
InboundLaneData, LaneId, Message, MessageData, MessageKey, MessageNonce, OutboundLaneData,
};
use bp_polkadot_core::parachains::{ParaHash, ParaHasher, ParaId};
use bp_runtime::{
messages::{DispatchFeePayment, MessageDispatchResult},
ChainId, Size, StorageProofChecker,
};
use bp_polkadot_core::parachains::{ParaHash, ParaHasher, ParaId};
use codec::{Decode, DecodeLimit, Encode, MaxEncodedLen};
use frame_support::{traits::Get,
traits::{Currency, ExistenceRequirement},
use frame_support::{
traits::{Currency, ExistenceRequirement, Get},
weights::{Weight, WeightToFee},
RuntimeDebug,
};
use hash_db::Hasher;
use scale_info::TypeInfo;
use sp_runtime::{
traits::{AtLeast32BitUnsigned, CheckedAdd, CheckedDiv, CheckedMul, Saturating, Zero, Header as HeaderT},
traits::{
AtLeast32BitUnsigned, CheckedAdd, CheckedDiv, CheckedMul, Header as HeaderT, Saturating,
Zero,
},
FixedPointNumber, FixedPointOperand, FixedU128,
};
use sp_std::{
Expand Down Expand Up @@ -1152,13 +1155,13 @@ mod tests {

impl ThisChainWithMessages for ThisChain {
type Call = ThisChainCall;
type Origin = ThisChainOrigin;
type ConfirmationTransactionEstimation = BasicConfirmationTransactionEstimation<
<ThisChain as ChainWithMessages>::AccountId,
{ DELIVERY_CONFIRMATION_TRANSACTION_WEIGHT },
0,
0,
>;
type Origin = ThisChainOrigin;

fn is_message_accepted(_send_origin: &Self::Origin, lane: &LaneId) -> bool {
lane == TEST_LANE_ID
Expand Down Expand Up @@ -1212,13 +1215,13 @@ mod tests {

impl ThisChainWithMessages for BridgedChain {
type Call = BridgedChainCall;
type Origin = BridgedChainOrigin;
type ConfirmationTransactionEstimation = BasicConfirmationTransactionEstimation<
<BridgedChain as ChainWithMessages>::AccountId,
0,
0,
0,
>;
type Origin = BridgedChainOrigin;

fn is_message_accepted(_send_origin: &Self::Origin, _lane: &LaneId) -> bool {
unreachable!()
Expand Down
6 changes: 3 additions & 3 deletions bin/runtime-common/src/messages_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<
inbound_lane_data.last_delivered_nonce(),
);

return sp_runtime::transaction_validity::InvalidTransaction::Stale.into()
return sp_runtime::transaction_validity::InvalidTransaction::Stale.into();
}
},
Some(pallet_bridge_messages::Call::<T, I>::receive_messages_delivery_proof {
Expand All @@ -85,12 +85,12 @@ impl<
outbound_lane_data.latest_received_nonce,
);

return sp_runtime::transaction_validity::InvalidTransaction::Stale.into()
return sp_runtime::transaction_validity::InvalidTransaction::Stale.into();
}
},
_ => {},
}

Ok(sp_runtime::transaction_validity::ValidTransaction::default())
}
}
}
2 changes: 1 addition & 1 deletion modules/fee-market/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ impl pallet_bridge_messages::Config for Test {
type MaxMessagesToPruneAtOnce = MaxMessagesToPruneAtOnce;
type MaxUnconfirmedMessagesAtInboundLane = MaxUnconfirmedMessagesAtInboundLane;
type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane;
type MaximalOutboundPayloadSize = frame_support::traits::ConstU32<MAX_OUTBOUND_PAYLOAD_SIZE>;
type MessageDeliveryAndDispatchPayment = TestMessageDeliveryAndDispatchPayment;
type MessageDispatch = TestMessageDispatch;
type OnDeliveryConfirmed = FeeMarketMessageConfirmedHandler<Self, ()>;
Expand All @@ -434,7 +435,6 @@ impl pallet_bridge_messages::Config for Test {
type SourceHeaderChain = TestSourceHeaderChain;
type TargetHeaderChain = TestTargetHeaderChain;
type WeightInfo = ();
type MaximalOutboundPayloadSize = frame_support::traits::ConstU32<MAX_OUTBOUND_PAYLOAD_SIZE>;
}

impl SenderOrigin<AccountId> for Origin {
Expand Down
2 changes: 1 addition & 1 deletion modules/grandpa/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl<
best_finalized_number,
);

return InvalidTransaction::Stale.into()
return InvalidTransaction::Stale.into();
}

Ok(ValidTransaction::default())
Expand Down
5 changes: 3 additions & 2 deletions modules/grandpa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ pub mod pallet {
}

impl<T: Config<I>, I: 'static> OwnedBridgeModule<T> for Pallet<T, I> {
const LOG_TARGET: &'static str = LOG_TARGET;
type OwnerStorage = PalletOwner<T, I>;
type OperatingMode = BasicOperatingMode;
type OperatingModeStorage = PalletOperatingMode<T, I>;
type OwnerStorage = PalletOwner<T, I>;

const LOG_TARGET: &'static str = LOG_TARGET;
}

#[pallet::call]
Expand Down
Loading