Skip to content

Commit

Permalink
Derive Eq to appease clippy (informalsystems#1191)
Browse files Browse the repository at this point in the history
Signed-off-by: Thane Thomson <[email protected]>

Signed-off-by: Thane Thomson <[email protected]>
  • Loading branch information
thanethomson committed Sep 6, 2022
1 parent 9b9ed44 commit 21e056c
Show file tree
Hide file tree
Showing 22 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion light-client-verifier/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize};
use crate::types::TrustThreshold;

/// Verification parameters
#[derive(Copy, Clone, Debug, PartialEq, Display, Serialize, Deserialize)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Display, Serialize, Deserialize)]
#[display(fmt = "{:?}", self)]
pub struct Options {
/// Defines what fraction of the total voting power of a known
Expand Down
4 changes: 2 additions & 2 deletions light-client-verifier/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl<'a> UntrustedBlockState<'a> {

/// A light block is the core data structure used by the light client.
/// It records everything the light client needs to know about a block.
#[derive(Clone, Debug, Display, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, Display, PartialEq, Eq, Serialize, Deserialize)]
#[display(fmt = "{:?}", self)]
pub struct LightBlock {
/// Header and commit of this block
Expand Down Expand Up @@ -163,7 +163,7 @@ impl LightBlock {

/// Contains the local status information, like the latest height, latest block and valset hashes,
/// list of of connected full nodes (primary and witnesses).
#[derive(Clone, Debug, Display, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, Display, PartialEq, Eq, Serialize, Deserialize)]
#[display(fmt = "{:?}", self)]
pub struct LatestStatus {
/// The latest height we are trusting.
Expand Down
4 changes: 2 additions & 2 deletions light-client/tests/model_based.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ mod mbt {
}
}

#[derive(Deserialize, Clone, Debug, PartialEq)]
#[derive(Deserialize, Clone, Debug, PartialEq, Eq)]
pub enum LiteTestKind {
SingleStep,
Bisection,
}

/// An abstraction of the LightClient verification verdict
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
pub enum LiteVerdict {
/// verified successfully
#[serde(rename = "SUCCESS")]
Expand Down
2 changes: 1 addition & 1 deletion p2p/src/secret_connection/amino_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::error::Error;
const PUB_KEY_ED25519_AMINO_PREFIX: [u8; 5] = [0x16, 0x24, 0xde, 0x64, 0x20];

/// Authentication signature message
#[derive(Clone, PartialEq, Message)]
#[derive(Clone, PartialEq, Eq, Message)]
pub struct AuthSigMessage {
/// Public key
#[prost(bytes, tag = "1")]
Expand Down
6 changes: 3 additions & 3 deletions rpc/src/endpoint/consensus_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub struct RoundVotes {
}

/// Details of a single vote from a particular consensus round.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum RoundVote {
Nil,
Vote(VoteSummary),
Expand Down Expand Up @@ -166,7 +166,7 @@ impl<'de> Deserialize<'de> for RoundVote {
}
}

#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct VoteSummary {
pub validator_index: i32,
pub validator_address_fingerprint: Fingerprint,
Expand Down Expand Up @@ -307,7 +307,7 @@ impl fmt::Display for VoteSummary {
}
}

#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Fingerprint(Vec<u8>);

impl FromStr for Fingerprint {
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/endpoint/evidence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tendermint::{abci::transaction, evidence::Evidence};
use crate::Method;

/// `/broadcast_evidence`: broadcast an evidence.
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
pub struct Request {
/// Evidence to broadcast
pub ev: Evidence,
Expand Down
8 changes: 4 additions & 4 deletions rpc/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{prelude::*, query::EventType, response::Wrapper, Response};
/// An incoming event produced by a [`Subscription`].
///
/// [`Subscription`]: ../struct.Subscription.html
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
pub struct Event {
/// The query that produced the event.
pub query: String,
Expand All @@ -40,7 +40,7 @@ impl Event {
}
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "type", content = "value")]
// To be fixed in 0.24
#[allow(clippy::large_enum_variant)]
Expand All @@ -60,7 +60,7 @@ pub enum EventData {
}

/// Transaction result info.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
pub struct TxInfo {
#[serde(with = "tendermint_proto::serializers::from_str")]
pub height: i64,
Expand All @@ -71,7 +71,7 @@ pub struct TxInfo {
}

/// Transaction result.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
pub struct TxResult {
pub log: Option<String>,
pub gas_wanted: Option<String>,
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ where
}

/// The types of Tendermint events for which we can query at present.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum EventType {
NewBlock,
Tx,
Expand Down
6 changes: 3 additions & 3 deletions tendermint/src/abci/responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub struct DeliverTx {
}

/// Event
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct Event {
/// Event type
#[serde(rename = "type")]
Expand All @@ -93,7 +93,7 @@ pub struct Event {
///
/// <https://github.com/tendermint/tendermint/blob/develop/abci/types/types.proto>
// TODO(tarcieri): generate this automatically from the proto
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct BeginBlock {
/// Tags
#[serde(default)]
Expand All @@ -106,7 +106,7 @@ pub struct BeginBlock {
///
/// <https://github.com/tendermint/tendermint/blob/develop/abci/types/types.proto>
// TODO(tarcieri): generate this automatically from the proto
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct EndBlock {
/// Validator updates
#[serde(deserialize_with = "deserialize_validator_updates")]
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/abci/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tendermint_proto::serializers::bytes::base64string;
use crate::{error::Error, prelude::*};

/// Tags
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct Tag {
/// Key
pub key: Key,
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/abci/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl Serialize for Transaction {
/// transactions are arbitrary byte arrays.
///
/// <https://github.com/tendermint/spec/blob/d46cd7f573a2c6a2399fcab2cde981330aa63f37/spec/core/data_structures.md#data>
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(try_from = "RawData", into = "RawData")]
pub struct Data {
txs: Option<Vec<Transaction>>,
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use crate::{abci::transaction, error::Error, evidence, prelude::*};
///
/// <https://github.com/tendermint/spec/blob/d46cd7f573a2c6a2399fcab2cde981330aa63f37/spec/core/data_structures.md#block>
// Default serialization - all fields serialize; used by /block endpoint
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub struct Block {
/// Block header
Expand Down
8 changes: 4 additions & 4 deletions tendermint/src/evidence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::{
/// evidence: `DuplicateVoteEvidence`.
///
/// <https://github.com/tendermint/spec/blob/d46cd7f573a2c6a2399fcab2cde981330aa63f37/spec/core/data_structures.md#evidence>
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
//#[serde(tag = "type", content = "value")]
#[serde(try_from = "RawEvidence", into = "RawEvidence")] // Used by RPC /broadcast_evidence endpoint
// To be fixed in 0.24
Expand Down Expand Up @@ -68,7 +68,7 @@ impl From<Evidence> for RawEvidence {
}

/// Duplicate vote evidence
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct DuplicateVoteEvidence {
vote_a: Vote,
vote_b: Vote,
Expand Down Expand Up @@ -135,7 +135,7 @@ impl DuplicateVoteEvidence {

/// Conflicting headers evidence.
// Todo: This struct doesn't seem to have a protobuf definition.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ConflictingHeadersEvidence {
//#[serde(rename = "H1")]
h1: SignedHeader,
Expand All @@ -153,7 +153,7 @@ impl ConflictingHeadersEvidence {
/// Evidence data is a wrapper for a list of `Evidence`.
///
/// <https://github.com/tendermint/spec/blob/d46cd7f573a2c6a2399fcab2cde981330aa63f37/spec/core/data_structures.md#evidencedata>
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(try_from = "RawEvidenceList", into = "RawEvidenceList")]
pub struct Data {
evidence: Option<Vec<Evidence>>,
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{
};

/// Proposal
#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct Proposal {
/// Proposal message type
pub msg_type: Type,
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/proposal/canonical_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
};

/// CanonicalProposal for signing
#[derive(Clone, PartialEq)]
#[derive(Clone, PartialEq, Eq)]
pub struct CanonicalProposal {
/// type alias for byte
pub msg_type: Type,
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/proposal/sign_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use super::Proposal;
use crate::{chain::Id as ChainId, error::Error, prelude::*};

/// SignProposalRequest is a request to sign a proposal
#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct SignProposalRequest {
/// Proposal
pub proposal: Proposal,
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/public_key/pub_key_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use tendermint_proto::{privval::PubKeyRequest as RawPubKeyRequest, Protobuf};
use crate::{chain::Id as ChainId, prelude::*, Error};

/// PubKeyRequest requests the consensus public key from the remote signer.
#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct PubKeyRequest {
/// Chain ID
pub chain_id: ChainId,
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ impl ProposerPriority {
}

/// Updates to the validator set
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct Update {
/// Validator public key
#[serde(deserialize_with = "deserialize_public_key")]
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use crate::{
/// include information about the validator signing it.
///
/// <https://github.com/tendermint/spec/blob/d46cd7f573a2c6a2399fcab2cde981330aa63f37/spec/core/data_structures.md#vote>
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[serde(try_from = "RawVote", into = "RawVote")]
pub struct Vote {
/// Type of vote (prevote or precommit)
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/vote/canonical_vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tendermint_proto::{types::CanonicalVote as RawCanonicalVote, Protobuf};
use crate::{block, chain::Id as ChainId, error::Error, prelude::*, Time};

/// CanonicalVote is used for protobuf encoding a Vote
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[serde(try_from = "RawCanonicalVote", into = "RawCanonicalVote")]
pub struct CanonicalVote {
/// Type of vote (prevote or precommit)
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/vote/sign_vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tendermint_proto::{
use crate::{chain, error::Error, prelude::*, Vote};

/// SignVoteRequest is a request to sign a vote
#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct SignVoteRequest {
/// Vote
pub vote: Vote,
Expand Down
2 changes: 1 addition & 1 deletion testgen/src/light_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use crate::{
/// }
/// }
/// ```
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct TmLightBlock {
/// Header and commit of this block
pub signed_header: SignedHeader,
Expand Down

0 comments on commit 21e056c

Please sign in to comment.