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

feat(OrderBook.ts) persist trades to DB #659

Merged
merged 7 commits into from
Nov 16, 2018
Merged

feat(OrderBook.ts) persist trades to DB #659

merged 7 commits into from
Nov 16, 2018

Conversation

ImmanuelSegol
Copy link
Contributor

@ImmanuelSegol ImmanuelSegol commented Nov 10, 2018

Edit: This addresses most of #608 but not the case where a swap is initiated by a remote peer.

@ghost ghost assigned ImmanuelSegol Nov 10, 2018
@ghost ghost added the in progress label Nov 10, 2018
Copy link
Collaborator

@sangaman sangaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests are failing because the orders are not being created in the db - there's an addOrderIfNotExists method you can use before you persist any trades.

lib/orderbook/OrderBook.ts Outdated Show resolved Hide resolved
lib/orderbook/OrderBook.ts Outdated Show resolved Hide resolved
lib/orderbook/OrderBookRepository.ts Outdated Show resolved Hide resolved
lib/orderbook/OrderBook.ts Outdated Show resolved Hide resolved
lib/orderbook/OrderBook.ts Outdated Show resolved Hide resolved
lib/orderbook/OrderBook.ts Outdated Show resolved Hide resolved
lib/orderbook/OrderBook.ts Outdated Show resolved Hide resolved
lib/orderbook/OrderBookRepository.ts Outdated Show resolved Hide resolved
lib/orderbook/OrderBook.ts Outdated Show resolved Hide resolved
lib/orderbook/OrderBookRepository.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@sangaman sangaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled this down and ran a quick sanity test and it worked fine, but I noticed we're not persisting trades on swap.paid which marks a successful trade of a remote peer filling one of our orders. I'm going to just fix these up and merge to get in the release.

Edit: Never mind actually, I will just remove an unused import for now and then open a separate PR.

@ghost ghost assigned sangaman Nov 16, 2018
@sangaman sangaman merged commit 54a9291 into master Nov 16, 2018
@ghost ghost removed the in progress label Nov 16, 2018
@sangaman sangaman deleted the persist-trades branch November 16, 2018 04:48
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.

2 participants