-
Notifications
You must be signed in to change notification settings - Fork 801
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
(BUG FIX) Fix order submission crash due to missing "exchange" parameter #468
Conversation
Codecov Report
@@ Coverage Diff @@
## master #468 +/- ##
==========================================
- Coverage 45.50% 45.49% -0.02%
==========================================
Files 210 210
Lines 48818 48826 +8
==========================================
- Hits 22217 22213 -4
- Misses 24343 24351 +8
- Partials 2258 2262 +4
Continue to review full report at Codecov.
|
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.
LGTM
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.
LGTM
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.
LGTM
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.
LGTM
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.
LGTM
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.
tested nice pick up thanks! I don't remember this coming up during testing of the pr that changed it odd
Approved with one comment
@@ -898,6 +904,8 @@ func (s *RPCServer) CancelOrder(ctx context.Context, r *gctrpc.CancelOrderReques | |||
ID: r.OrderId, | |||
Side: order.Side(r.Side), | |||
WalletAddress: r.WalletAddress, | |||
Pair : currency.NewPairFromStrings(r.Pair.Base,r.Pair.Quote), | |||
|
|||
}) | |||
|
|||
return &gctrpc.CancelOrderResponse{}, err |
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.
if you feel comfortable with protobuf/gRPC you could also update the CancelOrderResponse{} message here to pass back a confirmation but its kind of out of scope of the original fix and I am happy to open up a PR for it at a later time
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.
Yes you can , let's fix them as quickly as possible
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.
We can do this in a separate PR
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.
tACK! Thanks for this fix
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.
Great find! Just one nit.
engine/rpcserver.go
Outdated
@@ -898,6 +904,8 @@ func (s *RPCServer) CancelOrder(ctx context.Context, r *gctrpc.CancelOrderReques | |||
ID: r.OrderId, | |||
Side: order.Side(r.Side), | |||
WalletAddress: r.WalletAddress, | |||
Pair : currency.NewPairFromStrings(r.Pair.Base,r.Pair.Quote), |
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.
@@ -898,6 +904,7 @@ func (s *RPCServer) CancelOrder(ctx context.Context, r *gctrpc.CancelOrderReques | |||
ID: r.OrderId, | |||
Side: order.Side(r.Side), | |||
WalletAddress: r.WalletAddress, | |||
Pair: currency.NewPairFromStrings(r.Pair.Base, r.Pair.Quote), |
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.
Have adopted the suggestion of gofmt
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.
|
||
if err != nil { | ||
return &gctrpc.SubmitOrderResponse{}, err | ||
} | ||
|
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.
Here, I also suggest merging it into the master branch. It would panic if &gctrpc.SubmitOrderResponse is nil
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.
Thanks for your PR! ACK
…ter (thrasher-corp#468) * fix the return problem * fix the return problem * add the mandatory parameter * fix the symbol empity problem * fix the symbol empty problem * add Pair parameter for order.Cancel parameters * follow the gofmt rule Co-authored-by: MK <mk@MKdeMacBook-Pro.local>
PR Description
RPC server crashed when requesting submit by using gctcli
Fixes # (issue)
Type of change
Please delete options that are not relevant and add an
x
in[]
as item is complete.How has this been tested
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration and
also consider improving test coverage whilst working on a certain feature or package.
Checklist