compolabs / spark-envio-indexer

3 stars 2 forks source link

fix: update order base size based on order_id #1

Closed JossDuff closed 4 months ago

JossDuff commented 4 months ago

Previously, OrderChange events for closing an open SpotOrder weren't updating that SpotOrder's base_size because the field OrderChange.order was null and the handler was attempting to load a SpotOrder based off of OrderChange.order.id (which was null) instead of Orderchange.order_id.

**Make sure to double check the logic for the changes. I'm not super familiar with Spark orderbook smart contracts and event emitting patterns so this could miss an edge case. But it does solve the issue of the "phantom order" we encountered.