Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Still a work in progress, needs a test + some clean up. But the core logic is here.Let's say you have an order book you want to shut down. One option is to find all of the open order accounts, and then cancel all the open orders on that account. This requires writing a whole other crank, separate to whatever existing
consume_events
crank someone already has. Instead the process can be simplified by removing all the orders from the order book and placing them asout_events
/cancelled orders on the event queue. This means it fits in with the existingconsume_events
cranks someone might have.prune_orders
args:
function:
out_event
for the cancelled order to the event queue@ellttBen Aside from addingLooks like it is required for importing the functions to another program.pub mod prune_orders
to theprocess.rs
file, is there other structural code that's needed for a new function? e.g. does it need to have an entry added toprocess_instruction
in the sameprocess.rs
file or is that just left over code from when the AOB processed instructions like a regular program?