diff --git a/bridges/bin/millau/node/src/service.rs b/bridges/bin/millau/node/src/service.rs index 632eef06ff65..3c138a649e56 100644 --- a/bridges/bin/millau/node/src/service.rs +++ b/bridges/bin/millau/node/src/service.rs @@ -87,7 +87,7 @@ pub fn new_partial( .transpose()?; let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( - &config, + config, telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), )?; let client = Arc::new(client); diff --git a/bridges/bin/rialto/node/src/service.rs b/bridges/bin/rialto/node/src/service.rs index 0e90642ecdc2..a1844aa1af0f 100644 --- a/bridges/bin/rialto/node/src/service.rs +++ b/bridges/bin/rialto/node/src/service.rs @@ -89,7 +89,7 @@ pub fn new_partial( .transpose()?; let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( - &config, + config, telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), )?; let client = Arc::new(client); diff --git a/bridges/modules/ethereum-contract-builtin/src/lib.rs b/bridges/modules/ethereum-contract-builtin/src/lib.rs index 47c4452aee6c..a07f838cf8d6 100644 --- a/bridges/modules/ethereum-contract-builtin/src/lib.rs +++ b/bridges/modules/ethereum-contract-builtin/src/lib.rs @@ -151,7 +151,7 @@ pub fn verify_substrate_finality_proof( let best_set = best_set?; let verify_result = sc_finality_grandpa::GrandpaJustification::::decode_and_verify_finalizes( - &raw_finality_proof, + raw_finality_proof, (finality_target_hash, finality_target_number), best_set_id, &best_set, diff --git a/bridges/modules/grandpa/src/lib.rs b/bridges/modules/grandpa/src/lib.rs index 1d77bf9861db..4cca1c782738 100644 --- a/bridges/modules/grandpa/src/lib.rs +++ b/bridges/modules/grandpa/src/lib.rs @@ -415,9 +415,14 @@ pub mod pallet { let set_id = authority_set.set_id; Ok( - verify_justification::>((hash, number), set_id, &voter_set, &justification).map_err( + verify_justification::>((hash, number), set_id, &voter_set, justification).map_err( |e| { - log::error!(target: "runtime::bridge-grandpa", "Received invalid justification for {:?}: {:?}", hash, e); + log::error!( + target: "runtime::bridge-grandpa", + "Received invalid justification for {:?}: {:?}", + hash, + e, + ); >::InvalidJustification }, )?, diff --git a/bridges/primitives/ethereum-poa/src/lib.rs b/bridges/primitives/ethereum-poa/src/lib.rs index 57c539f2e27b..382e6f81ee5d 100644 --- a/bridges/primitives/ethereum-poa/src/lib.rs +++ b/bridges/primitives/ethereum-poa/src/lib.rs @@ -245,7 +245,7 @@ impl AuraHeader { /// Get step this header is generated for. pub fn step(&self) -> Option { - self.seal.get(0).map(|x| Rlp::new(&x)).and_then(|x| x.as_val().ok()) + self.seal.get(0).map(|x| Rlp::new(x)).and_then(|x| x.as_val().ok()) } /// Get header author' signature. @@ -496,7 +496,7 @@ pub fn transaction_decode_rlp(raw_tx: &[u8]) -> Result(params: JustificationGeneratorP for (i, (id, _weight)) in authorities.iter().enumerate() { // Assign authorities to sign pre-commits in a round-robin fashion let target = unsigned_precommits[i % forks as usize]; - let precommit = signed_precommit::(&id, target, round, set_id); + let precommit = signed_precommit::(id, target, round, set_id); precommits.push(precommit); } diff --git a/bridges/relays/bin-ethereum/src/instances.rs b/bridges/relays/bin-ethereum/src/instances.rs index 0d2a508f455a..6d3966ca45dc 100644 --- a/bridges/relays/bin-ethereum/src/instances.rs +++ b/bridges/relays/bin-ethereum/src/instances.rs @@ -53,7 +53,7 @@ impl BridgeInstance for RialtoPoA { .into_iter() .map(|header| { ( - into_substrate_ethereum_header(&header.header()), + into_substrate_ethereum_header(header.header()), into_substrate_ethereum_receipts(header.extra()), ) }) @@ -65,7 +65,7 @@ impl BridgeInstance for RialtoPoA { fn build_unsigned_header_call(&self, header: QueuedEthereumHeader) -> Call { let pallet_call = rialto_runtime::BridgeEthPoACall::import_unsigned_header( - into_substrate_ethereum_header(&header.header()), + into_substrate_ethereum_header(header.header()), into_substrate_ethereum_receipts(header.extra()), ); diff --git a/bridges/relays/bin-ethereum/src/main.rs b/bridges/relays/bin-ethereum/src/main.rs index 234e1237fcf5..bcdae353d3dc 100644 --- a/bridges/relays/bin-ethereum/src/main.rs +++ b/bridges/relays/bin-ethereum/src/main.rs @@ -60,7 +60,7 @@ async fn run_command(matches: &clap::ArgMatches<'_>) { match matches.subcommand() { ("eth-to-sub", Some(eth_to_sub_matches)) => { log::info!(target: "bridge", "Starting ETH ➡ SUB relay."); - if ethereum_sync_loop::run(match ethereum_sync_params(ð_to_sub_matches) { + if ethereum_sync_loop::run(match ethereum_sync_params(eth_to_sub_matches) { Ok(ethereum_sync_params) => ethereum_sync_params, Err(err) => { log::error!(target: "bridge", "Error parsing parameters: {}", err); @@ -75,7 +75,7 @@ async fn run_command(matches: &clap::ArgMatches<'_>) { } ("sub-to-eth", Some(sub_to_eth_matches)) => { log::info!(target: "bridge", "Starting SUB ➡ ETH relay."); - if substrate_sync_loop::run(match substrate_sync_params(&sub_to_eth_matches) { + if substrate_sync_loop::run(match substrate_sync_params(sub_to_eth_matches) { Ok(substrate_sync_params) => substrate_sync_params, Err(err) => { log::error!(target: "bridge", "Error parsing parameters: {}", err); @@ -90,7 +90,7 @@ async fn run_command(matches: &clap::ArgMatches<'_>) { } ("eth-deploy-contract", Some(eth_deploy_matches)) => { log::info!(target: "bridge", "Deploying ETH contracts."); - ethereum_deploy_contract::run(match ethereum_deploy_contract_params(ð_deploy_matches) { + ethereum_deploy_contract::run(match ethereum_deploy_contract_params(eth_deploy_matches) { Ok(ethereum_deploy_params) => ethereum_deploy_params, Err(err) => { log::error!(target: "bridge", "Error during contract deployment: {}", err); @@ -101,7 +101,7 @@ async fn run_command(matches: &clap::ArgMatches<'_>) { } ("eth-submit-exchange-tx", Some(eth_exchange_submit_matches)) => { log::info!(target: "bridge", "Submitting ETH ➡ SUB exchange transaction."); - ethereum_exchange_submit::run(match ethereum_exchange_submit_params(ð_exchange_submit_matches) { + ethereum_exchange_submit::run(match ethereum_exchange_submit_params(eth_exchange_submit_matches) { Ok(eth_exchange_submit_params) => eth_exchange_submit_params, Err(err) => { log::error!(target: "bridge", "Error submitting Eethereum exchange transaction: {}", err); @@ -112,7 +112,7 @@ async fn run_command(matches: &clap::ArgMatches<'_>) { } ("eth-exchange-sub", Some(eth_exchange_matches)) => { log::info!(target: "bridge", "Starting ETH ➡ SUB exchange transactions relay."); - ethereum_exchange::run(match ethereum_exchange_params(ð_exchange_matches) { + ethereum_exchange::run(match ethereum_exchange_params(eth_exchange_matches) { Ok(eth_exchange_params) => eth_exchange_params, Err(err) => { log::error!(target: "bridge", "Error relaying Ethereum transactions proofs: {}", err); @@ -285,7 +285,7 @@ fn ethereum_exchange_submit_params(matches: &clap::ArgMatches) -> Result { if remark_payload.is_none() { *remark_payload = Some(HexBytes(generate_remark_payload( - &remark_size, + remark_size, compute_maximal_message_arguments_size(Source::max_extrinsic_size(), Target::max_extrinsic_size()), ))); } diff --git a/bridges/relays/bin-substrate/src/cli/send_message.rs b/bridges/relays/bin-substrate/src/cli/send_message.rs index 6fa82a8cdb5e..abca740472f0 100644 --- a/bridges/relays/bin-substrate/src/cli/send_message.rs +++ b/bridges/relays/bin-substrate/src/cli/send_message.rs @@ -80,7 +80,7 @@ impl SendMessage { let target_sign = target_sign.to_keypair::()?; encode_call::preprocess_call::(message, bridge.bridge_instance_index()); - let target_call = Target::encode_call(&message)?; + let target_call = Target::encode_call(message)?; let payload = { let target_call_weight = prepare_call_dispatch_weight( diff --git a/bridges/relays/exchange/src/exchange.rs b/bridges/relays/exchange/src/exchange.rs index 4a2f07fa7f97..b87b99ee4207 100644 --- a/bridges/relays/exchange/src/exchange.rs +++ b/bridges/relays/exchange/src/exchange.rs @@ -324,7 +324,7 @@ async fn wait_transaction_mined( source_tx_hash: &TransactionHashOf

, ) -> Result<(HeaderId

, usize), String> { loop { - let source_header_and_tx = source_client.transaction_block(&source_tx_hash).await.map_err(|err| { + let source_header_and_tx = source_client.transaction_block(source_tx_hash).await.map_err(|err| { format!( "Error retrieving transaction {} from {} node: {:?}", source_tx_hash, @@ -363,7 +363,7 @@ async fn wait_header_imported( source_header_id: &HeaderId

, ) -> Result<(), String> { loop { - let is_header_known = target_client.is_header_known(&source_header_id).await.map_err(|err| { + let is_header_known = target_client.is_header_known(source_header_id).await.map_err(|err| { format!( "Failed to check existence of header {}/{} on {} node: {:?}", source_header_id.0, @@ -406,7 +406,7 @@ async fn wait_header_finalized( ) -> Result<(), String> { loop { let is_header_finalized = target_client - .is_header_finalized(&source_header_id) + .is_header_finalized(source_header_id) .await .map_err(|err| { format!( diff --git a/bridges/relays/exchange/src/exchange_loop.rs b/bridges/relays/exchange/src/exchange_loop.rs index 4525c33e36a1..8da4c3f45687 100644 --- a/bridges/relays/exchange/src/exchange_loop.rs +++ b/bridges/relays/exchange/src/exchange_loop.rs @@ -215,7 +215,7 @@ async fn run_loop_iteration( state.best_processed_header_number = state.best_processed_header_number + One::one(); storage.set_state(state); - if let Some(ref exchange_loop_metrics) = exchange_loop_metrics { + if let Some(exchange_loop_metrics) = exchange_loop_metrics { exchange_loop_metrics.update::

( state.best_processed_header_number, best_finalized_header_id.0, diff --git a/bridges/relays/headers/src/headers.rs b/bridges/relays/headers/src/headers.rs index 63dfbe583c4b..0b948d9da4cc 100644 --- a/bridges/relays/headers/src/headers.rs +++ b/bridges/relays/headers/src/headers.rs @@ -295,7 +295,7 @@ impl QueuedHeaders

{ &mut self.orphan, &mut self.known_headers, HeaderStatus::Orphan, - &id, + id, ); return; } @@ -305,7 +305,7 @@ impl QueuedHeaders

{ &mut self.maybe_extra, &mut self.known_headers, HeaderStatus::MaybeExtra, - &id, + id, ); } @@ -324,7 +324,7 @@ impl QueuedHeaders

{ destination_queue, &mut self.known_headers, destination_status, - &id, + id, |header| header, ); } @@ -654,7 +654,7 @@ impl QueuedHeaders

{ // remember that the header itself is synced // (condition is here to avoid duplicate log messages) if !id_processed { - set_header_status::

(&mut self.known_headers, &id, HeaderStatus::Synced); + set_header_status::

(&mut self.known_headers, id, HeaderStatus::Synced); } // now let's move all descendants from maybe_orphan && orphan queues to diff --git a/bridges/relays/messages/src/message_race_loop.rs b/bridges/relays/messages/src/message_race_loop.rs index 41f5ede1033a..646fad886d76 100644 --- a/bridges/relays/messages/src/message_race_loop.rs +++ b/bridges/relays/messages/src/message_race_loop.rs @@ -567,7 +567,7 @@ where .as_ref() .and_then(|best_finalized_source_header_id_at_best_target| { strategy - .select_nonces_to_deliver(&race_state) + .select_nonces_to_deliver(race_state) .map(|(nonces_range, proof_parameters)| { ( best_finalized_source_header_id_at_best_target.clone(),