This commit is contained in:
Hardhat Chad
2025-06-10 07:56:04 -07:00
parent 1ee9ad86ac
commit fb285226fb
55 changed files with 41 additions and 573 deletions

32
api/src/state/permit.rs Normal file
View File

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