diff --git a/src/error.rs b/src/error.rs index 423d18c..2dc6684 100644 --- a/src/error.rs +++ b/src/error.rs @@ -9,18 +9,16 @@ pub enum OreError { IsPaused = 0, #[error("The epoch has ended and needs reset")] NeedsReset = 1, - #[error("The epoch is active and cannot be reset at this time")] - ResetTooEarly = 2, #[error("The provided hash did not satisfy the minimum required difficulty")] - DifficultyInsufficient = 3, + DifficultyInsufficient = 2, #[error("The bus does not have enough rewards to issue at this time")] - BusRewardsInsufficient = 4, + BusRewardsInsufficient = 3, #[error("The claim amount cannot be greater than the claimable rewards")] - ClaimTooLarge = 5, + ClaimTooLarge = 4, #[error("The stake amount cannot exceed u64 size")] - StakeTooLarge = 6, + StakeTooLarge = 5, #[error("The clock time is invalid")] - ClockInvalid = 7, + ClockInvalid = 6, } impl From for ProgramError { diff --git a/src/processor/register.rs b/src/processor/register.rs index 9890eaa..acaf52d 100644 --- a/src/processor/register.rs +++ b/src/processor/register.rs @@ -14,10 +14,6 @@ use crate::{ PROOF, }; -// TODO Create a stake account (token account) -// TODO Need to keep claimable balance (from treasury) separate from staking balance (from stake account) -// TODO Multiplier calculations should account for both - /// Register generates a new hash chain for a prospective miner. Its responsibilities include: /// 1. Initialize a new proof account. /// 2. Generate an initial hash from the signer's key. diff --git a/src/processor/reset.rs b/src/processor/reset.rs index b4dc799..96b66b8 100644 --- a/src/processor/reset.rs +++ b/src/processor/reset.rs @@ -77,7 +77,7 @@ pub fn process_reset<'a, 'info>( let clock = Clock::get().or(Err(ProgramError::InvalidAccountData))?; let threshold = config.last_reset_at.saturating_add(EPOCH_DURATION); if clock.unix_timestamp.lt(&threshold) { - return Err(OreError::ResetTooEarly.into()); + return Ok(()); } // Update reset timestamp