-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add BTC/BSQ pair offer & trading tests #5359
Conversation
This change supports creation of BSQ BLOCKCHAIN payment method accounts. - Added proto message defs to grpc.proto. - Added grpc server boilerplate to GrpcPaymentAccountsService. - Added server impl to CoreApi, CorePaymentAccountsService. - Added createcryptopaymentacct-help.txt. - Added CLI side support for new api method. - Added opt parsing unit tests to OptionParsersTest. This is the 1st PR in a series, with the goal of supporting the BTC/BSQ trading pair. Support for other crypto currency payment accounts will be added later.
This change adds offer and trade contract detail to the API's Offer and Trade protos, and improves CLI output formatting. - Appended missing fields to OfferInfo proto message: uint64 sellerSecurityDeposit = 20; string offerFeePaymentTxId = 21; uint64 txFee = 22; uint64 makerFee = 23; - Added new api proto messages ContractInfo and PaymentAccountPayloadInfo. Lighterweight protos are needed because core Trade/Contract classes are not visible to CLI. - Appended ContractInfo field to api proto message TradeInfo. - Added proto / model converters for ContractInfo and PaymentAccountPayloadInfo, and adjusted OfferInfo & TradeInfo. - Improved CLI output formatting. Added more trade detail to CLI's gettrade output, and prepared to support BTC/BSQ trading pair. Note a reviewer is advised to look at the CLI outout formatting class files instead getting bogged down in the many commit changes.
And fixed maker and taker fees in trade output. Also tidy'd up some test cases: - Fixed some test names - Added comments - Loosened some trade state/phase asserts - Removed direction string literals - Made long literals more readable - Right justified offer amout and volume columns in CLI output - Added some offer and trade logging to see CLI output formatting
Converted this to draft because I need to adjust an apitest trading simulation script for a |
The number of gettrade output columns are the same for makers and takers.
- Added bool tradeInstant field to proto message def. - Adjusted core createcryptopaymentacct impl to new tradeInstant request param. - Adjusted cli side createcryptopaymentacct impl to new tradeInstant request param. - Fixed CliMain's takeoffer help text (was missing the --payment-account opt).
- Added AvailabilityResultWithDescription proto for better takeoffer failure msgs. - Added VerifyBsqSentToAddress impl to api, but don't expose to CLI yet. - Show BSQ Buyer Address in gettrade output (changed cli output formatting classes). - Fixed api.model.PaymentAccountPayloadInfo altcoin instant acct support bug
It was a test case opt, now it occurs by default.
A new botsupport package was added, with no dependencies on the test harness. The intent is eventually move this botsupport pkg code to a new gradle subproject called ':bot' which would depend only on the ':cli' subproject (to keep the ':cli' module light). The future ':bot' subproject would not be shipped, but would give java devs some api java-bot support and at least one example bot. A bsq-btc market maker bot is included in this commit.
I've asked @ripcurlx to loosen up a codacy rule. I think it's an error, claiming I'm using a double in a BigDecimal constructor, but I'm using a String. |
This is the explanation for code duplication the reviewer will find in the The It does not need to be repeated, but is relevant: there is a general problem around API code re-use due to JFX dependencies in The best solution is to carefully split up the common module into UI and non-UI related modules, as mentioned in the 1 April keybase meeting. But this work is not in the scope of this PR and the API v1 rollout. When this does happen, duplicate code in the botsupport pkg will be replaced by dependencies. |
The botsupport pkg will remain, but it is too early to be releasing an API bot that can run on mainnet.
This is not ready for mainnet, and needs to be discussed among other core devs. Closing. |
And fixed maker and taker fees in trade output.
Also tidy'd up some test cases:
This is the 3rd PR in a series, with the goal of supporting the BTC/BSQ trading pair.
PR #5357 must be reviewed/merge before this one.
Here is the improved CLI output for a Buy BSQ (Sell BTC) offer:
Here is
gettrade
output for BSQ buyer as maker:Here is
gettrade
output for BSQ seller as taker: