error.rs 523 B

1234567891011121314151617181920
  1. use steel::*;
  2. #[derive(Debug, Error, Clone, Copy, PartialEq, Eq, IntoPrimitive)]
  3. #[repr(u32)]
  4. pub enum TokenSwapError {
  5. #[error("Invalid fee, must be between 0 and 10000")]
  6. InvalidFee = 0,
  7. #[error("Account is not existed")]
  8. AccountIsNotExisted = 1,
  9. #[error("Invalid account")]
  10. InvalidAccount = 2,
  11. #[error("Deposit too small")]
  12. DepositTooSmall = 3,
  13. #[error("Withdrawal too small")]
  14. OutputTooSmall,
  15. #[error("Invariant violated")]
  16. InvariantViolated,
  17. }
  18. error!(TokenSwapError);