Skip to content

Commit

Permalink
fix clippy things (#1200)
Browse files Browse the repository at this point in the history
  • Loading branch information
svyatonik authored and bkchr committed Apr 10, 2024
1 parent 4812160 commit c2b38ba
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
18 changes: 9 additions & 9 deletions bridges/bin/rialto/node/src/overseer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ where

/// Obtain a prepared `OverseerBuilder`, that is initialized
/// with all default values.
pub fn prepared_overseer_builder<'a, Spawner, RuntimeClient>(
pub fn prepared_overseer_builder<Spawner, RuntimeClient>(
OverseerGenArgs {
leaves,
keystore,
Expand All @@ -134,7 +134,7 @@ pub fn prepared_overseer_builder<'a, Spawner, RuntimeClient>(
candidate_validation_config,
chain_selection_config,
dispute_coordinator_config,
}: OverseerGenArgs<'a, Spawner, RuntimeClient>,
}: OverseerGenArgs<'_, Spawner, RuntimeClient>,
) -> Result<
OverseerBuilder<
Spawner,
Expand Down Expand Up @@ -236,7 +236,7 @@ where
approval_voting_config,
parachains_db.clone(),
keystore.clone(),
Box::new(network_service.clone()),
Box::new(network_service),
Metrics::register(registry)?,
))
.gossip_support(GossipSupportSubsystem::new(
Expand All @@ -251,9 +251,9 @@ where
))
.dispute_participation(DisputeParticipationSubsystem::new())
.dispute_distribution(DisputeDistributionSubsystem::new(
keystore.clone(),
keystore,
dispute_req_receiver,
authority_discovery_service.clone(),
authority_discovery_service,
Metrics::register(registry)?,
))
.chain_selection(ChainSelectionSubsystem::new(chain_selection_config, parachains_db))
Expand All @@ -278,10 +278,10 @@ where
/// would do.
pub trait OverseerGen {
/// Overwrite the full generation of the overseer, including the subsystems.
fn generate<'a, Spawner, RuntimeClient>(
fn generate<Spawner, RuntimeClient>(
&self,
connector: OverseerConnector,
args: OverseerGenArgs<'a, Spawner, RuntimeClient>,
args: OverseerGenArgs<'_, Spawner, RuntimeClient>,
) -> Result<(Overseer<Spawner, Arc<RuntimeClient>>, OverseerHandle), Error>
where
RuntimeClient: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block> + AuxStore,
Expand All @@ -302,10 +302,10 @@ use polkadot_overseer::KNOWN_LEAVES_CACHE_SIZE;
pub struct RealOverseerGen;

impl OverseerGen for RealOverseerGen {
fn generate<'a, Spawner, RuntimeClient>(
fn generate<Spawner, RuntimeClient>(
&self,
connector: OverseerConnector,
args: OverseerGenArgs<'a, Spawner, RuntimeClient>,
args: OverseerGenArgs<'_, Spawner, RuntimeClient>,
) -> Result<(Overseer<Spawner, Arc<RuntimeClient>>, OverseerHandle), Error>
where
RuntimeClient: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block> + AuxStore,
Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/rialto/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ where
statement_req_receiver,
},
)?;
let handle = Handle::new(overseer_handle.clone());
let handle = Handle::new(overseer_handle);

{
let handle = handle.clone();
Expand Down
6 changes: 3 additions & 3 deletions bridges/relays/bin-ethereum/src/ethereum_deploy_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async fn prepare_initial_header(
let initial_header = sub_client.header_by_number(Zero::zero()).await;
initial_header
.map(|header| (HeaderId(Zero::zero(), header.hash()), header.encode()))
.map_err(|error| Error::ReadGenesisHeader(error))
.map_err(Error::ReadGenesisHeader)
},
}
}
Expand All @@ -134,7 +134,7 @@ async fn prepare_initial_authorities_set(
None => sub_client.grandpa_authorities_set(sub_initial_header_hash).await,
};

initial_authorities_set.map_err(|error| Error::ReadAuthorities(error))
initial_authorities_set.map_err(Error::ReadAuthorities)
}

/// Deploy bridge contract to Ethereum chain.
Expand All @@ -160,5 +160,5 @@ async fn deploy_bridge_contract(
),
)
.await
.map_err(|error| Error::DeployContract(error))
.map_err(Error::DeployContract)
}
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,10 @@ impl RelayHeadersAndMessages {
let left_to_right_messages = left_to_right_messages(MessagesRelayParams {
source_client: left_client.clone(),
source_sign: left_sign.clone(),
source_transactions_mortality: left_transactions_mortality.clone(),
source_transactions_mortality: left_transactions_mortality,
target_client: right_client.clone(),
target_sign: right_sign.clone(),
target_transactions_mortality: right_transactions_mortality.clone(),
target_transactions_mortality: right_transactions_mortality,
source_to_target_headers_relay: Some(left_to_right_on_demand_headers.clone()),
target_to_source_headers_relay: Some(right_to_left_on_demand_headers.clone()),
lane_id: lane,
Expand All @@ -531,10 +531,10 @@ impl RelayHeadersAndMessages {
let right_to_left_messages = right_to_left_messages(MessagesRelayParams {
source_client: right_client.clone(),
source_sign: right_sign.clone(),
source_transactions_mortality: right_transactions_mortality.clone(),
source_transactions_mortality: right_transactions_mortality,
target_client: left_client.clone(),
target_sign: left_sign.clone(),
target_transactions_mortality: left_transactions_mortality.clone(),
target_transactions_mortality: left_transactions_mortality,
source_to_target_headers_relay: Some(right_to_left_on_demand_headers.clone()),
target_to_source_headers_relay: Some(left_to_right_on_demand_headers.clone()),
lane_id: lane,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ mod tests {
// when we resubmit tx for the second time, 1/9 of queue is skipped
context = context.notice_resubmitted_transaction(Hash::from([3; 32]));
assert_eq!(
select_transaction_from_queue(queued_transactions.clone(), &context),
select_transaction_from_queue(queued_transactions, &context),
Some(Bytes(vec![1])),
);
}
Expand Down
4 changes: 2 additions & 2 deletions bridges/relays/exchange/src/exchange_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ pub async fn run<P: TransactionProofPipeline>(

relay_utils::relay_loop(source_client, target_client)
.with_metrics(Some(metrics_prefix::<P>()), metrics_params)
.loop_metric(|registry, prefix| ExchangeLoopMetrics::new(registry, prefix))?
.standalone_metric(|registry, prefix| GlobalMetrics::new(registry, prefix))?
.loop_metric(ExchangeLoopMetrics::new)?
.standalone_metric(GlobalMetrics::new)?
.expose()
.await?
.run(metrics_prefix::<P>(), move |source_client, target_client, metrics| {
Expand Down
4 changes: 2 additions & 2 deletions bridges/relays/finality/src/finality_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ pub async fn run<P: FinalitySyncPipeline>(
let exit_signal = exit_signal.shared();
relay_utils::relay_loop(source_client, target_client)
.with_metrics(Some(metrics_prefix::<P>()), metrics_params)
.loop_metric(|registry, prefix| SyncLoopMetrics::new(registry, prefix))?
.standalone_metric(|registry, prefix| GlobalMetrics::new(registry, prefix))?
.loop_metric(SyncLoopMetrics::new)?
.standalone_metric(GlobalMetrics::new)?
.expose()
.await?
.run(metrics_prefix::<P>(), move |source_client, target_client, metrics| {
Expand Down
4 changes: 2 additions & 2 deletions bridges/relays/headers/src/sync_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ pub async fn run<P: HeadersSyncPipeline, TC: TargetClient<P>>(
let exit_signal = exit_signal.shared();
relay_utils::relay_loop(source_client, target_client)
.with_metrics(Some(metrics_prefix::<P>()), metrics_params)
.loop_metric(|registry, prefix| SyncLoopMetrics::new(registry, prefix))?
.standalone_metric(|registry, prefix| GlobalMetrics::new(registry, prefix))?
.loop_metric(SyncLoopMetrics::new)?
.standalone_metric(GlobalMetrics::new)?
.expose()
.await?
.run(metrics_prefix::<P>(), move |source_client, target_client, metrics| {
Expand Down
4 changes: 2 additions & 2 deletions bridges/relays/messages/src/message_lane_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ pub async fn run<P: MessageLane>(
relay_utils::relay_loop(source_client, target_client)
.reconnect_delay(params.reconnect_delay)
.with_metrics(Some(metrics_prefix::<P>(&params.lane)), metrics_params)
.loop_metric(|registry, prefix| MessageLaneLoopMetrics::new(registry, prefix))?
.standalone_metric(|registry, prefix| GlobalMetrics::new(registry, prefix))?
.loop_metric(MessageLaneLoopMetrics::new)?
.standalone_metric(GlobalMetrics::new)?
.expose()
.await?
.run(metrics_prefix::<P>(&params.lane), move |source_client, target_client, metrics| {
Expand Down

0 comments on commit c2b38ba

Please sign in to comment.