Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor limit_order to move out limit_order_txs logic #8

Merged
merged 1 commit into from
Dec 31, 2022

Conversation

vipulsharma21
Copy link

Why this should be merged

I have moved out limit order transaction related logic in a separate file.
I was working on writing tests for limit_order.go.
For example in testing RunMatchingEngine() when we find matching limit_orders it makes a call to orderBookContract to execute those orders. The tests then need the correct setup for making those transaction including creating those accounts and adding gas.
We want to test only if the matching logic is working as we can test the code for making orderbook contract call separately. Here i can now start using mocks and check if the correct calls are being when matching orders are found and are not being made when no limit orders match.
Similarly for parsing blocks and storing limit_orders we can test each getting blocks and parsing it separately.
This will help me write better unit tests.
If we also want to add integration tests which test whole flow(we have one in OrderBook.ts) we can add those also separately.

How this works

How this was tested

It was tested using integration test in orderbook.ts.

plugin/evm/vm.go Show resolved Hide resolved
@vipulsharma21 vipulsharma21 merged commit 5abbb0e into hubble-v2 Dec 31, 2022
@lumos42 lumos42 deleted the refactor_limit_order branch March 10, 2023 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants