diff --git a/account-decoder/src/lib.rs b/account-decoder/src/lib.rs index 4a0cdf851..303391d1d 100644 --- a/account-decoder/src/lib.rs +++ b/account-decoder/src/lib.rs @@ -34,7 +34,7 @@ pub type StringDecimals = String; pub const MAX_BASE58_BYTES: usize = 128; /// A duplicate representation of an Account for pretty JSON serialization -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiAccount { pub lamports: u64, @@ -44,7 +44,7 @@ pub struct UiAccount { pub rent_epoch: Epoch, } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase", untagged)] pub enum UiAccountData { LegacyBinary(String), // Legacy. Retained for RPC backwards compatibility @@ -157,7 +157,7 @@ impl UiAccount { } } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiFeeCalculator { pub lamports_per_signature: StringAmount, diff --git a/account-decoder/src/parse_account_data.rs b/account-decoder/src/parse_account_data.rs index 73bba759b..4b7768dc6 100644 --- a/account-decoder/src/parse_account_data.rs +++ b/account-decoder/src/parse_account_data.rs @@ -57,7 +57,7 @@ pub enum ParseAccountError { SerdeJsonError(#[from] serde_json::error::Error), } -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ParsedAccount { pub program: String, diff --git a/account-decoder/src/parse_bpf_loader.rs b/account-decoder/src/parse_bpf_loader.rs index 736d91052..d27810505 100644 --- a/account-decoder/src/parse_bpf_loader.rs +++ b/account-decoder/src/parse_bpf_loader.rs @@ -60,7 +60,7 @@ pub fn parse_bpf_upgradeable_loader( Ok(parsed_account) } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase", tag = "type", content = "info")] pub enum BpfUpgradeableLoaderAccountType { Uninitialized, @@ -69,20 +69,20 @@ pub enum BpfUpgradeableLoaderAccountType { ProgramData(UiProgramData), } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiBuffer { pub authority: Option, pub data: UiAccountData, } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiProgram { pub program_data: String, } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiProgramData { pub slot: u64, diff --git a/account-decoder/src/parse_config.rs b/account-decoder/src/parse_config.rs index ecdcdbf1e..f070b2fd8 100644 --- a/account-decoder/src/parse_config.rs +++ b/account-decoder/src/parse_config.rs @@ -59,7 +59,7 @@ pub enum ConfigAccountType { ValidatorInfo(UiConfig), } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiConfigKey { pub pubkey: String, diff --git a/account-decoder/src/parse_nonce.rs b/account-decoder/src/parse_nonce.rs index d013a84f9..66ed2697b 100644 --- a/account-decoder/src/parse_nonce.rs +++ b/account-decoder/src/parse_nonce.rs @@ -27,14 +27,14 @@ pub fn parse_nonce(data: &[u8]) -> Result { } /// A duplicate representation of NonceState for pretty JSON serialization -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase", tag = "type", content = "info")] pub enum UiNonceState { Uninitialized, Initialized(UiNonceData), } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiNonceData { pub authority: String, diff --git a/account-decoder/src/parse_stake.rs b/account-decoder/src/parse_stake.rs index daafdc44f..4db60fecd 100644 --- a/account-decoder/src/parse_stake.rs +++ b/account-decoder/src/parse_stake.rs @@ -44,7 +44,7 @@ pub struct UiStakeAccount { pub stake: Option, } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiMeta { pub rent_exempt_reserve: StringAmount, @@ -62,7 +62,7 @@ impl From for UiMeta { } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiLockup { pub unix_timestamp: UnixTimestamp, @@ -80,7 +80,7 @@ impl From for UiLockup { } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiAuthorized { pub staker: String, diff --git a/account-decoder/src/parse_sysvar.rs b/account-decoder/src/parse_sysvar.rs index b52e0e047..7b7c0821b 100644 --- a/account-decoder/src/parse_sysvar.rs +++ b/account-decoder/src/parse_sysvar.rs @@ -107,7 +107,7 @@ pub enum SysvarAccountType { StakeHistory(Vec), } -#[derive(Debug, Serialize, Deserialize, PartialEq, Default)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Default)] #[serde(rename_all = "camelCase")] pub struct UiClock { pub slot: Slot, @@ -129,7 +129,7 @@ impl From for UiClock { } } -#[derive(Debug, Serialize, Deserialize, PartialEq, Default)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Default)] #[serde(rename_all = "camelCase")] pub struct UiFees { pub fee_calculator: UiFeeCalculator, @@ -175,21 +175,21 @@ impl From for UiRewards { } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiRecentBlockhashesEntry { pub blockhash: String, pub fee_calculator: UiFeeCalculator, } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiSlotHashEntry { pub slot: Slot, pub hash: String, } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiSlotHistory { pub next_slot: Slot, @@ -211,7 +211,7 @@ impl std::fmt::Debug for SlotHistoryBits { } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiStakeHistoryEntry { pub epoch: Epoch, diff --git a/account-decoder/src/parse_token.rs b/account-decoder/src/parse_token.rs index 5c24fef42..4a94f00aa 100644 --- a/account-decoder/src/parse_token.rs +++ b/account-decoder/src/parse_token.rs @@ -179,7 +179,7 @@ pub struct UiTokenAccount { pub extensions: Vec, } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub enum UiAccountState { Uninitialized, @@ -260,7 +260,7 @@ pub fn token_amount_to_ui_amount(amount: u64, decimals: u8) -> UiTokenAmount { } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiMint { pub mint_authority: Option, @@ -272,7 +272,7 @@ pub struct UiMint { pub extensions: Vec, } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiMultisig { pub num_required_signers: u8, diff --git a/account-decoder/src/parse_token_extension.rs b/account-decoder/src/parse_token_extension.rs index c031fbad3..092e91514 100644 --- a/account-decoder/src/parse_token_extension.rs +++ b/account-decoder/src/parse_token_extension.rs @@ -6,7 +6,7 @@ use { }, }; -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase", tag = "extension", content = "state")] pub enum UiExtension { Uninitialized, @@ -53,7 +53,7 @@ pub fn parse_extension( } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiTransferFee { pub epoch: u64, @@ -71,7 +71,7 @@ impl From for UiTransferFee { } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiTransferFeeConfig { pub transfer_fee_config_authority: Option, @@ -100,7 +100,7 @@ impl From for UiTransferFeeConfig { } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiTransferFeeAmount { pub withheld_amount: u64, @@ -114,7 +114,7 @@ impl From for UiTransferFeeAmount { } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiMintCloseAuthority { pub close_authority: Option, @@ -129,7 +129,7 @@ impl From for UiMintCloseAu } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiDefaultAccountState { pub account_state: UiAccountState, @@ -146,7 +146,7 @@ impl From for UiDefaultAc } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiMemoTransfer { pub require_incoming_transfer_memos: bool, diff --git a/account-decoder/src/parse_vote.rs b/account-decoder/src/parse_vote.rs index b383b2839..1c1ee08d3 100644 --- a/account-decoder/src/parse_vote.rs +++ b/account-decoder/src/parse_vote.rs @@ -61,14 +61,14 @@ pub fn parse_vote(data: &[u8]) -> Result { } /// A wrapper enum for consistency across programs -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase", tag = "type", content = "info")] pub enum VoteAccountType { Vote(UiVoteState), } /// A duplicate representation of VoteState for pretty JSON serialization -#[derive(Debug, Serialize, Deserialize, Default, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Default, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UiVoteState { node_pubkey: String, @@ -82,7 +82,7 @@ pub struct UiVoteState { last_timestamp: BlockTimestamp, } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] struct UiLockout { slot: Slot, @@ -98,14 +98,14 @@ impl From<&Lockout> for UiLockout { } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] struct UiAuthorizedVoters { epoch: Epoch, authorized_voter: String, } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] struct UiPriorVoters { authorized_pubkey: String, @@ -113,7 +113,7 @@ struct UiPriorVoters { target_epoch: Epoch, } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] struct UiEpochCredits { epoch: Epoch, diff --git a/account-decoder/src/validator_info.rs b/account-decoder/src/validator_info.rs index 85a98286b..47e00a412 100644 --- a/account-decoder/src/validator_info.rs +++ b/account-decoder/src/validator_info.rs @@ -6,7 +6,7 @@ pub const MAX_VALIDATOR_INFO: u64 = 576; solana_sdk::declare_id!("Va1idator1nfo111111111111111111111111111111"); -#[derive(Debug, Deserialize, PartialEq, Serialize, Default)] +#[derive(Debug, Deserialize, PartialEq, Eq, Serialize, Default)] pub struct ValidatorInfo { pub info: String, } diff --git a/banking-bench/src/main.rs b/banking-bench/src/main.rs index e108b70af..392322812 100644 --- a/banking-bench/src/main.rs +++ b/banking-bench/src/main.rs @@ -65,7 +65,7 @@ fn check_txs( no_bank } -#[derive(ArgEnum, Clone, Copy, PartialEq)] +#[derive(ArgEnum, Clone, Copy, PartialEq, Eq)] enum WriteLockContention { /// No transactions lock the same accounts. None, diff --git a/banks-interface/src/lib.rs b/banks-interface/src/lib.rs index d8ca61978..344a101f2 100644 --- a/banks-interface/src/lib.rs +++ b/banks-interface/src/lib.rs @@ -16,14 +16,14 @@ use { }, }; -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub enum TransactionConfirmationStatus { Processed, Confirmed, Finalized, } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct TransactionStatus { pub slot: Slot, pub confirmations: Option, // None = rooted @@ -31,7 +31,7 @@ pub struct TransactionStatus { pub confirmation_status: Option, } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TransactionSimulationDetails { pub logs: Vec, @@ -39,7 +39,7 @@ pub struct TransactionSimulationDetails { pub return_data: Option, } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct BanksTransactionResultWithSimulation { pub result: Option>, pub simulation_details: Option, diff --git a/bloom/src/bloom.rs b/bloom/src/bloom.rs index 15642069b..1c95e842d 100644 --- a/bloom/src/bloom.rs +++ b/bloom/src/bloom.rs @@ -19,7 +19,7 @@ pub trait BloomHashIndex { fn hash_at_index(&self, hash_index: u64) -> u64; } -#[derive(Serialize, Deserialize, Default, Clone, PartialEq, AbiExample)] +#[derive(Serialize, Deserialize, Default, Clone, PartialEq, Eq, AbiExample)] pub struct Bloom { pub keys: Vec, pub bits: BitVec, diff --git a/bucket_map/src/index_entry.rs b/bucket_map/src/index_entry.rs index 6b56c3b79..91e77ac8c 100644 --- a/bucket_map/src/index_entry.rs +++ b/bucket_map/src/index_entry.rs @@ -16,7 +16,7 @@ use { }; #[repr(C)] -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] // one instance of this per item in the index // stored in the index bucket pub struct IndexEntry { diff --git a/cli-config/src/config.rs b/cli-config/src/config.rs index 6bcc16eed..bedac8a38 100644 --- a/cli-config/src/config.rs +++ b/cli-config/src/config.rs @@ -25,7 +25,7 @@ lazy_static! { } /// The Solana CLI configuration. -#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] pub struct Config { /// The RPC address of a Solana validator node. /// diff --git a/cli-output/src/cli_output.rs b/cli-output/src/cli_output.rs index eb2ad8ab0..ded02b55e 100644 --- a/cli-output/src/cli_output.rs +++ b/cli-output/src/cli_output.rs @@ -52,7 +52,7 @@ static CHECK_MARK: Emoji = Emoji("✅ ", ""); static CROSS_MARK: Emoji = Emoji("❌ ", ""); static WARNING: Emoji = Emoji("⚠️", "!"); -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub enum OutputFormat { Display, Json, @@ -347,7 +347,7 @@ pub struct CliValidatorsStakeByVersion { pub delinquent_active_stake: u64, } -#[derive(Serialize, Deserialize, Debug, PartialEq, Clone, Copy)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone, Copy)] pub enum CliValidatorsSortOrder { Delinquent, Commission, @@ -1207,7 +1207,7 @@ impl fmt::Display for CliStakeState { } } -#[derive(Serialize, Deserialize, PartialEq)] +#[derive(Serialize, Deserialize, PartialEq, Eq)] pub enum CliStakeType { Stake, RewardsPool, @@ -1604,7 +1604,7 @@ impl fmt::Display for CliInflation { } } -#[derive(Serialize, Deserialize, Default, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Default, Debug, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct CliSignOnlyData { pub blockhash: String, diff --git a/cli-output/src/display.rs b/cli-output/src/display.rs index c5f3cd272..da4ef31bd 100644 --- a/cli-output/src/display.rs +++ b/cli-output/src/display.rs @@ -370,7 +370,7 @@ fn write_signatures( Ok(()) } -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] enum AccountKeyType<'a> { Known(&'a Pubkey), Unknown { diff --git a/cli/src/cluster_query.rs b/cli/src/cluster_query.rs index f39b64cde..841f15aed 100644 --- a/cli/src/cluster_query.rs +++ b/cli/src/cluster_query.rs @@ -2099,7 +2099,7 @@ impl fmt::Display for CliRentCalculation { impl QuietDisplay for CliRentCalculation {} impl VerboseDisplay for CliRentCalculation {} -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum RentLengthValue { Nonce, Stake, diff --git a/cli/src/feature.rs b/cli/src/feature.rs index cef10916e..3641fb5ae 100644 --- a/cli/src/feature.rs +++ b/cli/src/feature.rs @@ -25,14 +25,14 @@ use { const DEFAULT_MAX_ACTIVE_DISPLAY_AGE_SLOTS: Slot = 15_000_000; // ~90days -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum ForceActivation { No, Almost, Yes, } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum FeatureCliCommand { Status { features: Vec, diff --git a/cli/src/inflation.rs b/cli/src/inflation.rs index 6466899f5..c8b39dbd0 100644 --- a/cli/src/inflation.rs +++ b/cli/src/inflation.rs @@ -15,7 +15,7 @@ use { std::sync::Arc, }; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum InflationCliCommand { Show, Rewards(Vec, Option), diff --git a/cli/src/program.rs b/cli/src/program.rs index 7475f25bb..e9e044aad 100644 --- a/cli/src/program.rs +++ b/cli/src/program.rs @@ -54,7 +54,7 @@ use { }, }; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum ProgramCliCommand { Deploy { program_location: Option, diff --git a/cli/src/spend_utils.rs b/cli/src/spend_utils.rs index a8c0230bd..e2486ada9 100644 --- a/cli/src/spend_utils.rs +++ b/cli/src/spend_utils.rs @@ -12,7 +12,7 @@ use { }, }; -#[derive(Debug, PartialEq, Clone, Copy)] +#[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum SpendAmount { All, Some(u64), diff --git a/cli/src/stake.rs b/cli/src/stake.rs index fe85d251d..f6a76f7e9 100644 --- a/cli/src/stake.rs +++ b/cli/src/stake.rs @@ -103,7 +103,7 @@ pub(crate) struct StakeAuthorization { authority_pubkey: Option, } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct StakeAuthorizationIndexed { pub authorization_type: StakeAuthorize, pub new_authority_pubkey: Pubkey, diff --git a/client/src/blockhash_query.rs b/client/src/blockhash_query.rs index 03a59d758..1db39d166 100644 --- a/client/src/blockhash_query.rs +++ b/client/src/blockhash_query.rs @@ -12,7 +12,7 @@ use { }, }; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum Source { Cluster, NonceAccount(Pubkey), @@ -107,7 +107,7 @@ impl Source { } } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum BlockhashQuery { None(Hash), FeeCalculator(Source, Hash), diff --git a/client/src/nonce_utils.rs b/client/src/nonce_utils.rs index fd4204d78..59d9fe027 100644 --- a/client/src/nonce_utils.rs +++ b/client/src/nonce_utils.rs @@ -16,7 +16,7 @@ use { }, }; -#[derive(Debug, thiserror::Error, PartialEq)] +#[derive(Debug, thiserror::Error, PartialEq, Eq)] pub enum Error { #[error("invalid account owner")] InvalidAccountOwner, diff --git a/client/src/rpc_config.rs b/client/src/rpc_config.rs index 4c21b8284..8bab4f679 100644 --- a/client/src/rpc_config.rs +++ b/client/src/rpc_config.rs @@ -8,13 +8,13 @@ use { solana_transaction_status::{TransactionDetails, UiTransactionEncoding}, }; -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcSignatureStatusConfig { pub search_transaction_history: bool, } -#[derive(Debug, Default, Clone, Copy, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcSendTransactionConfig { #[serde(default)] @@ -25,14 +25,14 @@ pub struct RpcSendTransactionConfig { pub min_context_slot: Option, } -#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcSimulateTransactionAccountsConfig { pub encoding: Option, pub addresses: Vec, } -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcSimulateTransactionConfig { #[serde(default)] @@ -46,7 +46,7 @@ pub struct RpcSimulateTransactionConfig { pub min_context_slot: Option, } -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcRequestAirdropConfig { pub recent_blockhash: Option, // base-58 encoded blockhash @@ -54,7 +54,7 @@ pub struct RpcRequestAirdropConfig { pub commitment: Option, } -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcLeaderScheduleConfig { pub identity: Option, // validator identity, as a base-58 encoded string @@ -62,7 +62,7 @@ pub struct RpcLeaderScheduleConfig { pub commitment: Option, } -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcBlockProductionConfigRange { pub first_slot: Slot, @@ -78,7 +78,7 @@ pub struct RpcBlockProductionConfig { pub commitment: Option, } -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcGetVoteAccountsConfig { pub vote_pubkey: Option, // validator vote address, as a base-58 encoded string @@ -88,7 +88,7 @@ pub struct RpcGetVoteAccountsConfig { pub delinquent_slot_distance: Option, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(untagged)] pub enum RpcLeaderScheduleConfigWrapper { SlotOnly(Option), @@ -111,7 +111,7 @@ pub enum RpcLargestAccountsFilter { NonCirculating, } -#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcLargestAccountsConfig { #[serde(flatten)] @@ -119,7 +119,7 @@ pub struct RpcLargestAccountsConfig { pub filter: Option, } -#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcSupplyConfig { #[serde(flatten)] @@ -128,7 +128,7 @@ pub struct RpcSupplyConfig { pub exclude_non_circulating_accounts_list: bool, } -#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcEpochConfig { pub epoch: Option, @@ -137,7 +137,7 @@ pub struct RpcEpochConfig { pub min_context_slot: Option, } -#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcAccountInfoConfig { pub encoding: Option, @@ -147,7 +147,7 @@ pub struct RpcAccountInfoConfig { pub min_context_slot: Option, } -#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcProgramAccountsConfig { pub filters: Option>, @@ -156,7 +156,7 @@ pub struct RpcProgramAccountsConfig { pub with_context: Option, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub enum RpcTransactionLogsFilter { All, @@ -164,21 +164,21 @@ pub enum RpcTransactionLogsFilter { Mentions(Vec), // base58-encoded list of addresses } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcTransactionLogsConfig { #[serde(flatten)] pub commitment: Option, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub enum RpcTokenAccountsFilter { Mint(String), ProgramId(String), } -#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcSignatureSubscribeConfig { #[serde(flatten)] @@ -186,14 +186,14 @@ pub struct RpcSignatureSubscribeConfig { pub enable_received_notification: Option, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub enum RpcBlockSubscribeFilter { All, MentionsAccountOrProgram(String), } -#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcBlockSubscribeConfig { #[serde(flatten)] @@ -204,7 +204,7 @@ pub struct RpcBlockSubscribeConfig { pub max_supported_transaction_version: Option, } -#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcSignaturesForAddressConfig { pub before: Option, // Signature as base-58 string @@ -246,7 +246,7 @@ pub trait EncodingConfig { fn new_with_encoding(encoding: &Option) -> Self; } -#[derive(Debug, Clone, Copy, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcBlockConfig { pub encoding: Option, @@ -289,7 +289,7 @@ impl From for RpcEncodingConfigWrapper { } } -#[derive(Debug, Clone, Copy, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcTransactionConfig { pub encoding: Option, @@ -307,7 +307,7 @@ impl EncodingConfig for RpcTransactionConfig { } } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(untagged)] pub enum RpcBlocksConfigWrapper { EndSlotOnly(Option), @@ -323,7 +323,7 @@ impl RpcBlocksConfigWrapper { } } -#[derive(Debug, Clone, Copy, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcContextConfig { #[serde(flatten)] diff --git a/client/src/rpc_deprecated_config.rs b/client/src/rpc_deprecated_config.rs index eb4fbaea8..6457b5f34 100644 --- a/client/src/rpc_deprecated_config.rs +++ b/client/src/rpc_deprecated_config.rs @@ -11,7 +11,7 @@ use { since = "1.7.0", note = "Please use RpcSignaturesForAddressConfig instead" )] -#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcGetConfirmedSignaturesForAddress2Config { pub before: Option, // Signature as base-58 string @@ -22,7 +22,7 @@ pub struct RpcGetConfirmedSignaturesForAddress2Config { } #[deprecated(since = "1.7.0", note = "Please use RpcBlockConfig instead")] -#[derive(Debug, Clone, Copy, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcConfirmedBlockConfig { pub encoding: Option, @@ -77,7 +77,7 @@ impl From for RpcBlockConfig { } #[deprecated(since = "1.7.0", note = "Please use RpcTransactionConfig instead")] -#[derive(Debug, Clone, Copy, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcConfirmedTransactionConfig { pub encoding: Option, @@ -105,7 +105,7 @@ impl From for RpcTransactionConfig { } #[deprecated(since = "1.7.0", note = "Please use RpcBlocksConfigWrapper instead")] -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(untagged)] pub enum RpcConfirmedBlocksConfigWrapper { EndSlotOnly(Option), diff --git a/client/src/rpc_filter.rs b/client/src/rpc_filter.rs index f11de58ae..043984fce 100644 --- a/client/src/rpc_filter.rs +++ b/client/src/rpc_filter.rs @@ -87,7 +87,7 @@ impl RpcFilterType { } } -#[derive(Error, PartialEq, Debug)] +#[derive(Error, PartialEq, Eq, Debug)] pub enum RpcFilterError { #[error("encoded binary data should be less than 129 bytes")] DataTooLarge, diff --git a/client/src/rpc_response.rs b/client/src/rpc_response.rs index 3b7c21be5..9957838b2 100644 --- a/client/src/rpc_response.rs +++ b/client/src/rpc_response.rs @@ -19,7 +19,7 @@ use { pub type RpcResult = client_error::Result>; -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcResponseContext { pub slot: Slot, @@ -27,7 +27,7 @@ pub struct RpcResponseContext { pub api_version: Option, } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct RpcApiVersion(semver::Version); impl std::ops::Deref for RpcApiVersion { @@ -168,21 +168,21 @@ pub struct RpcInflationRate { pub epoch: Epoch, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct RpcKeyedAccount { pub pubkey: String, pub account: UiAccount, } -#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq)] pub struct SlotInfo { pub slot: Slot, pub parent: Slot, pub root: Slot, } -#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct SlotTransactionStats { pub num_transaction_entries: u64, @@ -290,14 +290,14 @@ pub struct RpcContactInfo { /// Map of leader base58 identity pubkeys to the slot indices relative to the first epoch slot pub type RpcLeaderSchedule = HashMap>; -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcBlockProductionRange { pub first_slot: Slot, pub last_slot: Slot, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct RpcBlockProduction { /// Map of leader base58 identity pubkeys to a tuple of `(number of leader slots, number of blocks produced)` @@ -431,14 +431,14 @@ pub struct RpcStorageTurn { pub slot: Slot, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct RpcAccountBalance { pub address: String, pub lamports: u64, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct RpcSupply { pub total: u64, @@ -447,7 +447,7 @@ pub struct RpcSupply { pub non_circulating_accounts: Vec, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub enum StakeActivationState { Activating, @@ -456,7 +456,7 @@ pub enum StakeActivationState { Inactive, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct RpcStakeActivation { pub state: StakeActivationState, @@ -472,7 +472,7 @@ pub struct RpcTokenAccountBalance { pub amount: UiTokenAmount, } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcConfirmedTransactionStatusWithSignature { pub signature: String, @@ -483,7 +483,7 @@ pub struct RpcConfirmedTransactionStatusWithSignature { pub confirmation_status: Option, } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcPerfSample { pub slot: Slot, @@ -492,7 +492,7 @@ pub struct RpcPerfSample { pub sample_period_secs: u16, } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RpcInflationReward { pub epoch: Epoch, @@ -539,7 +539,7 @@ impl From for RpcConfirmedTransactionSt } } -#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq)] pub struct RpcSnapshotSlotInfo { pub full: Slot, pub incremental: Option, diff --git a/core/src/ancestor_hashes_service.rs b/core/src/ancestor_hashes_service.rs index aa5746b03..24870aa38 100644 --- a/core/src/ancestor_hashes_service.rs +++ b/core/src/ancestor_hashes_service.rs @@ -36,7 +36,7 @@ use { }, }; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum AncestorHashesReplayUpdate { Dead(Slot), DeadDuplicateConfirmed(Slot), diff --git a/core/src/banking_stage.rs b/core/src/banking_stage.rs index 6e6375047..48b5a439a 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -103,7 +103,7 @@ struct RecordTransactionsSummary { result: Result<(), PohRecorderError>, } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum CommitTransactionDetails { Committed { compute_units: u64 }, NotCommitted, diff --git a/core/src/broadcast_stage.rs b/core/src/broadcast_stage.rs index 11e7bf979..4b3c87110 100644 --- a/core/src/broadcast_stage.rs +++ b/core/src/broadcast_stage.rs @@ -64,7 +64,7 @@ pub enum BroadcastStageReturnType { ChannelDisconnected, } -#[derive(PartialEq, Clone, Debug)] +#[derive(PartialEq, Eq, Clone, Debug)] pub enum BroadcastStageType { Standard, FailEntryVerification, diff --git a/core/src/broadcast_stage/broadcast_duplicates_run.rs b/core/src/broadcast_stage/broadcast_duplicates_run.rs index e4ba40519..124a6f080 100644 --- a/core/src/broadcast_stage/broadcast_duplicates_run.rs +++ b/core/src/broadcast_stage/broadcast_duplicates_run.rs @@ -16,7 +16,7 @@ use { pub const MINIMUM_DUPLICATE_SLOT: Slot = 20; pub const DUPLICATE_RATE: usize = 10; -#[derive(PartialEq, Clone, Debug)] +#[derive(PartialEq, Eq, Clone, Debug)] pub struct BroadcastDuplicatesConfig { /// Amount of stake (excluding the leader) to send different version of slots to. /// Note this is sampled from a list of stakes sorted least to greatest. diff --git a/core/src/cluster_slot_state_verifier.rs b/core/src/cluster_slot_state_verifier.rs index 8037cb66e..24828b756 100644 --- a/core/src/cluster_slot_state_verifier.rs +++ b/core/src/cluster_slot_state_verifier.rs @@ -14,7 +14,7 @@ pub(crate) type DuplicateSlotsToRepair = HashMap; pub(crate) type EpochSlotsFrozenSlots = BTreeMap; pub(crate) type GossipDuplicateConfirmedSlots = BTreeMap; -#[derive(PartialEq, Clone, Debug)] +#[derive(PartialEq, Eq, Clone, Debug)] pub enum ClusterConfirmedHash { // Ordered from strongest confirmation to weakest. Stronger // confirmations take precedence over weaker ones. @@ -22,7 +22,7 @@ pub enum ClusterConfirmedHash { EpochSlotsFrozen(Hash), } -#[derive(PartialEq, Clone, Debug)] +#[derive(PartialEq, Eq, Clone, Debug)] pub enum BankStatus { Frozen(Hash), Dead, @@ -71,7 +71,7 @@ impl BankStatus { } } -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub struct DeadState { // Keep fields private, forces construction // via constructor @@ -106,7 +106,7 @@ impl DeadState { } } -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub struct BankFrozenState { // Keep fields private, forces construction // via constructor @@ -149,7 +149,7 @@ impl BankFrozenState { } } -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub struct DuplicateConfirmedState { // Keep fields private, forces construction // via constructor @@ -174,7 +174,7 @@ impl DuplicateConfirmedState { } } -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub struct DuplicateState { // Keep fields private, forces construction // via constructor @@ -211,7 +211,7 @@ impl DuplicateState { } } -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub struct EpochSlotsFrozenState { // Keep fields private, forces construction // via constructor @@ -255,7 +255,7 @@ impl EpochSlotsFrozenState { } } -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub enum SlotStateUpdate { BankFrozen(BankFrozenState), DuplicateConfirmed(DuplicateConfirmedState), @@ -280,7 +280,7 @@ impl SlotStateUpdate { } } -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub enum ResultingStateChange { // Bank was frozen BankFrozen(Hash), diff --git a/core/src/consensus.rs b/core/src/consensus.rs index 3b1622274..a5c7a4933 100644 --- a/core/src/consensus.rs +++ b/core/src/consensus.rs @@ -39,7 +39,7 @@ use { thiserror::Error, }; -#[derive(PartialEq, Clone, Debug, AbiExample)] +#[derive(PartialEq, Eq, Clone, Debug, AbiExample)] pub enum SwitchForkDecision { SwitchProof(Hash), SameFork, diff --git a/core/src/duplicate_repair_status.rs b/core/src/duplicate_repair_status.rs index 781b647b7..8fc0eb6ba 100644 --- a/core/src/duplicate_repair_status.rs +++ b/core/src/duplicate_repair_status.rs @@ -17,7 +17,7 @@ pub const ANCESTOR_HASH_REPAIR_SAMPLE_SIZE: usize = 21; const MINIMUM_ANCESTOR_AGREEMENT_SIZE: usize = (ANCESTOR_HASH_REPAIR_SAMPLE_SIZE + 1) / 2; const RETRY_INTERVAL_SECONDS: usize = 5; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum DuplicateAncestorDecision { InvalidSample, AncestorsAllMatch, @@ -67,7 +67,7 @@ impl DuplicateAncestorDecision { } } -#[derive(Debug, Default, Clone, PartialEq)] +#[derive(Debug, Default, Clone, PartialEq, Eq)] pub struct DuplicateSlotRepairStatus { // Any ancestor slots that are either missing or are mismatched. // A mismatched ancestor slot is one that has been replayed (frozen) diff --git a/core/src/repair_weighted_traversal.rs b/core/src/repair_weighted_traversal.rs index 939955ff4..426cfd17e 100644 --- a/core/src/repair_weighted_traversal.rs +++ b/core/src/repair_weighted_traversal.rs @@ -9,7 +9,7 @@ use { std::collections::{HashMap, HashSet}, }; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] enum Visit { Visited(Slot), Unvisited(Slot), diff --git a/core/src/replay_stage.rs b/core/src/replay_stage.rs index 6a97d6518..aa65c2b95 100644 --- a/core/src/replay_stage.rs +++ b/core/src/replay_stage.rs @@ -85,7 +85,7 @@ pub const DUPLICATE_THRESHOLD: f64 = 1.0 - SWITCH_FORK_THRESHOLD - DUPLICATE_LIV const MAX_VOTE_SIGNATURES: usize = 200; const MAX_VOTE_REFRESH_INTERVAL_MILLIS: usize = 5000; -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub enum HeaviestForkFailures { LockedOut(u64), FailedThreshold(u64), diff --git a/core/src/tower1_7_14.rs b/core/src/tower1_7_14.rs index 8b7d3e830..63b70cdf8 100644 --- a/core/src/tower1_7_14.rs +++ b/core/src/tower1_7_14.rs @@ -37,7 +37,7 @@ pub struct Tower1_7_14 { } #[frozen_abi(digest = "CxwFFxKfn6ez6wifDKr5WYr3eu2PsWUKdMYp3LX8Xj52")] -#[derive(Default, Clone, Serialize, Deserialize, Debug, PartialEq, AbiExample)] +#[derive(Default, Clone, Serialize, Deserialize, Debug, PartialEq, Eq, AbiExample)] pub struct SavedTower1_7_14 { pub(crate) signature: Signature, pub(crate) data: Vec, diff --git a/core/src/tower_storage.rs b/core/src/tower_storage.rs index eefdb8161..330cf7bdc 100644 --- a/core/src/tower_storage.rs +++ b/core/src/tower_storage.rs @@ -14,7 +14,7 @@ use { }, }; -#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, AbiExample)] +#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq, AbiExample)] pub enum SavedTowerVersions { V1_17_14(SavedTower1_7_14), Current(SavedTower), @@ -76,7 +76,7 @@ impl From for SavedTowerVersions { } #[frozen_abi(digest = "Gaxfwvx5MArn52mKZQgzHmDCyn5YfCuTHvp5Et3rFfpp")] -#[derive(Default, Clone, Serialize, Deserialize, Debug, PartialEq, AbiExample)] +#[derive(Default, Clone, Serialize, Deserialize, Debug, PartialEq, Eq, AbiExample)] pub struct SavedTower { signature: Signature, data: Vec, @@ -109,7 +109,7 @@ pub trait TowerStorage: Sync + Send { fn store(&self, saved_tower: &SavedTowerVersions) -> Result<()>; } -#[derive(Debug, Default, Clone, PartialEq)] +#[derive(Debug, Default, Clone, PartialEq, Eq)] pub struct NullTowerStorage {} impl TowerStorage for NullTowerStorage { @@ -125,7 +125,7 @@ impl TowerStorage for NullTowerStorage { } } -#[derive(Debug, Default, Clone, PartialEq)] +#[derive(Debug, Default, Clone, PartialEq, Eq)] pub struct FileTowerStorage { pub tower_path: PathBuf, } diff --git a/core/src/validator.rs b/core/src/validator.rs index 86ba1b128..22f7bbeec 100644 --- a/core/src/validator.rs +++ b/core/src/validator.rs @@ -251,7 +251,7 @@ impl ValidatorConfig { // `ValidatorStartProgress` contains status information that is surfaced to the node operator over // the admin RPC channel to help them to follow the general progress of node startup without // having to watch log messages. -#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] pub enum ValidatorStartProgress { Initializing, // Catch all, default state SearchingForRpcService, @@ -1820,7 +1820,7 @@ fn initialize_rpc_transaction_history_services( } } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] enum ValidatorError { BadExpectedBankHash, NotEnoughLedgerData, diff --git a/dos/src/cli.rs b/dos/src/cli.rs index cce110a85..c6ea7b059 100644 --- a/dos/src/cli.rs +++ b/dos/src/cli.rs @@ -5,7 +5,7 @@ use { std::{net::SocketAddr, process::exit, str::FromStr}, }; -#[derive(Parser, Debug, PartialEq)] +#[derive(Parser, Debug, PartialEq, Eq)] #[clap(name = crate_name!(), version = crate_version!(), about = crate_description!(), @@ -52,7 +52,7 @@ pub struct DosClientParameters { pub transaction_params: TransactionParams, } -#[derive(Args, Serialize, Deserialize, Debug, Default, PartialEq)] +#[derive(Args, Serialize, Deserialize, Debug, Default, PartialEq, Eq)] #[clap(rename_all = "kebab-case")] pub struct TransactionParams { #[clap( @@ -119,7 +119,7 @@ pub enum DataType { Transaction, } -#[derive(ArgEnum, Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(ArgEnum, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub enum TransactionType { Transfer, AccountCreation, diff --git a/entry/src/entry.rs b/entry/src/entry.rs index e72247ac5..6bf2e54ab 100644 --- a/entry/src/entry.rs +++ b/entry/src/entry.rs @@ -318,7 +318,7 @@ pub struct VerifyRecyclers { tx_offset_recycler: Recycler, } -#[derive(PartialEq, Clone, Copy, Debug)] +#[derive(PartialEq, Eq, Clone, Copy, Debug)] pub enum EntryVerificationStatus { Failure, Success, diff --git a/gossip/src/crds.rs b/gossip/src/crds.rs index b8b008dad..2c215c928 100644 --- a/gossip/src/crds.rs +++ b/gossip/src/crds.rs @@ -77,7 +77,7 @@ pub struct Crds { stats: Mutex, } -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub enum CrdsError { InsertFailed, UnknownStakes, @@ -106,7 +106,7 @@ pub(crate) struct CrdsStats { } /// This structure stores some local metadata associated with the CrdsValue -#[derive(PartialEq, Debug, Clone)] +#[derive(PartialEq, Eq, Debug, Clone)] pub struct VersionedCrdsValue { /// Ordinal index indicating insert order. ordinal: u64, diff --git a/gossip/src/crds_gossip_error.rs b/gossip/src/crds_gossip_error.rs index add95f5d4..d6820bf44 100644 --- a/gossip/src/crds_gossip_error.rs +++ b/gossip/src/crds_gossip_error.rs @@ -1,4 +1,4 @@ -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub enum CrdsGossipError { NoPeers, PushMessageTimeout, diff --git a/gossip/src/crds_gossip_pull.rs b/gossip/src/crds_gossip_pull.rs index 0abc374e0..aecefead4 100644 --- a/gossip/src/crds_gossip_pull.rs +++ b/gossip/src/crds_gossip_pull.rs @@ -56,7 +56,7 @@ const PULL_ACTIVE_TIMEOUT_MS: u64 = 60_000; pub const FALSE_RATE: f64 = 0.1f64; pub const KEYS: f64 = 8f64; -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample)] pub struct CrdsFilter { pub filter: Bloom, mask: u64, diff --git a/gossip/src/crds_value.rs b/gossip/src/crds_value.rs index b1da5d4c5..cbee1542f 100644 --- a/gossip/src/crds_value.rs +++ b/gossip/src/crds_value.rs @@ -39,7 +39,7 @@ pub type EpochSlotsIndex = u8; pub const MAX_EPOCH_SLOTS: EpochSlotsIndex = 255; /// CrdsValue that is replicated across the cluster -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample)] pub struct CrdsValue { pub signature: Signature, pub data: CrdsData, @@ -79,7 +79,7 @@ impl Signable for CrdsValue { /// * Merge Strategy - Latest wallclock is picked /// * LowestSlot index is deprecated #[allow(clippy::large_enum_variant)] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample, AbiEnumVisitor)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample, AbiEnumVisitor)] pub enum CrdsData { ContactInfo(ContactInfo), Vote(VoteIndex, Vote), @@ -161,7 +161,7 @@ impl CrdsData { } } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample)] pub struct SnapshotHashes { pub from: Pubkey, pub hashes: Vec<(Slot, Hash)>, @@ -207,7 +207,7 @@ impl SnapshotHashes { } } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample)] pub struct IncrementalSnapshotHashes { pub from: Pubkey, pub base: (Slot, Hash), @@ -233,7 +233,7 @@ impl Sanitize for IncrementalSnapshotHashes { } } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample)] pub struct LowestSlot { pub from: Pubkey, root: Slot, //deprecated @@ -287,7 +287,7 @@ impl Sanitize for LowestSlot { } } -#[derive(Clone, Debug, PartialEq, AbiExample, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, AbiExample, Serialize)] pub struct Vote { pub(crate) from: Pubkey, transaction: Transaction, @@ -354,7 +354,7 @@ impl<'de> Deserialize<'de> for Vote { } } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample)] pub struct LegacyVersion { pub from: Pubkey, pub wallclock: u64, @@ -369,7 +369,7 @@ impl Sanitize for LegacyVersion { } } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample)] pub struct Version { pub from: Pubkey, pub wallclock: u64, @@ -409,7 +409,7 @@ impl Version { } } -#[derive(Clone, Debug, PartialEq, AbiExample, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, AbiExample, Deserialize, Serialize)] pub struct NodeInstance { from: Pubkey, wallclock: u64, diff --git a/gossip/src/deprecated.rs b/gossip/src/deprecated.rs index 57a7a8315..a838eb1a6 100644 --- a/gossip/src/deprecated.rs +++ b/gossip/src/deprecated.rs @@ -1,6 +1,6 @@ use solana_sdk::clock::Slot; -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample, AbiEnumVisitor)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample, AbiEnumVisitor)] enum CompressionType { Uncompressed, GZip, @@ -13,7 +13,7 @@ impl Default for CompressionType { } } -#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, AbiExample)] +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, Eq, AbiExample)] pub(crate) struct EpochIncompleteSlots { first: Slot, compression: CompressionType, diff --git a/gossip/src/duplicate_shred.rs b/gossip/src/duplicate_shred.rs index d0e5b34b0..537c6f8c0 100644 --- a/gossip/src/duplicate_shred.rs +++ b/gossip/src/duplicate_shred.rs @@ -27,7 +27,7 @@ pub(crate) const MAX_DUPLICATE_SHREDS: DuplicateShredIndex = 512; pub trait LeaderScheduleFn: FnOnce(Slot) -> Option {} impl LeaderScheduleFn for F where F: FnOnce(Slot) -> Option {} -#[derive(Clone, Debug, PartialEq, AbiExample, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, AbiExample, Deserialize, Serialize)] pub struct DuplicateShred { pub(crate) from: Pubkey, pub(crate) wallclock: u64, diff --git a/gossip/src/epoch_slots.rs b/gossip/src/epoch_slots.rs index 423bb64c0..173d4aaa5 100644 --- a/gossip/src/epoch_slots.rs +++ b/gossip/src/epoch_slots.rs @@ -14,7 +14,7 @@ use { }; const MAX_SLOTS_PER_ENTRY: usize = 2048 * 8; -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample)] pub struct Uncompressed { pub first_slot: Slot, pub num: usize, @@ -42,7 +42,7 @@ impl Sanitize for Uncompressed { } } -#[derive(Deserialize, Serialize, Clone, Debug, PartialEq, AbiExample)] +#[derive(Deserialize, Serialize, Clone, Debug, PartialEq, Eq, AbiExample)] pub struct Flate2 { pub first_slot: Slot, pub num: usize, @@ -61,7 +61,7 @@ impl Sanitize for Flate2 { } } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum Error { CompressError, DecompressError, @@ -156,7 +156,7 @@ impl Uncompressed { } } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample, AbiEnumVisitor)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample, AbiEnumVisitor)] pub enum CompressedSlots { Flate2(Flate2), Uncompressed(Uncompressed), @@ -225,7 +225,7 @@ impl CompressedSlots { } } -#[derive(Serialize, Deserialize, Clone, Default, PartialEq, AbiExample)] +#[derive(Serialize, Deserialize, Clone, Default, PartialEq, Eq, AbiExample)] pub struct EpochSlots { pub from: Pubkey, pub slots: Vec, diff --git a/install/src/config.rs b/install/src/config.rs index addb97f3d..4c1819184 100644 --- a/install/src/config.rs +++ b/install/src/config.rs @@ -9,13 +9,13 @@ use { }, }; -#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] pub enum ExplicitRelease { Semver(String), Channel(String), } -#[derive(Serialize, Deserialize, Default, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Default, Debug, PartialEq, Eq)] pub struct Config { pub json_rpc_url: String, pub update_manifest_pubkey: Pubkey, diff --git a/install/src/update_manifest.rs b/install/src/update_manifest.rs index e9de44bfc..57d408f89 100644 --- a/install/src/update_manifest.rs +++ b/install/src/update_manifest.rs @@ -10,7 +10,7 @@ use { }; /// Information required to download and apply a given update -#[derive(Serialize, Deserialize, Default, Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Default, Clone, Debug, PartialEq, Eq)] pub struct UpdateManifest { pub timestamp_secs: u64, // When the release was deployed in seconds since UNIX EPOCH pub download_url: String, // Download URL to the release tar.bz2 @@ -18,7 +18,7 @@ pub struct UpdateManifest { } /// Data of an Update Manifest program Account. -#[derive(Serialize, Deserialize, Default, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Default, Debug, PartialEq, Eq)] pub struct SignedUpdateManifest { pub manifest: UpdateManifest, pub manifest_signature: Signature, diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index f04466b42..5e1a8c35b 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -89,7 +89,7 @@ use { mod bigtable; mod ledger_path; -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] enum LedgerOutputMethod { Print, Json, diff --git a/ledger/src/block_error.rs b/ledger/src/block_error.rs index 958470843..d79b3e0aa 100644 --- a/ledger/src/block_error.rs +++ b/ledger/src/block_error.rs @@ -1,6 +1,6 @@ use thiserror::Error; -#[derive(Error, Debug, PartialEq)] +#[derive(Error, Debug, PartialEq, Eq)] pub enum BlockError { /// Block did not have enough ticks was not marked full /// and no shred with is_last was seen. diff --git a/ledger/src/blockstore_db.rs b/ledger/src/blockstore_db.rs index 6824caab8..202e0c838 100644 --- a/ledger/src/blockstore_db.rs +++ b/ledger/src/blockstore_db.rs @@ -236,7 +236,7 @@ pub mod columns { // - Account for column in `analyze_storage()` in ledger-tool/src/main.rs } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum AccessType { /// Primary (read/write) access; only one process can have Primary access. Primary, diff --git a/ledger/src/blockstore_meta.rs b/ledger/src/blockstore_meta.rs index 885a1f4f9..8a0257c7b 100644 --- a/ledger/src/blockstore_meta.rs +++ b/ledger/src/blockstore_meta.rs @@ -65,7 +65,7 @@ mod serde_compat { } } -#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)] +#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq)] /// Index recording presence/absence of shreds pub struct Index { pub slot: Slot, @@ -73,7 +73,7 @@ pub struct Index { coding: ShredIndex, } -#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)] +#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq)] pub struct ShredIndex { /// Map representing presence/absence of shreds index: BTreeSet, @@ -107,14 +107,14 @@ pub struct DuplicateSlotProof { pub shred2: Vec, } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum ErasureMetaStatus { CanRecover, DataFull, StillNeed(usize), } -#[derive(Deserialize, Serialize, Debug, PartialEq)] +#[derive(Deserialize, Serialize, Debug, PartialEq, Eq)] pub enum FrozenHashVersioned { Current(FrozenHashStatus), } @@ -135,7 +135,7 @@ impl FrozenHashVersioned { } } -#[derive(Deserialize, Serialize, Debug, PartialEq)] +#[derive(Deserialize, Serialize, Debug, PartialEq, Eq)] pub struct FrozenHashStatus { pub frozen_hash: Hash, pub is_duplicate_confirmed: bool, @@ -307,36 +307,36 @@ impl DuplicateSlotProof { } } -#[derive(Debug, Default, Deserialize, Serialize, PartialEq)] +#[derive(Debug, Default, Deserialize, Serialize, PartialEq, Eq)] pub struct TransactionStatusIndexMeta { pub max_slot: Slot, pub frozen: bool, } -#[derive(Debug, Default, Deserialize, Serialize, PartialEq)] +#[derive(Debug, Default, Deserialize, Serialize, PartialEq, Eq)] pub struct AddressSignatureMeta { pub writeable: bool, } -#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)] +#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq)] pub struct PerfSample { pub num_transactions: u64, pub num_slots: u64, pub sample_period_secs: u16, } -#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)] +#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq)] pub struct ProgramCost { pub cost: u64, } -#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)] +#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq)] pub struct OptimisticSlotMetaV0 { pub hash: Hash, pub timestamp: UnixTimestamp, } -#[derive(Deserialize, Serialize, Debug, PartialEq)] +#[derive(Deserialize, Serialize, Debug, PartialEq, Eq)] pub enum OptimisticSlotMetaVersioned { V0(OptimisticSlotMetaV0), } diff --git a/ledger/src/leader_schedule.rs b/ledger/src/leader_schedule.rs index 856bb0db0..9521544e6 100644 --- a/ledger/src/leader_schedule.rs +++ b/ledger/src/leader_schedule.rs @@ -13,7 +13,7 @@ pub struct FixedSchedule { } /// Stake-weighted leader schedule for one epoch. -#[derive(Debug, Default, PartialEq)] +#[derive(Debug, Default, PartialEq, Eq)] pub struct LeaderSchedule { slot_leaders: Vec, // Inverted index from pubkeys to indices where they are the leader. diff --git a/ledger/src/shred.rs b/ledger/src/shred.rs index 61b3961f5..094dc0862 100644 --- a/ledger/src/shred.rs +++ b/ledger/src/shred.rs @@ -173,7 +173,7 @@ pub enum ShredType { } /// A common header that is present in data and code shred headers -#[derive(Clone, Copy, Debug, PartialEq, Deserialize, Serialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)] struct ShredCommonHeader { signature: Signature, shred_type: ShredType, @@ -184,7 +184,7 @@ struct ShredCommonHeader { } /// The data shred header has parent offset and flags -#[derive(Clone, Copy, Debug, PartialEq, Deserialize, Serialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)] struct DataShredHeader { parent_offset: u16, flags: ShredFlags, @@ -192,14 +192,14 @@ struct DataShredHeader { } /// The coding shred header has FEC information -#[derive(Clone, Copy, Debug, PartialEq, Deserialize, Serialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)] struct CodingShredHeader { num_data_shreds: u16, num_coding_shreds: u16, position: u16, } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum Shred { ShredCode(ShredCode), ShredData(ShredData), diff --git a/ledger/src/shred/legacy.rs b/ledger/src/shred/legacy.rs index 8197fa710..0e9544022 100644 --- a/ledger/src/shred/legacy.rs +++ b/ledger/src/shred/legacy.rs @@ -23,14 +23,14 @@ const DATA_SHRED_SIZE_RANGE: RangeInclusive = const_assert_eq!(ENCODED_PAYLOAD_SIZE, 1139); const ENCODED_PAYLOAD_SIZE: usize = SHRED_PAYLOAD_SIZE - SIZE_OF_CODING_SHRED_HEADERS; -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct ShredData { common_header: ShredCommonHeader, data_header: DataShredHeader, payload: Vec, } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct ShredCode { common_header: ShredCommonHeader, coding_header: CodingShredHeader, diff --git a/merkle-tree/src/merkle_tree.rs b/merkle-tree/src/merkle_tree.rs index 2834fbee9..70e09c27e 100644 --- a/merkle-tree/src/merkle_tree.rs +++ b/merkle-tree/src/merkle_tree.rs @@ -24,7 +24,7 @@ pub struct MerkleTree { nodes: Vec, } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct ProofEntry<'a>(&'a Hash, Option<&'a Hash>, Option<&'a Hash>); impl<'a> ProofEntry<'a> { @@ -38,7 +38,7 @@ impl<'a> ProofEntry<'a> { } } -#[derive(Debug, Default, PartialEq)] +#[derive(Debug, Default, PartialEq, Eq)] pub struct Proof<'a>(Vec>); impl<'a> Proof<'a> { diff --git a/metrics/src/poh_timing_point.rs b/metrics/src/poh_timing_point.rs index d48fddc79..4433fd14f 100644 --- a/metrics/src/poh_timing_point.rs +++ b/metrics/src/poh_timing_point.rs @@ -14,7 +14,7 @@ pub type PohTimingReceiver = Receiver; pub type PohTimingSender = Sender; /// PohTimingPoint. Each TimingPoint is annotated with a timestamp in milliseconds. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum PohTimingPoint { PohSlotStart(u64), PohSlotEnd(u64), diff --git a/net-utils/src/ip_echo_server.rs b/net-utils/src/ip_echo_server.rs index 333561d4d..486de5a1f 100644 --- a/net-utils/src/ip_echo_server.rs +++ b/net-utils/src/ip_echo_server.rs @@ -28,7 +28,7 @@ pub(crate) struct IpEchoServerMessage { udp_ports: [u16; MAX_PORT_COUNT_PER_MESSAGE], // Fixed size list of ports to avoid vec serde } -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct IpEchoServerResponse { // Public IP address of request echoed back to the node. pub(crate) address: IpAddr, diff --git a/perf/src/sigverify.rs b/perf/src/sigverify.rs index df8e98740..6e060ea43 100644 --- a/perf/src/sigverify.rs +++ b/perf/src/sigverify.rs @@ -77,7 +77,7 @@ impl PacketOffsets { } } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum PacketError { InvalidLen, InvalidPubkeyLen, diff --git a/poh/src/poh_recorder.rs b/poh/src/poh_recorder.rs index bc1acafea..9f295e7e3 100644 --- a/poh/src/poh_recorder.rs +++ b/poh/src/poh_recorder.rs @@ -193,7 +193,7 @@ pub struct WorkingBank { pub max_tick_height: u64, } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum PohLeaderStatus { NotReached, Reached { poh_slot: Slot, parent_slot: Slot }, diff --git a/program-runtime/src/compute_budget.rs b/program-runtime/src/compute_budget.rs index 5d7bbeb65..0adbc64db 100644 --- a/program-runtime/src/compute_budget.rs +++ b/program-runtime/src/compute_budget.rs @@ -22,7 +22,7 @@ impl ::solana_frozen_abi::abi_example::AbiExample for ComputeBudget { } } -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct ComputeBudget { /// Number of compute units that a transaction or individual instruction is /// allowed to consume. Compute units are consumed by program execution, diff --git a/program-runtime/src/prioritization_fee.rs b/program-runtime/src/prioritization_fee.rs index befc85b49..97b14f93b 100644 --- a/program-runtime/src/prioritization_fee.rs +++ b/program-runtime/src/prioritization_fee.rs @@ -8,7 +8,7 @@ pub enum PrioritizationFeeType { Deprecated(u64), } -#[derive(Default, Debug, PartialEq)] +#[derive(Default, Debug, PartialEq, Eq)] pub struct PrioritizationFeeDetails { fee: u64, priority: u64, diff --git a/program-runtime/src/timings.rs b/program-runtime/src/timings.rs index dd1fbf65d..f342b9d5c 100644 --- a/program-runtime/src/timings.rs +++ b/program-runtime/src/timings.rs @@ -8,7 +8,7 @@ use { }, }; -#[derive(Default, Debug, PartialEq)] +#[derive(Default, Debug, PartialEq, Eq)] pub struct ProgramTiming { pub accumulated_us: u64, pub accumulated_units: u64, @@ -153,7 +153,7 @@ impl ExecuteAccessoryTimings { } } -#[derive(Default, Debug, PartialEq)] +#[derive(Default, Debug, PartialEq, Eq)] pub struct ExecuteDetailsTimings { pub serialize_us: u64, pub create_vm_us: u64, diff --git a/program-test/src/lib.rs b/program-test/src/lib.rs index 682f095d5..c514dbedd 100644 --- a/program-test/src/lib.rs +++ b/program-test/src/lib.rs @@ -69,7 +69,7 @@ pub mod programs; extern crate solana_bpf_loader_program; /// Errors from the program test environment -#[derive(Error, Debug, PartialEq)] +#[derive(Error, Debug, PartialEq, Eq)] pub enum ProgramTestError { /// The chosen warp slot is not in the future, so warp is not performed #[error("Warp slot not in the future")] diff --git a/programs/address-lookup-table/src/state.rs b/programs/address-lookup-table/src/state.rs index 52a1b30e9..b287b48b8 100644 --- a/programs/address-lookup-table/src/state.rs +++ b/programs/address-lookup-table/src/state.rs @@ -18,7 +18,7 @@ pub const LOOKUP_TABLE_MAX_ADDRESSES: usize = 256; pub const LOOKUP_TABLE_META_SIZE: usize = 56; /// Program account states -#[derive(Debug, Serialize, Deserialize, PartialEq, Clone, AbiExample, AbiEnumVisitor)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, AbiExample, AbiEnumVisitor)] #[allow(clippy::large_enum_variant)] pub enum ProgramState { /// Account is not initialized. @@ -28,7 +28,7 @@ pub enum ProgramState { } /// Activation status of a lookup table -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] pub enum LookupTableStatus { Activated, Deactivating { remaining_blocks: usize }, @@ -36,7 +36,7 @@ pub enum LookupTableStatus { } /// Address lookup table metadata -#[derive(Debug, Serialize, Deserialize, PartialEq, Clone, AbiExample)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, AbiExample)] pub struct LookupTableMeta { /// Lookup tables cannot be closed until the deactivation slot is /// no longer "recent" (not accessible in the `SlotHashes` sysvar). @@ -112,7 +112,7 @@ impl LookupTableMeta { } } -#[derive(Debug, PartialEq, Clone, AbiExample)] +#[derive(Debug, PartialEq, Eq, Clone, AbiExample)] pub struct AddressLookupTable<'a> { pub meta: LookupTableMeta, pub addresses: Cow<'a, [Pubkey]>, diff --git a/programs/bpf_loader/src/lib.rs b/programs/bpf_loader/src/lib.rs index 4dbcc7ba7..c2f02b315 100644 --- a/programs/bpf_loader/src/lib.rs +++ b/programs/bpf_loader/src/lib.rs @@ -68,7 +68,7 @@ solana_sdk::declare_builtin!( ); /// Errors returned by functions the BPF Loader registers with the VM -#[derive(Debug, Error, PartialEq)] +#[derive(Debug, Error, PartialEq, Eq)] pub enum BpfError { #[error("{0}")] VerifierError(#[from] VerifierError), diff --git a/programs/bpf_loader/src/syscalls.rs b/programs/bpf_loader/src/syscalls.rs index 1ab3ef705..c28ba7f5c 100644 --- a/programs/bpf_loader/src/syscalls.rs +++ b/programs/bpf_loader/src/syscalls.rs @@ -62,7 +62,7 @@ use { pub const MAX_SIGNERS: usize = 16; /// Error definitions -#[derive(Debug, ThisError, PartialEq)] +#[derive(Debug, ThisError, PartialEq, Eq)] pub enum SyscallError { #[error("{0}: {1:?}")] InvalidString(Utf8Error, Vec), diff --git a/programs/config/src/config_processor.rs b/programs/config/src/config_processor.rs index c801df3f3..6387acc7c 100644 --- a/programs/config/src/config_processor.rs +++ b/programs/config/src/config_processor.rs @@ -174,7 +174,7 @@ mod tests { ) } - #[derive(Serialize, Deserialize, Debug, PartialEq)] + #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] struct MyConfig { pub item: u64, } diff --git a/programs/stake/src/stake_state.rs b/programs/stake/src/stake_state.rs index f1cdfa8c7..bbe7f9e83 100644 --- a/programs/stake/src/stake_state.rs +++ b/programs/stake/src/stake_state.rs @@ -153,7 +153,7 @@ pub(crate) fn new_stake( /// and the total points over which those lamports /// are to be distributed // basically read as rewards/points, but in integers instead of as an f64 -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct PointValue { pub rewards: u64, // lamports to split pub points: u128, // over these points @@ -216,7 +216,7 @@ fn calculate_stake_points( .points } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] struct CalculatedStakePoints { points: u128, new_credits_observed: u64, @@ -329,7 +329,7 @@ fn calculate_stake_points_and_credits( } } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] struct CalculatedStakeRewards { staker_rewards: u64, voter_rewards: u64, diff --git a/programs/vote/src/vote_error.rs b/programs/vote/src/vote_error.rs index be4855d12..bc868ef21 100644 --- a/programs/vote/src/vote_error.rs +++ b/programs/vote/src/vote_error.rs @@ -8,7 +8,7 @@ use { }; /// Reasons the vote might have had an error -#[derive(Error, Debug, Clone, PartialEq, FromPrimitive, ToPrimitive)] +#[derive(Error, Debug, Clone, PartialEq, Eq, FromPrimitive, ToPrimitive)] pub enum VoteError { #[error("vote already recorded or not in slot hashes history")] VoteTooOld, diff --git a/programs/vote/src/vote_state/mod.rs b/programs/vote/src/vote_state/mod.rs index 1fe68117a..9fd029f63 100644 --- a/programs/vote/src/vote_state/mod.rs +++ b/programs/vote/src/vote_state/mod.rs @@ -41,7 +41,7 @@ pub const MAX_EPOCH_CREDITS_HISTORY: usize = 64; const DEFAULT_PRIOR_VOTERS_OFFSET: usize = 82; #[frozen_abi(digest = "6LBwH5w3WyAWZhsM3KTG9QZP7nYBhcC61K33kHR6gMAD")] -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, AbiEnumVisitor, AbiExample)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize, AbiEnumVisitor, AbiExample)] pub enum VoteTransaction { Vote(Vote), VoteStateUpdate(VoteStateUpdate), diff --git a/remote-wallet/src/ledger_error.rs b/remote-wallet/src/ledger_error.rs index a434f776b..b6dfff5d3 100644 --- a/remote-wallet/src/ledger_error.rs +++ b/remote-wallet/src/ledger_error.rs @@ -1,6 +1,6 @@ use {num_derive::FromPrimitive, thiserror::Error}; -#[derive(Error, Debug, Clone, FromPrimitive, PartialEq)] +#[derive(Error, Debug, Clone, FromPrimitive, PartialEq, Eq)] pub enum LedgerError { #[error("Solana app not open on Ledger device")] NoAppResponse = 0x6700, diff --git a/remote-wallet/src/locator.rs b/remote-wallet/src/locator.rs index 1bb65f5a5..be3aa3fec 100644 --- a/remote-wallet/src/locator.rs +++ b/remote-wallet/src/locator.rs @@ -8,7 +8,7 @@ use { uriparse::{URIReference, URIReferenceBuilder, URIReferenceError}, }; -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum Manufacturer { Unknown, Ledger, @@ -23,7 +23,7 @@ impl Default for Manufacturer { const MANUFACTURER_UNKNOWN: &str = "unknown"; const MANUFACTURER_LEDGER: &str = "ledger"; -#[derive(Clone, Debug, Error, PartialEq)] +#[derive(Clone, Debug, Error, PartialEq, Eq)] #[error("not a manufacturer")] pub struct ManufacturerError; @@ -67,7 +67,7 @@ impl std::fmt::Display for Manufacturer { } } -#[derive(Clone, Debug, Error, PartialEq)] +#[derive(Clone, Debug, Error, PartialEq, Eq)] pub enum LocatorError { #[error(transparent)] ManufacturerError(#[from] ManufacturerError), @@ -87,7 +87,7 @@ impl From for LocatorError { } } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct Locator { pub manufacturer: Manufacturer, pub pubkey: Option, diff --git a/rpc/src/rpc_health.rs b/rpc/src/rpc_health.rs index 8f4b4dfc4..e68746a5d 100644 --- a/rpc/src/rpc_health.rs +++ b/rpc/src/rpc_health.rs @@ -10,7 +10,7 @@ use { }, }; -#[derive(PartialEq, Clone, Copy, Debug)] +#[derive(PartialEq, Eq, Clone, Copy, Debug)] pub enum RpcHealthStatus { Ok, Behind { num_slots: Slot }, // Validator is behind its known validators diff --git a/rpc/src/rpc_subscriptions.rs b/rpc/src/rpc_subscriptions.rs index 9abac30f5..bd9fe3374 100644 --- a/rpc/src/rpc_subscriptions.rs +++ b/rpc/src/rpc_subscriptions.rs @@ -199,7 +199,7 @@ impl From> for RpcResponse { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] struct RpcNotificationContext { slot: Slot, } diff --git a/runtime/src/account_info.rs b/runtime/src/account_info.rs index b15ee6b8e..6b246dff9 100644 --- a/runtime/src/account_info.rs +++ b/runtime/src/account_info.rs @@ -60,7 +60,7 @@ impl StorageLocation { /// AppendVecs store accounts aligned to u64, so offset is always a multiple of 8 (sizeof(u64)) pub type OffsetReduced = u32; -#[derive(Default, Debug, PartialEq, Clone, Copy)] +#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] pub struct AccountInfo { /// index identifying the append storage store_id: AppendVecId, diff --git a/runtime/src/account_rent_state.rs b/runtime/src/account_rent_state.rs index 6df6a4b05..7ac504b40 100644 --- a/runtime/src/account_rent_state.rs +++ b/runtime/src/account_rent_state.rs @@ -9,7 +9,7 @@ use { }, }; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub(crate) enum RentState { /// account.lamports == 0 Uninitialized, diff --git a/runtime/src/accounts.rs b/runtime/src/accounts.rs index a5fc0816f..9b2c317d8 100644 --- a/runtime/src/accounts.rs +++ b/runtime/src/accounts.rs @@ -119,7 +119,7 @@ pub struct Accounts { // for the load instructions pub type TransactionRent = u64; pub type TransactionProgramIndices = Vec>; -#[derive(PartialEq, Debug, Clone)] +#[derive(PartialEq, Eq, Debug, Clone)] pub struct LoadedTransaction { pub accounts: Vec, pub program_indices: TransactionProgramIndices, diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 9ed36176c..e3c79af21 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -266,7 +266,7 @@ struct GenerateIndexTimings { pub accounts_data_len_dedup_time_us: u64, } -#[derive(Default, Debug, PartialEq)] +#[derive(Default, Debug, PartialEq, Eq)] struct StorageSizeAndCount { pub stored_size: usize, pub count: usize, @@ -407,7 +407,7 @@ impl Versioned for (u64, AccountInfo) { // Slower fallback code path will be taken if the fast path has failed over the retry // threshold, regardless of these hints. Also, load cannot fail not-deterministically // even under very rare circumstances, unlike previously did allow. -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum LoadHint { // Caller hints that it's loading transactions for a block which is // descended from the current root, and at the tip of its fork. @@ -870,7 +870,7 @@ pub fn get_temp_accounts_paths(count: u32) -> IoResult<(Vec, Vec, pub start_offset: usize, diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 7854829f3..b02a57651 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -124,7 +124,7 @@ pub trait IndexValue: { } -#[derive(Error, Debug, PartialEq)] +#[derive(Error, Debug, PartialEq, Eq)] pub enum ScanError { #[error("Node detected it replayed bad version of slot {slot:?} with id {bank_id:?}, thus the scan on said slot was aborted")] SlotRemoved { slot: Slot, bank_id: BankId }, diff --git a/runtime/src/ancient_append_vecs.rs b/runtime/src/ancient_append_vecs.rs index bbcbc6f01..7b2705e98 100644 --- a/runtime/src/ancient_append_vecs.rs +++ b/runtime/src/ancient_append_vecs.rs @@ -13,7 +13,7 @@ use { /// a set of accounts need to be stored. /// If there are too many to fit in 'Primary', the rest are put in 'Overflow' -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum StorageSelector { Primary, Overflow, diff --git a/runtime/src/append_vec.rs b/runtime/src/append_vec.rs index ce290d87f..3792ca103 100644 --- a/runtime/src/append_vec.rs +++ b/runtime/src/append_vec.rs @@ -46,7 +46,7 @@ pub type StoredMetaWriteVersion = u64; /// Meta contains enough context to recover the index from storage itself /// This struct will be backed by mmaped and snapshotted data files. /// So the data layout must be stable and consistent across the entire cluster! -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub struct StoredMeta { /// global write version pub write_version: StoredMetaWriteVersion, @@ -91,7 +91,7 @@ impl<'a, T: ReadableAccount> From> for AccountMeta { /// References to account data stored elsewhere. Getting an `Account` requires cloning /// (see `StoredAccountMeta::clone_account()`). -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub struct StoredAccountMeta<'a> { pub meta: &'a StoredMeta, /// account data diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index b41b16a64..d4c0d09cc 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -190,7 +190,7 @@ pub const MAX_LEADER_SCHEDULE_STAKES: Epoch = 5; pub type Rewrites = RwLock>; -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct RentDebit { rent_collected: u64, post_balance: u64, @@ -210,7 +210,7 @@ impl RentDebit { } } -#[derive(Clone, Debug, Default, PartialEq)] +#[derive(Clone, Debug, Default, PartialEq, Eq)] pub struct RentDebits(HashMap); impl RentDebits { fn get_account_rent_debit(&self, address: &Pubkey) -> u64 { @@ -765,7 +765,7 @@ pub fn inner_instructions_list_from_instruction_trace( /// A list of log messages emitted during a transaction pub type TransactionLogMessages = Vec; -#[derive(Serialize, Deserialize, AbiExample, AbiEnumVisitor, Debug, PartialEq)] +#[derive(Serialize, Deserialize, AbiExample, AbiEnumVisitor, Debug, PartialEq, Eq)] pub enum TransactionLogCollectorFilter { All, AllWithVotes, @@ -785,7 +785,7 @@ pub struct TransactionLogCollectorConfig { pub filter: TransactionLogCollectorFilter, } -#[derive(AbiExample, Clone, Debug, PartialEq)] +#[derive(AbiExample, Clone, Debug, PartialEq, Eq)] pub struct TransactionLogInfo { pub signature: Signature, pub result: Result<()>, @@ -829,7 +829,7 @@ pub trait NonceInfo { } /// Holds limited nonce info available during transaction checks -#[derive(Clone, Debug, Default, PartialEq)] +#[derive(Clone, Debug, Default, PartialEq, Eq)] pub struct NoncePartial { address: Pubkey, account: AccountSharedData, @@ -855,7 +855,7 @@ impl NonceInfo for NoncePartial { } /// Holds fee subtracted nonce info -#[derive(Clone, Debug, Default, PartialEq)] +#[derive(Clone, Debug, Default, PartialEq, Eq)] pub struct NonceFull { address: Pubkey, account: AccountSharedData, @@ -1101,7 +1101,7 @@ impl PartialEq for Bank { } } -#[derive(Debug, PartialEq, Serialize, Deserialize, AbiExample, AbiEnumVisitor, Clone, Copy)] +#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, AbiExample, AbiEnumVisitor, Clone, Copy)] pub enum RewardType { Fee, Rent, @@ -1138,7 +1138,7 @@ pub trait DropCallback: fmt::Debug { fn clone_box(&self) -> Box; } -#[derive(Debug, PartialEq, Serialize, Deserialize, AbiExample, Clone, Copy)] +#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, AbiExample, Clone, Copy)] pub struct RewardInfo { pub reward_type: RewardType, pub lamports: i64, // Reward amount @@ -17873,7 +17873,7 @@ pub(crate) mod tests { .try_borrow_instruction_account(transaction_context, 1)? .get_lamports(); let diff_balance = (new_balance as i64).saturating_sub(current_balance as i64); - let amount = diff_balance.abs() as u64; + let amount = diff_balance.unsigned_abs(); if diff_balance.is_positive() { instruction_context .try_borrow_instruction_account(transaction_context, 0)? diff --git a/runtime/src/expected_rent_collection.rs b/runtime/src/expected_rent_collection.rs index 0b3560074..502bf7645 100644 --- a/runtime/src/expected_rent_collection.rs +++ b/runtime/src/expected_rent_collection.rs @@ -16,7 +16,7 @@ use { std::sync::atomic::Ordering, }; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct ExpectedRentCollection { partition_from_pubkey: PartitionIndex, epoch_of_max_storage_slot: Epoch, diff --git a/runtime/src/serde_snapshot/newer.rs b/runtime/src/serde_snapshot/newer.rs index ccdb32c9c..999b8ac88 100644 --- a/runtime/src/serde_snapshot/newer.rs +++ b/runtime/src/serde_snapshot/newer.rs @@ -15,7 +15,7 @@ use { type AccountsDbFields = super::AccountsDbFields; -#[derive(Default, Clone, PartialEq, Debug, Deserialize, Serialize, AbiExample)] +#[derive(Default, Clone, PartialEq, Eq, Debug, Deserialize, Serialize, AbiExample)] struct UnusedAccounts { unused1: HashSet, unused2: HashSet, @@ -181,7 +181,7 @@ impl<'a> From> for SerializableVersionedB #[cfg(RUSTC_WITH_SPECIALIZATION)] impl<'a> solana_frozen_abi::abi_example::IgnoreAsHelper for SerializableVersionedBank<'a> {} -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] pub(super) struct Context {} impl<'a> TypeContext<'a> for Context { diff --git a/runtime/src/stake_history.rs b/runtime/src/stake_history.rs index 31ca94dcc..85a5a8c60 100644 --- a/runtime/src/stake_history.rs +++ b/runtime/src/stake_history.rs @@ -6,7 +6,7 @@ use std::{ }; /// The SDK's stake history with clone-on-write semantics -#[derive(Default, Clone, PartialEq, Debug, Deserialize, Serialize, AbiExample)] +#[derive(Default, Clone, PartialEq, Eq, Debug, Deserialize, Serialize, AbiExample)] pub struct StakeHistory(Arc); impl Deref for StakeHistory { diff --git a/runtime/src/stakes.rs b/runtime/src/stakes.rs index e8b9ea051..50b902121 100644 --- a/runtime/src/stakes.rs +++ b/runtime/src/stakes.rs @@ -36,7 +36,7 @@ pub enum Error { StakeAccountNotFound(Pubkey), } -#[derive(Debug, Clone, PartialEq, ToPrimitive)] +#[derive(Debug, Clone, PartialEq, Eq, ToPrimitive)] pub enum InvalidCacheEntryReason { Missing, BadState, diff --git a/runtime/src/system_instruction_processor.rs b/runtime/src/system_instruction_processor.rs index 748888a6e..6042d3b3a 100644 --- a/runtime/src/system_instruction_processor.rs +++ b/runtime/src/system_instruction_processor.rs @@ -26,7 +26,7 @@ use { // represents an address that may or may not have been generated // from a seed -#[derive(PartialEq, Default, Debug)] +#[derive(PartialEq, Eq, Default, Debug)] struct Address { address: Pubkey, base: Option, diff --git a/runtime/src/vote_transaction.rs b/runtime/src/vote_transaction.rs index c075ecc3d..6351ef34f 100644 --- a/runtime/src/vote_transaction.rs +++ b/runtime/src/vote_transaction.rs @@ -6,7 +6,7 @@ use { solana_vote_program::vote_state::{Vote, VoteStateUpdate}, }; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum VoteTransaction { Vote(Vote), VoteStateUpdate(VoteStateUpdate), diff --git a/sdk/program/src/address_lookup_table_account.rs b/sdk/program/src/address_lookup_table_account.rs index 565dd38ad..bbc04259e 100644 --- a/sdk/program/src/address_lookup_table_account.rs +++ b/sdk/program/src/address_lookup_table_account.rs @@ -6,7 +6,7 @@ use solana_program::pubkey::Pubkey; -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] pub struct AddressLookupTableAccount { pub key: Pubkey, pub addresses: Vec, diff --git a/sdk/program/src/borsh.rs b/sdk/program/src/borsh.rs index df2af05bb..42ed033f1 100644 --- a/sdk/program/src/borsh.rs +++ b/sdk/program/src/borsh.rs @@ -119,7 +119,7 @@ mod tests { std::{collections::HashMap, mem::size_of}, }; - #[derive(PartialEq, Clone, Debug, BorshSerialize, BorshDeserialize, BorshSchema)] + #[derive(PartialEq, Eq, Clone, Debug, BorshSerialize, BorshDeserialize, BorshSchema)] enum TestEnum { NoValue, Number(u32), @@ -148,12 +148,12 @@ mod tests { pub r#bool: bool, } - #[derive(Debug, PartialEq, BorshSerialize, BorshDeserialize, BorshSchema)] + #[derive(Debug, PartialEq, Eq, BorshSerialize, BorshDeserialize, BorshSchema)] struct Child { pub data: [u8; 64], } - #[derive(Debug, PartialEq, BorshSerialize, BorshDeserialize, BorshSchema)] + #[derive(Debug, PartialEq, Eq, BorshSerialize, BorshDeserialize, BorshSchema)] struct Parent { pub data: Vec, } @@ -269,7 +269,7 @@ mod tests { ); } - #[derive(Debug, PartialEq, BorshSerialize, BorshDeserialize, BorshSchema)] + #[derive(Debug, PartialEq, Eq, BorshSerialize, BorshDeserialize, BorshSchema)] struct StructWithHashMap { data: HashMap, } diff --git a/sdk/program/src/bpf_loader_upgradeable.rs b/sdk/program/src/bpf_loader_upgradeable.rs index 2bddc3843..93a9a809e 100644 --- a/sdk/program/src/bpf_loader_upgradeable.rs +++ b/sdk/program/src/bpf_loader_upgradeable.rs @@ -25,7 +25,7 @@ use crate::{ crate::declare_id!("BPFLoaderUpgradeab1e11111111111111111111111"); /// Upgradeable loader account states -#[derive(Debug, Serialize, Deserialize, PartialEq, Clone, Copy, AbiExample)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Copy, AbiExample)] pub enum UpgradeableLoaderState { /// Account is not initialized. Uninitialized, diff --git a/sdk/program/src/clock.rs b/sdk/program/src/clock.rs index 2ef2538f6..05e01e8a6 100644 --- a/sdk/program/src/clock.rs +++ b/sdk/program/src/clock.rs @@ -110,7 +110,7 @@ pub type UnixTimestamp = i64; /// as the network progresses). /// #[repr(C)] -#[derive(Serialize, Deserialize, Debug, Default, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Default, PartialEq, Eq)] pub struct Clock { /// the current network/bank Slot pub slot: Slot, diff --git a/sdk/program/src/decode_error.rs b/sdk/program/src/decode_error.rs index b0ba1f466..d225ba81a 100644 --- a/sdk/program/src/decode_error.rs +++ b/sdk/program/src/decode_error.rs @@ -37,7 +37,7 @@ mod tests { #[test] fn test_decode_custom_error_to_enum() { - #[derive(Debug, FromPrimitive, PartialEq)] + #[derive(Debug, FromPrimitive, PartialEq, Eq)] enum TestEnum { A, B, diff --git a/sdk/program/src/epoch_schedule.rs b/sdk/program/src/epoch_schedule.rs index 2810e66d7..01f6f06a9 100644 --- a/sdk/program/src/epoch_schedule.rs +++ b/sdk/program/src/epoch_schedule.rs @@ -21,7 +21,7 @@ pub const MAX_LEADER_SCHEDULE_EPOCH_OFFSET: u64 = 3; pub const MINIMUM_SLOTS_PER_EPOCH: u64 = 32; #[repr(C)] -#[derive(Debug, Copy, PartialEq, Deserialize, Serialize, AbiExample)] +#[derive(Debug, Copy, PartialEq, Eq, Deserialize, Serialize, AbiExample)] #[serde(rename_all = "camelCase")] pub struct EpochSchedule { /// The maximum number of slots in each epoch. diff --git a/sdk/program/src/feature.rs b/sdk/program/src/feature.rs index 3bd2243c5..25a3ec8a4 100644 --- a/sdk/program/src/feature.rs +++ b/sdk/program/src/feature.rs @@ -18,7 +18,7 @@ use crate::{ crate::declare_id!("Feature111111111111111111111111111111111111"); -#[derive(Default, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Default, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct Feature { pub activated_at: Option, } diff --git a/sdk/program/src/instruction.rs b/sdk/program/src/instruction.rs index 3693d40be..a24d1ff27 100644 --- a/sdk/program/src/instruction.rs +++ b/sdk/program/src/instruction.rs @@ -320,7 +320,7 @@ pub enum InstructionError { /// should be specified as signers during `Instruction` construction. The /// program must still validate during execution that the account is a signer. #[wasm_bindgen] -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] pub struct Instruction { /// Pubkey of the program that executes this instruction. #[wasm_bindgen(skip)] @@ -529,7 +529,7 @@ pub fn checked_add(a: u64, b: u64) -> Result { /// a minor hazard: use [`AccountMeta::new_readonly`] to specify that an account /// is not writable. #[repr(C)] -#[derive(Debug, Default, PartialEq, Clone, Serialize, Deserialize)] +#[derive(Debug, Default, PartialEq, Eq, Clone, Serialize, Deserialize)] pub struct AccountMeta { /// An account's public key. pub pubkey: Pubkey, @@ -755,7 +755,7 @@ pub fn get_stack_height() -> usize { #[test] fn test_account_meta_layout() { - #[derive(Debug, Default, PartialEq, Clone, Serialize, Deserialize)] + #[derive(Debug, Default, PartialEq, Eq, Clone, Serialize, Deserialize)] struct AccountMetaRust { pub pubkey: Pubkey, pub is_signer: bool, diff --git a/sdk/program/src/message/versions/v0/loaded.rs b/sdk/program/src/message/versions/v0/loaded.rs index 24fca2b28..c1a7adb26 100644 --- a/sdk/program/src/message/versions/v0/loaded.rs +++ b/sdk/program/src/message/versions/v0/loaded.rs @@ -18,7 +18,7 @@ pub struct LoadedMessage<'a> { /// Collection of addresses loaded from on-chain lookup tables, split /// by readonly and writable. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Default, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct LoadedAddresses { /// List of addresses for writable loaded accounts pub writable: Vec, diff --git a/sdk/program/src/nonce/state/current.rs b/sdk/program/src/nonce/state/current.rs index 4ed4fc760..19d4c75b1 100644 --- a/sdk/program/src/nonce/state/current.rs +++ b/sdk/program/src/nonce/state/current.rs @@ -6,7 +6,7 @@ use { /// Initialized data of a durable transaction nonce account. /// /// This is stored within [`State`] for initialized nonce accounts. -#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Clone)] +#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq, Clone)] pub struct Data { /// Address of the account that signs transactions using the nonce account. pub authority: Pubkey, @@ -36,7 +36,7 @@ impl Data { /// /// When created in memory with [`State::default`] or when deserialized from an /// uninitialized account, a nonce account will be [`State::Uninitialized`]. -#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] pub enum State { Uninitialized, Initialized(Data), diff --git a/sdk/program/src/nonce/state/mod.rs b/sdk/program/src/nonce/state/mod.rs index 92c0bb6e7..632eec52a 100644 --- a/sdk/program/src/nonce/state/mod.rs +++ b/sdk/program/src/nonce/state/mod.rs @@ -4,7 +4,7 @@ mod current; pub use current::{Data, State}; use serde_derive::{Deserialize, Serialize}; -#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] pub enum Versions { Current(Box), } diff --git a/sdk/program/src/pubkey.rs b/sdk/program/src/pubkey.rs index 2ba1d2ad6..6eb6e96d0 100644 --- a/sdk/program/src/pubkey.rs +++ b/sdk/program/src/pubkey.rs @@ -25,7 +25,7 @@ const MAX_BASE58_LEN: usize = 44; const PDA_MARKER: &[u8; 21] = b"ProgramDerivedAddress"; -#[derive(Error, Debug, Serialize, Clone, PartialEq, FromPrimitive, ToPrimitive)] +#[derive(Error, Debug, Serialize, Clone, PartialEq, Eq, FromPrimitive, ToPrimitive)] pub enum PubkeyError { /// Length of the seed is too long for address generation #[error("Length of the seed is too long for address generation")] @@ -88,7 +88,7 @@ pub struct Pubkey(pub(crate) [u8; 32]); impl crate::sanitize::Sanitize for Pubkey {} -#[derive(Error, Debug, Serialize, Clone, PartialEq, FromPrimitive, ToPrimitive)] +#[derive(Error, Debug, Serialize, Clone, PartialEq, Eq, FromPrimitive, ToPrimitive)] pub enum ParsePubkeyError { #[error("String is the wrong size")] WrongSize, diff --git a/sdk/program/src/slot_hashes.rs b/sdk/program/src/slot_hashes.rs index f89b70176..b4d68ebc8 100644 --- a/sdk/program/src/slot_hashes.rs +++ b/sdk/program/src/slot_hashes.rs @@ -33,7 +33,7 @@ pub fn set_entries_for_tests_only(entries: usize) { pub type SlotHash = (Slot, Hash); #[repr(C)] -#[derive(Serialize, Deserialize, PartialEq, Debug, Default)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Default)] pub struct SlotHashes(Vec); impl SlotHashes { diff --git a/sdk/program/src/slot_history.rs b/sdk/program/src/slot_history.rs index 618d391dd..e4bc43efe 100644 --- a/sdk/program/src/slot_history.rs +++ b/sdk/program/src/slot_history.rs @@ -11,7 +11,7 @@ pub use crate::clock::Slot; use bv::{BitVec, BitsMut}; #[repr(C)] -#[derive(Clone, Serialize, Deserialize, PartialEq)] +#[derive(Clone, Serialize, Deserialize, PartialEq, Eq)] pub struct SlotHistory { pub bits: BitVec, pub next_slot: Slot, @@ -41,7 +41,7 @@ impl std::fmt::Debug for SlotHistory { pub const MAX_ENTRIES: u64 = 1024 * 1024; // 1 million slots is about 5 days -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub enum Check { Future, TooOld, diff --git a/sdk/program/src/stake/instruction.rs b/sdk/program/src/stake/instruction.rs index c4bdfe1e6..13b0c2378 100644 --- a/sdk/program/src/stake/instruction.rs +++ b/sdk/program/src/stake/instruction.rs @@ -18,7 +18,7 @@ use { }; /// Reasons the stake might have had an error -#[derive(Error, Debug, Clone, PartialEq, FromPrimitive, ToPrimitive)] +#[derive(Error, Debug, Clone, PartialEq, Eq, FromPrimitive, ToPrimitive)] pub enum StakeError { #[error("not enough credits to redeem")] NoCreditsToRedeem, @@ -65,7 +65,7 @@ impl DecodeError for StakeError { } } -#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] pub enum StakeInstruction { /// Initialize a stake with lockup and authorization information /// @@ -260,20 +260,20 @@ pub enum StakeInstruction { DeactivateDelinquent, } -#[derive(Default, Debug, Serialize, Deserialize, PartialEq, Clone, Copy)] +#[derive(Default, Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Copy)] pub struct LockupArgs { pub unix_timestamp: Option, pub epoch: Option, pub custodian: Option, } -#[derive(Default, Debug, Serialize, Deserialize, PartialEq, Clone, Copy)] +#[derive(Default, Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Copy)] pub struct LockupCheckedArgs { pub unix_timestamp: Option, pub epoch: Option, } -#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] pub struct AuthorizeWithSeedArgs { pub new_authorized_pubkey: Pubkey, pub stake_authorize: StakeAuthorize, @@ -281,7 +281,7 @@ pub struct AuthorizeWithSeedArgs { pub authority_owner: Pubkey, } -#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] pub struct AuthorizeCheckedWithSeedArgs { pub stake_authorize: StakeAuthorize, pub authority_seed: String, diff --git a/sdk/program/src/stake/state.rs b/sdk/program/src/stake/state.rs index 576c17743..c65e28a71 100644 --- a/sdk/program/src/stake/state.rs +++ b/sdk/program/src/stake/state.rs @@ -113,7 +113,7 @@ impl StakeState { } } -#[derive(Debug, Serialize, Deserialize, PartialEq, Clone, Copy, AbiExample)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Copy, AbiExample)] pub enum StakeAuthorize { Staker, Withdrawer, @@ -125,6 +125,7 @@ pub enum StakeAuthorize { Serialize, Deserialize, PartialEq, + Eq, Clone, Copy, AbiExample, @@ -159,6 +160,7 @@ impl Lockup { Serialize, Deserialize, PartialEq, + Eq, Clone, Copy, AbiExample, @@ -238,6 +240,7 @@ impl Authorized { Serialize, Deserialize, PartialEq, + Eq, Clone, Copy, AbiExample, diff --git a/sdk/program/src/system_instruction.rs b/sdk/program/src/system_instruction.rs index a7885769e..0ec22db68 100644 --- a/sdk/program/src/system_instruction.rs +++ b/sdk/program/src/system_instruction.rs @@ -16,7 +16,7 @@ use { thiserror::Error, }; -#[derive(Error, Debug, Serialize, Clone, PartialEq, FromPrimitive, ToPrimitive)] +#[derive(Error, Debug, Serialize, Clone, PartialEq, Eq, FromPrimitive, ToPrimitive)] pub enum SystemError { #[error("an account with the same address already exists")] AccountAlreadyInUse, @@ -44,7 +44,7 @@ impl DecodeError for SystemError { } } -#[derive(Error, Debug, Clone, PartialEq, FromPrimitive, ToPrimitive)] +#[derive(Error, Debug, Clone, PartialEq, Eq, FromPrimitive, ToPrimitive)] pub enum NonceError { #[error("recent blockhash list is empty")] NoRecentBlockhashes, @@ -62,7 +62,7 @@ impl DecodeError for NonceError { } } -#[derive(Error, Debug, Clone, PartialEq, FromPrimitive, ToPrimitive)] +#[derive(Error, Debug, Clone, PartialEq, Eq, FromPrimitive, ToPrimitive)] enum NonceErrorAdapter { #[error("recent blockhash list is empty")] NoRecentBlockhashes, @@ -143,7 +143,7 @@ pub fn instruction_to_nonce_error( pub const MAX_PERMITTED_DATA_LENGTH: u64 = 10 * 1024 * 1024; #[frozen_abi(digest = "2xnDcizcPKKR7b624FeuuPd1zj5bmnkmVsBWgoKPTh4w")] -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, AbiExample, AbiEnumVisitor)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, AbiExample, AbiEnumVisitor)] pub enum SystemInstruction { /// Create a new account /// diff --git a/sdk/program/src/sysvar/fees.rs b/sdk/program/src/sysvar/fees.rs index 5675901f7..a957317f2 100644 --- a/sdk/program/src/sysvar/fees.rs +++ b/sdk/program/src/sysvar/fees.rs @@ -17,7 +17,7 @@ crate::declare_deprecated_sysvar_id!("SysvarFees11111111111111111111111111111111 note = "Please do not use, will no longer be available in the future" )] #[repr(C)] -#[derive(Serialize, Deserialize, Debug, Default, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Default, PartialEq, Eq)] pub struct Fees { pub fee_calculator: FeeCalculator, } diff --git a/sdk/program/src/sysvar/mod.rs b/sdk/program/src/sysvar/mod.rs index 69e69a31b..2ab9bcdb7 100644 --- a/sdk/program/src/sysvar/mod.rs +++ b/sdk/program/src/sysvar/mod.rs @@ -163,7 +163,7 @@ mod tests { }; #[repr(C)] - #[derive(Serialize, Deserialize, Debug, Default, PartialEq)] + #[derive(Serialize, Deserialize, Debug, Default, PartialEq, Eq)] struct TestSysvar { something: Pubkey, } diff --git a/sdk/program/src/sysvar/recent_blockhashes.rs b/sdk/program/src/sysvar/recent_blockhashes.rs index 3647ebab2..1387bb7eb 100644 --- a/sdk/program/src/sysvar/recent_blockhashes.rs +++ b/sdk/program/src/sysvar/recent_blockhashes.rs @@ -26,7 +26,7 @@ declare_deprecated_sysvar_id!( note = "Please do not use, will no longer be available in the future" )] #[repr(C)] -#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, Eq)] pub struct Entry { pub blockhash: Hash, pub fee_calculator: FeeCalculator, @@ -76,7 +76,7 @@ impl<'a> PartialOrd for IterItem<'a> { note = "Please do not use, will no longer be available in the future" )] #[repr(C)] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] pub struct RecentBlockhashes(Vec); impl Default for RecentBlockhashes { diff --git a/sdk/src/compute_budget.rs b/sdk/src/compute_budget.rs index 7375f55f0..1509286ba 100644 --- a/sdk/src/compute_budget.rs +++ b/sdk/src/compute_budget.rs @@ -17,6 +17,7 @@ crate::declare_id!("ComputeBudget111111111111111111111111111111"); Debug, Deserialize, PartialEq, + Eq, Serialize, )] pub enum ComputeBudgetInstruction { diff --git a/sdk/src/derivation_path.rs b/sdk/src/derivation_path.rs index a90b715e3..bb03ed9a5 100644 --- a/sdk/src/derivation_path.rs +++ b/sdk/src/derivation_path.rs @@ -14,7 +14,7 @@ const ACCOUNT_INDEX: usize = 2; const CHANGE_INDEX: usize = 3; /// Derivation path error. -#[derive(Error, Debug, Clone, PartialEq)] +#[derive(Error, Debug, Clone, PartialEq, Eq)] pub enum DerivationPathError { #[error("invalid derivation path: {0}")] InvalidDerivationPath(String), @@ -28,7 +28,7 @@ impl From for DerivationPathError { } } -#[derive(Clone, PartialEq)] +#[derive(Clone, PartialEq, Eq)] pub struct DerivationPath(DerivationPathInner); impl Default for DerivationPath { @@ -203,7 +203,7 @@ impl<'a> IntoIterator for &'a DerivationPath { const QUERY_KEY_FULL_PATH: &str = "full-path"; const QUERY_KEY_KEY: &str = "key"; -#[derive(Clone, Debug, Error, PartialEq)] +#[derive(Clone, Debug, Error, PartialEq, Eq)] #[error("invalid query key `{0}`")] struct QueryKeyError(String); diff --git a/sdk/src/deserialize_utils.rs b/sdk/src/deserialize_utils.rs index 4413fac29..fea63de9f 100644 --- a/sdk/src/deserialize_utils.rs +++ b/sdk/src/deserialize_utils.rs @@ -23,7 +23,7 @@ pub mod tests { #[test] fn test_default_on_eof() { - #[derive(Serialize, Deserialize, Debug, PartialEq)] + #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] struct Foo { bar: u16, #[serde(deserialize_with = "default_on_eof")] @@ -98,7 +98,7 @@ pub mod tests { fn test_default_on_eof_additional_untagged_fields() { // If later fields are not tagged `deserialize_with = "default_on_eof"`, deserialization // will panic on any missing fields/data - #[derive(Serialize, Deserialize, Debug, PartialEq)] + #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] struct Foo { bar: u16, #[serde(deserialize_with = "default_on_eof")] diff --git a/sdk/src/genesis_config.rs b/sdk/src/genesis_config.rs index b038e6e07..7b6b02457 100644 --- a/sdk/src/genesis_config.rs +++ b/sdk/src/genesis_config.rs @@ -41,7 +41,7 @@ pub const DEFAULT_GENESIS_DOWNLOAD_PATH: &str = "/genesis.tar.bz2"; pub const UNUSED_DEFAULT: u64 = 1024; // The order can't align with release lifecycle only to remain ABI-compatible... -#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, AbiEnumVisitor, AbiExample)] +#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, AbiEnumVisitor, AbiExample)] pub enum ClusterType { Testnet, MainnetBeta, diff --git a/sdk/src/precompiles.rs b/sdk/src/precompiles.rs index 89b40d7de..1f6149772 100644 --- a/sdk/src/precompiles.rs +++ b/sdk/src/precompiles.rs @@ -15,7 +15,7 @@ use { }; /// Precompile errors -#[derive(Error, Debug, Clone, PartialEq)] +#[derive(Error, Debug, Clone, PartialEq, Eq)] pub enum PrecompileError { #[error("public key is not valid")] InvalidPublicKey, diff --git a/sdk/src/signer/mod.rs b/sdk/src/signer/mod.rs index f7d8cdc90..84407ffc5 100644 --- a/sdk/src/signer/mod.rs +++ b/sdk/src/signer/mod.rs @@ -15,7 +15,7 @@ pub mod null_signer; pub mod presigner; pub mod signers; -#[derive(Debug, Error, PartialEq)] +#[derive(Debug, Error, PartialEq, Eq)] pub enum SignerError { #[error("keypair-pubkey mismatch")] KeypairPubkeyMismatch, diff --git a/sdk/src/signer/presigner.rs b/sdk/src/signer/presigner.rs index 47eb3119e..649bd3c31 100644 --- a/sdk/src/signer/presigner.rs +++ b/sdk/src/signer/presigner.rs @@ -28,7 +28,7 @@ impl Presigner { } } -#[derive(Debug, Error, PartialEq)] +#[derive(Debug, Error, PartialEq, Eq)] pub enum PresignerError { #[error("pre-generated signature cannot verify data")] VerificationFailure, diff --git a/sdk/src/transaction/mod.rs b/sdk/src/transaction/mod.rs index 023207548..79c8e80cd 100644 --- a/sdk/src/transaction/mod.rs +++ b/sdk/src/transaction/mod.rs @@ -138,7 +138,7 @@ mod versioned; pub use {error::*, sanitized::*, versioned::*}; -#[derive(PartialEq, Clone, Copy, Debug)] +#[derive(PartialEq, Eq, Clone, Copy, Debug)] pub enum TransactionVerificationMode { HashOnly, HashAndVerifyPrecompiles, diff --git a/sdk/src/transaction_context.rs b/sdk/src/transaction_context.rs index cb4be13c9..67e06708e 100644 --- a/sdk/src/transaction_context.rs +++ b/sdk/src/transaction_context.rs @@ -240,7 +240,7 @@ impl TransactionContext { } /// Return data at the end of a transaction -#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] +#[derive(Clone, Debug, Default, Deserialize, PartialEq, Eq, Serialize)] pub struct TransactionReturnData { pub program_id: Pubkey, pub data: Vec, diff --git a/send-transaction-service/src/send_transaction_service.rs b/send-transaction-service/src/send_transaction_service.rs index 65e1b2ce0..270ca9dc4 100644 --- a/send-transaction-service/src/send_transaction_service.rs +++ b/send-transaction-service/src/send_transaction_service.rs @@ -91,7 +91,7 @@ impl TransactionInfo { } } -#[derive(Default, Debug, PartialEq)] +#[derive(Default, Debug, PartialEq, Eq)] struct ProcessTransactionsResult { rooted: u64, expired: u64, diff --git a/storage-bigtable/proto/google.bigtable.v2.rs b/storage-bigtable/proto/google.bigtable.v2.rs index b1fdf30e7..558dd7ac8 100644 --- a/storage-bigtable/proto/google.bigtable.v2.rs +++ b/storage-bigtable/proto/google.bigtable.v2.rs @@ -1,6 +1,6 @@ /// Specifies the complete (requested) contents of a single row of a table. /// Rows which exceed 256MiB in size cannot be read in full. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct Row { /// The unique key which identifies this row within its table. This is the same /// key that's used to identify the row in, for example, a MutateRowRequest. @@ -14,7 +14,7 @@ pub struct Row { } /// Specifies (some of) the contents of a single row/column family intersection /// of a table. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct Family { /// The unique key which identifies this family within its row. This is the /// same key that's used to identify the family in, for example, a RowFilter @@ -30,7 +30,7 @@ pub struct Family { } /// Specifies (some of) the contents of a single row/column intersection of a /// table. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct Column { /// The unique key which identifies this column within its family. This is the /// same key that's used to identify the column in, for example, a RowFilter @@ -44,7 +44,7 @@ pub struct Column { pub cells: ::prost::alloc::vec::Vec, } /// Specifies (some of) the contents of a single row/column/timestamp of a table. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct Cell { /// The cell's stored timestamp, which also uniquely identifies it within /// its column. @@ -64,7 +64,7 @@ pub struct Cell { pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// Specifies a contiguous range of rows. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct RowRange { /// The row key at which to start the range. /// If neither field is set, interpreted as the empty string, inclusive. @@ -79,7 +79,7 @@ pub struct RowRange { pub mod row_range { /// The row key at which to start the range. /// If neither field is set, interpreted as the empty string, inclusive. - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, ::prost::Oneof)] pub enum StartKey { /// Used when giving an inclusive lower bound for the range. #[prost(bytes, tag="1")] @@ -90,7 +90,7 @@ pub mod row_range { } /// The row key at which to end the range. /// If neither field is set, interpreted as the infinite row key, exclusive. - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, ::prost::Oneof)] pub enum EndKey { /// Used when giving an exclusive upper bound for the range. #[prost(bytes, tag="3")] @@ -101,7 +101,7 @@ pub mod row_range { } } /// Specifies a non-contiguous set of rows. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct RowSet { /// Single rows included in the set. #[prost(bytes="vec", repeated, tag="1")] @@ -114,7 +114,7 @@ pub struct RowSet { /// The range spans from <column_family>:<start_qualifier> to /// <column_family>:<end_qualifier>, where both bounds can be either /// inclusive or exclusive. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct ColumnRange { /// The name of the column family within which this range falls. #[prost(string, tag="1")] @@ -132,7 +132,7 @@ pub struct ColumnRange { pub mod column_range { /// The column qualifier at which to start the range (within `column_family`). /// If neither field is set, interpreted as the empty string, inclusive. - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, ::prost::Oneof)] pub enum StartQualifier { /// Used when giving an inclusive lower bound for the range. #[prost(bytes, tag="2")] @@ -143,7 +143,7 @@ pub mod column_range { } /// The column qualifier at which to end the range (within `column_family`). /// If neither field is set, interpreted as the infinite string, exclusive. - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, ::prost::Oneof)] pub enum EndQualifier { /// Used when giving an inclusive upper bound for the range. #[prost(bytes, tag="4")] @@ -154,7 +154,7 @@ pub mod column_range { } } /// Specified a contiguous range of microsecond timestamps. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct TimestampRange { /// Inclusive lower bound. If left empty, interpreted as 0. #[prost(int64, tag="1")] @@ -164,7 +164,7 @@ pub struct TimestampRange { pub end_timestamp_micros: i64, } /// Specifies a contiguous range of raw byte values. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct ValueRange { /// The value at which to start the range. /// If neither field is set, interpreted as the empty string, inclusive. @@ -179,7 +179,7 @@ pub struct ValueRange { pub mod value_range { /// The value at which to start the range. /// If neither field is set, interpreted as the empty string, inclusive. - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, ::prost::Oneof)] pub enum StartValue { /// Used when giving an inclusive lower bound for the range. #[prost(bytes, tag="1")] @@ -190,7 +190,7 @@ pub mod value_range { } /// The value at which to end the range. /// If neither field is set, interpreted as the infinite string, exclusive. - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, ::prost::Oneof)] pub enum EndValue { /// Used when giving an inclusive upper bound for the range. #[prost(bytes, tag="3")] @@ -475,7 +475,7 @@ pub mod row_filter { } } /// Specifies a particular change to be made to the contents of a row. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct Mutation { /// Which of the possible Mutation types to apply. #[prost(oneof="mutation::Mutation", tags="1, 2, 3, 4")] @@ -484,7 +484,7 @@ pub struct Mutation { /// Nested message and enum types in `Mutation`. pub mod mutation { /// A Mutation which sets the value of the specified cell. - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct SetCell { /// The name of the family into which new data should be written. /// Must match `\[-_.a-zA-Z0-9\]+` @@ -507,7 +507,7 @@ pub mod mutation { } /// A Mutation which deletes cells from the specified column, optionally /// restricting the deletions to a given timestamp range. - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct DeleteFromColumn { /// The name of the family from which cells should be deleted. /// Must match `\[-_.a-zA-Z0-9\]+` @@ -522,7 +522,7 @@ pub mod mutation { pub time_range: ::core::option::Option, } /// A Mutation which deletes all cells from the specified column family. - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct DeleteFromFamily { /// The name of the family from which cells should be deleted. /// Must match `\[-_.a-zA-Z0-9\]+` @@ -530,11 +530,11 @@ pub mod mutation { pub family_name: ::prost::alloc::string::String, } /// A Mutation which deletes all cells from the containing row. - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct DeleteFromRow { } /// Which of the possible Mutation types to apply. - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, ::prost::Oneof)] pub enum Mutation { /// Set a cell's value. #[prost(message, tag="1")] @@ -552,7 +552,7 @@ pub mod mutation { } /// Specifies an atomic read/modify/write operation on the latest value of the /// specified column. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct ReadModifyWriteRule { /// The name of the family to which the read/modify/write should be applied. /// Must match `\[-_.a-zA-Z0-9\]+` @@ -572,7 +572,7 @@ pub struct ReadModifyWriteRule { pub mod read_modify_write_rule { /// The rule used to determine the column's new latest value from its current /// latest value. - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, ::prost::Oneof)] pub enum Rule { /// Rule specifying that `append_value` be appended to the existing value. /// If the targeted cell is unset, it will be treated as containing the @@ -612,7 +612,7 @@ pub struct ReadRowsRequest { pub rows_limit: i64, } /// Response message for Bigtable.ReadRows. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct ReadRowsResponse { /// A collection of a row's contents as part of the read request. #[prost(message, repeated, tag="1")] @@ -631,7 +631,7 @@ pub struct ReadRowsResponse { pub mod read_rows_response { /// Specifies a piece of a row's contents returned as part of the read /// response stream. - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct CellChunk { /// The row key for this chunk of data. If the row key is empty, /// this CellChunk is a continuation of the same row as the previous @@ -689,7 +689,7 @@ pub mod read_rows_response { /// Nested message and enum types in `CellChunk`. pub mod cell_chunk { /// Signals to the client concerning previous CellChunks received. - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, ::prost::Oneof)] pub enum RowStatus { /// Indicates that the client should drop all previous chunks for /// `row_key`, as it will be re-read from the beginning. @@ -703,7 +703,7 @@ pub mod read_rows_response { } } /// Request message for Bigtable.SampleRowKeys. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct SampleRowKeysRequest { /// Required. The unique name of the table from which to sample row keys. /// Values are of the form @@ -716,7 +716,7 @@ pub struct SampleRowKeysRequest { pub app_profile_id: ::prost::alloc::string::String, } /// Response message for Bigtable.SampleRowKeys. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct SampleRowKeysResponse { /// Sorted streamed sequence of sample row keys in the table. The table might /// have contents before the first row key in the list and after the last one, @@ -735,7 +735,7 @@ pub struct SampleRowKeysResponse { pub offset_bytes: i64, } /// Request message for Bigtable.MutateRow. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct MutateRowRequest { /// Required. The unique name of the table to which the mutation should be applied. /// Values are of the form @@ -756,11 +756,11 @@ pub struct MutateRowRequest { pub mutations: ::prost::alloc::vec::Vec, } /// Response message for Bigtable.MutateRow. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct MutateRowResponse { } /// Request message for BigtableService.MutateRows. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct MutateRowsRequest { /// Required. The unique name of the table to which the mutations should be applied. #[prost(string, tag="1")] @@ -780,7 +780,7 @@ pub struct MutateRowsRequest { /// Nested message and enum types in `MutateRowsRequest`. pub mod mutate_rows_request { /// A mutation for a given row. - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct Entry { /// The key of the row to which the `mutations` should be applied. #[prost(bytes="vec", tag="1")] @@ -855,7 +855,7 @@ pub struct CheckAndMutateRowRequest { pub false_mutations: ::prost::alloc::vec::Vec, } /// Response message for Bigtable.CheckAndMutateRow. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct CheckAndMutateRowResponse { /// Whether or not the request's `predicate_filter` yielded any results for /// the specified row. @@ -863,7 +863,7 @@ pub struct CheckAndMutateRowResponse { pub predicate_matched: bool, } /// Request message for Bigtable.ReadModifyWriteRow. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct ReadModifyWriteRowRequest { /// Required. The unique name of the table to which the read/modify/write rules should be /// applied. @@ -885,7 +885,7 @@ pub struct ReadModifyWriteRowRequest { pub rules: ::prost::alloc::vec::Vec, } /// Response message for Bigtable.ReadModifyWriteRow. -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, ::prost::Message)] pub struct ReadModifyWriteRowResponse { /// A Row containing the new contents of all cells modified by the request. #[prost(message, optional, tag="1")] diff --git a/storage-bigtable/src/lib.rs b/storage-bigtable/src/lib.rs index 4fe7a58e1..2d7e6a06e 100644 --- a/storage-bigtable/src/lib.rs +++ b/storage-bigtable/src/lib.rs @@ -297,7 +297,7 @@ impl From for StoredConfirmedBlockReward { } // A serialized `TransactionInfo` is stored in the `tx` table -#[derive(Serialize, Deserialize, PartialEq, Debug)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug)] struct TransactionInfo { slot: Slot, // The slot that contains the block with this transaction in it index: u32, // Where the transaction is located in the block @@ -306,7 +306,7 @@ struct TransactionInfo { } // Part of a serialized `TransactionInfo` which is stored in the `tx` table -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] struct UploadedTransaction { slot: Slot, // The slot that contains the block with this transaction in it index: u32, // Where the transaction is located in the block @@ -340,7 +340,7 @@ impl From for TransactionStatus { } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] struct LegacyTransactionByAddrInfo { pub signature: Signature, // The transaction signature pub err: Option, // None if the transaction executed successfully diff --git a/streamer/src/socket.rs b/streamer/src/socket.rs index b44ba5b8f..b664a6e64 100644 --- a/streamer/src/socket.rs +++ b/streamer/src/socket.rs @@ -1,6 +1,6 @@ use std::net::{IpAddr, SocketAddr}; -#[derive(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq, Eq)] pub enum SocketAddrSpace { Unspecified, Global, diff --git a/tokens/src/commands.rs b/tokens/src/commands.rs index 78928509a..ab4c00457 100644 --- a/tokens/src/commands.rs +++ b/tokens/src/commands.rs @@ -53,14 +53,14 @@ use { }, }; -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub struct Allocation { pub recipient: String, pub amount: u64, pub lockup_date: String, } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum FundingSource { FeePayer, SplTokenAccount, diff --git a/tokens/src/db.rs b/tokens/src/db.rs index f4f0edddc..a7617aaff 100644 --- a/tokens/src/db.rs +++ b/tokens/src/db.rs @@ -7,7 +7,7 @@ use { std::{cmp::Ordering, fs, io, path::Path}, }; -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub struct TransactionInfo { pub recipient: Pubkey, pub amount: u64, @@ -18,7 +18,7 @@ pub struct TransactionInfo { pub lockup_date: Option>, } -#[derive(Serialize, Deserialize, Debug, Default, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Default, PartialEq, Eq)] struct SignedTransactionInfo { recipient: String, amount: u64, diff --git a/tokens/src/token_display.rs b/tokens/src/token_display.rs index fae099f5f..c78ac26a6 100644 --- a/tokens/src/token_display.rs +++ b/tokens/src/token_display.rs @@ -9,7 +9,7 @@ use { const SOL_SYMBOL: &str = "◎"; -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] pub enum TokenType { Sol, SplToken, diff --git a/transaction-status/src/lib.rs b/transaction-status/src/lib.rs index 3b690d4f6..6b24308f3 100644 --- a/transaction-status/src/lib.rs +++ b/transaction-status/src/lib.rs @@ -122,7 +122,7 @@ impl Default for TransactionDetails { } /// A duplicate representation of an Instruction for pretty JSON serialization -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase", untagged)] pub enum UiInstruction { Compiled(UiCompiledInstruction), @@ -142,7 +142,7 @@ impl UiInstruction { } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase", untagged)] pub enum UiParsedInstruction { Parsed(ParsedInstruction), @@ -150,7 +150,7 @@ pub enum UiParsedInstruction { } /// A duplicate representation of a CompiledInstruction for pretty JSON serialization -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct UiCompiledInstruction { pub program_id_index: u8, @@ -169,7 +169,7 @@ impl From<&CompiledInstruction> for UiCompiledInstruction { } /// A partially decoded CompiledInstruction that includes explicit account addresses -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct UiPartiallyDecodedInstruction { pub program_id: String, @@ -191,7 +191,7 @@ impl UiPartiallyDecodedInstruction { } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct InnerInstructions { /// Transaction instruction index pub index: u8, @@ -199,7 +199,7 @@ pub struct InnerInstructions { pub instructions: Vec, } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct UiInnerInstructions { /// Transaction instruction index @@ -328,7 +328,7 @@ pub struct UiTransactionStatusMeta { } /// A duplicate representation of LoadedAddresses -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct UiLoadedAddresses { pub writable: Vec, @@ -405,7 +405,7 @@ impl From for UiTransactionStatusMeta { } } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub enum TransactionConfirmationStatus { Processed, @@ -413,7 +413,7 @@ pub enum TransactionConfirmationStatus { Finalized, } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TransactionStatus { pub slot: Slot, @@ -458,7 +458,7 @@ impl TransactionStatus { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct ConfirmedTransactionStatusWithSignature { pub signature: Signature, pub slot: Slot, @@ -467,7 +467,7 @@ pub struct ConfirmedTransactionStatusWithSignature { pub block_time: Option, } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Reward { pub pubkey: String, @@ -877,14 +877,14 @@ impl EncodedTransaction { } /// A duplicate representation of a Transaction for pretty JSON serialization -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct UiTransaction { pub signatures: Vec, pub message: UiMessage, } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase", untagged)] pub enum UiMessage { Parsed(UiParsedMessage), @@ -958,7 +958,7 @@ impl EncodableWithMeta for v0::Message { } /// A duplicate representation of a Message, in raw format, for pretty JSON serialization -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct UiRawMessage { pub header: MessageHeader, @@ -970,7 +970,7 @@ pub struct UiRawMessage { } /// A duplicate representation of a MessageAddressTableLookup, in raw format, for pretty JSON serialization -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct UiAddressTableLookup { pub account_key: String, @@ -989,7 +989,7 @@ impl From<&MessageAddressTableLookup> for UiAddressTableLookup { } /// A duplicate representation of a Message, in parsed format, for pretty JSON serialization -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct UiParsedMessage { pub account_keys: Vec, @@ -1000,7 +1000,7 @@ pub struct UiParsedMessage { // A serialized `Vec` is stored in the `tx-by-addr` table. The row keys are // the one's compliment of the slot so that rows may be listed in reverse order -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct TransactionByAddrInfo { pub signature: Signature, // The transaction signature pub err: Option, // None if the transaction executed successfully diff --git a/transaction-status/src/parse_accounts.rs b/transaction-status/src/parse_accounts.rs index 300e7fec0..a84fd06bf 100644 --- a/transaction-status/src/parse_accounts.rs +++ b/transaction-status/src/parse_accounts.rs @@ -1,6 +1,6 @@ use solana_sdk::message::{v0::LoadedMessage, Message}; -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ParsedAccount { pub pubkey: String, diff --git a/transaction-status/src/parse_instruction.rs b/transaction-status/src/parse_instruction.rs index dc69f7322..29f812c41 100644 --- a/transaction-status/src/parse_instruction.rs +++ b/transaction-status/src/parse_instruction.rs @@ -69,7 +69,7 @@ pub enum ParseInstructionError { SerdeJsonError(#[from] serde_json::error::Error), } -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ParsedInstruction { pub program: String, @@ -77,7 +77,7 @@ pub struct ParsedInstruction { pub parsed: Value, } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ParsedInstructionEnum { #[serde(rename = "type")] @@ -86,7 +86,7 @@ pub struct ParsedInstructionEnum { pub info: Value, } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub enum ParsableProgram { SplAssociatedTokenAccount, diff --git a/transaction-status/src/parse_token.rs b/transaction-status/src/parse_token.rs index 70e997bfd..4640c984f 100644 --- a/transaction-status/src/parse_token.rs +++ b/transaction-status/src/parse_token.rs @@ -553,7 +553,7 @@ pub fn parse_token( } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub enum UiAuthorityType { MintTokens, @@ -579,7 +579,7 @@ impl From for UiAuthorityType { } } -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub enum UiExtensionType { Uninitialized, diff --git a/validator/src/bin/solana-test-validator.rs b/validator/src/bin/solana-test-validator.rs index 2e5e36de2..84d3cc0e6 100644 --- a/validator/src/bin/solana-test-validator.rs +++ b/validator/src/bin/solana-test-validator.rs @@ -52,7 +52,7 @@ const DEFAULT_MAX_LEDGER_SHREDS: u64 = 10_000; const DEFAULT_FAUCET_SOL: f64 = 1_000_000.; -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] enum Output { None, Log, diff --git a/validator/src/main.rs b/validator/src/main.rs index ab91d0350..50fb4e6b9 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -93,7 +93,7 @@ use { #[global_allocator] static GLOBAL: Jemalloc = Jemalloc; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] enum Operation { Initialize, Run, diff --git a/version/src/lib.rs b/version/src/lib.rs index 8ab09ece5..6aeb1d798 100644 --- a/version/src/lib.rs +++ b/version/src/lib.rs @@ -10,7 +10,7 @@ use { extern crate solana_frozen_abi_macro; // Older version structure used earlier 1.3.x releases -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample)] pub struct LegacyVersion { major: u16, minor: u16, @@ -20,7 +20,7 @@ pub struct LegacyVersion { impl Sanitize for LegacyVersion {} -#[derive(Serialize, Deserialize, Clone, PartialEq, AbiExample)] +#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, AbiExample)] pub struct Version { pub major: u16, pub minor: u16, diff --git a/zk-token-sdk/src/curve25519/edwards.rs b/zk-token-sdk/src/curve25519/edwards.rs index c2d70f664..7f13149b4 100644 --- a/zk-token-sdk/src/curve25519/edwards.rs +++ b/zk-token-sdk/src/curve25519/edwards.rs @@ -1,7 +1,7 @@ use bytemuck::{Pod, Zeroable}; pub use target_arch::*; -#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Pod, Zeroable)] #[repr(transparent)] pub struct PodEdwardsPoint(pub [u8; 32]); diff --git a/zk-token-sdk/src/curve25519/ristretto.rs b/zk-token-sdk/src/curve25519/ristretto.rs index 0fc719fb0..7ad6a8b27 100644 --- a/zk-token-sdk/src/curve25519/ristretto.rs +++ b/zk-token-sdk/src/curve25519/ristretto.rs @@ -1,7 +1,7 @@ use bytemuck::{Pod, Zeroable}; pub use target_arch::*; -#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Pod, Zeroable)] #[repr(transparent)] pub struct PodRistrettoPoint(pub [u8; 32]); diff --git a/zk-token-sdk/src/curve25519/scalar.rs b/zk-token-sdk/src/curve25519/scalar.rs index 18bbddc94..103419863 100644 --- a/zk-token-sdk/src/curve25519/scalar.rs +++ b/zk-token-sdk/src/curve25519/scalar.rs @@ -1,6 +1,6 @@ pub use bytemuck::{Pod, Zeroable}; -#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Pod, Zeroable)] #[repr(transparent)] pub struct PodScalar(pub [u8; 32]); diff --git a/zk-token-sdk/src/encryption/elgamal.rs b/zk-token-sdk/src/encryption/elgamal.rs index 8ad4adc58..a4bbd5561 100644 --- a/zk-token-sdk/src/encryption/elgamal.rs +++ b/zk-token-sdk/src/encryption/elgamal.rs @@ -141,7 +141,7 @@ impl ElGamal { /// A (twisted) ElGamal encryption keypair. /// /// The instances of the secret key are zeroized on drop. -#[derive(Clone, Debug, Deserialize, PartialEq, Serialize, Zeroize)] +#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, Zeroize)] pub struct ElGamalKeypair { /// The public half of this keypair. pub public: ElGamalPubkey, diff --git a/zk-token-sdk/src/zk_token_elgamal/pod.rs b/zk-token-sdk/src/zk_token_elgamal/pod.rs index 3a1a35efe..8e0784be8 100644 --- a/zk-token-sdk/src/zk_token_elgamal/pod.rs +++ b/zk-token-sdk/src/zk_token_elgamal/pod.rs @@ -1,7 +1,7 @@ pub use bytemuck::{Pod, Zeroable}; use std::fmt; -#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Pod, Zeroable)] #[repr(transparent)] pub struct PodU16([u8; 2]); impl From for PodU16 { @@ -15,7 +15,7 @@ impl From for u16 { } } -#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Pod, Zeroable)] #[repr(transparent)] pub struct PodU64([u8; 8]); impl From for PodU64 { @@ -29,15 +29,15 @@ impl From for u64 { } } -#[derive(Clone, Copy, Pod, Zeroable, PartialEq)] +#[derive(Clone, Copy, Pod, Zeroable, PartialEq, Eq)] #[repr(transparent)] pub struct Scalar(pub [u8; 32]); -#[derive(Clone, Copy, Pod, Zeroable, PartialEq)] +#[derive(Clone, Copy, Pod, Zeroable, PartialEq, Eq)] #[repr(transparent)] pub struct CompressedRistretto(pub [u8; 32]); -#[derive(Clone, Copy, Pod, Zeroable, PartialEq)] +#[derive(Clone, Copy, Pod, Zeroable, PartialEq, Eq)] #[repr(transparent)] pub struct ElGamalCiphertext(pub [u8; 64]); @@ -53,7 +53,7 @@ impl Default for ElGamalCiphertext { } } -#[derive(Clone, Copy, Default, Pod, Zeroable, PartialEq)] +#[derive(Clone, Copy, Default, Pod, Zeroable, PartialEq, Eq)] #[repr(transparent)] pub struct ElGamalPubkey(pub [u8; 32]); @@ -63,7 +63,7 @@ impl fmt::Debug for ElGamalPubkey { } } -#[derive(Clone, Copy, Default, Pod, Zeroable, PartialEq)] +#[derive(Clone, Copy, Default, Pod, Zeroable, PartialEq, Eq)] #[repr(transparent)] pub struct PedersenCommitment(pub [u8; 32]); @@ -73,7 +73,7 @@ impl fmt::Debug for PedersenCommitment { } } -#[derive(Clone, Copy, Default, Pod, Zeroable, PartialEq)] +#[derive(Clone, Copy, Default, Pod, Zeroable, PartialEq, Eq)] #[repr(transparent)] pub struct DecryptHandle(pub [u8; 32]); @@ -169,7 +169,7 @@ unsafe impl Zeroable for RangeProof256 {} unsafe impl Pod for RangeProof256 {} /// Serialization for AeCiphertext -#[derive(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq, Eq)] #[repr(transparent)] pub struct AeCiphertext(pub [u8; 36]); diff --git a/zk-token-sdk/src/zk_token_proof_instruction.rs b/zk-token-sdk/src/zk_token_proof_instruction.rs index 5bcd65396..db0124c2d 100644 --- a/zk-token-sdk/src/zk_token_proof_instruction.rs +++ b/zk-token-sdk/src/zk_token_proof_instruction.rs @@ -7,7 +7,7 @@ use { solana_program::instruction::Instruction, }; -#[derive(Clone, Copy, Debug, FromPrimitive, ToPrimitive, PartialEq)] +#[derive(Clone, Copy, Debug, FromPrimitive, ToPrimitive, PartialEq, Eq)] #[repr(u8)] pub enum ProofInstruction { /// Verify a `CloseAccountData` struct