Files
ore/api/src/state/permit.rs
Hardhat Chad fdeb2cf82a collateral
2025-06-24 14:37:16 -05:00

36 lines
749 B
Rust

use steel::*;
use crate::state::permit_pda;
use super::OreAccount;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct Permit {
/// The authority of the miner account.
pub authority: Pubkey,
/// The ID of the block this permit is for.
pub block_id: u64,
/// The amount of hash tokens this miner has committed to the block.
pub commitment: u64,
/// The executor of the permit.
pub executor: Pubkey,
/// The fee paid to the executor.
pub fee: u64,
/// A user-supplied seed for random number generation.
pub seed: [u8; 32],
}
impl Permit {
pub fn pda(&self) -> (Pubkey, u8) {
permit_pda(self.authority, self.block_id)
}
}
account!(OreAccount, Permit);