This commit is contained in:
Hardhat Chad
2024-04-27 16:30:45 +00:00
parent 3a109e7a11
commit f4d36f9b9f
18 changed files with 1019 additions and 721 deletions

View File

@@ -5,18 +5,20 @@ use thiserror::Error;
#[derive(Debug, Error, Clone, Copy, PartialEq, Eq, IntoPrimitive)]
#[repr(u32)]
pub enum OreError {
#[error("The starting time has not passed yet")]
NotStarted = 0,
#[error("Mining is paused")]
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 was invalid")]
HashInvalid = 3,
#[error("The provided hash did not satisfy the minimum required difficulty")]
DifficultyInsufficient = 3,
#[error("The bus does not have enough rewards to issue at this time")]
BusRewardsInsufficient = 4,
#[error("The claim amount cannot be greater than the claimable rewards")]
ClaimTooLarge = 5,
#[error("The clock time is invalid")]
ClockInvalid = 6,
}
impl From<OreError> for ProgramError {