diff --git a/bridges/bin/millau/runtime/src/lib.rs b/bridges/bin/millau/runtime/src/lib.rs index f032eec844..612a9e4364 100644 --- a/bridges/bin/millau/runtime/src/lib.rs +++ b/bridges/bin/millau/runtime/src/lib.rs @@ -283,9 +283,7 @@ parameter_types! { pub struct BeefyDummyDataProvider; impl beefy_primitives::mmr::BeefyDataProvider<()> for BeefyDummyDataProvider { - fn extra_data() -> () { - () - } + fn extra_data() {} } impl pallet_beefy_mmr::Config for Runtime { diff --git a/bridges/bin/rialto-parachain/node/src/chain_spec.rs b/bridges/bin/rialto-parachain/node/src/chain_spec.rs index 6f52155817..4a9bdaf9af 100644 --- a/bridges/bin/rialto-parachain/node/src/chain_spec.rs +++ b/bridges/bin/rialto-parachain/node/src/chain_spec.rs @@ -34,7 +34,9 @@ pub fn get_from_seed(seed: &str) -> ::Pu } /// The extensions for the [`ChainSpec`]. -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)] +#[derive( + Debug, Clone, PartialEq, Eq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension, +)] #[serde(deny_unknown_fields)] pub struct Extensions { /// The relay chain of the Parachain. diff --git a/bridges/bin/rialto-parachain/runtime/src/lib.rs b/bridges/bin/rialto-parachain/runtime/src/lib.rs index e35e78e911..7110e5ba4f 100644 --- a/bridges/bin/rialto-parachain/runtime/src/lib.rs +++ b/bridges/bin/rialto-parachain/runtime/src/lib.rs @@ -301,7 +301,7 @@ parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(ParachainInfo::parachain_id().into()).into()); + pub UniversalLocation: InteriorMultiLocation = X1(Parachain(ParachainInfo::parachain_id().into())); } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used diff --git a/bridges/bin/rialto-parachain/runtime/src/millau_messages.rs b/bridges/bin/rialto-parachain/runtime/src/millau_messages.rs index 4e765000b9..8d88a4d44b 100644 --- a/bridges/bin/rialto-parachain/runtime/src/millau_messages.rs +++ b/bridges/bin/rialto-parachain/runtime/src/millau_messages.rs @@ -101,7 +101,7 @@ impl MessageBridge for WithMillauMessageBridge { bridged_to_this_conversion_rate_override: Option, ) -> bp_rialto_parachain::Balance { let conversion_rate = bridged_to_this_conversion_rate_override - .unwrap_or_else(|| MillauToRialtoParachainConversionRate::get()); + .unwrap_or_else(MillauToRialtoParachainConversionRate::get); bp_rialto_parachain::Balance::try_from(conversion_rate.saturating_mul_int(bridged_balance)) .unwrap_or(bp_rialto_parachain::Balance::MAX) } diff --git a/bridges/bin/rialto/runtime/src/lib.rs b/bridges/bin/rialto/runtime/src/lib.rs index e87639f6cb..82eb57f40f 100644 --- a/bridges/bin/rialto/runtime/src/lib.rs +++ b/bridges/bin/rialto/runtime/src/lib.rs @@ -297,9 +297,7 @@ parameter_types! { pub struct BeefyDummyDataProvider; impl beefy_primitives::mmr::BeefyDataProvider<()> for BeefyDummyDataProvider { - fn extra_data() -> () { - () - } + fn extra_data() {} } impl pallet_beefy_mmr::Config for Runtime { diff --git a/bridges/bin/rialto/runtime/src/millau_messages.rs b/bridges/bin/rialto/runtime/src/millau_messages.rs index ce1bd6b6fb..fdc376be70 100644 --- a/bridges/bin/rialto/runtime/src/millau_messages.rs +++ b/bridges/bin/rialto/runtime/src/millau_messages.rs @@ -96,7 +96,7 @@ impl MessageBridge for WithMillauMessageBridge { bridged_to_this_conversion_rate_override: Option, ) -> bp_rialto::Balance { let conversion_rate = bridged_to_this_conversion_rate_override - .unwrap_or_else(|| MillauToRialtoConversionRate::get()); + .unwrap_or_else(MillauToRialtoConversionRate::get); bp_rialto::Balance::try_from(conversion_rate.saturating_mul_int(bridged_balance)) .unwrap_or(bp_rialto::Balance::MAX) } diff --git a/bridges/bin/rialto/runtime/src/xcm_config.rs b/bridges/bin/rialto/runtime/src/xcm_config.rs index 8cad3896b1..65ffc54a9f 100644 --- a/bridges/bin/rialto/runtime/src/xcm_config.rs +++ b/bridges/bin/rialto/runtime/src/xcm_config.rs @@ -297,8 +297,7 @@ mod tests { let mut incoming_message = DispatchMessage { key: MessageKey { lane_id: [0, 0, 0, 0], nonce: 1 }, data: DispatchMessageData { payload: Ok((location, xcm).into()), fee: 0 }, - } - .into(); + }; let dispatch_weight = MessageDispatcher::dispatch_weight(&mut incoming_message); assert_eq!(dispatch_weight, 1_000_000_000); diff --git a/bridges/bin/runtime-common/src/messages.rs b/bridges/bin/runtime-common/src/messages.rs index 87dd009cff..d302d35c85 100644 --- a/bridges/bin/runtime-common/src/messages.rs +++ b/bridges/bin/runtime-common/src/messages.rs @@ -481,7 +481,7 @@ pub mod target { use super::*; /// Decoded Bridged -> This message payload. - #[derive(RuntimeDebug, PartialEq)] + #[derive(RuntimeDebug, PartialEq, Eq)] pub struct FromBridgedChainMessagePayload { /// Data that is actually sent over the wire. pub xcm: (xcm::v3::MultiLocation, xcm::v3::Xcm), @@ -726,7 +726,7 @@ pub mod target { .map_err(Into::into) } - #[derive(Debug, PartialEq)] + #[derive(Debug, PartialEq, Eq)] pub(crate) enum MessageProofError { Empty, MessagesCountMismatch, @@ -944,7 +944,7 @@ pub mod xcm_copy { message: &mut Option>, ) -> Result<((Vec, XcmHash), MultiAssets), SendError> { let bridged_network = BridgedNetwork::get(); - ensure!(&network == &bridged_network, SendError::NotApplicable); + ensure!(network == bridged_network, SendError::NotApplicable); // We don't/can't use the `channel` for this adapter. let dest = destination.take().ok_or(SendError::MissingArgument)?; let universal_dest = match dest.pushed_front_with(GlobalConsensus(bridged_network)) { @@ -1030,13 +1030,13 @@ mod tests { } } - #[derive(Debug, PartialEq, Decode, Encode, Clone)] + #[derive(Debug, PartialEq, Eq, Decode, Encode, Clone)] struct ThisChainAccountId(u32); - #[derive(Debug, PartialEq, Decode, Encode)] + #[derive(Debug, PartialEq, Eq, Decode, Encode)] struct ThisChainSigner(u32); - #[derive(Debug, PartialEq, Decode, Encode)] + #[derive(Debug, PartialEq, Eq, Decode, Encode)] struct ThisChainSignature(u32); - #[derive(Debug, PartialEq, Decode, Encode)] + #[derive(Debug, PartialEq, Eq, Decode, Encode)] enum ThisChainCall { #[codec(index = 42)] Transfer, @@ -1056,13 +1056,13 @@ mod tests { } } - #[derive(Debug, PartialEq, Decode, Encode)] + #[derive(Debug, PartialEq, Eq, Decode, Encode)] struct BridgedChainAccountId(u32); - #[derive(Debug, PartialEq, Decode, Encode)] + #[derive(Debug, PartialEq, Eq, Decode, Encode)] struct BridgedChainSigner(u32); - #[derive(Debug, PartialEq, Decode, Encode)] + #[derive(Debug, PartialEq, Eq, Decode, Encode)] struct BridgedChainSignature(u32); - #[derive(Debug, PartialEq, Decode, Encode)] + #[derive(Debug, PartialEq, Eq, Decode, Encode)] enum BridgedChainCall {} #[derive(Clone, Debug)] struct BridgedChainOrigin; @@ -1079,7 +1079,7 @@ mod tests { macro_rules! impl_wrapped_balance { ($name:ident) => { - #[derive(Debug, PartialEq, Decode, Encode, Clone, Copy)] + #[derive(Debug, PartialEq, Eq, Decode, Encode, Clone, Copy)] struct $name(u32); impl From for $name { diff --git a/bridges/modules/grandpa/src/extension.rs b/bridges/modules/grandpa/src/extension.rs index bddb722c92..4a7d19acf2 100644 --- a/bridges/modules/grandpa/src/extension.rs +++ b/bridges/modules/grandpa/src/extension.rs @@ -20,9 +20,9 @@ /// /// ```nocompile /// pallet_bridge_grandpa::declare_check_bridged_block_number_ext!{ -/// Runtime, -/// Call::BridgeRialtoGrandpa => RialtoGrandpaInstance, -/// Call::BridgeWestendGrandpa => WestendGrandpaInstance, +/// Runtime, +/// Call::BridgeRialtoGrandpa => RialtoGrandpaInstance, +/// Call::BridgeWestendGrandpa => WestendGrandpaInstance, /// } /// ``` #[macro_export] diff --git a/bridges/primitives/header-chain/src/justification.rs b/bridges/primitives/header-chain/src/justification.rs index ff841d70f9..dadd48a485 100644 --- a/bridges/primitives/header-chain/src/justification.rs +++ b/bridges/primitives/header-chain/src/justification.rs @@ -53,7 +53,7 @@ impl crate::FinalityProof for GrandpaJustification { } /// Justification verification error. -#[derive(RuntimeDebug, PartialEq)] +#[derive(Eq, RuntimeDebug, PartialEq)] pub enum Error { /// Failed to decode justification. JustificationDecode, diff --git a/bridges/primitives/header-chain/src/lib.rs b/bridges/primitives/header-chain/src/lib.rs index 28949f28de..29d9cc5254 100644 --- a/bridges/primitives/header-chain/src/lib.rs +++ b/bridges/primitives/header-chain/src/lib.rs @@ -38,7 +38,7 @@ pub trait Parameter: Codec + EncodeLike + Clone + Eq + Debug + TypeInfo {} impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + Debug + TypeInfo {} /// A GRANDPA Authority List and ID. -#[derive(Default, Encode, Decode, RuntimeDebug, PartialEq, Clone, TypeInfo)] +#[derive(Default, Encode, Eq, Decode, RuntimeDebug, PartialEq, Clone, TypeInfo)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct AuthoritySet { /// List of GRANDPA authorities for the current round. diff --git a/bridges/primitives/messages/src/source_chain.rs b/bridges/primitives/messages/src/source_chain.rs index 28ce49acc0..8451941a40 100644 --- a/bridges/primitives/messages/src/source_chain.rs +++ b/bridges/primitives/messages/src/source_chain.rs @@ -173,7 +173,7 @@ impl } /// Send message artifacts. -#[derive(RuntimeDebug, PartialEq)] +#[derive(Eq, RuntimeDebug, PartialEq)] pub struct SendMessageArtifacts { /// Nonce of the message. pub nonce: MessageNonce, @@ -198,7 +198,7 @@ pub trait MessagesBridge { } /// Bridge that does nothing when message is being sent. -#[derive(RuntimeDebug, PartialEq)] +#[derive(Eq, RuntimeDebug, PartialEq)] pub struct NoopMessagesBridge; impl diff --git a/bridges/primitives/runtime/src/storage_proof.rs b/bridges/primitives/runtime/src/storage_proof.rs index 4a99ab6210..30976ff7fb 100644 --- a/bridges/primitives/runtime/src/storage_proof.rs +++ b/bridges/primitives/runtime/src/storage_proof.rs @@ -58,7 +58,7 @@ where } } -#[derive(RuntimeDebug, PartialEq)] +#[derive(Eq, RuntimeDebug, PartialEq)] pub enum Error { StorageRootMismatch, StorageValueUnavailable, diff --git a/bridges/relays/bin-substrate/src/cli/bridge.rs b/bridges/relays/bin-substrate/src/cli/bridge.rs index db6c61381f..45d6f960ae 100644 --- a/bridges/relays/bin-substrate/src/cli/bridge.rs +++ b/bridges/relays/bin-substrate/src/cli/bridge.rs @@ -74,7 +74,7 @@ macro_rules! select_full_bridge { // Relay-messages #[allow(unused_imports)] - use crate::chains::millau_messages_to_rialto::MillauMessagesToRialto as MessagesLane; + use $crate::chains::millau_messages_to_rialto::MillauMessagesToRialto as MessagesLane; // Send-message / Estimate-fee #[allow(unused_imports)] @@ -93,7 +93,7 @@ macro_rules! select_full_bridge { // Relay-messages #[allow(unused_imports)] - use crate::chains::rialto_messages_to_millau::RialtoMessagesToMillau as MessagesLane; + use $crate::chains::rialto_messages_to_millau::RialtoMessagesToMillau as MessagesLane; // Send-message / Estimate-fee #[allow(unused_imports)] @@ -112,7 +112,7 @@ macro_rules! select_full_bridge { // Relay-messages #[allow(unused_imports)] - use crate::chains::rococo_messages_to_wococo::RococoMessagesToWococo as MessagesLane; + use $crate::chains::rococo_messages_to_wococo::RococoMessagesToWococo as MessagesLane; // Send-message / Estimate-fee #[allow(unused_imports)] @@ -131,7 +131,7 @@ macro_rules! select_full_bridge { // Relay-messages #[allow(unused_imports)] - use crate::chains::wococo_messages_to_rococo::WococoMessagesToRococo as MessagesLane; + use $crate::chains::wococo_messages_to_rococo::WococoMessagesToRococo as MessagesLane; // Send-message / Estimate-fee #[allow(unused_imports)] @@ -150,7 +150,7 @@ macro_rules! select_full_bridge { // Relay-messages #[allow(unused_imports)] - use crate::chains::kusama_messages_to_polkadot::KusamaMessagesToPolkadot as MessagesLane; + use $crate::chains::kusama_messages_to_polkadot::KusamaMessagesToPolkadot as MessagesLane; // Send-message / Estimate-fee #[allow(unused_imports)] @@ -169,7 +169,7 @@ macro_rules! select_full_bridge { // Relay-messages #[allow(unused_imports)] - use crate::chains::polkadot_messages_to_kusama::PolkadotMessagesToKusama as MessagesLane; + use $crate::chains::polkadot_messages_to_kusama::PolkadotMessagesToKusama as MessagesLane; // Send-message / Estimate-fee #[allow(unused_imports)] @@ -188,7 +188,7 @@ macro_rules! select_full_bridge { // Relay-messages #[allow(unused_imports)] - use crate::chains::millau_messages_to_rialto_parachain::MillauMessagesToRialtoParachain as MessagesLane; + use $crate::chains::millau_messages_to_rialto_parachain::MillauMessagesToRialtoParachain as MessagesLane; // Send-message / Estimate-fee #[allow(unused_imports)] @@ -207,7 +207,7 @@ macro_rules! select_full_bridge { // Relay-messages #[allow(unused_imports)] - use crate::chains::rialto_parachain_messages_to_millau::RialtoParachainMessagesToMillau as MessagesLane; + use $crate::chains::rialto_parachain_messages_to_millau::RialtoParachainMessagesToMillau as MessagesLane; // Send-message / Estimate-fee #[allow(unused_imports)] diff --git a/bridges/relays/bin-substrate/src/cli/encode_message.rs b/bridges/relays/bin-substrate/src/cli/encode_message.rs index e74d6da766..ad6070fdb0 100644 --- a/bridges/relays/bin-substrate/src/cli/encode_message.rs +++ b/bridges/relays/bin-substrate/src/cli/encode_message.rs @@ -83,11 +83,9 @@ pub(crate) fn compute_maximal_message_size( bridge_runtime_common::messages::target::maximal_incoming_message_size( maximal_target_extrinsic_size, ); - let maximal_message_size = if maximal_message_size > maximal_source_extrinsic_size { + if maximal_message_size > maximal_source_extrinsic_size { maximal_source_extrinsic_size } else { maximal_message_size - }; - - maximal_message_size + } } diff --git a/bridges/relays/bin-substrate/src/cli/register_parachain.rs b/bridges/relays/bin-substrate/src/cli/register_parachain.rs index 79515b31dc..d164781205 100644 --- a/bridges/relays/bin-substrate/src/cli/register_parachain.rs +++ b/bridges/relays/bin-substrate/src/cli/register_parachain.rs @@ -46,7 +46,7 @@ const NEXT_FREE_PARA_ID_STORAGE_NAME: &str = "NextFreeParaId"; const PARAS_LIFECYCLES_STORAGE_NAME: &str = "ParaLifecycles"; /// Register parachain. -#[derive(StructOpt, Debug, PartialEq)] +#[derive(StructOpt, Debug, PartialEq, Eq)] pub struct RegisterParachain { /// A parachain to register. #[structopt(possible_values = Parachain::VARIANTS, case_insensitive = true)] @@ -69,7 +69,7 @@ pub struct RegisterParachain { } /// Parachain to register. -#[derive(Debug, EnumString, EnumVariantNames, PartialEq)] +#[derive(Debug, EnumString, EnumVariantNames, PartialEq, Eq)] #[strum(serialize_all = "kebab_case")] pub enum Parachain { RialtoParachain, diff --git a/bridges/relays/bin-substrate/src/cli/reinit_bridge.rs b/bridges/relays/bin-substrate/src/cli/reinit_bridge.rs index 79869ad031..f598bdbca0 100644 --- a/bridges/relays/bin-substrate/src/cli/reinit_bridge.rs +++ b/bridges/relays/bin-substrate/src/cli/reinit_bridge.rs @@ -49,7 +49,7 @@ use substrate_relay_helper::{ }; /// Reinitialize bridge pallet. -#[derive(Debug, PartialEq, StructOpt)] +#[derive(Debug, PartialEq, Eq, StructOpt)] pub struct ReinitBridge { /// A bridge instance to reinitialize. #[structopt(possible_values = ReinitBridgeName::VARIANTS, case_insensitive = true)] @@ -62,7 +62,7 @@ pub struct ReinitBridge { target_sign: TargetSigningParams, } -#[derive(Debug, EnumString, EnumVariantNames, PartialEq)] +#[derive(Debug, EnumString, EnumVariantNames, PartialEq, Eq)] #[strum(serialize_all = "kebab_case")] /// Bridge to initialize. pub enum ReinitBridgeName { diff --git a/bridges/relays/bin-substrate/src/cli/relay_messages.rs b/bridges/relays/bin-substrate/src/cli/relay_messages.rs index 45087fad5e..820a71748d 100644 --- a/bridges/relays/bin-substrate/src/cli/relay_messages.rs +++ b/bridges/relays/bin-substrate/src/cli/relay_messages.rs @@ -29,7 +29,7 @@ use crate::{ }; /// Relayer operating mode. -#[derive(Debug, EnumString, EnumVariantNames, Clone, Copy, PartialEq)] +#[derive(Debug, EnumString, EnumVariantNames, Clone, Copy, PartialEq, Eq)] #[strum(serialize_all = "kebab_case")] pub enum RelayerMode { /// The relayer doesn't care about rewards. diff --git a/bridges/relays/bin-substrate/src/cli/send_message.rs b/bridges/relays/bin-substrate/src/cli/send_message.rs index 53187009d3..959fbbd7fc 100644 --- a/bridges/relays/bin-substrate/src/cli/send_message.rs +++ b/bridges/relays/bin-substrate/src/cli/send_message.rs @@ -100,6 +100,7 @@ impl SendMessage { ), }; let payload_len = payload.encode().len(); + #[allow(clippy::useless_conversion)] let send_message_call = Source::encode_send_message_call( self.lane.0, payload, diff --git a/bridges/relays/client-millau/src/lib.rs b/bridges/relays/client-millau/src/lib.rs index cefc722168..a2d18d5385 100644 --- a/bridges/relays/client-millau/src/lib.rs +++ b/bridges/relays/client-millau/src/lib.rs @@ -31,7 +31,7 @@ use std::time::Duration; pub type HeaderId = relay_utils::HeaderId; /// Millau chain definition. -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Millau; impl ChainBase for Millau { diff --git a/bridges/relays/client-rialto/src/lib.rs b/bridges/relays/client-rialto/src/lib.rs index e79556b966..70fcf44509 100644 --- a/bridges/relays/client-rialto/src/lib.rs +++ b/bridges/relays/client-rialto/src/lib.rs @@ -32,7 +32,7 @@ use std::time::Duration; pub type HeaderId = relay_utils::HeaderId; /// Rialto chain definition -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Rialto; impl ChainBase for Rialto { diff --git a/bridges/relays/client-substrate/src/test_chain.rs b/bridges/relays/client-substrate/src/test_chain.rs index c7c9983efe..f97df643a2 100644 --- a/bridges/relays/client-substrate/src/test_chain.rs +++ b/bridges/relays/client-substrate/src/test_chain.rs @@ -26,7 +26,7 @@ use frame_support::weights::{IdentityFee, Weight}; use std::time::Duration; /// Chain that may be used in tests. -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct TestChain; impl bp_runtime::Chain for TestChain { diff --git a/bridges/relays/finality/src/finality_loop_tests.rs b/bridges/relays/finality/src/finality_loop_tests.rs index 478d8e1be6..330d166098 100644 --- a/bridges/relays/finality/src/finality_loop_tests.rs +++ b/bridges/relays/finality/src/finality_loop_tests.rs @@ -70,7 +70,7 @@ impl FinalitySyncPipeline for TestFinalitySyncPipeline { type FinalityProof = TestFinalityProof; } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] struct TestSourceHeader(IsMandatory, TestNumber, TestHash); impl SourceHeader for TestSourceHeader { @@ -87,7 +87,7 @@ impl SourceHeader for TestSourceHeader { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] struct TestFinalityProof(TestNumber); impl FinalityProof for TestFinalityProof { diff --git a/bridges/relays/messages/src/message_lane_loop.rs b/bridges/relays/messages/src/message_lane_loop.rs index c1778d5d11..487623096f 100644 --- a/bridges/relays/messages/src/message_lane_loop.rs +++ b/bridges/relays/messages/src/message_lane_loop.rs @@ -62,7 +62,7 @@ pub struct Params { } /// Relayer operating mode. -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum RelayerMode { /// The relayer doesn't care about rewards. Altruistic, @@ -111,7 +111,7 @@ pub type MessageDetailsMap = BTreeMap>; /// Message delivery race proof parameters. -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct MessageProofParameters { /// Include outbound lane state proof? pub outbound_state_proof_required: bool, diff --git a/bridges/relays/parachains/src/parachains_loop.rs b/bridges/relays/parachains/src/parachains_loop.rs index b3baa217e8..827a5d4430 100644 --- a/bridges/relays/parachains/src/parachains_loop.rs +++ b/bridges/relays/parachains/src/parachains_loop.rs @@ -538,7 +538,7 @@ mod tests { } } - #[derive(Clone, Debug, PartialEq)] + #[derive(Clone, Debug, PartialEq, Eq)] struct TestParachainsPipeline; impl ParachainsPipeline for TestParachainsPipeline { @@ -1022,13 +1022,13 @@ mod tests { stall_timeout: Duration::from_secs(60), }; - assert_eq!(is_update_required(&sync_params, &[]), false); - assert_eq!(is_update_required(&sync_params, &[ParaId(PARA_ID)]), true); - assert_eq!(is_update_required(&sync_params, &[ParaId(PARA_ID), ParaId(PARA_1_ID)]), true); + assert!(!is_update_required(&sync_params, &[])); + assert!(is_update_required(&sync_params, &[ParaId(PARA_ID)])); + assert!(is_update_required(&sync_params, &[ParaId(PARA_ID), ParaId(PARA_1_ID)])); sync_params.strategy = ParachainSyncStrategy::All; - assert_eq!(is_update_required(&sync_params, &[]), false); - assert_eq!(is_update_required(&sync_params, &[ParaId(PARA_ID)]), false); - assert_eq!(is_update_required(&sync_params, &[ParaId(PARA_ID), ParaId(PARA_1_ID)]), true); + assert!(!is_update_required(&sync_params, &[])); + assert!(!is_update_required(&sync_params, &[ParaId(PARA_ID)])); + assert!(is_update_required(&sync_params, &[ParaId(PARA_ID), ParaId(PARA_1_ID)])); } } diff --git a/bridges/relays/utils/src/lib.rs b/bridges/relays/utils/src/lib.rs index a335be7912..603011819b 100644 --- a/bridges/relays/utils/src/lib.rs +++ b/bridges/relays/utils/src/lib.rs @@ -179,7 +179,7 @@ pub fn interval(timeout: Duration) -> impl futures::Stream { } /// Which client has caused error. -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Eq, Clone, Copy, PartialEq)] pub enum FailedClient { /// It is the source client who has caused error. Source, diff --git a/bridges/relays/utils/src/relay_loop.rs b/bridges/relays/utils/src/relay_loop.rs index 3c1d2d4ae8..11e14744a0 100644 --- a/bridges/relays/utils/src/relay_loop.rs +++ b/bridges/relays/utils/src/relay_loop.rs @@ -201,7 +201,7 @@ impl LoopMetrics { }, }; - let _ = runtime.block_on(async move { + runtime.block_on(async move { log::trace!( target: "bridge-metrics", "Starting prometheus endpoint at: {:?}",