-
Notifications
You must be signed in to change notification settings - Fork 43
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
Listorders all #820
Listorders all #820
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for the most part. One thing I wish I'd thought of sooner is that I think it would make more sense to have an optional max_results
rather than an all
field. If it's zero (the default value) we return all orders. This way a caller who wants more than the hardcoded 10 orders can fetch exactly how many orders they want. It should be a simple change from what you have here. Does that make sense @kilrau ?
Also one minor note, we should change the comment for the ListOrders
rpc call in the proto file to drop the words "but unsorted" since it no longer applies.
If we do go with a max results parameter, I think we should call it |
Could you clarify your suggestion? or
? Honestly, the latter might just be the easiest to understand and ok with me. |
I'm thinking the latter, zero (which is the default value if you don't specify a value for the parameter) returns all, specifying a limit returns that many. |
Yep, exactly. Good with you too? And sorry again for changing our minds on that ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to these, could you also fix the Command.spec.ts test by changing "should flatten, format and sort orders" to "should flatten and format orders" and remove all lines referencing expectedFirstRow
and expectedLastRow
?
@sangaman I think there is a bug in the test, could you have a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more small changes. Re: the test failing, see the top comment from my last review for the steps I think you need to take in Command.spec.ts.
Closes #748
When
all=false
we return only the top 10 orders sorted by best market price.