Skip to content

Commit

Permalink
fixing spellcheck, clippy and rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
svyatonik committed Jul 28, 2023
1 parent c467911 commit b26aa98
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
22 changes: 12 additions & 10 deletions bin/runtime-common/src/messages_xcm_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl LocalXcmQueueManager {
}
}

/// A structure that implements [`frame_support:traits::messages::ProcessMessage`] and may
/// A structure that implements [`frame_support::traits::ProcessMessage`] and may
/// be used in the `pallet-message-queue` configuration to stop processing messages when the
/// bridge queue is congested.
///
Expand Down Expand Up @@ -243,18 +243,19 @@ where
) -> Result<bool, ProcessMessageError> {
// if the queue is suspended, yield immediately
let sender_and_lane = SL::get();
if origin.clone().into() == sender_and_lane.location {
if LocalXcmQueueManager::is_inbound_queue_suspended::<R, MI>(sender_and_lane.lane) {
return Err(ProcessMessageError::Yield)
}
let is_expected_origin = origin.clone().into() == sender_and_lane.location;
if is_expected_origin &&
LocalXcmQueueManager::is_inbound_queue_suspended::<R, MI>(sender_and_lane.lane)
{
return Err(ProcessMessageError::Yield)
}

// else pass message to backed processor
Inner::process_message(message, origin, meter, id)
}
}

/// A structure that implements [`frame_support:traits::messages::QueuePausedQuery`] and may
/// A structure that implements [`frame_support::traits::QueuePausedQuery`] and may
/// be used in the `pallet-message-queue` configuration to stop processing messages when the
/// bridge queue is congested.
///
Expand All @@ -280,10 +281,11 @@ where

// if we have suspended the queue before, do not even start processing its messages
let sender_and_lane = SL::get();
if origin.clone().into() == sender_and_lane.location {
if LocalXcmQueueManager::is_inbound_queue_suspended::<R, MI>(sender_and_lane.lane) {
return true
}
let is_expected_origin = origin.clone().into() == sender_and_lane.location;
if is_expected_origin &&
LocalXcmQueueManager::is_inbound_queue_suspended::<R, MI>(sender_and_lane.lane)
{
return true
}

// else process message
Expand Down
7 changes: 2 additions & 5 deletions modules/xcm-bridge-hub-router/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub mod pallet {
/// The bridged network that this config is for.
type BridgedNetworkId: Get<NetworkId>;

/// Actual message sender (XCMP/DMP) to the sibling bridge hub location.
/// Actual message sender (`HRMP` or `DMP`) to the sibling bridge hub location.
type ToBridgeHubSender: SendXcm;
/// Underlying channel with the sibling bridge hub. It must match the channel, used
/// by the `Self::ToBridgeHubSender`.
Expand Down Expand Up @@ -343,10 +343,7 @@ mod tests {
.into_inner() / FixedU128::DIV +
HRMP_FEE;
assert_eq!(
XcmBridgeHubRouter::validate(&mut Some(dest), &mut Some(xcm.clone()))
.unwrap()
.1
.get(0),
XcmBridgeHubRouter::validate(&mut Some(dest), &mut Some(xcm)).unwrap().1.get(0),
Some(&(BridgeFeeAsset::get(), expected_fee).into()),
);
});
Expand Down
2 changes: 1 addition & 1 deletion modules/xcm-bridge-hub-router/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl SendXcm for TestToBridgeHubSender {

fn deliver(_ticket: Self::Ticket) -> Result<XcmHash, SendError> {
frame_support::storage::unhashed::put(b"TestToBridgeHubSender.Sent", &true);
Ok([0u8; 32].into())
Ok([0u8; 32])
}
}

Expand Down
2 changes: 1 addition & 1 deletion primitives/messages/src/target_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub trait MessageDispatch {
/// simply drop messages if it returns `false`. The consumer may still call the `dispatch`
/// if dispatcher has returned `false`.
///
/// We check it in the messages delivery transaction prolgoue. So if it becomes `false`
/// We check it in the messages delivery transaction prologue. So if it becomes `false`
/// after some portion of messages is already dispatched, it doesn't fail the whole transaction.
fn is_active() -> bool;

Expand Down

0 comments on commit b26aa98

Please sign in to comment.