mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-15 07:26:45 +00:00
square
This commit is contained in:
@@ -26,6 +26,12 @@ 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)
|
||||
}
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
use steel::*;
|
||||
|
||||
use crate::state::square_pda;
|
||||
use crate::state::{square_pda, OreAccountOLD};
|
||||
|
||||
use super::OreAccount;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
|
||||
pub struct Square {
|
||||
/// The count of miners on this square.
|
||||
pub count: [usize; 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,
|
||||
|
||||
@@ -20,10 +30,11 @@ pub struct Square {
|
||||
pub miners: [Pubkey; 16],
|
||||
}
|
||||
|
||||
impl Square {
|
||||
pub fn pda(&self) -> (Pubkey, u8) {
|
||||
square_pda(self.id)
|
||||
}
|
||||
}
|
||||
// impl Square {
|
||||
// pub fn pda() -> (Pubkey, u8) {
|
||||
// square_pda()
|
||||
// }
|
||||
// }
|
||||
|
||||
account!(OreAccount, Square);
|
||||
account!(OreAccountOLD, SquareOLD);
|
||||
|
||||
Reference in New Issue
Block a user