solana/sdk/program/src/lamports.rs

23 lines
612 B
Rust
Raw Normal View History

use crate::instruction::InstructionError;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum LamportsError {
/// arithmetic underflowed
#[error("Arithmetic underflowed")]
ArithmeticUnderflow,
/// arithmetic overflowed
#[error("Arithmetic overflowed")]
ArithmeticOverflow,
}
impl From<LamportsError> for InstructionError {
fn from(error: LamportsError) -> Self {
match error {
LamportsError::ArithmeticOverflow => InstructionError::ArithmeticOverflow,
LamportsError::ArithmeticUnderflow => InstructionError::ArithmeticOverflow,
}
}
}