use anchor_lang::prelude::*;
#[error_code]
pub enum AleaError {
#[msg("BLS signature verification failed")]
InvalidSignature,
#[msg("Signature bytes are not a valid G1 point (y² != x³ + 3 mod p)")]
InvalidG1Point,
#[msg("Round number must be greater than 0")]
RoundZero,
#[msg("Reserved (unreachable in v1) — do not treat as retryable")]
InvalidFieldElement, #[msg("Square root does not exist for this field element")]
NoSquareRoot, #[msg("Public key bytes are not a valid G2 point")]
InvalidG2Point, #[msg("Pairing check syscall failed")]
PairingError, #[msg("chain_hash does not match EXPECTED_EVMNET_CHAIN_HASH (wrong-chain deployment)")]
WrongChainHash,
#[msg("pubkey_g2 does not match EXPECTED_EVMNET_G2_PUBKEY (ADR 0027 fallback path)")]
WrongPubkey,
#[msg("CPI consumer: get_return_data returned None (program upgrade mismatch?)")]
ReturnDataMissing, #[msg("genesis_time does not match EXPECTED_EVMNET_GENESIS_TIME")]
InvalidGenesisTime, #[msg("period does not match EXPECTED_EVMNET_PERIOD")]
InvalidPeriod, #[msg("initialize authority must equal the program's upgrade_authority_address")]
UnauthorizedInit, }