Commit Graph

388 Commits

Author SHA1 Message Date
ghubstan
3ce68d6b0c
Adjust to method renaming in superclass 2022-06-13 21:29:30 -03:00
ghubstan
421cdcaa0f
Deprecate BSQ v1 protocol trade tests 2022-06-13 21:28:54 -03:00
ghubstan
4bad8152f0
Add payment msg precondition checks to AbstractTradeTest
- verifyPaymentSentMsgIsFromBtcBuyerPrecondition
- verifyPaymentReceivedMsgIsFromBtcSellerPrecondition
- verifyPaymentSentMsgDepositTxConfirmedPrecondition
- verifyPaymentReceivedMsgDepositTxConfirmedPrecondition
- verifyPaymentReceivedMsgAfterPaymentSentMsgPrecondition

Changed a couple of related method names.
2022-06-13 21:25:13 -03:00
ghubstan
4be8040403
Disable BSQ v1 protocol trade tests in TradeTest suite
Replaced by BSQ Swaps, and will be deprecated.
2022-06-13 21:22:07 -03:00
Christoph Atteneder
ad15fcd5c4
Merge pull request #6214 from ghubstan/remove-bitcoind-txindex-param
Remove legacy bitcoind txindex param from apitest harness
2022-05-30 12:52:59 +02:00
ghubstan
a648bf9756
Fix test name 2022-05-22 17:12:45 -03:00
ghubstan
c9f3aa9edf
Block API takeoffer attempt if !sufficient btc in wallet
This API bug was relying on offer availability checks, but those do
not check the taker's wallet.  The take offer model makes the check convenient,
and a core.api NotAvailableException can be thrown from CoreTradesService,
then mapped to the appropriate gPRC UNAVAILABLE exception sent to clients.

A new test case is added for this change:  Bob's wallet is emptied, he
fails to take an offer, and Alice returns Bob's BTC.
2022-05-22 17:00:33 -03:00
ghubstan
0b66c2f9a2
Remove legacy bitcoind txindex param from apitest harness
It was put there thinking it would be needed by the test harness and suites,
which work fine without it, and it must be removed before API test harness
can run against bitcoin-core v23.

See https://github.com/bitcoin/bitcoin/pull/22626#issuecomment-893220371
2022-05-19 15:56:37 -03:00
Christoph Atteneder
108255bf8e
Move supported currencies into payment accounts 2022-04-20 17:57:07 +02:00
ghubstan
a3990783a4
Send pretty payment details to api clients
Non-CLI clients need a better way of accessing payment details
than a contract json string.

- Add grpc.proto PaymentAccountPayloadInfo field: payment_details.
- Adjust proto wrapper PaymentAccountPayloadInfo to new field.
- Add test asserts to verify payment details are sent to client.
- Fix a test name: testKeepFunds -> testCloseTrade.

Based on branch `master` @ Sat 12 Mar 2022 01:42 PM -03 ,
         commit c6293b5273
2022-03-12 14:33:23 -03:00
ghubstan
1ba2b6ca18
Fix API OfferInfo.isActivated setting for bsqswaps
I think this bug was introduced when deprecating GrpcOffersService
 .getMyOffer(id), in favor of using only getOffer(id) for 'my'
and 'available' offers.  This change explicitly sets the proto's
isActivated flag in the OfferInfo factory methods, and adds checks
to api offer test cases.

Based on branch `2-improve-grpc-exception-status-code-mapping`,
PR https://github.com/bisq-network/bisq/pull/6088
2022-03-07 20:46:27 -03:00
ghubstan
df2cac3015
Make codacy happy 2022-03-05 21:00:33 -03:00
ghubstan
784e2ae894
Send meaningful io.grpc.Status.Code to gRPC clients
Exceptions thrown by the core.api services for the daemon Grpc*Services
have to be converted into gRPC StatusRuntimeExceptions before being sent to
gRPC clients.  Most of these gRPC StatusRuntimeExceptions had a gRPC
Status.Code.UNKNOWN, which not helpful to client error handlers.

This change partially resolves the issue by sending more meaningful
io.grpc.Status.Codes to clients, where possible.  But it is not as
comprehensive as it an be for a webapp because HTTP has so many more
possible response status codes than the gRPC library (sixteen). See:
https://github.com/grpc/grpc-java/blob/master/api/src/main/java/io/grpc/Status.java

There are three types of changes:

- Create custom exceptions in bisq.core.api.exception.

- Map any custom bisq.core.api.exception to a meaningful
  io.grpc.Status.Code within daemon Grpc*Service classes.

- Adjust apitest cases to new grpc status codes.

Based on branch `move-cli-crypto-offer-filter-to-server`,  PR https://github.com/bisq-network/bisq/pull/6086
2022-03-05 20:31:50 -03:00
ghubstan
b7fb3df0d4
Move get (cryptocurrency) offer filter to daemon
Some API reference & Python bot examples exposed an API bug the Java CLI
has been hiding. Due due this Bisq v1 Offer entity design:

- In fiat offers, the baseCurrencyCode=BTC, counterCurrencyCode=FiatCode
- In altcoin offers, baseCurrencyCode=AltcoinCode, counterCurrencyCode=BTC,

new API examples were not doing what the CLI has been doing for several
months, which is get (cryptocurrency) all BTC offers from the server,
and filter on the altcoin code.  The CLI side filtering should have been
done on the server, as it is in this commit.

A lot of dead gRPC client side offer filtering code is removed as well.

Based on `master`.
2022-03-03 16:19:00 -03:00
ghubstan
06c6b0c3d2
Adjust apitest cases to TradeInfo field name changes
See commit b9b66b4826.
2022-02-27 18:24:19 -03:00
ghubstan
82a0f0060c
Adjust to grpc.proto TradeInfo field name changes
See commit b9b66b4826.
2022-02-27 18:13:54 -03:00
Stan
1499465c11
Merge branch 'master' into 7-more-grpcproto-comments 2022-02-25 20:46:05 -03:00
ghubstan
5e754a25a1
Fix comment 2022-02-24 08:28:36 -03:00
ghubstan
dd7d803053
Fix BSQ swap description of BTC price for 1 BSQ 2022-02-23 19:44:25 -03:00
ghubstan
2febe6b327
Adjust apitest cases to new .proto *Pct field names 2022-02-20 15:22:40 -03:00
ghubstan
543c573998
Adjust apitest cases to TradeInfo .proto's price & volume type change 2022-02-19 15:17:38 -03:00
ghubstan
15f75eea3d
Add some asserts on volume/min-volume strings from server 2022-02-18 16:49:51 -03:00
ghubstan
2af3ac22a3
Adjust to string triggerPrice change in API test cases 2022-02-18 11:25:18 -03:00
ghubstan
18888f4d7a
Fix 'unnecessary use of fully qualified name'. 2022-02-17 18:30:27 -03:00
ghubstan
1d70b1bb5f
Adjust apitest cases to OfferInfo.price proto field type to string 2022-02-17 18:18:54 -03:00
ghubstan
135a42ba45
Delete deprecated CLI console output formatting classes
The new console output formatting (tbl) api is working, and the
deprecated classes just add maintenance work.

Update affected test cases.
2022-02-17 15:00:52 -03:00
ghubstan
210d966702
Fix method name 2022-01-25 12:12:07 -03:00
ghubstan
fd0c4c2794
Add BsqSwapSellBtcTradeTest 2022-01-23 17:09:34 -03:00
ghubstan
2db20c0df1
Split BsqSwap tests into "buy" and "sell" tests 2022-01-23 17:08:49 -03:00
ghubstan
0ec095220b
Remove trailing spaces 2022-01-20 15:06:06 -03:00
ghubstan
a5857e26f6
Re-set log level to INFO in apitest cases 2022-01-18 13:04:10 -03:00
ghubstan
3cd1e05a9f
Try to display accurate status of closed trades, or "Pending" if still open 2022-01-18 13:01:42 -03:00
ghubstan
7690ffd953
Add API methods 'failtrade', 'unfailtrade'
Prerequisite for next PR: Add API method 'gettrades'

The `gettrades` method will show 'open', 'closed', and 'failed' trades.
Users already needed to be able to fail and unfail trades for the
same reasons they do in the UI.  API test cases will need to be able to
fail and unfail trades to check correct behavior of 'gettrades' method.

Based on branch `rename-keepfunds2closetrade`.
2022-01-07 19:11:34 -03:00
ghubstan
905841b2b2
Adjust api beta test guide to new closetrade cmd 2022-01-05 12:19:36 -03:00
ghubstan
a9aaba87fa
Rename API method keepfunds -> closetrade
Trade proceeds and deposits have already been transfered to Bisq wallets
before the `keepfunds` command is (was) executed;  `keepfunds` merely moves
open trades to closed trades lists and persistence files.  Renaming `keepfunds`
as `closetrade` makes its purpose clear to API users.

The commit modifies only method names and comments in api server+cli classes,
apitest cases, and api trade simulation scripts.

Based on `master`
2022-01-05 12:10:46 -03:00
ghubstan
5a390fa359
Document 'createcryptopaymentacct' in API beta-test guide 2021-12-27 13:45:16 -03:00
ghubstan
cb4df2b1c3
Rename CLI opt '--payment-account' -> '--payment-account-id'
Adjust related docs and scripts.
2021-12-27 13:10:16 -03:00
Stan
53d693d710
Merge branch 'master' into 7-deprecate-api-getmyoffer 2021-12-27 12:09:22 -03:00
ghubstan
5f571cccca
Deprecate API 'getmyoffer'
The method 'getoffer' should support looking up a user's open-offers, and other users' available offers.

- Adjust api-beta-test-guide.md to use only 'getoffer'.
- Adjust trade simulation scripts to use only 'getoffer'.
- Adjust api testcases to use 'getoffer' in place of 'getmyoffer'.
- Mark appropriate methods and protobuf msgs as deprecated.
2021-12-27 12:05:17 -03:00
Christoph Atteneder
23d1856a60
Merge pull request #5852 from ghubstan/create-swift-acct-with-api
Support and test creation of Swift accounts via API
2021-12-20 11:49:20 +01:00
ghubstan
0f32fe2fc3
Merge branch '5-api-bsqswap-simulation-n-docs-update' into 6-api-xmr-trading 2021-12-03 13:16:26 -03:00
ghubstan
bb68605c69
Add missing --currency-code=bsq param to createoffer example
Resolves issue mentioned in https://github.com/bisq-network/bisq/pull/5876#pullrequestreview-822692137
2021-12-03 12:13:33 -03:00
ghubstan
104f11acaa
Do not run 2x from gradle terminal cmd
Method tests are combined in scenario pkg tests to reduce test
harness startup/shutdown time.
2021-12-02 19:50:18 -03:00
ghubstan
e2647af6b5
Add a few more checks on editedOffer.getUseMarketBasedPrice() 2021-12-02 19:40:58 -03:00
ghubstan
f867f6beb3
Add new regtest apitest/scripts/trade-xmr-simulation.sh 2021-12-02 19:18:24 -03:00
ghubstan
743ef93750
Test API XMR support 2021-12-02 19:11:29 -03:00
ghubstan
3015554f9a
Adjust API beta-test guide for BSQ swaps 2021-11-29 13:14:56 -03:00
ghubstan
a1db0d10b0
Update API docs for Bitcoin Core version v22.0
Plus some outdated JDK version compat comments.
2021-11-29 12:43:58 -03:00
ghubstan
8b2dec7a55
Remove unused function outputs 2021-11-28 16:37:41 -03:00
ghubstan
1b7e43a874
Add apitest/scripts/bsqswap-simulation.sh script
Some refactoring and typo corrections in existing scripts too.
2021-11-28 16:12:02 -03:00