use bytemuck::{Pod, Zeroable};
pub const CONFIG_DISCRIMINATOR: u64 = 1;
pub const ROUND_DISCRIMINATOR: u64 = 2;
pub const MINER_DISCRIMINATOR: u64 = 3;
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Config {
pub discriminator: u64,
pub admin: [u8; 32],
pub mint: [u8; 32],
pub current_round: u64,
pub round_start_ts: i64,
pub min_difficulty: u64,
pub base_weight: u64,
pub round_seconds: u64,
pub config_bump: u64,
pub treasury_bump: u64,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Round {
pub discriminator: u64,
pub index: u64,
pub total_weight: u64,
pub start_ts: i64,
pub budget: u64,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Miner {
pub discriminator: u64,
pub authority: [u8; 32],
pub session_key: [u8; 32],
pub challenge: [u8; 32],
pub last_round: u64,
pub last_round_weight: u64,
pub last_balance: u64,
pub pending_rewards: u64,
pub total_mined: u64,
pub total_hashes: u64,
pub bump: u64,
}
impl Config {
pub const SIZE: usize = core::mem::size_of::<Config>();
}
impl Round {
pub const SIZE: usize = core::mem::size_of::<Round>();
}
impl Miner {
pub const SIZE: usize = core::mem::size_of::<Miner>();
}