From 508ea7a2baa78eb99b08dae26807c893543d1232 Mon Sep 17 00:00:00 2001 From: Roy Li Date: Fri, 22 Mar 2024 19:56:11 -0400 Subject: [PATCH] crazy tesT --- protocol/scripts/protodecoder/protodecoder.go | 0 protocol/x/clob/memclob/memclob.go | 44 ------------------- 2 files changed, 44 deletions(-) create mode 100644 protocol/scripts/protodecoder/protodecoder.go diff --git a/protocol/scripts/protodecoder/protodecoder.go b/protocol/scripts/protodecoder/protodecoder.go new file mode 100644 index 00000000000..e69de29bb2d diff --git a/protocol/x/clob/memclob/memclob.go b/protocol/x/clob/memclob/memclob.go index 8f17780a854..fe2da4a18b1 100644 --- a/protocol/x/clob/memclob/memclob.go +++ b/protocol/x/clob/memclob/memclob.go @@ -603,50 +603,6 @@ func (m *MemClobPriceTimePriority) PlaceOrder( return orderSizeOptimisticallyFilledFromMatchingQuantums, orderStatus, offchainUpdates, nil } - // The taker order has unfilled size which will be added to the orderbook as a maker order. - // Verify the maker order can be added to the orderbook by performing the add-to-orderbook - // collateralization check. - addOrderOrderStatus := m.addOrderToOrderbookCollateralizationCheck( - ctx, - order, - ) - - // If the add order to orderbook collateralization check failed, we cannot add the order to the orderbook. - if !addOrderOrderStatus.IsSuccess() { - if m.generateOffchainUpdates { - // Send an off-chain update message indicating the order should be removed from the orderbook - // on the Indexer. - if message, success := off_chain_updates.CreateOrderRemoveMessage( - ctx, - order.OrderId, - addOrderOrderStatus, - nil, - ocutypes.OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED, - ); success { - offchainUpdates.AddRemoveMessage(order.OrderId, message) - } - } - - // remove stateful orders which fail collateralization check while being added to orderbook - if order.IsStatefulOrder() && !m.operationsToPropose.IsOrderRemovalInOperationsQueue(order.OrderId) { - m.operationsToPropose.MustAddOrderRemovalToOperationsQueue( - order.OrderId, - types.OrderRemoval_REMOVAL_REASON_UNDERCOLLATERALIZED, - ) - } - return orderSizeOptimisticallyFilledFromMatchingQuantums, addOrderOrderStatus, offchainUpdates, nil - } - - // If this is a Short-Term order and it's not in the operations queue, add the TX bytes to the - // operations to propose. - if order.IsShortTermOrder() && - !m.operationsToPropose.IsOrderPlacementInOperationsQueue(order) { - m.operationsToPropose.MustAddShortTermOrderTxBytes( - order, - ctx.TxBytes(), - ) - } - // Add the order to the orderbook and all other bookkeeping data structures. m.mustAddOrderToOrderbook(ctx, order, false)