diff --git a/bridges/bin/rialto/node/src/overseer.rs b/bridges/bin/rialto/node/src/overseer.rs index 0139f3cdf835d..17f7edce2a319 100644 --- a/bridges/bin/rialto/node/src/overseer.rs +++ b/bridges/bin/rialto/node/src/overseer.rs @@ -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( OverseerGenArgs { leaves, keystore, @@ -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, @@ -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( @@ -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)) @@ -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( &self, connector: OverseerConnector, - args: OverseerGenArgs<'a, Spawner, RuntimeClient>, + args: OverseerGenArgs<'_, Spawner, RuntimeClient>, ) -> Result<(Overseer>, OverseerHandle), Error> where RuntimeClient: 'static + ProvideRuntimeApi + HeaderBackend + AuxStore, @@ -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( &self, connector: OverseerConnector, - args: OverseerGenArgs<'a, Spawner, RuntimeClient>, + args: OverseerGenArgs<'_, Spawner, RuntimeClient>, ) -> Result<(Overseer>, OverseerHandle), Error> where RuntimeClient: 'static + ProvideRuntimeApi + HeaderBackend + AuxStore, diff --git a/bridges/bin/rialto/node/src/service.rs b/bridges/bin/rialto/node/src/service.rs index 6e9eb8a62e46f..e2e811eaa67f4 100644 --- a/bridges/bin/rialto/node/src/service.rs +++ b/bridges/bin/rialto/node/src/service.rs @@ -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(); diff --git a/bridges/relays/bin-ethereum/src/ethereum_deploy_contract.rs b/bridges/relays/bin-ethereum/src/ethereum_deploy_contract.rs index cbe2762263a6f..76a75b062ecbc 100644 --- a/bridges/relays/bin-ethereum/src/ethereum_deploy_contract.rs +++ b/bridges/relays/bin-ethereum/src/ethereum_deploy_contract.rs @@ -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) }, } } @@ -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. @@ -160,5 +160,5 @@ async fn deploy_bridge_contract( ), ) .await - .map_err(|error| Error::DeployContract(error)) + .map_err(Error::DeployContract) } diff --git a/bridges/relays/bin-substrate/src/cli/relay_headers_and_messages.rs b/bridges/relays/bin-substrate/src/cli/relay_headers_and_messages.rs index 92343288ede15..748b68e33c4d8 100644 --- a/bridges/relays/bin-substrate/src/cli/relay_headers_and_messages.rs +++ b/bridges/relays/bin-substrate/src/cli/relay_headers_and_messages.rs @@ -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, @@ -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, diff --git a/bridges/relays/bin-substrate/src/cli/resubmit_transactions.rs b/bridges/relays/bin-substrate/src/cli/resubmit_transactions.rs index 66728622d755d..64663d7e8ec02 100644 --- a/bridges/relays/bin-substrate/src/cli/resubmit_transactions.rs +++ b/bridges/relays/bin-substrate/src/cli/resubmit_transactions.rs @@ -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])), ); } diff --git a/bridges/relays/exchange/src/exchange_loop.rs b/bridges/relays/exchange/src/exchange_loop.rs index 84f4f9261163c..84d216f43968f 100644 --- a/bridges/relays/exchange/src/exchange_loop.rs +++ b/bridges/relays/exchange/src/exchange_loop.rs @@ -99,8 +99,8 @@ pub async fn run( relay_utils::relay_loop(source_client, target_client) .with_metrics(Some(metrics_prefix::

()), 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::

(), move |source_client, target_client, metrics| { diff --git a/bridges/relays/finality/src/finality_loop.rs b/bridges/relays/finality/src/finality_loop.rs index 1b1327ffde590..191d183837931 100644 --- a/bridges/relays/finality/src/finality_loop.rs +++ b/bridges/relays/finality/src/finality_loop.rs @@ -114,8 +114,8 @@ pub async fn run( let exit_signal = exit_signal.shared(); relay_utils::relay_loop(source_client, target_client) .with_metrics(Some(metrics_prefix::

()), 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::

(), move |source_client, target_client, metrics| { diff --git a/bridges/relays/headers/src/sync_loop.rs b/bridges/relays/headers/src/sync_loop.rs index 419211835aa8e..da8d23dc39dec 100644 --- a/bridges/relays/headers/src/sync_loop.rs +++ b/bridges/relays/headers/src/sync_loop.rs @@ -147,8 +147,8 @@ pub async fn run>( let exit_signal = exit_signal.shared(); relay_utils::relay_loop(source_client, target_client) .with_metrics(Some(metrics_prefix::

()), 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::

(), move |source_client, target_client, metrics| { diff --git a/bridges/relays/messages/src/message_lane_loop.rs b/bridges/relays/messages/src/message_lane_loop.rs index bfd1a2b94082b..e727794aa81cd 100644 --- a/bridges/relays/messages/src/message_lane_loop.rs +++ b/bridges/relays/messages/src/message_lane_loop.rs @@ -268,8 +268,8 @@ pub async fn run( relay_utils::relay_loop(source_client, target_client) .reconnect_delay(params.reconnect_delay) .with_metrics(Some(metrics_prefix::

(¶ms.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::

(¶ms.lane), move |source_client, target_client, metrics| {