Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Commit

Permalink
refactor: rename Market => MarketBuy
Browse files Browse the repository at this point in the history
  • Loading branch information
politeWall committed Nov 21, 2023
1 parent fb1b155 commit 5d4ca4d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/action/execute/create_spot_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fn check_denom_error(
return Err(ContractError::SpotOrderSameDenom);
}

if order_type == &SpotOrderType::Market {
if order_type == &SpotOrderType::MarketBuy {
return Ok(());
}

Expand All @@ -98,7 +98,7 @@ fn create_resp(
.add_attribute("order_id", new_order.order_id.to_string())
.add_message(bank_msg); // information message

if new_order.order_type != SpotOrderType::Market {
if new_order.order_type != SpotOrderType::MarketBuy {
return Ok(resp);
}

Expand Down
4 changes: 2 additions & 2 deletions src/action/execute/process_spot_orders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fn send_token(
}

fn check_order(order: &SpotOrder, querier: &ElysQuerier) -> bool {
if order.order_type == SpotOrderType::Market {
if order.order_type == SpotOrderType::MarketBuy {
return true;
}

Expand Down Expand Up @@ -107,7 +107,7 @@ fn process_order(
SpotOrderType::LimitBuy => calculate_token_out_min_amount(order),
SpotOrderType::LimitSell => calculate_token_out_min_amount(order),
SpotOrderType::StopLoss => Int128::zero(),
SpotOrderType::Market => Int128::zero(),
SpotOrderType::MarketBuy => Int128::zero(),
};

let msg = ElysMsg::amm_swap_exact_amount_in(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn successful_create_stop_loss_order() {
Addr::unchecked("user"),
addr.clone(),
&ExecuteMsg::CreateSpotOrder {
order_type: SpotOrderType::Market,
order_type: SpotOrderType::MarketBuy,
// Empty order price - not utilized in market orders
order_price: SpotOrderPrice {
base_denom: "".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion src/types/spot_order_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ pub enum SpotOrderType {
StopLoss,
LimitSell,
LimitBuy,
Market,
MarketBuy,
}

0 comments on commit 5d4ca4d

Please sign in to comment.