Commit Graph

17379 Commits

Author SHA1 Message Date
Steven Barclay
1f8538f6c1
Add utilities for SortedSet ranging with mapped keys & predicates
Provide a 'RangeUtils' class for computing subsets of a navigable set
with natural element order, with each bound defined by a mathematical
filter (that is, a predicate specifying whether an element is 'big' -
true, or 'small' - false), instead of a specific element. This allows
the subset of all elements which map into a given range to be computed,
provided the mapping function is (strictly or non-strictly) increasing.
Provide a fluent interface for this in RangeUtils (with unit tests).

To support this, provide a Comparable sub-interface, 'ComparableExt', of
elements which may be compared with marks/delimiters instead of just
elements of the same type, to work round the limitation that sorted (&
navigable) Sets/Maps in Java do not support general binary searching
with a filter (predicate) on the keys instead of just a specific key.

This will make it possible to efficiently take subsets of objects within
a given date range, say, without having to scan the entire set, provided
it is sorted (w.r.t. a suitable natural order).
2023-05-10 19:41:19 +01:00
Steven Barclay
e231c64cc2
Use primitive arrays & streams to optimise InlierUtil
Use a DoubleStream when streaming over 'List<Double>' method arguments
in InlierUtil, as well as a primitive array sort in 'InlierUtil.trim'
(followed by taking a sublist view), instead of calling 'Stream.sorted'.

To this end, use Guava 'Doubles.asList' to pass lists of Doubles to/from
the InlierUtil methods without incurring any boxing or unboxing costs,
since their spliterators can be simply downcast to Spliterator.OfDouble
(opportunistically), instead of needing to use 'mapToDouble' to unbox.

This was a minor hotspot when called from AveragePriceUtil (used by the
burning man and BSQ dashboard views).
2023-05-10 19:41:19 +01:00
Steven Barclay
069b20ae5f
Use correct bounds in AveragePriceUtil.removeOutliers
Use nonstrict bounds when filtering outliers from the provided trade
statistics list, since otherwise it will always remove the outermost two
inliers from the list. This is because the dependent call to
'InlierUtil.findInlierRange' returns the min & max inlier values.
2023-05-10 19:41:19 +01:00
Steven Barclay
277b170e3c
Further speedups of TradeStatistics3.isValid
Use a Map to speed up 'PaymentMethod.getPaymentMethod', called from
'isValid', instead of scanning the payment method list every invocation.
Make the list immutable to ensure the map never goes stale, which is OK
since no code modified it outside PaymentMethod's static initialisation.

Also speed up the global accessor 'TradeLimits.getMaxTradeLimit', by
caching the DAO param value in a volatile field, cleared upon each new
block arrival.

Furthermore, speed up 'TradeLimits.getFirstMonthRiskBasedTradeLimit' by
simplifying the rounding logic to avoid a pass through the (rather slow)
BigDecimal type.
2023-05-10 19:41:18 +01:00
Steven Barclay
4bc1d299e5
Avoid exception to speed up TradeStatistics3.isValid
Short circuit the exception control flow used in the method
'TradeStatistics3.getPaymentMethodId', which occurs whenever the payment
method code is stored directly in the 'paymentMethod' field instead of
first being converted into a numeric string. This occurs if the method
is unrecognised as it is not in listed into 'PaymentMethodWrapper' enum.

This fixes an unnecessary slowdown of 'TradeStatistics3.isValid', which
calls the above, when scanning the list of BSQ trade statistics in
AveragePriceUtil and elsewhere, due to the fact that the 'BSQ_SWAP'
payment method has been missed out of the above enum.

Also add a (presently disabled) unit test to prevent any future payment
methods from being missed out of the enum. (Should fix the missing BSQ
swaps issue in a separate PR to make sure that the seed nodes recognise
the new payment method code before anyone else.)
2023-05-10 19:40:19 +01:00
Alejandro García
b90776989b
Merge pull request #6619 from napoly/upgrade_junit4_to_junit5_jupiter
Replacing JUnit4 with JUnit5 Jupiter
2023-05-07 16:57:57 +00:00
napoly
e19ffe2308
Upgrade JUnit4 to JUnit5 Jupiter 2023-05-04 20:04:49 +02:00
Alejandro García
d17749110a
Merge pull request #6670 from jmacxx/trade_fee_leniency
Allow leniency of 50% when validating trade fees.
2023-05-04 05:59:13 +00:00
Alejandro García
0e22b1c6d7
Merge pull request #6674 from HenrikJannsen/fix-accounting-filter-for-large-fees
Increase fee limit for accounting data filter.
2023-05-03 14:24:56 +00:00
HenrikJannsen
35f69232fd
Increase fee limit for accounting data filter.
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-05-02 09:59:23 +07:00
jmacxx
8c05af1f0a
Allow leniency of 50% when validating trade fees. Issue #6669. 2023-04-30 14:04:03 -05:00
Christoph Atteneder
c8c256f958
Merge pull request #6666 from stejbac/fix-npe-from-burningmanview-comparators
Fix NPE from BurningManView column comparators
2023-04-24 11:01:56 +02:00
Steven Barclay
01de88b163
Slight code cleanup: BurningManView & BalanceEntryItem
1) Replace statement lambda with expression lambda;
2) Use '.iterator().next()' instead of 'new ArrayList<>(_).get(0)'.
2023-04-22 00:41:12 +01:00
Steven Barclay
c353a95cd9
Use primitive 'comparing*' comparators to avoid boxing
Replace uses of 'Comparator.comparing' with 'comparing[Double|Int|Long]'
in BurningManView, as appropriate, since it is slightly more efficient.
2023-04-22 00:29:13 +01:00
Steven Barclay
8e8d727231
Fix NPE from BurningManView column comparators
Make sure that none of the key extractor functions passed to
'Comparator.comparing(fn)' can return null, as this results in an NPE
when the corresponding column is sorted in the UI, but has blank entries
(such as the BTC received for a BSQ burn in the balance entries table).

(Make blanks appear smallest in magnitude using 'Comparator.nullsFirst'
or by defaulting to 0 instead of null, since the entries are initially
sorted biggest to smallest, pushing them to the bottom of the table.)

Also change the default sort type of the burned BSQ column, which should
be ASCENDING since the entries are negative.
2023-04-21 23:59:37 +01:00
Alejandro García
23dae954e7
Merge pull request #6662 from wiz/wiz/20230419-update-wiz-bitcoin-nodes
Update clearnet IPs for wiz's Bitcoin nodes
2023-04-21 10:24:58 +00:00
Alejandro García
1fe05c0fb9
Merge pull request #6656 from bisq-network/dependabot/github_actions/actions/checkout-3.5.2
Bump actions/checkout from 3.5.0 to 3.5.2
2023-04-21 10:22:40 +00:00
Alejandro García
6e65b2ba63
Merge pull request #6655 from bisq-network/dependabot/github_actions/gradle/gradle-build-action-2.4.2
Bump gradle/gradle-build-action from 2.4.0 to 2.4.2
2023-04-21 10:14:11 +00:00
wiz
4df4c4bc3a
Update clearnet IPs for wiz's Bitcoin nodes 2023-04-19 17:21:13 +09:00
dependabot[bot]
129944f59a
Bump actions/checkout from 3.5.0 to 3.5.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.0 to 3.5.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.5.0...v3.5.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-17 14:58:53 +00:00
dependabot[bot]
7d5d345367
Bump gradle/gradle-build-action from 2.4.0 to 2.4.2
Bumps [gradle/gradle-build-action](https://github.com/gradle/gradle-build-action) from 2.4.0 to 2.4.2.
- [Release notes](https://github.com/gradle/gradle-build-action/releases)
- [Commits](https://github.com/gradle/gradle-build-action/compare/v2.4.0...v2.4.2)

---
updated-dependencies:
- dependency-name: gradle/gradle-build-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-17 14:58:50 +00:00
Gabriel Bernard
caab3dbe55
Merge pull request #6649 from bisq-network/release/v1.9.10
Release/v1.9.10
2023-04-17 08:15:12 +00:00
Alejandro García
3f584e32fe
Merge pull request #6652 from alvasw/remove_broken_offer_util_test_test_get_random_offer_id
OfferUtilTest: Remove broken testGetRandomOfferId test
2023-04-17 07:30:18 +00:00
Alva Swanson
d969d497bb
OfferUtilTest: Remove broken testGetRandomOfferId test 2023-04-17 17:00:29 +10:00
Alejandro García
bfad06caae
Merge pull request #6647 from HenrikJannsen/show_total_distributed_btc_fees
Show total fees and total DPT
2023-04-15 02:32:21 +00:00
Alejandro García
e8a3d92d34
Merge pull request #6646 from helixx87/api-get-all
Support "all" attribute in getoffers API method
2023-04-15 02:31:02 +00:00
Alejandro García
28bb0a60fc
Merge pull request #6641 from helixx87/6629-fix-close-button-after-offer-creation
Fix close button behaviour on successful offer creation popup
2023-04-15 02:28:41 +00:00
Alejandro García
0391be64a5
Revert to SNAPSHOT version 2023-04-15 11:59:46 +10:00
HenrikJannsen
1416b946a8
Add fields for total BTC fees and total DPT amounts
Add more data to CSV export

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-04-12 16:17:44 +07:00
helixx87
458f50dec9
Support "all" attribute in getoffers API method 2023-04-11 12:50:00 +02:00
Alejandro García
e84dc6bb13
Merge pull request #6643 from alejandrogarcia83/update-data-stores-for-v1.9.10
Update data stores for v1.9.10
2023-04-11 02:12:19 +00:00
sqrrm
8b9619f4b7
Merge pull request #6644 from HenrikJannsen/make_processing_burningman_accounting_data_optional
Make processing burningman accounting data optional
2023-04-10 16:21:36 +02:00
HenrikJannsen
795964f06b
Add info if burningman accounting data processing is disabled or if it is in progress.
We use a postfix to the header title and not a busy animation, as the busy animation is quite CPU intense.

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-04-10 16:01:13 +07:00
HenrikJannsen
25fa962e5e
Enable processing of accounting data only if option in preferences is set.
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-04-10 14:52:45 +07:00
HenrikJannsen
cec05e13f9
Add toggle to PreferencesView
Add popup when selecting a burningman to ask for enabling processing

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-04-10 14:49:47 +07:00
HenrikJannsen
fb5b56d03c
Add processBurningManAccountingData field to preferences
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-04-10 14:38:37 +07:00
Alejandro García
26e68f8412
Update data stores for v1.9.10 2023-04-09 12:32:55 +02:00
Alejandro García
6afbc29c12
Merge pull request #6638 from ripcurlx/update-data-stores-for-v1.9.10
Update data stores for v1.9.10
2023-04-09 10:29:00 +00:00
helixx87
c3619f3839
Fix close button behaviour on successful offer creation popup 2023-04-08 18:01:33 +02:00
Christoph Atteneder
b1110058c2
Update data stores for v1.9.10 2023-04-07 18:11:46 +02:00
Christoph Atteneder
84d3804117
Add BurningManAccountingStore to script 2023-04-07 18:11:33 +02:00
Alejandro García
68124302db
Update BurningManAccountingStore for v1.9.10 2023-04-06 16:18:49 +10:00
HenrikJannsen
874f6b4aa5
Add more validations
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-04-04 16:58:25 +10:00
Alejandro García
907090b455
Merge pull request #6620 from bisq-network/dependabot/github_actions/actions/setup-java-3.11.0
Bump actions/setup-java from 3.10.0 to 3.11.0
2023-04-04 06:55:48 +00:00
Alejandro García
d6fb00624f
Merge pull request #6618 from bisq-network/dependabot/github_actions/actions/checkout-3.5.0
Bump actions/checkout from 3.4.0 to 3.5.0
2023-04-04 06:55:12 +00:00
Alejandro García
29c9e0077b
Merge pull request #6608 from helixx87/offer-util-test
Tests for OfferUtil
2023-04-04 06:54:36 +00:00
Alejandro García
2669d736b6
Merge pull request #6631 from alejandrogarcia83/update-data-stores-for-v1.9.10
Update data stores for v1.9.10
2023-04-04 06:53:23 +00:00
Alejandro García
f49be9ab3c
Merge pull request #6632 from HenrikJannsen/improve_validations
Add more validations
2023-04-04 06:52:47 +00:00
yonson2023
8e43f15114
Code review changes. 2023-04-03 11:45:18 +10:00
yonson2023
ce4bae99bb
Move knaccc test module to core/xmr. 2023-04-03 11:45:11 +10:00