This commit is contained in:
Hardhat Chad
2025-09-18 15:04:59 -07:00
parent ba1ef7270d
commit 6697d284b9
3 changed files with 7 additions and 30 deletions

View File

@@ -26,12 +26,6 @@ pub enum OreAccount {
Square = 106,
}
#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
pub enum OreAccountOLD {
SquareOLD = 106,
}
pub fn board_pda() -> (Pubkey, u8) {
Pubkey::find_program_address(&[BOARD], &crate::ID)
}

View File

@@ -1,6 +1,6 @@
use steel::*;
use crate::state::{square_pda, OreAccountOLD};
use crate::state::square_pda;
use super::OreAccount;
@@ -8,33 +8,16 @@ use super::OreAccount;
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct Square {
/// The count of miners on this square.
pub count: [usize; 25],
pub count: [u64; 25],
/// The miners in each 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,
/// The commits for the round.
pub id: u64,
/// The round number.
pub round_id: u64,
/// The miners on this square.
pub miners: [Pubkey; 16],
impl Square {
pub fn pda() -> (Pubkey, u8) {
square_pda()
}
}
// impl Square {
// pub fn pda() -> (Pubkey, u8) {
// square_pda()
// }
// }
account!(OreAccount, Square);
account!(OreAccountOLD, SquareOLD);

View File

@@ -95,7 +95,7 @@ pub fn process_prospect(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramRes
// Update square
if is_first_move {
square.miners[square_id][square.count[square_id]] = *signer_info.key;
square.miners[square_id][square.count[square_id] as usize] = *signer_info.key;
square.count[square_id] += 1;
}