This commit is contained in:
Hardhat Chad
2025-10-01 09:41:29 -07:00
parent e0a0ca273c
commit bef1c56ee3
4 changed files with 147 additions and 3587 deletions

View File

@@ -6,25 +6,35 @@ use super::OreAccount;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct Board {
pub struct Game {
/// The current round number.
pub round_id: u64,
/// The timestamp at which the current round starts mining.
pub start_at: i64,
/// The slot at which the current round starts mining.
pub start_slot: u64,
/// The slot at which the current round ends mining.
pub end_slot: u64,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct Round {
/// The round number.
pub id: u64,
/// The deployed SOL for the round.
/// The amount of SOL deployed in each square.
pub deployed: [u64; 25],
/// The timestamp at which the block starts mining.
pub start_at: i64,
/// The slot at which the block starts trading.
pub start_slot: u64,
/// The slot at which the block ends trading.
pub end_slot: u64,
/// The hash of the end slot, provided by solana, used for random number generation.
pub slot_hash: [u8; 32],
/// The slot at which claims for this round account end.
pub expires_at: i64,
/// The top miner of the round.
pub top_miner: Pubkey,
@@ -38,10 +48,23 @@ pub struct Board {
pub total_winnings: u64,
}
impl Board {
pub fn pda(&self) -> (Pubkey, u8) {
board_pda()
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct Move {
/// The authority of the move.
pub authority: Pubkey,
/// The amount of SOL deployed in each square.
pub deployed: [u64; 25],
/// The round number.
pub round_id: u64,
}
account!(OreAccount, Board);
// impl Board {
// pub fn pda(&self) -> (Pubkey, u8) {
// board_pda()
// }
// }
// account!(OreAccount, Board);