Skip to content
This repository has been archived by the owner on Jan 20, 2020. It is now read-only.

Check for null price on change request #268

Merged
merged 2 commits into from
Feb 20, 2018
Merged

Conversation

kyle-mccarthy
Copy link
Contributor

Fixes #255. A null price can be returned from the API on a change request, when this happens in indicates that the order was a market order. The problem currently is that there is no check to ensure that the price is not null, and passing a null price to BigNumber will cause an uncaught exception.

Any change message where the price is null indicates that the change message is for a market order. Change messages for limit orders will always have a price specified.

Relevant GDAX API docs

@kyle-mccarthy kyle-mccarthy changed the title check for null/undefined price for change orders as they are market o… Check for null price on change request Feb 18, 2018
@rmm5t
Copy link
Contributor

rmm5t commented Feb 18, 2018

Could you also please add a test case to help prevent a regression in the future?

@kyle-mccarthy
Copy link
Contributor Author

@rmm5t Okay no problem, I added a very basic test case for this scenario.

@fb55 fb55 merged commit 932ee61 into coinbase:master Feb 20, 2018
@fb55
Copy link
Contributor

fb55 commented Feb 20, 2018

Thanks a lot!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants