This commit is contained in:
Hardhat Chad
2024-09-27 07:59:17 +00:00
parent 466d696765
commit ec505541b1
6 changed files with 6 additions and 16 deletions

View File

@@ -1,12 +1,7 @@
use std::mem::size_of;
use ore_api::{consts::*, instruction::Open, state::Proof};
use solana_program::{
keccak::hashv,
slot_hashes::SlotHash,
system_program,
sysvar::{self, Sysvar},
};
use solana_program::{keccak::hashv, slot_hashes::SlotHash};
use steel::*;
/// Open creates a new proof account to track a miner's state.
@@ -38,7 +33,7 @@ pub fn process_open(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult
system_program,
payer_info,
)?;
let clock = Clock::get().or(Err(ProgramError::InvalidAccountData))?;
let clock = Clock::get()?;
let proof = proof_info.to_account_mut::<Proof>(&ore_api::ID)?;
proof.authority = *signer_info.key;
proof.balance = 0;