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

can't place order using CLI #1015

Closed
offerm opened this issue Jun 10, 2019 · 1 comment · Fixed by #1023
Closed

can't place order using CLI #1015

offerm opened this issue Jun 10, 2019 · 1 comment · Fixed by #1023
Assignees
Labels
critical bug P1 top priority
Milestone

Comments

@offerm
Copy link
Contributor

offerm commented Jun 10, 2019

xud@xud-test-2:~$ xucli buy 2.3 ltc/btc 0.0079

/opt/xud/node_modules/yargs/yargs.js:1101
      else throw err
           ^
AssertionError: Assertion failed
    at new goog.asserts.AssertionError (/opt/xud/node_modules/google-protobuf/google-protobuf.js:98:603)
    at Object.goog.asserts.doAssertFailure_ (/opt/xud/node_modules/google-protobuf/google-protobuf.js:99:126)
    at Object.goog.asserts.assert (/opt/xud/node_modules/google-protobuf/google-protobuf.js:99:385)
    at jspb.BinaryEncoder.writeUnsignedVarint64 (/opt/xud/node_modules/google-protobuf/google-protobuf.js:253:77)
    at jspb.BinaryWriter.writeUnsignedVarint64_ (/opt/xud/node_modules/google-protobuf/google-protobuf.js:273:507)
    at jspb.BinaryWriter.writeUint64 (/opt/xud/node_modules/google-protobuf/google-protobuf.js:278:318)
    at Function.proto.xudrpc.PlaceOrderRequest.serializeBinaryToWriter (/opt/xud/dist/proto/xudrpc_pb.js:6681:12)
    at proto.xudrpc.PlaceOrderRequest.serializeBinary (/opt/xud/dist/proto/xudrpc_pb.js:6658:34)
    at serialize_xudrpc_PlaceOrderRequest (/opt/xud/dist/proto/xudrpc_grpc_pb.js:330:26)
    at Object.final_requester.sendMessage (/opt/xud/node_modules/grpc/src/client_interceptors.js:806:37)
@kilrau kilrau added this to the 1.0.0-beta milestone Jun 10, 2019
@kilrau kilrau added the P1 top priority label Jun 10, 2019
@kilrau
Copy link
Contributor

kilrau commented Jun 10, 2019

Ouch, same for me on current master. The problem seems to be values between 2.1 and 2.4 for the base currency !?

kilrau@K-Yoga:~/xud/bin$ ./xucli buy 3 ltc/btc 0.0079
no matches found
remaining 3 LTC entered the order book as 6407a3c0-8b69-11e9-848f-8580835ac003
kilrau@K-Yoga:~/xud/bin$ ./xucli buy 2.5 ltc/btc 0.0079
no matches found
remaining 2.5 LTC entered the order book as 685fb340-8b69-11e9-848f-8580835ac003
kilrau@K-Yoga:~/xud/bin$ ./xucli buy 2.3 ltc/btc 0.0079

/home/kilrau/xud/node_modules/yargs/yargs.js:1101
      else throw err
           ^
AssertionError: Assertion failed
    at new goog.asserts.AssertionError (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:98:603)
    at Object.goog.asserts.doAssertFailure_ (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:99:126)
    at Object.goog.asserts.assert (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:99:385)
    at jspb.BinaryEncoder.writeUnsignedVarint64 (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:253:77)
    at jspb.BinaryWriter.writeUnsignedVarint64_ (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:273:507)
    at jspb.BinaryWriter.writeUint64 (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:278:318)
    at Function.proto.xudrpc.PlaceOrderRequest.serializeBinaryToWriter (/home/kilrau/xud/dist/proto/xudrpc_pb.js:6681:12)
    at proto.xudrpc.PlaceOrderRequest.serializeBinary (/home/kilrau/xud/dist/proto/xudrpc_pb.js:6658:34)
    at serialize_xudrpc_PlaceOrderRequest (/home/kilrau/xud/dist/proto/xudrpc_grpc_pb.js:330:26)
    at Object.final_requester.sendMessage (/home/kilrau/xud/node_modules/grpc/src/client_interceptors.js:806:37)
kilrau@K-Yoga:~/xud/bin$ ./xucli buy 2.3 ltc/btc 1

/home/kilrau/xud/node_modules/yargs/yargs.js:1101
      else throw err
           ^
AssertionError: Assertion failed
    at new goog.asserts.AssertionError (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:98:603)
    at Object.goog.asserts.doAssertFailure_ (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:99:126)
    at Object.goog.asserts.assert (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:99:385)
    at jspb.BinaryEncoder.writeUnsignedVarint64 (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:253:77)
    at jspb.BinaryWriter.writeUnsignedVarint64_ (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:273:507)
    at jspb.BinaryWriter.writeUint64 (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:278:318)
    at Function.proto.xudrpc.PlaceOrderRequest.serializeBinaryToWriter (/home/kilrau/xud/dist/proto/xudrpc_pb.js:6681:12)
    at proto.xudrpc.PlaceOrderRequest.serializeBinary (/home/kilrau/xud/dist/proto/xudrpc_pb.js:6658:34)
    at serialize_xudrpc_PlaceOrderRequest (/home/kilrau/xud/dist/proto/xudrpc_grpc_pb.js:330:26)
    at Object.final_requester.sendMessage (/home/kilrau/xud/node_modules/grpc/src/client_interceptors.js:806:37)
kilrau@K-Yoga:~/xud/bin$ ./xucli buy 2.2 ltc/btc 1

/home/kilrau/xud/node_modules/yargs/yargs.js:1101
      else throw err
           ^
AssertionError: Assertion failed
    at new goog.asserts.AssertionError (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:98:603)
    at Object.goog.asserts.doAssertFailure_ (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:99:126)
    at Object.goog.asserts.assert (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:99:385)
    at jspb.BinaryEncoder.writeUnsignedVarint64 (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:253:77)
    at jspb.BinaryWriter.writeUnsignedVarint64_ (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:273:507)
    at jspb.BinaryWriter.writeUint64 (/home/kilrau/xud/node_modules/google-protobuf/google-protobuf.js:278:318)
    at Function.proto.xudrpc.PlaceOrderRequest.serializeBinaryToWriter (/home/kilrau/xud/dist/proto/xudrpc_pb.js:6681:12)
    at proto.xudrpc.PlaceOrderRequest.serializeBinary (/home/kilrau/xud/dist/proto/xudrpc_pb.js:6658:34)
    at serialize_xudrpc_PlaceOrderRequest (/home/kilrau/xud/dist/proto/xudrpc_grpc_pb.js:330:26)
    at Object.final_requester.sendMessage (/home/kilrau/xud/node_modules/grpc/src/client_interceptors.js:806:37)
kilrau@K-Yoga:~/xud/bin$ ./xucli buy 2.1 ltc/btc 1
no matches found
remaining 2.1 LTC entered the order book as 77ddc3c0-8b69-11e9-848f-8580835ac003
kilrau@K-Yoga:~/xud/bin$ ./xucli buy 2.4 ltc/btc 1
no matches found
remaining 2.4 LTC entered the order book as 7d269be0-8b69-11e9-848f-8580835ac003

@kilrau kilrau assigned ghost Jun 10, 2019
@sangaman sangaman assigned sangaman and unassigned ghost Jun 10, 2019
sangaman added a commit that referenced this issue Jun 10, 2019
This fixes edge case rounding errors when converting cli arguments like
`2.3 * 100000000 = 229999999.99999997`. It creates conversion methods
between coins and satoshis as well as unit tests for those methods.

Fixes #1015.
@ghost ghost closed this as completed in #1023 Jun 11, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical bug P1 top priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants