1use cosmwasm_std::StdError;
2use tg_utils::{HookError, PreauthError, SlasherError};
3use thiserror::Error;
4
5#[derive(Error, Debug, PartialEq)]
6pub enum ContractError {
7 #[error("{0}")]
8 Std(#[from] StdError),
9
10 #[error("{0}")]
11 Hook(#[from] HookError),
12
13 #[error("{0}")]
14 Slasher(#[from] SlasherError),
15
16 #[error("{0}")]
17 Preauth(#[from] PreauthError),
18
19 #[error("Unauthorized: {0}")]
20 Unauthorized(String),
21
22 #[error("Contract {0} doesn't fulfill the tg4 interface")]
23 NotTg4(String),
24
25 #[error("Overflow when multiplying group points - the product must be less than 10^18")]
26 PointsOverflow {},
27
28 #[error("Overflow when computing: {0}")]
29 ComputationOverflow(&'static str),
30
31 #[error("Overflow when mixing input points - the result cannot be represented as u64")]
32 MixerOverflow {},
33
34 #[error("The parameter '{0}' is out of range: {1}")]
35 ParameterRange(&'static str, String),
36}