use bytemuck::{Pod, Zeroable};
use marsh_utils::*;
use solana_program::pubkey::Pubkey;
use crate::consts::PROOF;
use super::MarshAccount;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct Proof {
pub authority: Pubkey,
pub balance: u64,
pub challenge: [u8; 32],
pub last_hash: [u8; 32],
pub last_hash_at: i64,
pub last_stake_at: i64,
pub miner: Pubkey,
pub total_hashes: u64,
pub total_rewards: u64,
}
pub fn proof_pda(authority: Pubkey) -> (Pubkey, u8) {
Pubkey::find_program_address(&[PROOF, authority.as_ref()], &crate::id())
}
account!(MarshAccount, Proof);