astroport_emissions_controller/
error.rs

1use cosmwasm_std::{CheckedFromRatioError, Coin, StdError};
2use cw_utils::{ParseReplyError, PaymentError};
3use neutron_sdk::NeutronError;
4use thiserror::Error;
5
6/// This enum describes contract errors
7#[derive(Error, Debug, PartialEq)]
8pub enum ContractError {
9    #[error("{0}")]
10    Std(#[from] StdError),
11
12    #[error("{0}")]
13    PaymentError(#[from] PaymentError),
14
15    #[error("{0}")]
16    NeutronError(#[from] NeutronError),
17
18    #[error("{0}")]
19    ParseReplyError(#[from] ParseReplyError),
20
21    #[error("{0}")]
22    CheckedFromRatioError(#[from] CheckedFromRatioError),
23
24    #[error("Unauthorized")]
25    Unauthorized {},
26
27    #[error("You can't vote with zero voting power")]
28    ZeroVotingPower {},
29
30    #[error("Next time you can change your vote is at {0}")]
31    VoteCooldown(u64),
32
33    #[error("Next tuning will be available at {0}")]
34    TuneCooldown(u64),
35
36    #[error("Pool {0} is not whitelisted")]
37    PoolIsNotWhitelisted(String),
38
39    #[error("Incorrect whitelist fee. Expected {0}")]
40    IncorrectWhitelistFee(Coin),
41
42    #[error("Pool {0} is already whitelisted")]
43    PoolAlreadyWhitelisted(String),
44
45    #[error("Invalid total votes weight. Must be 1")]
46    InvalidTotalWeight {},
47
48    #[error("Failed to parse reply")]
49    FailedToParseReply {},
50
51    #[error("Invalid outpost prefix for {0}")]
52    InvalidOutpostPrefix(String),
53
54    #[error("Invalid ASTRO denom for outpost. Must start with ibc/")]
55    InvalidOutpostAstroDenom {},
56
57    #[error("Invalid ASTRO denom on the Hub. Must be {0}")]
58    InvalidHubAstroDenom(String),
59
60    #[error("Invalid ics20 channel. Must start with channel-")]
61    InvalidOutpostIcs20Channel {},
62
63    #[error("Failed to determine outpost for pool {0}")]
64    NoOutpostForPool(String),
65
66    #[error("Message contains duplicated pools")]
67    DuplicatedVotes {},
68
69    #[error("Astro pool can't be whitelisted")]
70    IsAstroPool {},
71
72    #[error("No failed outposts to retry")]
73    NoFailedOutpostsToRetry {},
74
75    #[error("Can't set zero emissions for astro pool")]
76    ZeroAstroEmissions {},
77
78    #[error("Failed to migrate contract")]
79    MigrationError {},
80
81    #[error("Outpost {prefix} not found")]
82    OutpostNotFound { prefix: String },
83
84    #[error("Outpost {prefix} is jailed. Only vxASTRO unlocks are available")]
85    JailedOutpost { prefix: String },
86
87    #[error("Pool {0} is blacklisted")]
88    PoolIsBlacklisted(String),
89}