Skip to content

Commit 1d39a91

Browse files
authored
fix(restrictions): remove wallet-only restriction from max_maker_vol (#2153)
1 parent 9f241c0 commit 1d39a91

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

mm2src/mm2_main/src/lp_swap/max_maker_vol_rpc.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ pub enum MaxMakerVolRpcError {
5252
},
5353
#[display(fmt = "No such coin {}", coin)]
5454
NoSuchCoin { coin: String },
55-
#[display(fmt = "Coin {} is wallet only", coin)]
56-
CoinIsWalletOnly { coin: String },
5755
#[display(fmt = "Transport error: {}", _0)]
5856
Transport(String),
5957
#[display(fmt = "Internal error: {}", _0)]
@@ -111,11 +109,10 @@ impl From<CheckBalanceError> for MaxMakerVolRpcError {
111109
impl HttpStatusCode for MaxMakerVolRpcError {
112110
fn status_code(&self) -> StatusCode {
113111
match self {
112+
MaxMakerVolRpcError::NoSuchCoin { .. } => StatusCode::NOT_FOUND,
114113
MaxMakerVolRpcError::NotSufficientBalance { .. }
115114
| MaxMakerVolRpcError::NotSufficientBaseCoinBalance { .. }
116-
| MaxMakerVolRpcError::VolumeTooLow { .. }
117-
| MaxMakerVolRpcError::NoSuchCoin { .. }
118-
| MaxMakerVolRpcError::CoinIsWalletOnly { .. } => StatusCode::BAD_REQUEST,
115+
| MaxMakerVolRpcError::VolumeTooLow { .. } => StatusCode::BAD_REQUEST,
119116
MaxMakerVolRpcError::Transport(_) | MaxMakerVolRpcError::InternalError(_) => {
120117
StatusCode::INTERNAL_SERVER_ERROR
121118
},
@@ -138,14 +135,12 @@ pub struct MaxMakerVolResponse {
138135

139136
pub async fn max_maker_vol(ctx: MmArc, req: MaxMakerVolRequest) -> MmResult<MaxMakerVolResponse, MaxMakerVolRpcError> {
140137
let coin = lp_coinfind_or_err(&ctx, &req.coin).await?;
141-
if coin.wallet_only(&ctx) {
142-
return MmError::err(MaxMakerVolRpcError::CoinIsWalletOnly { coin: req.coin });
143-
}
144138
let CoinVolumeInfo {
145139
volume,
146140
balance,
147141
locked_by_swaps,
148142
} = get_max_maker_vol(&ctx, &coin).await?;
143+
149144
Ok(MaxMakerVolResponse {
150145
coin: req.coin,
151146
volume: MmNumberMultiRepr::from(volume),

0 commit comments

Comments
 (0)