diff --git a/src/processor/claim.rs b/src/processor/claim.rs index 0115276..2f7ee5c 100644 --- a/src/processor/claim.rs +++ b/src/processor/claim.rs @@ -43,12 +43,9 @@ pub fn process_claim<'a, 'info>( )?; load_program(token_program, spl_token::id())?; - // If last claim was less than 1 day ago, burn some of the claim amount + // Update miner balance let mut proof_data = proof_info.data.borrow_mut(); let proof = Proof::try_from_bytes_mut(&mut proof_data)?; - let clock = Clock::get().or(Err(ProgramError::InvalidAccountData))?; - - // Update miner balance proof.balance = proof .balance .checked_sub(amount) diff --git a/src/processor/reset.rs b/src/processor/reset.rs index 54ed945..ed385fb 100644 --- a/src/processor/reset.rs +++ b/src/processor/reset.rs @@ -16,8 +16,6 @@ use crate::{ SMOOTHING_FACTOR, TARGET_EPOCH_REWARDS, TREASURY, TREASURY_BUMP, }; -// TODO Update comments to account for 5 minute epoch - /// Reset sets up the Ore program for the next epoch. Its responsibilities include: /// 1. Reset bus account rewards counters. /// 2. Adjust the reward rate to stabilize inflation. diff --git a/src/state/hash.rs b/src/state/hash.rs deleted file mode 100644 index 55084de..0000000 --- a/src/state/hash.rs +++ /dev/null @@ -1,47 +0,0 @@ -use std::{fmt, mem::transmute}; - -use bytemuck::{Pod, Zeroable}; -use solana_program::keccak::{Hash as KeccakHash, HASH_BYTES}; - -use crate::impl_to_bytes; - -/// Hash is an equivalent type to solana_program::keccak::Hash which supports bytemuck serialization. -#[repr(C)] -#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)] -pub struct Hash(pub [u8; HASH_BYTES]); - -impl From for Hash { - #[inline(always)] - fn from(value: KeccakHash) -> Self { - unsafe { transmute(value) } - } -} - -impl From for KeccakHash { - #[inline(always)] - fn from(value: Hash) -> Self { - unsafe { transmute(value) } - } -} - -impl fmt::Display for Hash { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", bs58::encode(self.0).into_string()) - } -} - -// impl Hash { -// pub fn difficulty(&self) -> u32 { -// let mut count = 0; -// for &byte in &self.0 { -// let lz = byte.leading_zeros(); -// count += lz; -// if lz < 8 { -// break; -// } -// } -// count -// } -// } - -impl_to_bytes!(Hash); diff --git a/src/state/mod.rs b/src/state/mod.rs index 6b681f5..7a3b009 100644 --- a/src/state/mod.rs +++ b/src/state/mod.rs @@ -1,11 +1,9 @@ mod bus; mod config; -// mod hash; mod proof; mod treasury; pub use bus::*; pub use config::*; -// pub use hash::*; pub use proof::*; pub use treasury::*;