diff --git a/api/src/state/config.rs b/api/src/state/config.rs index 8deaf79..26a2ac6 100644 --- a/api/src/state/config.rs +++ b/api/src/state/config.rs @@ -1,6 +1,6 @@ use steel::*; -use crate::state::{config_pda, OreAccountOLD}; +use crate::state::config_pda; use super::OreAccount; @@ -25,25 +25,6 @@ pub struct Config { pub fee_rate: u64, } -#[repr(C)] -#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)] -pub struct ConfigOLD { - // The address that can set the admin. - pub admin: Pubkey, - - // The block duration in slots. - pub block_duration: u64, - - // The duration in slots for which the sniper fee is applied. - pub sniper_fee_duration: u64, - - // The address that receives fees. - pub fee_collector: Pubkey, - - // The fee rate taken for each swap. - pub fee_rate: u64, -} - impl Config { pub fn pda() -> (Pubkey, u8) { config_pda() @@ -51,4 +32,3 @@ impl Config { } account!(OreAccount, Config); -account!(OreAccountOLD, ConfigOLD); diff --git a/api/src/state/miner.rs b/api/src/state/miner.rs index 66a4ff6..f1ba87f 100644 --- a/api/src/state/miner.rs +++ b/api/src/state/miner.rs @@ -1,6 +1,6 @@ use steel::*; -use crate::state::{miner_pda, OreAccountOLD}; +use crate::state::miner_pda; use super::OreAccount; @@ -29,31 +29,6 @@ pub struct Miner { pub lifetime_rewards_ore: u64, } -#[repr(C)] -#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)] -pub struct MinerOLD { - /// The authority of this miner account. - pub authority: Pubkey, - - /// The ID of the last block this miner mined in. - pub block_id: u64, - - /// An account authorized to execute actions on behalf of this miner. - pub executor: Pubkey, - - /// The amount of hashpower this miner has committed to the current block. - pub hashpower: u64, - - /// A user-supplied seed for random number generation. - pub seed: [u8; 32], - - /// The total amount of hashpower this miner has committed across all blocks. - pub total_hashpower: u64, - - /// The total amount of ORE this miner has mined across all blocks. - pub total_rewards: u64, -} - impl Miner { pub fn pda(&self) -> (Pubkey, u8) { miner_pda(self.authority) @@ -61,4 +36,3 @@ impl Miner { } account!(OreAccount, Miner); -account!(OreAccountOLD, MinerOLD); diff --git a/api/src/state/mod.rs b/api/src/state/mod.rs index c5efa53..2029915 100644 --- a/api/src/state/mod.rs +++ b/api/src/state/mod.rs @@ -26,14 +26,6 @@ pub enum OreAccount { Square = 106, } -#[repr(u8)] -#[derive(Clone, Copy, Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)] -pub enum OreAccountOLD { - ConfigOLD = 101, - MinerOLD = 103, - TreasuryOLD = 104, -} - pub fn board_pda() -> (Pubkey, u8) { Pubkey::find_program_address(&[BOARD], &crate::ID) } diff --git a/api/src/state/treasury.rs b/api/src/state/treasury.rs index 07ba1a9..9047e30 100644 --- a/api/src/state/treasury.rs +++ b/api/src/state/treasury.rs @@ -1,6 +1,6 @@ use steel::*; -use crate::state::{treasury_pda, OreAccountOLD}; +use crate::state::treasury_pda; use super::OreAccount; @@ -12,17 +12,4 @@ pub struct Treasury { pub balance: u64, } -/// Treasury is a singleton account which is the mint authority for the ORE token and the authority of -/// the program's global token account. -#[repr(C)] -#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)] -pub struct TreasuryOLD {} - -impl Treasury { - pub fn pda() -> (Pubkey, u8) { - treasury_pda() - } -} - account!(OreAccount, Treasury); -account!(OreAccountOLD, TreasuryOLD); diff --git a/cli/src/main.rs b/cli/src/main.rs index a2657b2..38fe0ef 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -375,13 +375,6 @@ async fn get_miner(rpc: &RpcClient, authority: Pubkey) -> Result Result { - let miner_pda = ore_api::state::miner_pda(authority); - let account = rpc.get_account(&miner_pda.0).await?; - let miner = MinerOLD::try_from_bytes(&account.data)?; - Ok(*miner) -} - async fn get_clock(rpc: &RpcClient) -> Result { let data = rpc.get_account_data(&solana_sdk::sysvar::clock::ID).await?; let clock = bincode::deserialize::(&data)?; @@ -393,11 +386,6 @@ async fn get_miners(rpc: &RpcClient) -> Result, anyhow::Err Ok(miners) } -async fn get_miners_old(rpc: &RpcClient) -> Result, anyhow::Error> { - let miners = get_program_accounts::(rpc, ore_api::ID, vec![]).await?; - Ok(miners) -} - fn get_winning_square(slot_hash: &[u8]) -> u64 { // Use slot hash to generate a random u64 let r1 = u64::from_le_bytes(slot_hash[0..8].try_into().unwrap());