mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-18 23:16:48 +00:00
cleanup
This commit is contained in:
@@ -18,8 +18,6 @@ pub enum OreInstruction {
|
||||
Wrap = 10,
|
||||
SetAdmin = 11,
|
||||
SetFeeCollector = 12,
|
||||
MigrateMiner = 13,
|
||||
MigrateSquares = 14,
|
||||
|
||||
// Seeker
|
||||
ClaimSeeker = 15,
|
||||
@@ -123,14 +121,6 @@ pub struct Bury {
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct ClaimSeeker {}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct MigrateMiner {}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct MigrateSquares {}
|
||||
|
||||
instruction!(OreInstruction, Automate);
|
||||
instruction!(OreInstruction, Boost);
|
||||
instruction!(OreInstruction, ClaimSOL);
|
||||
@@ -144,5 +134,3 @@ instruction!(OreInstruction, Reset);
|
||||
instruction!(OreInstruction, SetAdmin);
|
||||
instruction!(OreInstruction, SetFeeCollector);
|
||||
instruction!(OreInstruction, ClaimSeeker);
|
||||
instruction!(OreInstruction, MigrateMiner);
|
||||
instruction!(OreInstruction, MigrateSquares);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use steel::*;
|
||||
|
||||
use crate::state::{miner_pda, OreAccountOLD};
|
||||
use crate::state::miner_pda;
|
||||
|
||||
use super::OreAccount;
|
||||
|
||||
@@ -36,35 +36,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 miner's prospects in the current round.
|
||||
pub deployed: [u64; 25],
|
||||
|
||||
/// The executor with permmission to deploy capital with this account.
|
||||
#[deprecated(note = "Use automation executor instead")]
|
||||
pub executor: Pubkey,
|
||||
|
||||
/// The amount of SOL this miner can claim.
|
||||
pub rewards_sol: u64,
|
||||
|
||||
/// The amount of ORE this miner can claim.
|
||||
pub rewards_ore: u64,
|
||||
|
||||
/// The ID of the round this miner last played in.
|
||||
pub round_id: u64,
|
||||
|
||||
/// The total amount of SOL this miner has mined across all blocks.
|
||||
pub lifetime_rewards_sol: u64,
|
||||
|
||||
/// The total amount of ORE this miner has mined across all blocks.
|
||||
pub lifetime_rewards_ore: u64,
|
||||
}
|
||||
|
||||
impl Miner {
|
||||
pub fn pda(&self) -> (Pubkey, u8) {
|
||||
miner_pda(self.authority)
|
||||
@@ -72,4 +43,3 @@ impl Miner {
|
||||
}
|
||||
|
||||
account!(OreAccount, Miner);
|
||||
account!(OreAccountOLD, MinerOLD);
|
||||
|
||||
@@ -29,14 +29,6 @@ pub enum OreAccount {
|
||||
Square = 106,
|
||||
}
|
||||
|
||||
#[repr(u8)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
|
||||
pub enum OreAccountOLD {
|
||||
MinerOLD = 103,
|
||||
TreasuryOLD = 104,
|
||||
SquareOLD = 106,
|
||||
}
|
||||
|
||||
pub fn automation_pda(authority: Pubkey) -> (Pubkey, u8) {
|
||||
Pubkey::find_program_address(&[AUTOMATION, &authority.to_bytes()], &crate::ID)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use steel::*;
|
||||
|
||||
use crate::state::{square_pda, OreAccountOLD};
|
||||
use crate::state::square_pda;
|
||||
|
||||
use super::OreAccount;
|
||||
|
||||
@@ -17,19 +17,6 @@ pub struct Square {
|
||||
pub miners: [[Pubkey; 16]; 25],
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
|
||||
pub struct SquareOLD {
|
||||
/// The count of miners on this square.
|
||||
pub count: [u64; 25],
|
||||
|
||||
/// The deployments of all players.
|
||||
pub deployed: [[u64; 16]; 25],
|
||||
|
||||
/// The miners in each square.
|
||||
pub miners: [[Pubkey; 16]; 25],
|
||||
}
|
||||
|
||||
impl Square {
|
||||
pub fn pda() -> (Pubkey, u8) {
|
||||
square_pda()
|
||||
@@ -37,4 +24,3 @@ impl Square {
|
||||
}
|
||||
|
||||
account!(OreAccount, Square);
|
||||
account!(OreAccountOLD, SquareOLD);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
use steel::*;
|
||||
|
||||
use crate::state::OreAccountOLD;
|
||||
|
||||
use super::OreAccount;
|
||||
|
||||
/// Treasury is a singleton account which is the mint authority for the ORE token and the authority of
|
||||
@@ -24,4 +22,3 @@ pub struct TreasuryOLD {
|
||||
}
|
||||
|
||||
account!(OreAccount, Treasury);
|
||||
account!(OreAccountOLD, TreasuryOLD);
|
||||
|
||||
Reference in New Issue
Block a user