Commit Graph

423 Commits

Author SHA1 Message Date
Steven Barclay
92da7956e6
Tidy logback files & add space back to log pattern
Uniformise the log patterns somewhat, by making the 'Logger' classname
field width either 15 for the seednode & statsnode, or 40 for the other
applications (lengthened from 30 in a few cases).

Also clean up the logback XML files somewhat, in particular removing
references to the old Thali (thaliproject/Tor_Onion_Proxy_Library) Tor
library, which was replaced years ago with our own fork of NetLayer
(https://github.com/cd2357/netlayer).

Finally, add a missing space back to the log pattern for bisq-desktop,
to prevent DEBUG, ERROR or TRACE lines appearing as follows:

  ... [JavaFX Application Thread] ERRORb.c.s.CommonSetup: ...

(It isn't clear whether this recently introduced behaviour was really
intentional, though it did prevent two consecutive spaces appearing in
the majority INFO log lines.)
2024-05-02 01:56:32 +02:00
Alva Swanson
e7cb152e11
DevEnv: Make DEV_PRIVILEGE_PRIV_KEY private and add getter 2023-12-28 08:50:13 +01:00
Alva Swanson
c8f686ba56
Apply AppStartPlugin to all desktop applications 2023-09-10 22:10:09 +02:00
Alva Swanson
e999e8e3af
apitest: Move JVM args definition to build.gradle 2023-08-05 19:46:14 +02:00
Alva Swanson
55f113c787
apitest: Define mainClass in application block 2023-08-05 19:45:20 +02:00
Alva Swanson
9ce8f83719
Gradle: Centralize application setup 2023-08-05 15:14:04 +02:00
Alva Swanson
168fbaa3c1
apitest: Move build configuration to its own build.gradle 2023-08-05 14:51:26 +02:00
Alejandro García
9d52cfe8a2
Merge pull request #6733 from alyokaz/refactor-takebuybtcoffertest
Refactor TakeBuyBTCOfferTest to replace sleep with loops
2023-07-06 19:31:22 +00:00
Alejandro García
ff44e18de1
Merge pull request #6732 from alyokaz/fix-failing-takebuybtcoffertest
Fix failing TakeBuyBTCOfferTest
2023-07-06 19:30:09 +00:00
Alejandro García
a3da0207ec
Merge pull request #6727 from alyokaz/enable-apitest-debugging-suspend
Suspend instances in Apitest by CSV list in apitest.properties
2023-07-06 19:29:39 +00:00
Alejandro García
ee9109d14d
Merge pull request #6725 from alyokaz/remove-hardcoded-debug-option
Remove hardcoding of enableBisqDebugging in ApiTest
2023-07-06 19:28:58 +00:00
AllyKaz
03b205a597
Refactor TakeBuyBTCOfferTest to replace sleep with loops
Replace the use of Thread.sleep in the tests with loops
2023-07-04 21:29:33 +01:00
AllyKaz
d2f9172a50
Fix failing TakeBuyBTCOfferTest
Fix failing test by setting amount and minAmount to the maxTradeLimit for
fiat accounts (0.1 BTC)
2023-07-04 21:11:53 +01:00
AllyKaz
b5b68b52ce
Suspend instances in Apitest by CSV list in apitest.properties
Enable instances to be suspended in debugging mode by the inclusion of the
instance name in a CSV list in apitest.properties
2023-07-04 21:00:48 +01:00
AllyKaz
6026e6fb78
xRemove hardcoding of enableBisqDebugging in ApiTest
Remove hardcoding of value to prevent it  being set as a command line option
that then overides the option being set from apitest.properties file
preventing it from being altered without altering code. Redundant as false is
the default.
2023-07-04 19:11:11 +01:00
AllyKaz
1a931b815f
Stop deletion of original bisq.properties during test harness setup
Stop the deletion of the original bisq.properties file after it's copied into the
instances data directories.
2023-07-04 18:40:05 +01:00
AllyKaz
a2ef728ee0
Refactor dao-setup.gradle
Remove redundant directory moving and renaming. Make buildResourcesDir
property less brittle.
2023-07-04 18:12:24 +01:00
AllyKaz
0fb9e36eff
Fix bisq.properties pickup in ApiTest
Copy 'bisq.properties' file in apitest/src/main/resources
to each instance's DataDir on startup to allow pickup by
the instance.
2023-07-04 18:11:43 +01:00
napoly
e19ffe2308
Upgrade JUnit4 to JUnit5 Jupiter 2023-05-04 20:04:49 +02:00
helixx87
458f50dec9
Support "all" attribute in getoffers API method 2023-04-11 12:50:00 +02:00
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