Fix derive_partial_eq_without_eq clippy lint
This commit is contained in:
parent
e22be02d3a
commit
b05c7d91ed
|
@ -34,7 +34,7 @@ pub type StringDecimals = String;
|
||||||
pub const MAX_BASE58_BYTES: usize = 128;
|
pub const MAX_BASE58_BYTES: usize = 128;
|
||||||
|
|
||||||
/// A duplicate representation of an Account for pretty JSON serialization
|
/// 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")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiAccount {
|
pub struct UiAccount {
|
||||||
pub lamports: u64,
|
pub lamports: u64,
|
||||||
|
@ -44,7 +44,7 @@ pub struct UiAccount {
|
||||||
pub rent_epoch: Epoch,
|
pub rent_epoch: Epoch,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase", untagged)]
|
#[serde(rename_all = "camelCase", untagged)]
|
||||||
pub enum UiAccountData {
|
pub enum UiAccountData {
|
||||||
LegacyBinary(String), // Legacy. Retained for RPC backwards compatibility
|
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")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiFeeCalculator {
|
pub struct UiFeeCalculator {
|
||||||
pub lamports_per_signature: StringAmount,
|
pub lamports_per_signature: StringAmount,
|
||||||
|
|
|
@ -57,7 +57,7 @@ pub enum ParseAccountError {
|
||||||
SerdeJsonError(#[from] serde_json::error::Error),
|
SerdeJsonError(#[from] serde_json::error::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct ParsedAccount {
|
pub struct ParsedAccount {
|
||||||
pub program: String,
|
pub program: String,
|
||||||
|
|
|
@ -60,7 +60,7 @@ pub fn parse_bpf_upgradeable_loader(
|
||||||
Ok(parsed_account)
|
Ok(parsed_account)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase", tag = "type", content = "info")]
|
#[serde(rename_all = "camelCase", tag = "type", content = "info")]
|
||||||
pub enum BpfUpgradeableLoaderAccountType {
|
pub enum BpfUpgradeableLoaderAccountType {
|
||||||
Uninitialized,
|
Uninitialized,
|
||||||
|
@ -69,20 +69,20 @@ pub enum BpfUpgradeableLoaderAccountType {
|
||||||
ProgramData(UiProgramData),
|
ProgramData(UiProgramData),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiBuffer {
|
pub struct UiBuffer {
|
||||||
pub authority: Option<String>,
|
pub authority: Option<String>,
|
||||||
pub data: UiAccountData,
|
pub data: UiAccountData,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiProgram {
|
pub struct UiProgram {
|
||||||
pub program_data: String,
|
pub program_data: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiProgramData {
|
pub struct UiProgramData {
|
||||||
pub slot: u64,
|
pub slot: u64,
|
||||||
|
|
|
@ -59,7 +59,7 @@ pub enum ConfigAccountType {
|
||||||
ValidatorInfo(UiConfig<Value>),
|
ValidatorInfo(UiConfig<Value>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiConfigKey {
|
pub struct UiConfigKey {
|
||||||
pub pubkey: String,
|
pub pubkey: String,
|
||||||
|
|
|
@ -27,14 +27,14 @@ pub fn parse_nonce(data: &[u8]) -> Result<UiNonceState, ParseAccountError> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A duplicate representation of NonceState for pretty JSON serialization
|
/// 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")]
|
#[serde(rename_all = "camelCase", tag = "type", content = "info")]
|
||||||
pub enum UiNonceState {
|
pub enum UiNonceState {
|
||||||
Uninitialized,
|
Uninitialized,
|
||||||
Initialized(UiNonceData),
|
Initialized(UiNonceData),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiNonceData {
|
pub struct UiNonceData {
|
||||||
pub authority: String,
|
pub authority: String,
|
||||||
|
|
|
@ -44,7 +44,7 @@ pub struct UiStakeAccount {
|
||||||
pub stake: Option<UiStake>,
|
pub stake: Option<UiStake>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiMeta {
|
pub struct UiMeta {
|
||||||
pub rent_exempt_reserve: StringAmount,
|
pub rent_exempt_reserve: StringAmount,
|
||||||
|
@ -62,7 +62,7 @@ impl From<Meta> for UiMeta {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiLockup {
|
pub struct UiLockup {
|
||||||
pub unix_timestamp: UnixTimestamp,
|
pub unix_timestamp: UnixTimestamp,
|
||||||
|
@ -80,7 +80,7 @@ impl From<Lockup> for UiLockup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiAuthorized {
|
pub struct UiAuthorized {
|
||||||
pub staker: String,
|
pub staker: String,
|
||||||
|
|
|
@ -107,7 +107,7 @@ pub enum SysvarAccountType {
|
||||||
StakeHistory(Vec<UiStakeHistoryEntry>),
|
StakeHistory(Vec<UiStakeHistoryEntry>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq, Default)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Default)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiClock {
|
pub struct UiClock {
|
||||||
pub slot: Slot,
|
pub slot: Slot,
|
||||||
|
@ -129,7 +129,7 @@ impl From<Clock> for UiClock {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq, Default)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Default)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiFees {
|
pub struct UiFees {
|
||||||
pub fee_calculator: UiFeeCalculator,
|
pub fee_calculator: UiFeeCalculator,
|
||||||
|
@ -175,21 +175,21 @@ impl From<Rewards> for UiRewards {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiRecentBlockhashesEntry {
|
pub struct UiRecentBlockhashesEntry {
|
||||||
pub blockhash: String,
|
pub blockhash: String,
|
||||||
pub fee_calculator: UiFeeCalculator,
|
pub fee_calculator: UiFeeCalculator,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiSlotHashEntry {
|
pub struct UiSlotHashEntry {
|
||||||
pub slot: Slot,
|
pub slot: Slot,
|
||||||
pub hash: String,
|
pub hash: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiSlotHistory {
|
pub struct UiSlotHistory {
|
||||||
pub next_slot: Slot,
|
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")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiStakeHistoryEntry {
|
pub struct UiStakeHistoryEntry {
|
||||||
pub epoch: Epoch,
|
pub epoch: Epoch,
|
||||||
|
|
|
@ -179,7 +179,7 @@ pub struct UiTokenAccount {
|
||||||
pub extensions: Vec<UiExtension>,
|
pub extensions: Vec<UiExtension>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub enum UiAccountState {
|
pub enum UiAccountState {
|
||||||
Uninitialized,
|
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")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiMint {
|
pub struct UiMint {
|
||||||
pub mint_authority: Option<String>,
|
pub mint_authority: Option<String>,
|
||||||
|
@ -272,7 +272,7 @@ pub struct UiMint {
|
||||||
pub extensions: Vec<UiExtension>,
|
pub extensions: Vec<UiExtension>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiMultisig {
|
pub struct UiMultisig {
|
||||||
pub num_required_signers: u8,
|
pub num_required_signers: u8,
|
||||||
|
|
|
@ -6,7 +6,7 @@ use {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase", tag = "extension", content = "state")]
|
#[serde(rename_all = "camelCase", tag = "extension", content = "state")]
|
||||||
pub enum UiExtension {
|
pub enum UiExtension {
|
||||||
Uninitialized,
|
Uninitialized,
|
||||||
|
@ -53,7 +53,7 @@ pub fn parse_extension<S: BaseState>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiTransferFee {
|
pub struct UiTransferFee {
|
||||||
pub epoch: u64,
|
pub epoch: u64,
|
||||||
|
@ -71,7 +71,7 @@ impl From<extension::transfer_fee::TransferFee> for UiTransferFee {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiTransferFeeConfig {
|
pub struct UiTransferFeeConfig {
|
||||||
pub transfer_fee_config_authority: Option<String>,
|
pub transfer_fee_config_authority: Option<String>,
|
||||||
|
@ -100,7 +100,7 @@ impl From<extension::transfer_fee::TransferFeeConfig> for UiTransferFeeConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiTransferFeeAmount {
|
pub struct UiTransferFeeAmount {
|
||||||
pub withheld_amount: u64,
|
pub withheld_amount: u64,
|
||||||
|
@ -114,7 +114,7 @@ impl From<extension::transfer_fee::TransferFeeAmount> for UiTransferFeeAmount {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiMintCloseAuthority {
|
pub struct UiMintCloseAuthority {
|
||||||
pub close_authority: Option<String>,
|
pub close_authority: Option<String>,
|
||||||
|
@ -129,7 +129,7 @@ impl From<extension::mint_close_authority::MintCloseAuthority> for UiMintCloseAu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiDefaultAccountState {
|
pub struct UiDefaultAccountState {
|
||||||
pub account_state: UiAccountState,
|
pub account_state: UiAccountState,
|
||||||
|
@ -146,7 +146,7 @@ impl From<extension::default_account_state::DefaultAccountState> for UiDefaultAc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiMemoTransfer {
|
pub struct UiMemoTransfer {
|
||||||
pub require_incoming_transfer_memos: bool,
|
pub require_incoming_transfer_memos: bool,
|
||||||
|
|
|
@ -61,14 +61,14 @@ pub fn parse_vote(data: &[u8]) -> Result<VoteAccountType, ParseAccountError> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A wrapper enum for consistency across programs
|
/// 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")]
|
#[serde(rename_all = "camelCase", tag = "type", content = "info")]
|
||||||
pub enum VoteAccountType {
|
pub enum VoteAccountType {
|
||||||
Vote(UiVoteState),
|
Vote(UiVoteState),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A duplicate representation of VoteState for pretty JSON serialization
|
/// 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")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct UiVoteState {
|
pub struct UiVoteState {
|
||||||
node_pubkey: String,
|
node_pubkey: String,
|
||||||
|
@ -82,7 +82,7 @@ pub struct UiVoteState {
|
||||||
last_timestamp: BlockTimestamp,
|
last_timestamp: BlockTimestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
struct UiLockout {
|
struct UiLockout {
|
||||||
slot: Slot,
|
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")]
|
#[serde(rename_all = "camelCase")]
|
||||||
struct UiAuthorizedVoters {
|
struct UiAuthorizedVoters {
|
||||||
epoch: Epoch,
|
epoch: Epoch,
|
||||||
authorized_voter: String,
|
authorized_voter: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
struct UiPriorVoters {
|
struct UiPriorVoters {
|
||||||
authorized_pubkey: String,
|
authorized_pubkey: String,
|
||||||
|
@ -113,7 +113,7 @@ struct UiPriorVoters {
|
||||||
target_epoch: Epoch,
|
target_epoch: Epoch,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
struct UiEpochCredits {
|
struct UiEpochCredits {
|
||||||
epoch: Epoch,
|
epoch: Epoch,
|
||||||
|
|
|
@ -6,7 +6,7 @@ pub const MAX_VALIDATOR_INFO: u64 = 576;
|
||||||
|
|
||||||
solana_sdk::declare_id!("Va1idator1nfo111111111111111111111111111111");
|
solana_sdk::declare_id!("Va1idator1nfo111111111111111111111111111111");
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, PartialEq, Serialize, Default)]
|
#[derive(Debug, Deserialize, PartialEq, Eq, Serialize, Default)]
|
||||||
pub struct ValidatorInfo {
|
pub struct ValidatorInfo {
|
||||||
pub info: String,
|
pub info: String,
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ fn check_txs(
|
||||||
no_bank
|
no_bank
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(ArgEnum, Clone, Copy, PartialEq)]
|
#[derive(ArgEnum, Clone, Copy, PartialEq, Eq)]
|
||||||
enum WriteLockContention {
|
enum WriteLockContention {
|
||||||
/// No transactions lock the same accounts.
|
/// No transactions lock the same accounts.
|
||||||
None,
|
None,
|
||||||
|
|
|
@ -16,14 +16,14 @@ use {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub enum TransactionConfirmationStatus {
|
pub enum TransactionConfirmationStatus {
|
||||||
Processed,
|
Processed,
|
||||||
Confirmed,
|
Confirmed,
|
||||||
Finalized,
|
Finalized,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct TransactionStatus {
|
pub struct TransactionStatus {
|
||||||
pub slot: Slot,
|
pub slot: Slot,
|
||||||
pub confirmations: Option<usize>, // None = rooted
|
pub confirmations: Option<usize>, // None = rooted
|
||||||
|
@ -31,7 +31,7 @@ pub struct TransactionStatus {
|
||||||
pub confirmation_status: Option<TransactionConfirmationStatus>,
|
pub confirmation_status: Option<TransactionConfirmationStatus>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct TransactionSimulationDetails {
|
pub struct TransactionSimulationDetails {
|
||||||
pub logs: Vec<String>,
|
pub logs: Vec<String>,
|
||||||
|
@ -39,7 +39,7 @@ pub struct TransactionSimulationDetails {
|
||||||
pub return_data: Option<TransactionReturnData>,
|
pub return_data: Option<TransactionReturnData>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct BanksTransactionResultWithSimulation {
|
pub struct BanksTransactionResultWithSimulation {
|
||||||
pub result: Option<transaction::Result<()>>,
|
pub result: Option<transaction::Result<()>>,
|
||||||
pub simulation_details: Option<TransactionSimulationDetails>,
|
pub simulation_details: Option<TransactionSimulationDetails>,
|
||||||
|
|
|
@ -19,7 +19,7 @@ pub trait BloomHashIndex {
|
||||||
fn hash_at_index(&self, hash_index: u64) -> u64;
|
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<T: BloomHashIndex> {
|
pub struct Bloom<T: BloomHashIndex> {
|
||||||
pub keys: Vec<u64>,
|
pub keys: Vec<u64>,
|
||||||
pub bits: BitVec<u64>,
|
pub bits: BitVec<u64>,
|
||||||
|
|
|
@ -16,7 +16,7 @@ use {
|
||||||
};
|
};
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||||
// one instance of this per item in the index
|
// one instance of this per item in the index
|
||||||
// stored in the index bucket
|
// stored in the index bucket
|
||||||
pub struct IndexEntry {
|
pub struct IndexEntry {
|
||||||
|
|
|
@ -25,7 +25,7 @@ lazy_static! {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The Solana CLI configuration.
|
/// The Solana CLI configuration.
|
||||||
#[derive(Serialize, Deserialize, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
/// The RPC address of a Solana validator node.
|
/// The RPC address of a Solana validator node.
|
||||||
///
|
///
|
||||||
|
|
|
@ -52,7 +52,7 @@ static CHECK_MARK: Emoji = Emoji("✅ ", "");
|
||||||
static CROSS_MARK: Emoji = Emoji("❌ ", "");
|
static CROSS_MARK: Emoji = Emoji("❌ ", "");
|
||||||
static WARNING: Emoji = Emoji("⚠️", "!");
|
static WARNING: Emoji = Emoji("⚠️", "!");
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub enum OutputFormat {
|
pub enum OutputFormat {
|
||||||
Display,
|
Display,
|
||||||
Json,
|
Json,
|
||||||
|
@ -347,7 +347,7 @@ pub struct CliValidatorsStakeByVersion {
|
||||||
pub delinquent_active_stake: u64,
|
pub delinquent_active_stake: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone, Copy)]
|
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone, Copy)]
|
||||||
pub enum CliValidatorsSortOrder {
|
pub enum CliValidatorsSortOrder {
|
||||||
Delinquent,
|
Delinquent,
|
||||||
Commission,
|
Commission,
|
||||||
|
@ -1207,7 +1207,7 @@ impl fmt::Display for CliStakeState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, PartialEq)]
|
#[derive(Serialize, Deserialize, PartialEq, Eq)]
|
||||||
pub enum CliStakeType {
|
pub enum CliStakeType {
|
||||||
Stake,
|
Stake,
|
||||||
RewardsPool,
|
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")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct CliSignOnlyData {
|
pub struct CliSignOnlyData {
|
||||||
pub blockhash: String,
|
pub blockhash: String,
|
||||||
|
|
|
@ -370,7 +370,7 @@ fn write_signatures<W: io::Write>(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
enum AccountKeyType<'a> {
|
enum AccountKeyType<'a> {
|
||||||
Known(&'a Pubkey),
|
Known(&'a Pubkey),
|
||||||
Unknown {
|
Unknown {
|
||||||
|
|
|
@ -2099,7 +2099,7 @@ impl fmt::Display for CliRentCalculation {
|
||||||
impl QuietDisplay for CliRentCalculation {}
|
impl QuietDisplay for CliRentCalculation {}
|
||||||
impl VerboseDisplay for CliRentCalculation {}
|
impl VerboseDisplay for CliRentCalculation {}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum RentLengthValue {
|
pub enum RentLengthValue {
|
||||||
Nonce,
|
Nonce,
|
||||||
Stake,
|
Stake,
|
||||||
|
|
|
@ -25,14 +25,14 @@ use {
|
||||||
|
|
||||||
const DEFAULT_MAX_ACTIVE_DISPLAY_AGE_SLOTS: Slot = 15_000_000; // ~90days
|
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 {
|
pub enum ForceActivation {
|
||||||
No,
|
No,
|
||||||
Almost,
|
Almost,
|
||||||
Yes,
|
Yes,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum FeatureCliCommand {
|
pub enum FeatureCliCommand {
|
||||||
Status {
|
Status {
|
||||||
features: Vec<Pubkey>,
|
features: Vec<Pubkey>,
|
||||||
|
|
|
@ -15,7 +15,7 @@ use {
|
||||||
std::sync::Arc,
|
std::sync::Arc,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum InflationCliCommand {
|
pub enum InflationCliCommand {
|
||||||
Show,
|
Show,
|
||||||
Rewards(Vec<Pubkey>, Option<Epoch>),
|
Rewards(Vec<Pubkey>, Option<Epoch>),
|
||||||
|
|
|
@ -54,7 +54,7 @@ use {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum ProgramCliCommand {
|
pub enum ProgramCliCommand {
|
||||||
Deploy {
|
Deploy {
|
||||||
program_location: Option<String>,
|
program_location: Option<String>,
|
||||||
|
|
|
@ -12,7 +12,7 @@ use {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone, Copy)]
|
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
||||||
pub enum SpendAmount {
|
pub enum SpendAmount {
|
||||||
All,
|
All,
|
||||||
Some(u64),
|
Some(u64),
|
||||||
|
|
|
@ -103,7 +103,7 @@ pub(crate) struct StakeAuthorization {
|
||||||
authority_pubkey: Option<Pubkey>,
|
authority_pubkey: Option<Pubkey>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub struct StakeAuthorizationIndexed {
|
pub struct StakeAuthorizationIndexed {
|
||||||
pub authorization_type: StakeAuthorize,
|
pub authorization_type: StakeAuthorize,
|
||||||
pub new_authority_pubkey: Pubkey,
|
pub new_authority_pubkey: Pubkey,
|
||||||
|
|
|
@ -12,7 +12,7 @@ use {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum Source {
|
pub enum Source {
|
||||||
Cluster,
|
Cluster,
|
||||||
NonceAccount(Pubkey),
|
NonceAccount(Pubkey),
|
||||||
|
@ -107,7 +107,7 @@ impl Source {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum BlockhashQuery {
|
pub enum BlockhashQuery {
|
||||||
None(Hash),
|
None(Hash),
|
||||||
FeeCalculator(Source, Hash),
|
FeeCalculator(Source, Hash),
|
||||||
|
|
|
@ -16,7 +16,7 @@ use {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error, PartialEq)]
|
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error("invalid account owner")]
|
#[error("invalid account owner")]
|
||||||
InvalidAccountOwner,
|
InvalidAccountOwner,
|
||||||
|
|
|
@ -8,13 +8,13 @@ use {
|
||||||
solana_transaction_status::{TransactionDetails, UiTransactionEncoding},
|
solana_transaction_status::{TransactionDetails, UiTransactionEncoding},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcSignatureStatusConfig {
|
pub struct RpcSignatureStatusConfig {
|
||||||
pub search_transaction_history: bool,
|
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")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcSendTransactionConfig {
|
pub struct RpcSendTransactionConfig {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
@ -25,14 +25,14 @@ pub struct RpcSendTransactionConfig {
|
||||||
pub min_context_slot: Option<Slot>,
|
pub min_context_slot: Option<Slot>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcSimulateTransactionAccountsConfig {
|
pub struct RpcSimulateTransactionAccountsConfig {
|
||||||
pub encoding: Option<UiAccountEncoding>,
|
pub encoding: Option<UiAccountEncoding>,
|
||||||
pub addresses: Vec<String>,
|
pub addresses: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcSimulateTransactionConfig {
|
pub struct RpcSimulateTransactionConfig {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
@ -46,7 +46,7 @@ pub struct RpcSimulateTransactionConfig {
|
||||||
pub min_context_slot: Option<Slot>,
|
pub min_context_slot: Option<Slot>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcRequestAirdropConfig {
|
pub struct RpcRequestAirdropConfig {
|
||||||
pub recent_blockhash: Option<String>, // base-58 encoded blockhash
|
pub recent_blockhash: Option<String>, // base-58 encoded blockhash
|
||||||
|
@ -54,7 +54,7 @@ pub struct RpcRequestAirdropConfig {
|
||||||
pub commitment: Option<CommitmentConfig>,
|
pub commitment: Option<CommitmentConfig>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcLeaderScheduleConfig {
|
pub struct RpcLeaderScheduleConfig {
|
||||||
pub identity: Option<String>, // validator identity, as a base-58 encoded string
|
pub identity: Option<String>, // validator identity, as a base-58 encoded string
|
||||||
|
@ -62,7 +62,7 @@ pub struct RpcLeaderScheduleConfig {
|
||||||
pub commitment: Option<CommitmentConfig>,
|
pub commitment: Option<CommitmentConfig>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcBlockProductionConfigRange {
|
pub struct RpcBlockProductionConfigRange {
|
||||||
pub first_slot: Slot,
|
pub first_slot: Slot,
|
||||||
|
@ -78,7 +78,7 @@ pub struct RpcBlockProductionConfig {
|
||||||
pub commitment: Option<CommitmentConfig>,
|
pub commitment: Option<CommitmentConfig>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcGetVoteAccountsConfig {
|
pub struct RpcGetVoteAccountsConfig {
|
||||||
pub vote_pubkey: Option<String>, // validator vote address, as a base-58 encoded string
|
pub vote_pubkey: Option<String>, // validator vote address, as a base-58 encoded string
|
||||||
|
@ -88,7 +88,7 @@ pub struct RpcGetVoteAccountsConfig {
|
||||||
pub delinquent_slot_distance: Option<u64>,
|
pub delinquent_slot_distance: Option<u64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum RpcLeaderScheduleConfigWrapper {
|
pub enum RpcLeaderScheduleConfigWrapper {
|
||||||
SlotOnly(Option<Slot>),
|
SlotOnly(Option<Slot>),
|
||||||
|
@ -111,7 +111,7 @@ pub enum RpcLargestAccountsFilter {
|
||||||
NonCirculating,
|
NonCirculating,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcLargestAccountsConfig {
|
pub struct RpcLargestAccountsConfig {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
|
@ -119,7 +119,7 @@ pub struct RpcLargestAccountsConfig {
|
||||||
pub filter: Option<RpcLargestAccountsFilter>,
|
pub filter: Option<RpcLargestAccountsFilter>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcSupplyConfig {
|
pub struct RpcSupplyConfig {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
|
@ -128,7 +128,7 @@ pub struct RpcSupplyConfig {
|
||||||
pub exclude_non_circulating_accounts_list: bool,
|
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")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcEpochConfig {
|
pub struct RpcEpochConfig {
|
||||||
pub epoch: Option<Epoch>,
|
pub epoch: Option<Epoch>,
|
||||||
|
@ -137,7 +137,7 @@ pub struct RpcEpochConfig {
|
||||||
pub min_context_slot: Option<Slot>,
|
pub min_context_slot: Option<Slot>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcAccountInfoConfig {
|
pub struct RpcAccountInfoConfig {
|
||||||
pub encoding: Option<UiAccountEncoding>,
|
pub encoding: Option<UiAccountEncoding>,
|
||||||
|
@ -147,7 +147,7 @@ pub struct RpcAccountInfoConfig {
|
||||||
pub min_context_slot: Option<Slot>,
|
pub min_context_slot: Option<Slot>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcProgramAccountsConfig {
|
pub struct RpcProgramAccountsConfig {
|
||||||
pub filters: Option<Vec<RpcFilterType>>,
|
pub filters: Option<Vec<RpcFilterType>>,
|
||||||
|
@ -156,7 +156,7 @@ pub struct RpcProgramAccountsConfig {
|
||||||
pub with_context: Option<bool>,
|
pub with_context: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub enum RpcTransactionLogsFilter {
|
pub enum RpcTransactionLogsFilter {
|
||||||
All,
|
All,
|
||||||
|
@ -164,21 +164,21 @@ pub enum RpcTransactionLogsFilter {
|
||||||
Mentions(Vec<String>), // base58-encoded list of addresses
|
Mentions(Vec<String>), // base58-encoded list of addresses
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcTransactionLogsConfig {
|
pub struct RpcTransactionLogsConfig {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub commitment: Option<CommitmentConfig>,
|
pub commitment: Option<CommitmentConfig>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub enum RpcTokenAccountsFilter {
|
pub enum RpcTokenAccountsFilter {
|
||||||
Mint(String),
|
Mint(String),
|
||||||
ProgramId(String),
|
ProgramId(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcSignatureSubscribeConfig {
|
pub struct RpcSignatureSubscribeConfig {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
|
@ -186,14 +186,14 @@ pub struct RpcSignatureSubscribeConfig {
|
||||||
pub enable_received_notification: Option<bool>,
|
pub enable_received_notification: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub enum RpcBlockSubscribeFilter {
|
pub enum RpcBlockSubscribeFilter {
|
||||||
All,
|
All,
|
||||||
MentionsAccountOrProgram(String),
|
MentionsAccountOrProgram(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcBlockSubscribeConfig {
|
pub struct RpcBlockSubscribeConfig {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
|
@ -204,7 +204,7 @@ pub struct RpcBlockSubscribeConfig {
|
||||||
pub max_supported_transaction_version: Option<u8>,
|
pub max_supported_transaction_version: Option<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcSignaturesForAddressConfig {
|
pub struct RpcSignaturesForAddressConfig {
|
||||||
pub before: Option<String>, // Signature as base-58 string
|
pub before: Option<String>, // Signature as base-58 string
|
||||||
|
@ -246,7 +246,7 @@ pub trait EncodingConfig {
|
||||||
fn new_with_encoding(encoding: &Option<UiTransactionEncoding>) -> Self;
|
fn new_with_encoding(encoding: &Option<UiTransactionEncoding>) -> Self;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcBlockConfig {
|
pub struct RpcBlockConfig {
|
||||||
pub encoding: Option<UiTransactionEncoding>,
|
pub encoding: Option<UiTransactionEncoding>,
|
||||||
|
@ -289,7 +289,7 @@ impl From<RpcBlockConfig> for RpcEncodingConfigWrapper<RpcBlockConfig> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcTransactionConfig {
|
pub struct RpcTransactionConfig {
|
||||||
pub encoding: Option<UiTransactionEncoding>,
|
pub encoding: Option<UiTransactionEncoding>,
|
||||||
|
@ -307,7 +307,7 @@ impl EncodingConfig for RpcTransactionConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum RpcBlocksConfigWrapper {
|
pub enum RpcBlocksConfigWrapper {
|
||||||
EndSlotOnly(Option<Slot>),
|
EndSlotOnly(Option<Slot>),
|
||||||
|
@ -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")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcContextConfig {
|
pub struct RpcContextConfig {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
|
|
|
@ -11,7 +11,7 @@ use {
|
||||||
since = "1.7.0",
|
since = "1.7.0",
|
||||||
note = "Please use RpcSignaturesForAddressConfig instead"
|
note = "Please use RpcSignaturesForAddressConfig instead"
|
||||||
)]
|
)]
|
||||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcGetConfirmedSignaturesForAddress2Config {
|
pub struct RpcGetConfirmedSignaturesForAddress2Config {
|
||||||
pub before: Option<String>, // Signature as base-58 string
|
pub before: Option<String>, // Signature as base-58 string
|
||||||
|
@ -22,7 +22,7 @@ pub struct RpcGetConfirmedSignaturesForAddress2Config {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deprecated(since = "1.7.0", note = "Please use RpcBlockConfig instead")]
|
#[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")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcConfirmedBlockConfig {
|
pub struct RpcConfirmedBlockConfig {
|
||||||
pub encoding: Option<UiTransactionEncoding>,
|
pub encoding: Option<UiTransactionEncoding>,
|
||||||
|
@ -77,7 +77,7 @@ impl From<RpcConfirmedBlockConfig> for RpcBlockConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deprecated(since = "1.7.0", note = "Please use RpcTransactionConfig instead")]
|
#[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")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcConfirmedTransactionConfig {
|
pub struct RpcConfirmedTransactionConfig {
|
||||||
pub encoding: Option<UiTransactionEncoding>,
|
pub encoding: Option<UiTransactionEncoding>,
|
||||||
|
@ -105,7 +105,7 @@ impl From<RpcConfirmedTransactionConfig> for RpcTransactionConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deprecated(since = "1.7.0", note = "Please use RpcBlocksConfigWrapper instead")]
|
#[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)]
|
#[serde(untagged)]
|
||||||
pub enum RpcConfirmedBlocksConfigWrapper {
|
pub enum RpcConfirmedBlocksConfigWrapper {
|
||||||
EndSlotOnly(Option<Slot>),
|
EndSlotOnly(Option<Slot>),
|
||||||
|
|
|
@ -87,7 +87,7 @@ impl RpcFilterType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Error, PartialEq, Debug)]
|
#[derive(Error, PartialEq, Eq, Debug)]
|
||||||
pub enum RpcFilterError {
|
pub enum RpcFilterError {
|
||||||
#[error("encoded binary data should be less than 129 bytes")]
|
#[error("encoded binary data should be less than 129 bytes")]
|
||||||
DataTooLarge,
|
DataTooLarge,
|
||||||
|
|
|
@ -19,7 +19,7 @@ use {
|
||||||
|
|
||||||
pub type RpcResult<T> = client_error::Result<Response<T>>;
|
pub type RpcResult<T> = client_error::Result<Response<T>>;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcResponseContext {
|
pub struct RpcResponseContext {
|
||||||
pub slot: Slot,
|
pub slot: Slot,
|
||||||
|
@ -27,7 +27,7 @@ pub struct RpcResponseContext {
|
||||||
pub api_version: Option<RpcApiVersion>,
|
pub api_version: Option<RpcApiVersion>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct RpcApiVersion(semver::Version);
|
pub struct RpcApiVersion(semver::Version);
|
||||||
|
|
||||||
impl std::ops::Deref for RpcApiVersion {
|
impl std::ops::Deref for RpcApiVersion {
|
||||||
|
@ -168,21 +168,21 @@ pub struct RpcInflationRate {
|
||||||
pub epoch: Epoch,
|
pub epoch: Epoch,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcKeyedAccount {
|
pub struct RpcKeyedAccount {
|
||||||
pub pubkey: String,
|
pub pubkey: String,
|
||||||
pub account: UiAccount,
|
pub account: UiAccount,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
pub struct SlotInfo {
|
pub struct SlotInfo {
|
||||||
pub slot: Slot,
|
pub slot: Slot,
|
||||||
pub parent: Slot,
|
pub parent: Slot,
|
||||||
pub root: Slot,
|
pub root: Slot,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct SlotTransactionStats {
|
pub struct SlotTransactionStats {
|
||||||
pub num_transaction_entries: u64,
|
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
|
/// Map of leader base58 identity pubkeys to the slot indices relative to the first epoch slot
|
||||||
pub type RpcLeaderSchedule = HashMap<String, Vec<usize>>;
|
pub type RpcLeaderSchedule = HashMap<String, Vec<usize>>;
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcBlockProductionRange {
|
pub struct RpcBlockProductionRange {
|
||||||
pub first_slot: Slot,
|
pub first_slot: Slot,
|
||||||
pub last_slot: Slot,
|
pub last_slot: Slot,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcBlockProduction {
|
pub struct RpcBlockProduction {
|
||||||
/// Map of leader base58 identity pubkeys to a tuple of `(number of leader slots, number of blocks produced)`
|
/// 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,
|
pub slot: Slot,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcAccountBalance {
|
pub struct RpcAccountBalance {
|
||||||
pub address: String,
|
pub address: String,
|
||||||
pub lamports: u64,
|
pub lamports: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcSupply {
|
pub struct RpcSupply {
|
||||||
pub total: u64,
|
pub total: u64,
|
||||||
|
@ -447,7 +447,7 @@ pub struct RpcSupply {
|
||||||
pub non_circulating_accounts: Vec<String>,
|
pub non_circulating_accounts: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub enum StakeActivationState {
|
pub enum StakeActivationState {
|
||||||
Activating,
|
Activating,
|
||||||
|
@ -456,7 +456,7 @@ pub enum StakeActivationState {
|
||||||
Inactive,
|
Inactive,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcStakeActivation {
|
pub struct RpcStakeActivation {
|
||||||
pub state: StakeActivationState,
|
pub state: StakeActivationState,
|
||||||
|
@ -472,7 +472,7 @@ pub struct RpcTokenAccountBalance {
|
||||||
pub amount: UiTokenAmount,
|
pub amount: UiTokenAmount,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcConfirmedTransactionStatusWithSignature {
|
pub struct RpcConfirmedTransactionStatusWithSignature {
|
||||||
pub signature: String,
|
pub signature: String,
|
||||||
|
@ -483,7 +483,7 @@ pub struct RpcConfirmedTransactionStatusWithSignature {
|
||||||
pub confirmation_status: Option<TransactionConfirmationStatus>,
|
pub confirmation_status: Option<TransactionConfirmationStatus>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcPerfSample {
|
pub struct RpcPerfSample {
|
||||||
pub slot: Slot,
|
pub slot: Slot,
|
||||||
|
@ -492,7 +492,7 @@ pub struct RpcPerfSample {
|
||||||
pub sample_period_secs: u16,
|
pub sample_period_secs: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RpcInflationReward {
|
pub struct RpcInflationReward {
|
||||||
pub epoch: Epoch,
|
pub epoch: Epoch,
|
||||||
|
@ -539,7 +539,7 @@ impl From<ConfirmedTransactionStatusWithSignature> for RpcConfirmedTransactionSt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
pub struct RpcSnapshotSlotInfo {
|
pub struct RpcSnapshotSlotInfo {
|
||||||
pub full: Slot,
|
pub full: Slot,
|
||||||
pub incremental: Option<Slot>,
|
pub incremental: Option<Slot>,
|
||||||
|
|
|
@ -36,7 +36,7 @@ use {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum AncestorHashesReplayUpdate {
|
pub enum AncestorHashesReplayUpdate {
|
||||||
Dead(Slot),
|
Dead(Slot),
|
||||||
DeadDuplicateConfirmed(Slot),
|
DeadDuplicateConfirmed(Slot),
|
||||||
|
|
|
@ -103,7 +103,7 @@ struct RecordTransactionsSummary {
|
||||||
result: Result<(), PohRecorderError>,
|
result: Result<(), PohRecorderError>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub enum CommitTransactionDetails {
|
pub enum CommitTransactionDetails {
|
||||||
Committed { compute_units: u64 },
|
Committed { compute_units: u64 },
|
||||||
NotCommitted,
|
NotCommitted,
|
||||||
|
|
|
@ -64,7 +64,7 @@ pub enum BroadcastStageReturnType {
|
||||||
ChannelDisconnected,
|
ChannelDisconnected,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Debug)]
|
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||||
pub enum BroadcastStageType {
|
pub enum BroadcastStageType {
|
||||||
Standard,
|
Standard,
|
||||||
FailEntryVerification,
|
FailEntryVerification,
|
||||||
|
|
|
@ -16,7 +16,7 @@ use {
|
||||||
pub const MINIMUM_DUPLICATE_SLOT: Slot = 20;
|
pub const MINIMUM_DUPLICATE_SLOT: Slot = 20;
|
||||||
pub const DUPLICATE_RATE: usize = 10;
|
pub const DUPLICATE_RATE: usize = 10;
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Debug)]
|
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||||
pub struct BroadcastDuplicatesConfig {
|
pub struct BroadcastDuplicatesConfig {
|
||||||
/// Amount of stake (excluding the leader) to send different version of slots to.
|
/// 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.
|
/// Note this is sampled from a list of stakes sorted least to greatest.
|
||||||
|
|
|
@ -14,7 +14,7 @@ pub(crate) type DuplicateSlotsToRepair = HashMap<Slot, Hash>;
|
||||||
pub(crate) type EpochSlotsFrozenSlots = BTreeMap<Slot, Hash>;
|
pub(crate) type EpochSlotsFrozenSlots = BTreeMap<Slot, Hash>;
|
||||||
pub(crate) type GossipDuplicateConfirmedSlots = BTreeMap<Slot, Hash>;
|
pub(crate) type GossipDuplicateConfirmedSlots = BTreeMap<Slot, Hash>;
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Debug)]
|
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||||
pub enum ClusterConfirmedHash {
|
pub enum ClusterConfirmedHash {
|
||||||
// Ordered from strongest confirmation to weakest. Stronger
|
// Ordered from strongest confirmation to weakest. Stronger
|
||||||
// confirmations take precedence over weaker ones.
|
// confirmations take precedence over weaker ones.
|
||||||
|
@ -22,7 +22,7 @@ pub enum ClusterConfirmedHash {
|
||||||
EpochSlotsFrozen(Hash),
|
EpochSlotsFrozen(Hash),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Debug)]
|
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||||
pub enum BankStatus {
|
pub enum BankStatus {
|
||||||
Frozen(Hash),
|
Frozen(Hash),
|
||||||
Dead,
|
Dead,
|
||||||
|
@ -71,7 +71,7 @@ impl BankStatus {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub struct DeadState {
|
pub struct DeadState {
|
||||||
// Keep fields private, forces construction
|
// Keep fields private, forces construction
|
||||||
// via constructor
|
// via constructor
|
||||||
|
@ -106,7 +106,7 @@ impl DeadState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub struct BankFrozenState {
|
pub struct BankFrozenState {
|
||||||
// Keep fields private, forces construction
|
// Keep fields private, forces construction
|
||||||
// via constructor
|
// via constructor
|
||||||
|
@ -149,7 +149,7 @@ impl BankFrozenState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub struct DuplicateConfirmedState {
|
pub struct DuplicateConfirmedState {
|
||||||
// Keep fields private, forces construction
|
// Keep fields private, forces construction
|
||||||
// via constructor
|
// via constructor
|
||||||
|
@ -174,7 +174,7 @@ impl DuplicateConfirmedState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub struct DuplicateState {
|
pub struct DuplicateState {
|
||||||
// Keep fields private, forces construction
|
// Keep fields private, forces construction
|
||||||
// via constructor
|
// via constructor
|
||||||
|
@ -211,7 +211,7 @@ impl DuplicateState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub struct EpochSlotsFrozenState {
|
pub struct EpochSlotsFrozenState {
|
||||||
// Keep fields private, forces construction
|
// Keep fields private, forces construction
|
||||||
// via constructor
|
// via constructor
|
||||||
|
@ -255,7 +255,7 @@ impl EpochSlotsFrozenState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub enum SlotStateUpdate {
|
pub enum SlotStateUpdate {
|
||||||
BankFrozen(BankFrozenState),
|
BankFrozen(BankFrozenState),
|
||||||
DuplicateConfirmed(DuplicateConfirmedState),
|
DuplicateConfirmed(DuplicateConfirmedState),
|
||||||
|
@ -280,7 +280,7 @@ impl SlotStateUpdate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub enum ResultingStateChange {
|
pub enum ResultingStateChange {
|
||||||
// Bank was frozen
|
// Bank was frozen
|
||||||
BankFrozen(Hash),
|
BankFrozen(Hash),
|
||||||
|
|
|
@ -39,7 +39,7 @@ use {
|
||||||
thiserror::Error,
|
thiserror::Error,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Debug, AbiExample)]
|
#[derive(PartialEq, Eq, Clone, Debug, AbiExample)]
|
||||||
pub enum SwitchForkDecision {
|
pub enum SwitchForkDecision {
|
||||||
SwitchProof(Hash),
|
SwitchProof(Hash),
|
||||||
SameFork,
|
SameFork,
|
||||||
|
|
|
@ -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 MINIMUM_ANCESTOR_AGREEMENT_SIZE: usize = (ANCESTOR_HASH_REPAIR_SAMPLE_SIZE + 1) / 2;
|
||||||
const RETRY_INTERVAL_SECONDS: usize = 5;
|
const RETRY_INTERVAL_SECONDS: usize = 5;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum DuplicateAncestorDecision {
|
pub enum DuplicateAncestorDecision {
|
||||||
InvalidSample,
|
InvalidSample,
|
||||||
AncestorsAllMatch,
|
AncestorsAllMatch,
|
||||||
|
@ -67,7 +67,7 @@ impl DuplicateAncestorDecision {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq)]
|
||||||
pub struct DuplicateSlotRepairStatus {
|
pub struct DuplicateSlotRepairStatus {
|
||||||
// Any ancestor slots that are either missing or are mismatched.
|
// Any ancestor slots that are either missing or are mismatched.
|
||||||
// A mismatched ancestor slot is one that has been replayed (frozen)
|
// A mismatched ancestor slot is one that has been replayed (frozen)
|
||||||
|
|
|
@ -9,7 +9,7 @@ use {
|
||||||
std::collections::{HashMap, HashSet},
|
std::collections::{HashMap, HashSet},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
enum Visit {
|
enum Visit {
|
||||||
Visited(Slot),
|
Visited(Slot),
|
||||||
Unvisited(Slot),
|
Unvisited(Slot),
|
||||||
|
|
|
@ -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_SIGNATURES: usize = 200;
|
||||||
const MAX_VOTE_REFRESH_INTERVAL_MILLIS: usize = 5000;
|
const MAX_VOTE_REFRESH_INTERVAL_MILLIS: usize = 5000;
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub enum HeaviestForkFailures {
|
pub enum HeaviestForkFailures {
|
||||||
LockedOut(u64),
|
LockedOut(u64),
|
||||||
FailedThreshold(u64),
|
FailedThreshold(u64),
|
||||||
|
|
|
@ -37,7 +37,7 @@ pub struct Tower1_7_14 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[frozen_abi(digest = "CxwFFxKfn6ez6wifDKr5WYr3eu2PsWUKdMYp3LX8Xj52")]
|
#[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 struct SavedTower1_7_14 {
|
||||||
pub(crate) signature: Signature,
|
pub(crate) signature: Signature,
|
||||||
pub(crate) data: Vec<u8>,
|
pub(crate) data: Vec<u8>,
|
||||||
|
|
|
@ -14,7 +14,7 @@ use {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, AbiExample)]
|
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq, AbiExample)]
|
||||||
pub enum SavedTowerVersions {
|
pub enum SavedTowerVersions {
|
||||||
V1_17_14(SavedTower1_7_14),
|
V1_17_14(SavedTower1_7_14),
|
||||||
Current(SavedTower),
|
Current(SavedTower),
|
||||||
|
@ -76,7 +76,7 @@ impl From<SavedTower1_7_14> for SavedTowerVersions {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[frozen_abi(digest = "Gaxfwvx5MArn52mKZQgzHmDCyn5YfCuTHvp5Et3rFfpp")]
|
#[frozen_abi(digest = "Gaxfwvx5MArn52mKZQgzHmDCyn5YfCuTHvp5Et3rFfpp")]
|
||||||
#[derive(Default, Clone, Serialize, Deserialize, Debug, PartialEq, AbiExample)]
|
#[derive(Default, Clone, Serialize, Deserialize, Debug, PartialEq, Eq, AbiExample)]
|
||||||
pub struct SavedTower {
|
pub struct SavedTower {
|
||||||
signature: Signature,
|
signature: Signature,
|
||||||
data: Vec<u8>,
|
data: Vec<u8>,
|
||||||
|
@ -109,7 +109,7 @@ pub trait TowerStorage: Sync + Send {
|
||||||
fn store(&self, saved_tower: &SavedTowerVersions) -> Result<()>;
|
fn store(&self, saved_tower: &SavedTowerVersions) -> Result<()>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq)]
|
||||||
pub struct NullTowerStorage {}
|
pub struct NullTowerStorage {}
|
||||||
|
|
||||||
impl TowerStorage for 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 struct FileTowerStorage {
|
||||||
pub tower_path: PathBuf,
|
pub tower_path: PathBuf,
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,7 +251,7 @@ impl ValidatorConfig {
|
||||||
// `ValidatorStartProgress` contains status information that is surfaced to the node operator over
|
// `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
|
// the admin RPC channel to help them to follow the general progress of node startup without
|
||||||
// having to watch log messages.
|
// having to watch log messages.
|
||||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)]
|
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
pub enum ValidatorStartProgress {
|
pub enum ValidatorStartProgress {
|
||||||
Initializing, // Catch all, default state
|
Initializing, // Catch all, default state
|
||||||
SearchingForRpcService,
|
SearchingForRpcService,
|
||||||
|
@ -1820,7 +1820,7 @@ fn initialize_rpc_transaction_history_services(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
enum ValidatorError {
|
enum ValidatorError {
|
||||||
BadExpectedBankHash,
|
BadExpectedBankHash,
|
||||||
NotEnoughLedgerData,
|
NotEnoughLedgerData,
|
||||||
|
|
|
@ -5,7 +5,7 @@ use {
|
||||||
std::{net::SocketAddr, process::exit, str::FromStr},
|
std::{net::SocketAddr, process::exit, str::FromStr},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Parser, Debug, PartialEq)]
|
#[derive(Parser, Debug, PartialEq, Eq)]
|
||||||
#[clap(name = crate_name!(),
|
#[clap(name = crate_name!(),
|
||||||
version = crate_version!(),
|
version = crate_version!(),
|
||||||
about = crate_description!(),
|
about = crate_description!(),
|
||||||
|
@ -52,7 +52,7 @@ pub struct DosClientParameters {
|
||||||
pub transaction_params: TransactionParams,
|
pub transaction_params: TransactionParams,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Args, Serialize, Deserialize, Debug, Default, PartialEq)]
|
#[derive(Args, Serialize, Deserialize, Debug, Default, PartialEq, Eq)]
|
||||||
#[clap(rename_all = "kebab-case")]
|
#[clap(rename_all = "kebab-case")]
|
||||||
pub struct TransactionParams {
|
pub struct TransactionParams {
|
||||||
#[clap(
|
#[clap(
|
||||||
|
@ -119,7 +119,7 @@ pub enum DataType {
|
||||||
Transaction,
|
Transaction,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(ArgEnum, Serialize, Deserialize, Debug, Clone, PartialEq)]
|
#[derive(ArgEnum, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum TransactionType {
|
pub enum TransactionType {
|
||||||
Transfer,
|
Transfer,
|
||||||
AccountCreation,
|
AccountCreation,
|
||||||
|
|
|
@ -318,7 +318,7 @@ pub struct VerifyRecyclers {
|
||||||
tx_offset_recycler: Recycler<sigverify::TxOffset>,
|
tx_offset_recycler: Recycler<sigverify::TxOffset>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Copy, Debug)]
|
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
|
||||||
pub enum EntryVerificationStatus {
|
pub enum EntryVerificationStatus {
|
||||||
Failure,
|
Failure,
|
||||||
Success,
|
Success,
|
||||||
|
|
|
@ -77,7 +77,7 @@ pub struct Crds {
|
||||||
stats: Mutex<CrdsStats>,
|
stats: Mutex<CrdsStats>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub enum CrdsError {
|
pub enum CrdsError {
|
||||||
InsertFailed,
|
InsertFailed,
|
||||||
UnknownStakes,
|
UnknownStakes,
|
||||||
|
@ -106,7 +106,7 @@ pub(crate) struct CrdsStats {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This structure stores some local metadata associated with the CrdsValue
|
/// This structure stores some local metadata associated with the CrdsValue
|
||||||
#[derive(PartialEq, Debug, Clone)]
|
#[derive(PartialEq, Eq, Debug, Clone)]
|
||||||
pub struct VersionedCrdsValue {
|
pub struct VersionedCrdsValue {
|
||||||
/// Ordinal index indicating insert order.
|
/// Ordinal index indicating insert order.
|
||||||
ordinal: u64,
|
ordinal: u64,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub enum CrdsGossipError {
|
pub enum CrdsGossipError {
|
||||||
NoPeers,
|
NoPeers,
|
||||||
PushMessageTimeout,
|
PushMessageTimeout,
|
||||||
|
|
|
@ -56,7 +56,7 @@ const PULL_ACTIVE_TIMEOUT_MS: u64 = 60_000;
|
||||||
pub const FALSE_RATE: f64 = 0.1f64;
|
pub const FALSE_RATE: f64 = 0.1f64;
|
||||||
pub const KEYS: f64 = 8f64;
|
pub const KEYS: f64 = 8f64;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample)]
|
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample)]
|
||||||
pub struct CrdsFilter {
|
pub struct CrdsFilter {
|
||||||
pub filter: Bloom<Hash>,
|
pub filter: Bloom<Hash>,
|
||||||
mask: u64,
|
mask: u64,
|
||||||
|
|
|
@ -39,7 +39,7 @@ pub type EpochSlotsIndex = u8;
|
||||||
pub const MAX_EPOCH_SLOTS: EpochSlotsIndex = 255;
|
pub const MAX_EPOCH_SLOTS: EpochSlotsIndex = 255;
|
||||||
|
|
||||||
/// CrdsValue that is replicated across the cluster
|
/// 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 struct CrdsValue {
|
||||||
pub signature: Signature,
|
pub signature: Signature,
|
||||||
pub data: CrdsData,
|
pub data: CrdsData,
|
||||||
|
@ -79,7 +79,7 @@ impl Signable for CrdsValue {
|
||||||
/// * Merge Strategy - Latest wallclock is picked
|
/// * Merge Strategy - Latest wallclock is picked
|
||||||
/// * LowestSlot index is deprecated
|
/// * LowestSlot index is deprecated
|
||||||
#[allow(clippy::large_enum_variant)]
|
#[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 {
|
pub enum CrdsData {
|
||||||
ContactInfo(ContactInfo),
|
ContactInfo(ContactInfo),
|
||||||
Vote(VoteIndex, Vote),
|
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 struct SnapshotHashes {
|
||||||
pub from: Pubkey,
|
pub from: Pubkey,
|
||||||
pub hashes: Vec<(Slot, Hash)>,
|
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 struct IncrementalSnapshotHashes {
|
||||||
pub from: Pubkey,
|
pub from: Pubkey,
|
||||||
pub base: (Slot, Hash),
|
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 struct LowestSlot {
|
||||||
pub from: Pubkey,
|
pub from: Pubkey,
|
||||||
root: Slot, //deprecated
|
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 struct Vote {
|
||||||
pub(crate) from: Pubkey,
|
pub(crate) from: Pubkey,
|
||||||
transaction: Transaction,
|
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 struct LegacyVersion {
|
||||||
pub from: Pubkey,
|
pub from: Pubkey,
|
||||||
pub wallclock: u64,
|
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 struct Version {
|
||||||
pub from: Pubkey,
|
pub from: Pubkey,
|
||||||
pub wallclock: u64,
|
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 {
|
pub struct NodeInstance {
|
||||||
from: Pubkey,
|
from: Pubkey,
|
||||||
wallclock: u64,
|
wallclock: u64,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use solana_sdk::clock::Slot;
|
use solana_sdk::clock::Slot;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, AbiExample, AbiEnumVisitor)]
|
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, AbiExample, AbiEnumVisitor)]
|
||||||
enum CompressionType {
|
enum CompressionType {
|
||||||
Uncompressed,
|
Uncompressed,
|
||||||
GZip,
|
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 {
|
pub(crate) struct EpochIncompleteSlots {
|
||||||
first: Slot,
|
first: Slot,
|
||||||
compression: CompressionType,
|
compression: CompressionType,
|
||||||
|
|
|
@ -27,7 +27,7 @@ pub(crate) const MAX_DUPLICATE_SHREDS: DuplicateShredIndex = 512;
|
||||||
pub trait LeaderScheduleFn: FnOnce(Slot) -> Option<Pubkey> {}
|
pub trait LeaderScheduleFn: FnOnce(Slot) -> Option<Pubkey> {}
|
||||||
impl<F> LeaderScheduleFn for F where F: FnOnce(Slot) -> Option<Pubkey> {}
|
impl<F> LeaderScheduleFn for F where F: FnOnce(Slot) -> Option<Pubkey> {}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, AbiExample, Deserialize, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, AbiExample, Deserialize, Serialize)]
|
||||||
pub struct DuplicateShred {
|
pub struct DuplicateShred {
|
||||||
pub(crate) from: Pubkey,
|
pub(crate) from: Pubkey,
|
||||||
pub(crate) wallclock: u64,
|
pub(crate) wallclock: u64,
|
||||||
|
|
|
@ -14,7 +14,7 @@ use {
|
||||||
};
|
};
|
||||||
|
|
||||||
const MAX_SLOTS_PER_ENTRY: usize = 2048 * 8;
|
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 struct Uncompressed {
|
||||||
pub first_slot: Slot,
|
pub first_slot: Slot,
|
||||||
pub num: usize,
|
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 struct Flate2 {
|
||||||
pub first_slot: Slot,
|
pub first_slot: Slot,
|
||||||
pub num: usize,
|
pub num: usize,
|
||||||
|
@ -61,7 +61,7 @@ impl Sanitize for Flate2 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
CompressError,
|
CompressError,
|
||||||
DecompressError,
|
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 {
|
pub enum CompressedSlots {
|
||||||
Flate2(Flate2),
|
Flate2(Flate2),
|
||||||
Uncompressed(Uncompressed),
|
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 struct EpochSlots {
|
||||||
pub from: Pubkey,
|
pub from: Pubkey,
|
||||||
pub slots: Vec<CompressedSlots>,
|
pub slots: Vec<CompressedSlots>,
|
||||||
|
|
|
@ -9,13 +9,13 @@ use {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
|
||||||
pub enum ExplicitRelease {
|
pub enum ExplicitRelease {
|
||||||
Semver(String),
|
Semver(String),
|
||||||
Channel(String),
|
Channel(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Default, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Default, Debug, PartialEq, Eq)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub json_rpc_url: String,
|
pub json_rpc_url: String,
|
||||||
pub update_manifest_pubkey: Pubkey,
|
pub update_manifest_pubkey: Pubkey,
|
||||||
|
|
|
@ -10,7 +10,7 @@ use {
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Information required to download and apply a given update
|
/// 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 struct UpdateManifest {
|
||||||
pub timestamp_secs: u64, // When the release was deployed in seconds since UNIX EPOCH
|
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
|
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.
|
/// Data of an Update Manifest program Account.
|
||||||
#[derive(Serialize, Deserialize, Default, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Default, Debug, PartialEq, Eq)]
|
||||||
pub struct SignedUpdateManifest {
|
pub struct SignedUpdateManifest {
|
||||||
pub manifest: UpdateManifest,
|
pub manifest: UpdateManifest,
|
||||||
pub manifest_signature: Signature,
|
pub manifest_signature: Signature,
|
||||||
|
|
|
@ -89,7 +89,7 @@ use {
|
||||||
mod bigtable;
|
mod bigtable;
|
||||||
mod ledger_path;
|
mod ledger_path;
|
||||||
|
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq, Eq)]
|
||||||
enum LedgerOutputMethod {
|
enum LedgerOutputMethod {
|
||||||
Print,
|
Print,
|
||||||
Json,
|
Json,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
#[derive(Error, Debug, PartialEq)]
|
#[derive(Error, Debug, PartialEq, Eq)]
|
||||||
pub enum BlockError {
|
pub enum BlockError {
|
||||||
/// Block did not have enough ticks was not marked full
|
/// Block did not have enough ticks was not marked full
|
||||||
/// and no shred with is_last was seen.
|
/// and no shred with is_last was seen.
|
||||||
|
|
|
@ -236,7 +236,7 @@ pub mod columns {
|
||||||
// - Account for column in `analyze_storage()` in ledger-tool/src/main.rs
|
// - Account for column in `analyze_storage()` in ledger-tool/src/main.rs
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub enum AccessType {
|
pub enum AccessType {
|
||||||
/// Primary (read/write) access; only one process can have Primary access.
|
/// Primary (read/write) access; only one process can have Primary access.
|
||||||
Primary,
|
Primary,
|
||||||
|
|
|
@ -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
|
/// Index recording presence/absence of shreds
|
||||||
pub struct Index {
|
pub struct Index {
|
||||||
pub slot: Slot,
|
pub slot: Slot,
|
||||||
|
@ -73,7 +73,7 @@ pub struct Index {
|
||||||
coding: ShredIndex,
|
coding: ShredIndex,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq)]
|
||||||
pub struct ShredIndex {
|
pub struct ShredIndex {
|
||||||
/// Map representing presence/absence of shreds
|
/// Map representing presence/absence of shreds
|
||||||
index: BTreeSet<u64>,
|
index: BTreeSet<u64>,
|
||||||
|
@ -107,14 +107,14 @@ pub struct DuplicateSlotProof {
|
||||||
pub shred2: Vec<u8>,
|
pub shred2: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum ErasureMetaStatus {
|
pub enum ErasureMetaStatus {
|
||||||
CanRecover,
|
CanRecover,
|
||||||
DataFull,
|
DataFull,
|
||||||
StillNeed(usize),
|
StillNeed(usize),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize, Debug, PartialEq)]
|
#[derive(Deserialize, Serialize, Debug, PartialEq, Eq)]
|
||||||
pub enum FrozenHashVersioned {
|
pub enum FrozenHashVersioned {
|
||||||
Current(FrozenHashStatus),
|
Current(FrozenHashStatus),
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ impl FrozenHashVersioned {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize, Debug, PartialEq)]
|
#[derive(Deserialize, Serialize, Debug, PartialEq, Eq)]
|
||||||
pub struct FrozenHashStatus {
|
pub struct FrozenHashStatus {
|
||||||
pub frozen_hash: Hash,
|
pub frozen_hash: Hash,
|
||||||
pub is_duplicate_confirmed: bool,
|
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 struct TransactionStatusIndexMeta {
|
||||||
pub max_slot: Slot,
|
pub max_slot: Slot,
|
||||||
pub frozen: bool,
|
pub frozen: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Deserialize, Serialize, PartialEq)]
|
#[derive(Debug, Default, Deserialize, Serialize, PartialEq, Eq)]
|
||||||
pub struct AddressSignatureMeta {
|
pub struct AddressSignatureMeta {
|
||||||
pub writeable: bool,
|
pub writeable: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq)]
|
||||||
pub struct PerfSample {
|
pub struct PerfSample {
|
||||||
pub num_transactions: u64,
|
pub num_transactions: u64,
|
||||||
pub num_slots: u64,
|
pub num_slots: u64,
|
||||||
pub sample_period_secs: u16,
|
pub sample_period_secs: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq)]
|
||||||
pub struct ProgramCost {
|
pub struct ProgramCost {
|
||||||
pub cost: u64,
|
pub cost: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq)]
|
||||||
pub struct OptimisticSlotMetaV0 {
|
pub struct OptimisticSlotMetaV0 {
|
||||||
pub hash: Hash,
|
pub hash: Hash,
|
||||||
pub timestamp: UnixTimestamp,
|
pub timestamp: UnixTimestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize, Debug, PartialEq)]
|
#[derive(Deserialize, Serialize, Debug, PartialEq, Eq)]
|
||||||
pub enum OptimisticSlotMetaVersioned {
|
pub enum OptimisticSlotMetaVersioned {
|
||||||
V0(OptimisticSlotMetaV0),
|
V0(OptimisticSlotMetaV0),
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ pub struct FixedSchedule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Stake-weighted leader schedule for one epoch.
|
/// Stake-weighted leader schedule for one epoch.
|
||||||
#[derive(Debug, Default, PartialEq)]
|
#[derive(Debug, Default, PartialEq, Eq)]
|
||||||
pub struct LeaderSchedule {
|
pub struct LeaderSchedule {
|
||||||
slot_leaders: Vec<Pubkey>,
|
slot_leaders: Vec<Pubkey>,
|
||||||
// Inverted index from pubkeys to indices where they are the leader.
|
// Inverted index from pubkeys to indices where they are the leader.
|
||||||
|
|
|
@ -173,7 +173,7 @@ pub enum ShredType {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A common header that is present in data and code shred headers
|
/// 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 {
|
struct ShredCommonHeader {
|
||||||
signature: Signature,
|
signature: Signature,
|
||||||
shred_type: ShredType,
|
shred_type: ShredType,
|
||||||
|
@ -184,7 +184,7 @@ struct ShredCommonHeader {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The data shred header has parent offset and flags
|
/// 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 {
|
struct DataShredHeader {
|
||||||
parent_offset: u16,
|
parent_offset: u16,
|
||||||
flags: ShredFlags,
|
flags: ShredFlags,
|
||||||
|
@ -192,14 +192,14 @@ struct DataShredHeader {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The coding shred header has FEC information
|
/// The coding shred header has FEC information
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Deserialize, Serialize)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
struct CodingShredHeader {
|
struct CodingShredHeader {
|
||||||
num_data_shreds: u16,
|
num_data_shreds: u16,
|
||||||
num_coding_shreds: u16,
|
num_coding_shreds: u16,
|
||||||
position: u16,
|
position: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub enum Shred {
|
pub enum Shred {
|
||||||
ShredCode(ShredCode),
|
ShredCode(ShredCode),
|
||||||
ShredData(ShredData),
|
ShredData(ShredData),
|
||||||
|
|
|
@ -23,14 +23,14 @@ const DATA_SHRED_SIZE_RANGE: RangeInclusive<usize> =
|
||||||
const_assert_eq!(ENCODED_PAYLOAD_SIZE, 1139);
|
const_assert_eq!(ENCODED_PAYLOAD_SIZE, 1139);
|
||||||
const ENCODED_PAYLOAD_SIZE: usize = SHRED_PAYLOAD_SIZE - SIZE_OF_CODING_SHRED_HEADERS;
|
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 {
|
pub struct ShredData {
|
||||||
common_header: ShredCommonHeader,
|
common_header: ShredCommonHeader,
|
||||||
data_header: DataShredHeader,
|
data_header: DataShredHeader,
|
||||||
payload: Vec<u8>,
|
payload: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub struct ShredCode {
|
pub struct ShredCode {
|
||||||
common_header: ShredCommonHeader,
|
common_header: ShredCommonHeader,
|
||||||
coding_header: CodingShredHeader,
|
coding_header: CodingShredHeader,
|
||||||
|
|
|
@ -24,7 +24,7 @@ pub struct MerkleTree {
|
||||||
nodes: Vec<Hash>,
|
nodes: Vec<Hash>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub struct ProofEntry<'a>(&'a Hash, Option<&'a Hash>, Option<&'a Hash>);
|
pub struct ProofEntry<'a>(&'a Hash, Option<&'a Hash>, Option<&'a Hash>);
|
||||||
|
|
||||||
impl<'a> ProofEntry<'a> {
|
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<ProofEntry<'a>>);
|
pub struct Proof<'a>(Vec<ProofEntry<'a>>);
|
||||||
|
|
||||||
impl<'a> Proof<'a> {
|
impl<'a> Proof<'a> {
|
||||||
|
|
|
@ -14,7 +14,7 @@ pub type PohTimingReceiver = Receiver<SlotPohTimingInfo>;
|
||||||
pub type PohTimingSender = Sender<SlotPohTimingInfo>;
|
pub type PohTimingSender = Sender<SlotPohTimingInfo>;
|
||||||
|
|
||||||
/// PohTimingPoint. Each TimingPoint is annotated with a timestamp in milliseconds.
|
/// PohTimingPoint. Each TimingPoint is annotated with a timestamp in milliseconds.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum PohTimingPoint {
|
pub enum PohTimingPoint {
|
||||||
PohSlotStart(u64),
|
PohSlotStart(u64),
|
||||||
PohSlotEnd(u64),
|
PohSlotEnd(u64),
|
||||||
|
|
|
@ -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
|
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 {
|
pub struct IpEchoServerResponse {
|
||||||
// Public IP address of request echoed back to the node.
|
// Public IP address of request echoed back to the node.
|
||||||
pub(crate) address: IpAddr,
|
pub(crate) address: IpAddr,
|
||||||
|
|
|
@ -77,7 +77,7 @@ impl PacketOffsets {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum PacketError {
|
pub enum PacketError {
|
||||||
InvalidLen,
|
InvalidLen,
|
||||||
InvalidPubkeyLen,
|
InvalidPubkeyLen,
|
||||||
|
|
|
@ -193,7 +193,7 @@ pub struct WorkingBank {
|
||||||
pub max_tick_height: u64,
|
pub max_tick_height: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum PohLeaderStatus {
|
pub enum PohLeaderStatus {
|
||||||
NotReached,
|
NotReached,
|
||||||
Reached { poh_slot: Slot, parent_slot: Slot },
|
Reached { poh_slot: Slot, parent_slot: Slot },
|
||||||
|
|
|
@ -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 {
|
pub struct ComputeBudget {
|
||||||
/// Number of compute units that a transaction or individual instruction is
|
/// Number of compute units that a transaction or individual instruction is
|
||||||
/// allowed to consume. Compute units are consumed by program execution,
|
/// allowed to consume. Compute units are consumed by program execution,
|
||||||
|
|
|
@ -8,7 +8,7 @@ pub enum PrioritizationFeeType {
|
||||||
Deprecated(u64),
|
Deprecated(u64),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, PartialEq)]
|
#[derive(Default, Debug, PartialEq, Eq)]
|
||||||
pub struct PrioritizationFeeDetails {
|
pub struct PrioritizationFeeDetails {
|
||||||
fee: u64,
|
fee: u64,
|
||||||
priority: u64,
|
priority: u64,
|
||||||
|
|
|
@ -8,7 +8,7 @@ use {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Default, Debug, PartialEq)]
|
#[derive(Default, Debug, PartialEq, Eq)]
|
||||||
pub struct ProgramTiming {
|
pub struct ProgramTiming {
|
||||||
pub accumulated_us: u64,
|
pub accumulated_us: u64,
|
||||||
pub accumulated_units: u64,
|
pub accumulated_units: u64,
|
||||||
|
@ -153,7 +153,7 @@ impl ExecuteAccessoryTimings {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, PartialEq)]
|
#[derive(Default, Debug, PartialEq, Eq)]
|
||||||
pub struct ExecuteDetailsTimings {
|
pub struct ExecuteDetailsTimings {
|
||||||
pub serialize_us: u64,
|
pub serialize_us: u64,
|
||||||
pub create_vm_us: u64,
|
pub create_vm_us: u64,
|
||||||
|
|
|
@ -69,7 +69,7 @@ pub mod programs;
|
||||||
extern crate solana_bpf_loader_program;
|
extern crate solana_bpf_loader_program;
|
||||||
|
|
||||||
/// Errors from the program test environment
|
/// Errors from the program test environment
|
||||||
#[derive(Error, Debug, PartialEq)]
|
#[derive(Error, Debug, PartialEq, Eq)]
|
||||||
pub enum ProgramTestError {
|
pub enum ProgramTestError {
|
||||||
/// The chosen warp slot is not in the future, so warp is not performed
|
/// The chosen warp slot is not in the future, so warp is not performed
|
||||||
#[error("Warp slot not in the future")]
|
#[error("Warp slot not in the future")]
|
||||||
|
|
|
@ -18,7 +18,7 @@ pub const LOOKUP_TABLE_MAX_ADDRESSES: usize = 256;
|
||||||
pub const LOOKUP_TABLE_META_SIZE: usize = 56;
|
pub const LOOKUP_TABLE_META_SIZE: usize = 56;
|
||||||
|
|
||||||
/// Program account states
|
/// 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)]
|
#[allow(clippy::large_enum_variant)]
|
||||||
pub enum ProgramState {
|
pub enum ProgramState {
|
||||||
/// Account is not initialized.
|
/// Account is not initialized.
|
||||||
|
@ -28,7 +28,7 @@ pub enum ProgramState {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Activation status of a lookup table
|
/// Activation status of a lookup table
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||||
pub enum LookupTableStatus {
|
pub enum LookupTableStatus {
|
||||||
Activated,
|
Activated,
|
||||||
Deactivating { remaining_blocks: usize },
|
Deactivating { remaining_blocks: usize },
|
||||||
|
@ -36,7 +36,7 @@ pub enum LookupTableStatus {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Address lookup table metadata
|
/// Address lookup table metadata
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone, AbiExample)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, AbiExample)]
|
||||||
pub struct LookupTableMeta {
|
pub struct LookupTableMeta {
|
||||||
/// Lookup tables cannot be closed until the deactivation slot is
|
/// Lookup tables cannot be closed until the deactivation slot is
|
||||||
/// no longer "recent" (not accessible in the `SlotHashes` sysvar).
|
/// 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 struct AddressLookupTable<'a> {
|
||||||
pub meta: LookupTableMeta,
|
pub meta: LookupTableMeta,
|
||||||
pub addresses: Cow<'a, [Pubkey]>,
|
pub addresses: Cow<'a, [Pubkey]>,
|
||||||
|
|
|
@ -68,7 +68,7 @@ solana_sdk::declare_builtin!(
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Errors returned by functions the BPF Loader registers with the VM
|
/// Errors returned by functions the BPF Loader registers with the VM
|
||||||
#[derive(Debug, Error, PartialEq)]
|
#[derive(Debug, Error, PartialEq, Eq)]
|
||||||
pub enum BpfError {
|
pub enum BpfError {
|
||||||
#[error("{0}")]
|
#[error("{0}")]
|
||||||
VerifierError(#[from] VerifierError),
|
VerifierError(#[from] VerifierError),
|
||||||
|
|
|
@ -62,7 +62,7 @@ use {
|
||||||
pub const MAX_SIGNERS: usize = 16;
|
pub const MAX_SIGNERS: usize = 16;
|
||||||
|
|
||||||
/// Error definitions
|
/// Error definitions
|
||||||
#[derive(Debug, ThisError, PartialEq)]
|
#[derive(Debug, ThisError, PartialEq, Eq)]
|
||||||
pub enum SyscallError {
|
pub enum SyscallError {
|
||||||
#[error("{0}: {1:?}")]
|
#[error("{0}: {1:?}")]
|
||||||
InvalidString(Utf8Error, Vec<u8>),
|
InvalidString(Utf8Error, Vec<u8>),
|
||||||
|
|
|
@ -174,7 +174,7 @@ mod tests {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
|
||||||
struct MyConfig {
|
struct MyConfig {
|
||||||
pub item: u64,
|
pub item: u64,
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,7 @@ pub(crate) fn new_stake(
|
||||||
/// and the total points over which those lamports
|
/// and the total points over which those lamports
|
||||||
/// are to be distributed
|
/// are to be distributed
|
||||||
// basically read as rewards/points, but in integers instead of as an f64
|
// 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 struct PointValue {
|
||||||
pub rewards: u64, // lamports to split
|
pub rewards: u64, // lamports to split
|
||||||
pub points: u128, // over these points
|
pub points: u128, // over these points
|
||||||
|
@ -216,7 +216,7 @@ fn calculate_stake_points(
|
||||||
.points
|
.points
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
struct CalculatedStakePoints {
|
struct CalculatedStakePoints {
|
||||||
points: u128,
|
points: u128,
|
||||||
new_credits_observed: u64,
|
new_credits_observed: u64,
|
||||||
|
@ -329,7 +329,7 @@ fn calculate_stake_points_and_credits(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
struct CalculatedStakeRewards {
|
struct CalculatedStakeRewards {
|
||||||
staker_rewards: u64,
|
staker_rewards: u64,
|
||||||
voter_rewards: u64,
|
voter_rewards: u64,
|
||||||
|
|
|
@ -8,7 +8,7 @@ use {
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Reasons the vote might have had an error
|
/// 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 {
|
pub enum VoteError {
|
||||||
#[error("vote already recorded or not in slot hashes history")]
|
#[error("vote already recorded or not in slot hashes history")]
|
||||||
VoteTooOld,
|
VoteTooOld,
|
||||||
|
|
|
@ -41,7 +41,7 @@ pub const MAX_EPOCH_CREDITS_HISTORY: usize = 64;
|
||||||
const DEFAULT_PRIOR_VOTERS_OFFSET: usize = 82;
|
const DEFAULT_PRIOR_VOTERS_OFFSET: usize = 82;
|
||||||
|
|
||||||
#[frozen_abi(digest = "6LBwH5w3WyAWZhsM3KTG9QZP7nYBhcC61K33kHR6gMAD")]
|
#[frozen_abi(digest = "6LBwH5w3WyAWZhsM3KTG9QZP7nYBhcC61K33kHR6gMAD")]
|
||||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, AbiEnumVisitor, AbiExample)]
|
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize, AbiEnumVisitor, AbiExample)]
|
||||||
pub enum VoteTransaction {
|
pub enum VoteTransaction {
|
||||||
Vote(Vote),
|
Vote(Vote),
|
||||||
VoteStateUpdate(VoteStateUpdate),
|
VoteStateUpdate(VoteStateUpdate),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use {num_derive::FromPrimitive, thiserror::Error};
|
use {num_derive::FromPrimitive, thiserror::Error};
|
||||||
|
|
||||||
#[derive(Error, Debug, Clone, FromPrimitive, PartialEq)]
|
#[derive(Error, Debug, Clone, FromPrimitive, PartialEq, Eq)]
|
||||||
pub enum LedgerError {
|
pub enum LedgerError {
|
||||||
#[error("Solana app not open on Ledger device")]
|
#[error("Solana app not open on Ledger device")]
|
||||||
NoAppResponse = 0x6700,
|
NoAppResponse = 0x6700,
|
||||||
|
|
|
@ -8,7 +8,7 @@ use {
|
||||||
uriparse::{URIReference, URIReferenceBuilder, URIReferenceError},
|
uriparse::{URIReference, URIReferenceBuilder, URIReferenceError},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
pub enum Manufacturer {
|
pub enum Manufacturer {
|
||||||
Unknown,
|
Unknown,
|
||||||
Ledger,
|
Ledger,
|
||||||
|
@ -23,7 +23,7 @@ impl Default for Manufacturer {
|
||||||
const MANUFACTURER_UNKNOWN: &str = "unknown";
|
const MANUFACTURER_UNKNOWN: &str = "unknown";
|
||||||
const MANUFACTURER_LEDGER: &str = "ledger";
|
const MANUFACTURER_LEDGER: &str = "ledger";
|
||||||
|
|
||||||
#[derive(Clone, Debug, Error, PartialEq)]
|
#[derive(Clone, Debug, Error, PartialEq, Eq)]
|
||||||
#[error("not a manufacturer")]
|
#[error("not a manufacturer")]
|
||||||
pub struct ManufacturerError;
|
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 {
|
pub enum LocatorError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
ManufacturerError(#[from] ManufacturerError),
|
ManufacturerError(#[from] ManufacturerError),
|
||||||
|
@ -87,7 +87,7 @@ impl From<Infallible> for LocatorError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub struct Locator {
|
pub struct Locator {
|
||||||
pub manufacturer: Manufacturer,
|
pub manufacturer: Manufacturer,
|
||||||
pub pubkey: Option<Pubkey>,
|
pub pubkey: Option<Pubkey>,
|
||||||
|
|
|
@ -10,7 +10,7 @@ use {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Copy, Debug)]
|
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
|
||||||
pub enum RpcHealthStatus {
|
pub enum RpcHealthStatus {
|
||||||
Ok,
|
Ok,
|
||||||
Behind { num_slots: Slot }, // Validator is behind its known validators
|
Behind { num_slots: Slot }, // Validator is behind its known validators
|
||||||
|
|
|
@ -199,7 +199,7 @@ impl<T> From<RpcNotificationResponse<T>> for RpcResponse<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
struct RpcNotificationContext {
|
struct RpcNotificationContext {
|
||||||
slot: Slot,
|
slot: Slot,
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ impl StorageLocation {
|
||||||
/// AppendVecs store accounts aligned to u64, so offset is always a multiple of 8 (sizeof(u64))
|
/// AppendVecs store accounts aligned to u64, so offset is always a multiple of 8 (sizeof(u64))
|
||||||
pub type OffsetReduced = u32;
|
pub type OffsetReduced = u32;
|
||||||
|
|
||||||
#[derive(Default, Debug, PartialEq, Clone, Copy)]
|
#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)]
|
||||||
pub struct AccountInfo {
|
pub struct AccountInfo {
|
||||||
/// index identifying the append storage
|
/// index identifying the append storage
|
||||||
store_id: AppendVecId,
|
store_id: AppendVecId,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub(crate) enum RentState {
|
pub(crate) enum RentState {
|
||||||
/// account.lamports == 0
|
/// account.lamports == 0
|
||||||
Uninitialized,
|
Uninitialized,
|
||||||
|
|
|
@ -119,7 +119,7 @@ pub struct Accounts {
|
||||||
// for the load instructions
|
// for the load instructions
|
||||||
pub type TransactionRent = u64;
|
pub type TransactionRent = u64;
|
||||||
pub type TransactionProgramIndices = Vec<Vec<usize>>;
|
pub type TransactionProgramIndices = Vec<Vec<usize>>;
|
||||||
#[derive(PartialEq, Debug, Clone)]
|
#[derive(PartialEq, Eq, Debug, Clone)]
|
||||||
pub struct LoadedTransaction {
|
pub struct LoadedTransaction {
|
||||||
pub accounts: Vec<TransactionAccount>,
|
pub accounts: Vec<TransactionAccount>,
|
||||||
pub program_indices: TransactionProgramIndices,
|
pub program_indices: TransactionProgramIndices,
|
||||||
|
|
|
@ -266,7 +266,7 @@ struct GenerateIndexTimings {
|
||||||
pub accounts_data_len_dedup_time_us: u64,
|
pub accounts_data_len_dedup_time_us: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, PartialEq)]
|
#[derive(Default, Debug, PartialEq, Eq)]
|
||||||
struct StorageSizeAndCount {
|
struct StorageSizeAndCount {
|
||||||
pub stored_size: usize,
|
pub stored_size: usize,
|
||||||
pub count: 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
|
// 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
|
// threshold, regardless of these hints. Also, load cannot fail not-deterministically
|
||||||
// even under very rare circumstances, unlike previously did allow.
|
// even under very rare circumstances, unlike previously did allow.
|
||||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
pub enum LoadHint {
|
pub enum LoadHint {
|
||||||
// Caller hints that it's loading transactions for a block which is
|
// Caller hints that it's loading transactions for a block which is
|
||||||
// descended from the current root, and at the tip of its fork.
|
// 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<TempDir>, Vec<PathBu
|
||||||
Ok((temp_dirs, paths))
|
Ok((temp_dirs, paths))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Default, Debug, Serialize, Deserialize, PartialEq, AbiExample)]
|
#[derive(Clone, Default, Debug, Serialize, Deserialize, PartialEq, Eq, AbiExample)]
|
||||||
pub struct BankHashStats {
|
pub struct BankHashStats {
|
||||||
pub num_updated_accounts: u64,
|
pub num_updated_accounts: u64,
|
||||||
pub num_removed_accounts: u64,
|
pub num_removed_accounts: u64,
|
||||||
|
@ -906,7 +906,7 @@ impl BankHashStats {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Default, Debug, Serialize, Deserialize, PartialEq, AbiExample)]
|
#[derive(Clone, Default, Debug, Serialize, Deserialize, PartialEq, Eq, AbiExample)]
|
||||||
pub struct BankHashInfo {
|
pub struct BankHashInfo {
|
||||||
pub hash: Hash,
|
pub hash: Hash,
|
||||||
pub snapshot_hash: Hash,
|
pub snapshot_hash: Hash,
|
||||||
|
|
|
@ -225,7 +225,7 @@ impl HashStats {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, PartialEq, Clone)]
|
#[derive(Default, Debug, PartialEq, Eq, Clone)]
|
||||||
pub struct CalculateHashIntermediate {
|
pub struct CalculateHashIntermediate {
|
||||||
pub hash: Hash,
|
pub hash: Hash,
|
||||||
pub lamports: u64,
|
pub lamports: u64,
|
||||||
|
@ -242,7 +242,7 @@ impl CalculateHashIntermediate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, PartialEq)]
|
#[derive(Default, Debug, PartialEq, Eq)]
|
||||||
pub struct CumulativeOffset {
|
pub struct CumulativeOffset {
|
||||||
pub index: Vec<usize>,
|
pub index: Vec<usize>,
|
||||||
pub start_offset: usize,
|
pub start_offset: usize,
|
||||||
|
|
|
@ -124,7 +124,7 @@ pub trait IndexValue:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Error, Debug, PartialEq)]
|
#[derive(Error, Debug, PartialEq, Eq)]
|
||||||
pub enum ScanError {
|
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")]
|
#[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 },
|
SlotRemoved { slot: Slot, bank_id: BankId },
|
||||||
|
|
|
@ -13,7 +13,7 @@ use {
|
||||||
|
|
||||||
/// a set of accounts need to be stored.
|
/// a set of accounts need to be stored.
|
||||||
/// If there are too many to fit in 'Primary', the rest are put in 'Overflow'
|
/// 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 {
|
pub enum StorageSelector {
|
||||||
Primary,
|
Primary,
|
||||||
Overflow,
|
Overflow,
|
||||||
|
|
|
@ -46,7 +46,7 @@ pub type StoredMetaWriteVersion = u64;
|
||||||
/// Meta contains enough context to recover the index from storage itself
|
/// Meta contains enough context to recover the index from storage itself
|
||||||
/// This struct will be backed by mmaped and snapshotted data files.
|
/// This struct will be backed by mmaped and snapshotted data files.
|
||||||
/// So the data layout must be stable and consistent across the entire cluster!
|
/// 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 {
|
pub struct StoredMeta {
|
||||||
/// global write version
|
/// global write version
|
||||||
pub write_version: StoredMetaWriteVersion,
|
pub write_version: StoredMetaWriteVersion,
|
||||||
|
@ -91,7 +91,7 @@ impl<'a, T: ReadableAccount> From<Option<&'a T>> for AccountMeta {
|
||||||
|
|
||||||
/// References to account data stored elsewhere. Getting an `Account` requires cloning
|
/// References to account data stored elsewhere. Getting an `Account` requires cloning
|
||||||
/// (see `StoredAccountMeta::clone_account()`).
|
/// (see `StoredAccountMeta::clone_account()`).
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub struct StoredAccountMeta<'a> {
|
pub struct StoredAccountMeta<'a> {
|
||||||
pub meta: &'a StoredMeta,
|
pub meta: &'a StoredMeta,
|
||||||
/// account data
|
/// account data
|
||||||
|
|
|
@ -190,7 +190,7 @@ pub const MAX_LEADER_SCHEDULE_STAKES: Epoch = 5;
|
||||||
|
|
||||||
pub type Rewrites = RwLock<HashMap<Pubkey, Hash>>;
|
pub type Rewrites = RwLock<HashMap<Pubkey, Hash>>;
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub struct RentDebit {
|
pub struct RentDebit {
|
||||||
rent_collected: u64,
|
rent_collected: u64,
|
||||||
post_balance: 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<Pubkey, RentDebit>);
|
pub struct RentDebits(HashMap<Pubkey, RentDebit>);
|
||||||
impl RentDebits {
|
impl RentDebits {
|
||||||
fn get_account_rent_debit(&self, address: &Pubkey) -> u64 {
|
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
|
/// A list of log messages emitted during a transaction
|
||||||
pub type TransactionLogMessages = Vec<String>;
|
pub type TransactionLogMessages = Vec<String>;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, AbiExample, AbiEnumVisitor, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, AbiExample, AbiEnumVisitor, Debug, PartialEq, Eq)]
|
||||||
pub enum TransactionLogCollectorFilter {
|
pub enum TransactionLogCollectorFilter {
|
||||||
All,
|
All,
|
||||||
AllWithVotes,
|
AllWithVotes,
|
||||||
|
@ -785,7 +785,7 @@ pub struct TransactionLogCollectorConfig {
|
||||||
pub filter: TransactionLogCollectorFilter,
|
pub filter: TransactionLogCollectorFilter,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(AbiExample, Clone, Debug, PartialEq)]
|
#[derive(AbiExample, Clone, Debug, PartialEq, Eq)]
|
||||||
pub struct TransactionLogInfo {
|
pub struct TransactionLogInfo {
|
||||||
pub signature: Signature,
|
pub signature: Signature,
|
||||||
pub result: Result<()>,
|
pub result: Result<()>,
|
||||||
|
@ -829,7 +829,7 @@ pub trait NonceInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Holds limited nonce info available during transaction checks
|
/// Holds limited nonce info available during transaction checks
|
||||||
#[derive(Clone, Debug, Default, PartialEq)]
|
#[derive(Clone, Debug, Default, PartialEq, Eq)]
|
||||||
pub struct NoncePartial {
|
pub struct NoncePartial {
|
||||||
address: Pubkey,
|
address: Pubkey,
|
||||||
account: AccountSharedData,
|
account: AccountSharedData,
|
||||||
|
@ -855,7 +855,7 @@ impl NonceInfo for NoncePartial {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Holds fee subtracted nonce info
|
/// Holds fee subtracted nonce info
|
||||||
#[derive(Clone, Debug, Default, PartialEq)]
|
#[derive(Clone, Debug, Default, PartialEq, Eq)]
|
||||||
pub struct NonceFull {
|
pub struct NonceFull {
|
||||||
address: Pubkey,
|
address: Pubkey,
|
||||||
account: AccountSharedData,
|
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 {
|
pub enum RewardType {
|
||||||
Fee,
|
Fee,
|
||||||
Rent,
|
Rent,
|
||||||
|
@ -1138,7 +1138,7 @@ pub trait DropCallback: fmt::Debug {
|
||||||
fn clone_box(&self) -> Box<dyn DropCallback + Send + Sync>;
|
fn clone_box(&self) -> Box<dyn DropCallback + Send + Sync>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Serialize, Deserialize, AbiExample, Clone, Copy)]
|
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, AbiExample, Clone, Copy)]
|
||||||
pub struct RewardInfo {
|
pub struct RewardInfo {
|
||||||
pub reward_type: RewardType,
|
pub reward_type: RewardType,
|
||||||
pub lamports: i64, // Reward amount
|
pub lamports: i64, // Reward amount
|
||||||
|
@ -17873,7 +17873,7 @@ pub(crate) mod tests {
|
||||||
.try_borrow_instruction_account(transaction_context, 1)?
|
.try_borrow_instruction_account(transaction_context, 1)?
|
||||||
.get_lamports();
|
.get_lamports();
|
||||||
let diff_balance = (new_balance as i64).saturating_sub(current_balance as i64);
|
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() {
|
if diff_balance.is_positive() {
|
||||||
instruction_context
|
instruction_context
|
||||||
.try_borrow_instruction_account(transaction_context, 0)?
|
.try_borrow_instruction_account(transaction_context, 0)?
|
||||||
|
|
|
@ -16,7 +16,7 @@ use {
|
||||||
std::sync::atomic::Ordering,
|
std::sync::atomic::Ordering,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub struct ExpectedRentCollection {
|
pub struct ExpectedRentCollection {
|
||||||
partition_from_pubkey: PartitionIndex,
|
partition_from_pubkey: PartitionIndex,
|
||||||
epoch_of_max_storage_slot: Epoch,
|
epoch_of_max_storage_slot: Epoch,
|
||||||
|
|
|
@ -15,7 +15,7 @@ use {
|
||||||
|
|
||||||
type AccountsDbFields = super::AccountsDbFields<SerializableAccountStorageEntry>;
|
type AccountsDbFields = super::AccountsDbFields<SerializableAccountStorageEntry>;
|
||||||
|
|
||||||
#[derive(Default, Clone, PartialEq, Debug, Deserialize, Serialize, AbiExample)]
|
#[derive(Default, Clone, PartialEq, Eq, Debug, Deserialize, Serialize, AbiExample)]
|
||||||
struct UnusedAccounts {
|
struct UnusedAccounts {
|
||||||
unused1: HashSet<Pubkey>,
|
unused1: HashSet<Pubkey>,
|
||||||
unused2: HashSet<Pubkey>,
|
unused2: HashSet<Pubkey>,
|
||||||
|
@ -181,7 +181,7 @@ impl<'a> From<crate::bank::BankFieldsToSerialize<'a>> for SerializableVersionedB
|
||||||
#[cfg(RUSTC_WITH_SPECIALIZATION)]
|
#[cfg(RUSTC_WITH_SPECIALIZATION)]
|
||||||
impl<'a> solana_frozen_abi::abi_example::IgnoreAsHelper for SerializableVersionedBank<'a> {}
|
impl<'a> solana_frozen_abi::abi_example::IgnoreAsHelper for SerializableVersionedBank<'a> {}
|
||||||
|
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq, Eq)]
|
||||||
pub(super) struct Context {}
|
pub(super) struct Context {}
|
||||||
|
|
||||||
impl<'a> TypeContext<'a> for Context {
|
impl<'a> TypeContext<'a> for Context {
|
||||||
|
|
|
@ -6,7 +6,7 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
/// The SDK's stake history with clone-on-write semantics
|
/// 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<StakeHistoryInner>);
|
pub struct StakeHistory(Arc<StakeHistoryInner>);
|
||||||
|
|
||||||
impl Deref for StakeHistory {
|
impl Deref for StakeHistory {
|
||||||
|
|
|
@ -36,7 +36,7 @@ pub enum Error {
|
||||||
StakeAccountNotFound(Pubkey),
|
StakeAccountNotFound(Pubkey),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, ToPrimitive)]
|
#[derive(Debug, Clone, PartialEq, Eq, ToPrimitive)]
|
||||||
pub enum InvalidCacheEntryReason {
|
pub enum InvalidCacheEntryReason {
|
||||||
Missing,
|
Missing,
|
||||||
BadState,
|
BadState,
|
||||||
|
|
|
@ -26,7 +26,7 @@ use {
|
||||||
|
|
||||||
// represents an address that may or may not have been generated
|
// represents an address that may or may not have been generated
|
||||||
// from a seed
|
// from a seed
|
||||||
#[derive(PartialEq, Default, Debug)]
|
#[derive(PartialEq, Eq, Default, Debug)]
|
||||||
struct Address {
|
struct Address {
|
||||||
address: Pubkey,
|
address: Pubkey,
|
||||||
base: Option<Pubkey>,
|
base: Option<Pubkey>,
|
||||||
|
|
|
@ -6,7 +6,7 @@ use {
|
||||||
solana_vote_program::vote_state::{Vote, VoteStateUpdate},
|
solana_vote_program::vote_state::{Vote, VoteStateUpdate},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum VoteTransaction {
|
pub enum VoteTransaction {
|
||||||
Vote(Vote),
|
Vote(Vote),
|
||||||
VoteStateUpdate(VoteStateUpdate),
|
VoteStateUpdate(VoteStateUpdate),
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
use solana_program::pubkey::Pubkey;
|
use solana_program::pubkey::Pubkey;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||||
pub struct AddressLookupTableAccount {
|
pub struct AddressLookupTableAccount {
|
||||||
pub key: Pubkey,
|
pub key: Pubkey,
|
||||||
pub addresses: Vec<Pubkey>,
|
pub addresses: Vec<Pubkey>,
|
||||||
|
|
|
@ -119,7 +119,7 @@ mod tests {
|
||||||
std::{collections::HashMap, mem::size_of},
|
std::{collections::HashMap, mem::size_of},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Debug, BorshSerialize, BorshDeserialize, BorshSchema)]
|
#[derive(PartialEq, Eq, Clone, Debug, BorshSerialize, BorshDeserialize, BorshSchema)]
|
||||||
enum TestEnum {
|
enum TestEnum {
|
||||||
NoValue,
|
NoValue,
|
||||||
Number(u32),
|
Number(u32),
|
||||||
|
@ -148,12 +148,12 @@ mod tests {
|
||||||
pub r#bool: bool,
|
pub r#bool: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, BorshSerialize, BorshDeserialize, BorshSchema)]
|
#[derive(Debug, PartialEq, Eq, BorshSerialize, BorshDeserialize, BorshSchema)]
|
||||||
struct Child {
|
struct Child {
|
||||||
pub data: [u8; 64],
|
pub data: [u8; 64],
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, BorshSerialize, BorshDeserialize, BorshSchema)]
|
#[derive(Debug, PartialEq, Eq, BorshSerialize, BorshDeserialize, BorshSchema)]
|
||||||
struct Parent {
|
struct Parent {
|
||||||
pub data: Vec<Child>,
|
pub data: Vec<Child>,
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,7 @@ mod tests {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, BorshSerialize, BorshDeserialize, BorshSchema)]
|
#[derive(Debug, PartialEq, Eq, BorshSerialize, BorshDeserialize, BorshSchema)]
|
||||||
struct StructWithHashMap {
|
struct StructWithHashMap {
|
||||||
data: HashMap<String, TestEnum>,
|
data: HashMap<String, TestEnum>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ use crate::{
|
||||||
crate::declare_id!("BPFLoaderUpgradeab1e11111111111111111111111");
|
crate::declare_id!("BPFLoaderUpgradeab1e11111111111111111111111");
|
||||||
|
|
||||||
/// Upgradeable loader account states
|
/// Upgradeable loader account states
|
||||||
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone, Copy, AbiExample)]
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Copy, AbiExample)]
|
||||||
pub enum UpgradeableLoaderState {
|
pub enum UpgradeableLoaderState {
|
||||||
/// Account is not initialized.
|
/// Account is not initialized.
|
||||||
Uninitialized,
|
Uninitialized,
|
||||||
|
|
|
@ -110,7 +110,7 @@ pub type UnixTimestamp = i64;
|
||||||
/// as the network progresses).
|
/// as the network progresses).
|
||||||
///
|
///
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Serialize, Deserialize, Debug, Default, PartialEq)]
|
#[derive(Serialize, Deserialize, Debug, Default, PartialEq, Eq)]
|
||||||
pub struct Clock {
|
pub struct Clock {
|
||||||
/// the current network/bank Slot
|
/// the current network/bank Slot
|
||||||
pub slot: Slot,
|
pub slot: Slot,
|
||||||
|
|
|
@ -37,7 +37,7 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_decode_custom_error_to_enum() {
|
fn test_decode_custom_error_to_enum() {
|
||||||
#[derive(Debug, FromPrimitive, PartialEq)]
|
#[derive(Debug, FromPrimitive, PartialEq, Eq)]
|
||||||
enum TestEnum {
|
enum TestEnum {
|
||||||
A,
|
A,
|
||||||
B,
|
B,
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue