Commit Graph

403 Commits

Author SHA1 Message Date
ghubstan
ade885e205
Ignore v1 protocol bsq offer test 2023-02-13 19:14:08 -03:00
ghubstan
e26955bf60
Adjust to removal of --daoActivated opt 2023-02-13 19:09:54 -03:00
ghubstan
f69fb3a959
Update for bticoind v23 + IDE format 2023-02-13 19:09:01 -03:00
Alva Swanson
c1c4caf87f
Gradle: Apply bisq.java-conventions to all projects 2023-02-05 22:02:13 +01:00
ghubstan
2c85f258dc
Remove dead api test harness code 2022-09-01 19:18:37 -03:00
ghubstan
dbd3d1f7fb
Test support for new takeoffer --amount param 2022-08-06 15:11:10 -03:00
ghubstan
c57b573d5c
Document TakeOfferRequest's intended trade amt param 2022-08-06 15:09:00 -03:00
Christoph Atteneder
bca997a55b
Merge pull request #6219 from ghubstan/wip-prep-bisq-for-bitcoin-v23
Prepare Bisq for bitcoin-core v23 compatiblity
2022-07-05 09:05:08 +02:00
ghubstan
11eabc745b
Warn user not to run API daemon and GUI at same time 2022-06-29 11:44:39 -03:00
ghubstan
815e0500b9
Move getnetwork test to WalletTest suite 2022-06-17 09:19:57 -03:00
ghubstan
ae41e98db9
Add API API method 'getnetwork'
Returns name of the BTC network API daemon is connected to.

I am working on some Java bot examples in another repo, and want to stop
worrying about accidentally simulating trade payments on mainnet, despite
all the warnings I add in comments.  The 'getnetwork' method allows bots
to know what network the API daemon is connected to, and gives API bot
devs and users a way to avoid one potential source of costly mistakes.

API CLI manpage and apitest case are included in this commit.
2022-06-16 15:31:03 -03:00
ghubstan
2db1e4cb3d
Add new msg precondition unit test to Trade test suites 2022-06-14 08:50:24 -03:00
ghubstan
87cce9053f
Minor formatting, rename a method 2022-06-14 08:49:45 -03:00
ghubstan
7570671994
Add payment msg precondition checks to v1 protocol tests
- verifyPaymentSentMsgIsFromBtcBuyerPrecondition
- verifyPaymentReceivedMsgIsFromBtcSellerPrecondition
- verifyPaymentSentMsgDepositTxConfirmedPrecondition
- verifyPaymentReceivedMsgDepositTxConfirmedPrecondition
- verifyPaymentReceivedMsgAfterPaymentSentMsgPrecondition
2022-06-13 21:30:36 -03:00
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
9506386753
Do not run test daemon in debug mode (by default)
Thie test case is @Disabled anyway, but run inside a suite instead,
where it was not running the test daemon in debug mode (anyway).
2022-05-21 17:14:05 -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