More missing derives (#27418)

* add Eq, PartialEq to EpochInfo

* add Eq, PartialEq related to transactions and messages

* add Eq, PartialEq to Ed25519SignatureOffsets

* add Eq, PartialEq to FeatureSet

* add Eq, PartialEq to fee.rs

* add Eq, PartialEq to GenesisConfig

* don't add Eq to GenesisConfig because floats

* add Eq, PartialEq to PohConfig

* add Eq, PartialEq to SecpSignatureOffsets

* add some missing derives to transaction_context.rs

* add Eq, PartialEq to ProcessedSiblingInstruction
This commit is contained in:
Kevin Heavey 2022-10-11 22:59:58 +03:00 committed by GitHub
parent db9e32d71d
commit 061bed0a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 17 additions and 17 deletions

View File

@ -665,7 +665,7 @@ impl CompiledInstruction {
/// Use to query and convey information about the sibling instruction components
/// when calling the `sol_get_processed_sibling_instruction` syscall.
#[repr(C)]
#[derive(Default, Debug, Clone, Copy)]
#[derive(Default, Debug, Clone, Copy, Eq, PartialEq)]
pub struct ProcessedSiblingInstruction {
/// Length of the instruction data
pub data_len: u64,

View File

@ -19,7 +19,7 @@ use {
thiserror::Error,
};
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct LegacyMessage<'a> {
/// Legacy message
pub message: Cow<'a, legacy::Message>,
@ -66,7 +66,7 @@ impl<'a> LegacyMessage<'a> {
}
/// Sanitized message of a transaction.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum SanitizedMessage {
/// Sanitized legacy message
Legacy(LegacyMessage<'static>),

View File

@ -8,7 +8,7 @@ use {
};
/// Combination of a version #0 message and its loaded addresses
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct LoadedMessage<'a> {
/// Message which loaded a collection of lookup table addresses
pub message: Cow<'a, v0::Message>,

View File

@ -14,7 +14,7 @@ pub const SIGNATURE_OFFSETS_SERIALIZED_SIZE: usize = 14;
pub const SIGNATURE_OFFSETS_START: usize = 2;
pub const DATA_START: usize = SIGNATURE_OFFSETS_SERIALIZED_SIZE + SIGNATURE_OFFSETS_START;
#[derive(Default, Debug, Copy, Clone, Zeroable, Pod)]
#[derive(Default, Debug, Copy, Clone, Zeroable, Pod, Eq, PartialEq)]
#[repr(C)]
pub struct Ed25519SignatureOffsets {
signature_offset: u16, // offset to ed25519 signature of 64 bytes

View File

@ -1,6 +1,6 @@
use crate::clock::{Epoch, Slot};
#[derive(Serialize, Deserialize, Clone, Debug)]
#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct EpochInfo {
/// The current epoch

View File

@ -685,7 +685,7 @@ lazy_static! {
}
/// `FeatureSet` holds the set of currently active/inactive runtime features
#[derive(AbiExample, Debug, Clone)]
#[derive(AbiExample, Debug, Clone, Eq, PartialEq)]
pub struct FeatureSet {
pub active: HashMap<Pubkey, Slot>,
pub inactive: HashSet<Pubkey>,

View File

@ -1,7 +1,7 @@
use crate::native_token::sol_to_lamports;
/// A fee and its associated compute unit limit
#[derive(Debug, Default, Clone)]
#[derive(Debug, Default, Clone, Eq, PartialEq)]
pub struct FeeBin {
/// maximum compute units for which this fee will be charged
pub limit: u64,
@ -10,7 +10,7 @@ pub struct FeeBin {
}
/// Information used to calculate fees
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct FeeStructure {
/// lamports per signature
pub lamports_per_signature: u64,

View File

@ -68,7 +68,7 @@ impl FromStr for ClusterType {
}
#[frozen_abi(digest = "3V3ZVRyzNhRfe8RJwDeGpeTP8xBWGGFBEbwTkvKKVjEa")]
#[derive(Serialize, Deserialize, Debug, Clone, AbiExample)]
#[derive(Serialize, Deserialize, Debug, Clone, AbiExample, PartialEq)]
pub struct GenesisConfig {
/// when the network (bootstrap validator) was started relative to the UNIX Epoch
pub creation_time: UnixTimestamp,

View File

@ -3,7 +3,7 @@ use {
std::time::Duration,
};
#[derive(Serialize, Deserialize, Clone, Debug, AbiExample)]
#[derive(Serialize, Deserialize, Clone, Debug, AbiExample, Eq, PartialEq)]
pub struct PohConfig {
/// The target tick rate of the cluster.
pub target_tick_duration: Duration,

View File

@ -811,7 +811,7 @@ pub const DATA_START: usize = SIGNATURE_OFFSETS_SERIALIZED_SIZE + 1;
/// See the [module documentation][md] for a complete description.
///
/// [md]: self
#[derive(Default, Serialize, Deserialize, Debug)]
#[derive(Default, Serialize, Deserialize, Debug, Eq, PartialEq)]
pub struct SecpSignatureOffsets {
/// Offset to 64-byte signature plus 1-byte recovery ID.
pub signature_offset: u16,

View File

@ -27,7 +27,7 @@ use {
pub const MAX_TX_ACCOUNT_LOCKS: usize = 128;
/// Sanitized transaction and the hash of its message
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct SanitizedTransaction {
message: SanitizedMessage,
message_hash: Hash,
@ -36,7 +36,7 @@ pub struct SanitizedTransaction {
}
/// Set of accounts that must be locked for safe transaction processing
#[derive(Debug, Clone, Default)]
#[derive(Debug, Clone, Default, Eq, PartialEq)]
pub struct TransactionAccountLocks<'a> {
/// List of readonly account key locks
pub readonly: Vec<&'a Pubkey>,

View File

@ -83,7 +83,7 @@ pub type IndexOfAccount = u16;
/// Contains account meta data which varies between instruction.
///
/// It also contains indices to other structures for faster lookup.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct InstructionAccount {
/// Points to the account and its key in the `TransactionContext`
pub index_in_transaction: IndexOfAccount,
@ -107,7 +107,7 @@ pub type TransactionAccount = (Pubkey, AccountSharedData);
/// Loaded transaction shared between runtime and programs.
///
/// This context is valid for the entire duration of a transaction being processed.
#[derive(Debug)]
#[derive(Debug, Clone, PartialEq)]
pub struct TransactionContext {
account_keys: Pin<Box<[Pubkey]>>,
accounts: Pin<Box<[RefCell<AccountSharedData>]>>,
@ -431,7 +431,7 @@ pub struct TransactionReturnData {
/// Loaded instruction shared between runtime and programs.
///
/// This context is valid for the entire duration of a (possibly cross program) instruction being processed.
#[derive(Debug, Clone, Default)]
#[derive(Debug, Clone, Default, Eq, PartialEq)]
pub struct InstructionContext {
nesting_level: usize,
instruction_accounts_lamport_sum: u128,