improve checks
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
87bcc538cd
commit
9cd08a1355
|
@ -72,7 +72,7 @@ pub fn serum3_cancel_order(
|
|||
// Cancel
|
||||
//
|
||||
let order = serum_dex::instruction::CancelOrderInstructionV2 {
|
||||
side: (side as u8).try_into().unwrap(),
|
||||
side: u8::try_from(side).unwrap().try_into().unwrap(),
|
||||
order_id,
|
||||
};
|
||||
cpi_cancel_order(ctx.accounts, order)?;
|
||||
|
|
|
@ -161,12 +161,15 @@ pub fn serum3_place_order(
|
|||
// matched against an existing other order.
|
||||
//
|
||||
let order = serum_dex::instruction::NewOrderInstructionV3 {
|
||||
side: (side as u8).try_into().unwrap(),
|
||||
side: u8::try_from(side as u8).unwrap().try_into().unwrap(),
|
||||
limit_price: limit_price.try_into().unwrap(),
|
||||
max_coin_qty: max_base_qty.try_into().unwrap(),
|
||||
max_native_pc_qty_including_fees: max_native_quote_qty_including_fees.try_into().unwrap(),
|
||||
self_trade_behavior: (self_trade_behavior as u8).try_into().unwrap(),
|
||||
order_type: (order_type as u8).try_into().unwrap(),
|
||||
self_trade_behavior: u8::try_from(self_trade_behavior as u8)
|
||||
.unwrap()
|
||||
.try_into()
|
||||
.unwrap(),
|
||||
order_type: u8::try_from(order_type as u8).unwrap().try_into().unwrap(),
|
||||
client_order_id,
|
||||
limit,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue