Skip to content
Snippets Groups Projects
Commit bc1dcb75 authored by Svyatoslav Nikolsky's avatar Svyatoslav Nikolsky Committed by Bastian Köcher
Browse files

fix clippy issues (#1332)

parent e656e008
Branches
No related merge requests found
......@@ -37,7 +37,7 @@ pub type Rococo = PolkadotLike;
///
/// Note that since this is a target sessions may change before/after this time depending on network
/// conditions.
pub const SESSION_LENGTH: BlockNumber = 1 * time_units::HOURS;
pub const SESSION_LENGTH: BlockNumber = time_units::HOURS;
// NOTE: This needs to be kept up to date with the Rococo runtime found in the Polkadot repo.
pub const VERSION: RuntimeVersion = RuntimeVersion {
......
......@@ -35,7 +35,7 @@ pub type Wococo = PolkadotLike;
///
/// Note that since this is a target sessions may change before/after this time depending on network
/// conditions.
pub const SESSION_LENGTH: BlockNumber = 1 * time_units::MINUTES;
pub const SESSION_LENGTH: BlockNumber = time_units::MINUTES;
// We use this to get the account on Wococo (target) which is derived from Rococo's (source)
// account.
......
......@@ -346,11 +346,10 @@ where
// we shall not ever see this error in relay, because we are never signing decoded
// transactions. Instead we're constructing and signing new transactions. So the error code
// is kinda random here
self.additional_signed.ok_or_else(|| {
frame_support::unsigned::TransactionValidityError::Unknown(
self.additional_signed
.ok_or(frame_support::unsigned::TransactionValidityError::Unknown(
frame_support::unsigned::UnknownTransaction::Custom(0xFF),
)
})
))
}
fn pre_dispatch(
......
......@@ -312,7 +312,7 @@ async fn best_source_block_number_at_target<P: SubstrateFinalitySyncPipeline>(
target_client: &Client<P::TargetChain>,
) -> anyhow::Result<BlockNumberOf<P::SourceChain>> {
Ok(read_client_state::<P::TargetChain, P::SourceChain>(
&target_client,
target_client,
None,
P::SourceChain::BEST_FINALIZED_HEADER_ID_METHOD,
)
......@@ -346,7 +346,7 @@ async fn find_mandatory_headers_in_range<P: SubstrateFinalitySyncPipeline>(
let mut mandatory_headers = Vec::new();
let mut current = range.0;
while current <= range.1 {
let (header, proof) = finality_source.header_and_finality_proof(current).await?.into();
let (header, proof) = finality_source.header_and_finality_proof(current).await?;
if header.is_mandatory() {
match proof {
Some(proof) => mandatory_headers.push((header, proof)),
......@@ -412,7 +412,7 @@ fn make_mandatory_headers_batches<
} else {
current_batch_size = new_batch_size;
current_batch_weight = new_batch_weight;
i = i + 1;
i += 1;
}
}
if !headers_to_submit.is_empty() {
......
......@@ -18,7 +18,7 @@ use crate::cli::{
bridge::FullBridge,
encode_call::{self, CliEncodeCall},
estimate_fee::estimate_message_delivery_and_dispatch_fee,
Balance, CliChain, ExplicitOrMaximal, HexBytes, HexLaneId, Origins, SourceConnectionParams,
Balance, ExplicitOrMaximal, HexBytes, HexLaneId, Origins, SourceConnectionParams,
SourceSigningParams, TargetConnectionParams, TargetSigningParams,
};
use bp_message_dispatch::{CallOrigin, MessagePayload};
......@@ -304,6 +304,7 @@ pub(crate) fn compute_maximal_message_dispatch_weight(maximal_extrinsic_weight:
#[cfg(test)]
mod tests {
use super::*;
use crate::cli::CliChain;
use hex_literal::hex;
#[async_std::test]
......
......@@ -23,7 +23,7 @@ pub fn token_price_metric(token_id: &str) -> Result<FloatJsonValueMetric, Promet
FloatJsonValueMetric::new(
format!("https://api.coingecko.com/api/v3/simple/price?ids={}&vs_currencies=btc", token_id),
format!("$.{}.btc", token_id),
format!("{}_to_base_conversion_rate", token_id.replace("-", "_")),
format!("{}_to_base_conversion_rate", token_id.replace('-', "_")),
format!("Rate used to convert from {} to some BASE tokens", token_id.to_uppercase()),
)
}
......@@ -334,6 +334,7 @@ where
}
/// Make messages delivery proof transaction from given proof.
#[allow(clippy::too_many_arguments)]
fn make_messages_delivery_proof_transaction<P: SubstrateMessageLane>(
spec_version: u32,
transaction_version: u32,
......@@ -443,7 +444,7 @@ where
peer_client.header_by_number(peer_on_self_best_finalized_id.0).await?;
HeaderId(peer_on_self_best_finalized_id.0, actual_peer_on_self_best_finalized.hash())
},
None => peer_on_self_best_finalized_id.clone(),
None => peer_on_self_best_finalized_id,
};
Ok(ClientState {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment