Skip to content

Commit

Permalink
Fix clippy issues (#1884)
Browse files Browse the repository at this point in the history
* fix clippy issues

* fix?

* fix?

* forget about extra_unused_type_parameters lint for now
  • Loading branch information
svyatonik committed Feb 16, 2023
1 parent 0bd77f4 commit 91e66cf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion bin/millau/runtime/src/rialto_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ mod tests {
RialtoGrandpaInstance,
WithRialtoMessagesInstance,
WithRialtoMessageBridge,
bp_millau::Millau,
>(AssertCompleteBridgeConstants {
this_chain_constants: AssertChainConstants {
block_length: bp_millau::BlockLength::get(),
Expand Down
1 change: 0 additions & 1 deletion bin/rialto/runtime/src/millau_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ mod tests {
MillauGrandpaInstance,
WithMillauMessagesInstance,
WithMillauMessageBridge,
bp_rialto::Rialto,
>(AssertCompleteBridgeConstants {
this_chain_constants: AssertChainConstants {
block_length: bp_rialto::BlockLength::get(),
Expand Down
8 changes: 3 additions & 5 deletions bin/runtime-common/src/integrity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,9 @@ pub struct AssertChainConstants {
///
/// 1) block weight limits are matching;
/// 2) block size limits are matching.
pub fn assert_chain_constants<R, C>(params: AssertChainConstants)
pub fn assert_chain_constants<R>(params: AssertChainConstants)
where
R: frame_system::Config,
C: Chain,
{
// we don't check runtime version here, because in our case we'll be building relay from one
// repo and runtime will live in another repo, along with outdated relay version. To avoid
Expand Down Expand Up @@ -274,17 +273,16 @@ pub struct AssertCompleteBridgeConstants<'a> {

/// All bridge-related constants tests for the complete standard messages bridge (i.e. with bridge
/// GRANDPA and messages pallets deployed).
pub fn assert_complete_bridge_constants<R, GI, MI, B, This>(params: AssertCompleteBridgeConstants)
pub fn assert_complete_bridge_constants<R, GI, MI, B>(params: AssertCompleteBridgeConstants)
where
R: frame_system::Config
+ pallet_bridge_grandpa::Config<GI>
+ pallet_bridge_messages::Config<MI>,
GI: 'static,
MI: 'static,
B: MessageBridge,
This: Chain,
{
assert_chain_constants::<R, This>(params.this_chain_constants);
assert_chain_constants::<R>(params.this_chain_constants);
assert_bridge_grandpa_pallet_constants::<R, GI>();
assert_bridge_messages_pallet_constants::<R, MI>(params.messages_pallet_constants);
assert_bridge_pallet_names::<B, R, GI, MI>(params.pallet_names);
Expand Down
4 changes: 2 additions & 2 deletions modules/beefy/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn verify_authority_set<T: Config<I>, I: 'static>(
///
/// We're using 'conservative' approach here, where signatures of `2/3+1` validators are
/// required..
pub(crate) fn signatures_required<T: Config<I>, I: 'static>(validators_len: usize) -> usize {
pub(crate) fn signatures_required(validators_len: usize) -> usize {
validators_len - validators_len.saturating_sub(1) / 3
}

Expand All @@ -67,7 +67,7 @@ fn verify_signatures<T: Config<I>, I: 'static>(

// Ensure that the commitment was signed by enough authorities.
let msg = commitment.commitment.encode();
let mut missing_signatures = signatures_required::<T, I>(authority_set.len());
let mut missing_signatures = signatures_required(authority_set.len());
for (idx, (authority, maybe_sig)) in
authority_set.validators().iter().zip(commitment.signatures.iter()).enumerate()
{
Expand Down

0 comments on commit 91e66cf

Please sign in to comment.