Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tip Router: Remove duplication of ShankType trait #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/src/ballot_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use spl_math::precise_number::PreciseNumber;

use crate::{constants::PRECISE_CONSENSUS, discriminators::Discriminators, error::TipRouterError};

#[derive(Debug, Clone, PartialEq, Eq, Copy, Zeroable, ShankType, Pod, ShankType)]
#[derive(Debug, Clone, PartialEq, Eq, Copy, Zeroable, Pod, ShankType)]
#[repr(C)]
pub struct Ballot {
merkle_root: [u8; 32],
Expand Down Expand Up @@ -42,7 +42,7 @@ impl Ballot {
}
}

#[derive(Debug, Clone, Copy, Zeroable, ShankType, Pod, ShankType)]
#[derive(Debug, Clone, Copy, Zeroable, Pod, ShankType)]
#[repr(C)]
pub struct BallotTally {
ballot: Ballot,
Expand Down Expand Up @@ -104,7 +104,7 @@ impl BallotTally {
}
}

#[derive(Debug, Clone, Copy, Zeroable, ShankType, Pod, ShankType)]
#[derive(Debug, Clone, Copy, Zeroable, Pod, ShankType)]
#[repr(C)]
pub struct OperatorVote {
operator: Pubkey,
Expand Down Expand Up @@ -164,7 +164,7 @@ impl OperatorVote {
}

// PDA'd ["epoch_snapshot", NCN, NCN_EPOCH_SLOT]
#[derive(Debug, Clone, Copy, Zeroable, ShankType, Pod, AccountDeserialize, ShankAccount)]
#[derive(Debug, Clone, Copy, Zeroable, Pod, AccountDeserialize, ShankAccount)]
#[repr(C)]
pub struct BallotBox {
ncn: Pubkey,
Expand Down
6 changes: 3 additions & 3 deletions core/src/epoch_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
};

// PDA'd ["epoch_snapshot", NCN, NCN_EPOCH_SLOT]
#[derive(Debug, Clone, Copy, Zeroable, ShankType, Pod, AccountDeserialize, ShankAccount)]
#[derive(Debug, Clone, Copy, Zeroable, Pod, AccountDeserialize, ShankAccount)]
#[repr(C)]
pub struct EpochSnapshot {
/// The NCN on-chain program is the signer to create and update this account,
Expand Down Expand Up @@ -192,7 +192,7 @@ impl EpochSnapshot {
}

// PDA'd ["operator_snapshot", OPERATOR, NCN, NCN_EPOCH_SLOT]
#[derive(Debug, Clone, Copy, Zeroable, ShankType, Pod, AccountDeserialize, ShankAccount)]
#[derive(Debug, Clone, Copy, Zeroable, Pod, AccountDeserialize, ShankAccount)]
#[repr(C)]
pub struct OperatorSnapshot {
operator: Pubkey,
Expand Down Expand Up @@ -220,7 +220,7 @@ pub struct OperatorSnapshot {
vault_operator_stake_weight: [VaultOperatorStakeWeight; 32],
}

#[derive(Debug, Clone, Copy, Zeroable, ShankType, Pod, ShankType)]
#[derive(Debug, Clone, Copy, Zeroable, Pod, ShankType)]
#[repr(C)]
pub struct VaultOperatorStakeWeight {
vault: Pubkey,
Expand Down
4 changes: 2 additions & 2 deletions core/src/ncn_config.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use bytemuck::{Pod, Zeroable};
use jito_bytemuck::{AccountDeserialize, Discriminator};
use shank::{ShankAccount, ShankType};
use shank::ShankAccount;
use solana_program::{account_info::AccountInfo, msg, program_error::ProgramError, pubkey::Pubkey};

use crate::{discriminators::Discriminators, fees::Fees};

#[derive(Debug, Clone, Copy, Zeroable, ShankType, Pod, AccountDeserialize, ShankAccount)]
#[derive(Debug, Clone, Copy, Zeroable, Pod, AccountDeserialize, ShankAccount)]
#[repr(C)]
pub struct NcnConfig {
/// The Restaking program's NCN admin is the signer to create and update this account
Expand Down
4 changes: 2 additions & 2 deletions core/src/weight_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ use std::collections::HashSet;

use bytemuck::{Pod, Zeroable};
use jito_bytemuck::{types::PodU64, AccountDeserialize, Discriminator};
use shank::{ShankAccount, ShankType};
use shank::ShankAccount;
use solana_program::{account_info::AccountInfo, msg, program_error::ProgramError, pubkey::Pubkey};
use spl_math::precise_number::PreciseNumber;

use crate::{discriminators::Discriminators, error::TipRouterError, weight_entry::WeightEntry};

// PDA'd ["WEIGHT_TABLE", NCN, NCN_EPOCH_SLOT]
#[derive(Debug, Clone, Copy, Zeroable, ShankType, Pod, AccountDeserialize, ShankAccount)]
#[derive(Debug, Clone, Copy, Zeroable, Pod, AccountDeserialize, ShankAccount)]
#[repr(C)]
pub struct WeightTable {
/// The NCN on-chain program is the signer to create and update this account,
Expand Down