Commit Graph

7282 Commits

Author SHA1 Message Date
Steven Barclay
c94fa98417
Generify remaining raw types used by the DAO packages
Fix raw usage of the following types, all of which (apart from
Comparator) touch the DAO packages somewhere:

  Comparable, Comparator, GetStateHashesResponse, NewStateHashMessage,
  RequestStateHashesHandler, PersistenceManager

(Also replace 'Integer.valueOf' with the non-boxing but otherwise
identical method 'Integer.parseInt', in the class 'TxOutputKey'.)
2024-03-09 01:26:36 +08:00
Steven Barclay
e1a8424f12
Generify Bond raw types & rename BondRepository type params
Replace all raw uses of 'Bond<T extends BondedAsset>', mostly with
wildcards (that is, 'Bond<?>'), to prevent compiler/IDE warnings.

Also rename the 'T extends Bond<R>' & 'R extend BondedAsset' type params
of 'BondRepository<..>' to 'B' & 'T' respectively, as this is a little
less confusing.
2024-03-08 21:11:31 +08:00
Steven Barclay
314e976bbc
Cleanup: replace putIfAbsent-then-get with computeIfAbsent
Use the simpler & slightly more efficient 'Map::computeIfAbsent' method
in place of the common pattern:

  map.putIfAbsent(key, newValue());
  V value = map.get();

(Clean up BondRepository + some cases missed from BurningManService.)
2024-03-08 14:40:44 +08:00
Alejandro García
f941ef300f
Merge pull request #7047 from stejbac/fix-remaining-accounting-store-data-race
Fix remaining data race in BurningManAccountingStore
2024-02-25 14:34:35 +00:00
Alejandro García
42d40e56a1
Merge pull request #7041 from jmacxx/remove_wiz_bsq_explorer
Remove reference to non-functioning BSQ explorer
2024-02-25 14:33:51 +00:00
Alejandro García
e53fb3521f
Merge pull request #7023 from jmacxx/fix_issue_7022
GetTrades should not filter open failed trades
2024-02-25 14:31:39 +00:00
Alejandro García
c86d965b33
Merge pull request #7012 from jmacxx/api_get_dao_status
Add API call to get DAO status
2024-02-25 14:31:06 +00:00
Alejandro García
29c4999f36
Merge pull request #7008 from jmacxx/fix_issue_7006
Refactor detectMultipleHolderNames for efficient use of RAM.
2024-02-25 14:30:31 +00:00
Alejandro García
ebc987b8a4
Merge pull request #7045 from wiz/wiz/20240222-remove-wiz-bitcoin-nodes
Remove 2 more of wiz Bitcoin nodes
2024-02-24 15:15:37 +00:00
Steven Barclay
0214566619
Simplify & optimise BurningManAccountingStore.purgeLastTenBlocks
Remove the last 10 blocks one-by-one from the end of the internal linked
list of blocks, instead of rebuilding a truncated list from scratch.
(This all takes place within a write-lock anyway, so it's atomic.)
2024-02-24 11:26:16 +08:00
Steven Barclay
02ee5bc6ea
Fix remaining data race in BurningManAccountingStore
Add missing synchronisation to the 'toProtoMessage' method, by first
copying the internal list of blocks inside a read-lock, prior to
serialisation (still outside the lock, to maximise concurrency). Since
we only make a shallow copy, this should be fast and take no more than a
MB or so of extra memory.

This prevents a race seen to cause a ConcurrentModificationException
during store persistence, that sometimes occurred when the application
resumed from a long suspension.
2024-02-24 11:12:33 +08:00
Stephan Oeste
79571aa99f
Remove seednodes from jmacxx and add 403State 2024-02-23 17:59:27 +01:00
wiz
8d1aea62fe
Remove 2 more of wiz Bitcoin nodes 2024-02-22 15:09:14 +09:00
jmacxx
b151d11e00
Remove non-available BSQ explorer. 2024-02-17 16:50:38 -06:00
jmacxx
1cad6c86e6
GetTrades should not filter open failed trades.
API add has_failed and error_message properties to TradeInfo.
Code review fixes from @dutu.
2024-02-14 16:59:11 -06:00
Alejandro García
c5a73c0c86
Merge pull request #7007 from jmacxx/bsq_market_cap_chart
Add BSQ market cap chart
2024-02-11 10:05:48 +00:00
Alejandro García
4c1b1cd161
Merge pull request #6986 from yonson2023/fix_transferwise
Wise: fix account summary and add copy icon to form.
2024-02-11 10:04:38 +00:00
jmacxx
0eb50d420b
Expose isDaoStateReadyAndInSync status to API clients. 2024-02-09 13:30:28 -06:00
yonson2023
25a6e08c09
Wise: fix account summary and add copy icon to form.
Add copy icon to Pix form holder name field.
Prompt for holder name if empty.
Optimize form layout.
2024-02-07 20:44:41 -06:00
jmacxx
bc4a46b3df
Refactor detectMultipleHolderNames for efficient use of RAM.
Fixes issue #7006 (Out Of Memory Exception thrown)
2024-02-07 10:32:38 -06:00
Steven Barclay
99f639a589
Replace MockitoSession with the Mockito test extension
Now that 'mockito-junit-jupiter' has been added to the build test
dependencies, we may replace the manual setup & tear down of a Mockito
session with the 'MockitoExtension' JUnit 5 test extension, as the old
Mockito JUnit 4 test runner was no longer available upon upgrading to
Jupiter. This slightly simplifies the tests which use '@Mock', '@Spy',
etc.
2024-02-03 02:36:31 +08:00
Steven Barclay
c41903f7ab
Clean up TxValidatorTest & resource loading in other tests
Fix inspection warnings and other minor defects (unchecked casts, bad
'assert*' usage, unused assignments/declarations, missing null checks,
object equality on enum instances, needless statement lambdas, missing
final, redundant 'toString', needless visibility) in 'TxValidatorTest'.

Also, uniformise and slightly tidy resource loading in other test
classes, replacing 'Files.readAllBytes' with Java 11 'Files.readString'
(which assumes UTF-8 as desired, instead of the default charset).
2024-02-03 01:44:25 +08:00
Steven Barclay
1e3320917c
Use Paths.get(URI) instead of Path.of(String) to fetch test resource
Fix resource loading in 'MakerTxValidatorSanityCheckTests', which breaks
when the working directory has spaces in its absolute path, due to the
fact that the test resource paths are URL encoded.

(This pattern is already used to load resources in a few other tests, so
there hopefully won't be a regression on Windows.)
2024-02-03 00:39:03 +08:00
Alejandro García
66483b4354
Merge pull request #7021 from alvasw/test_all_taker_bsq_cases
Test all Taker BSQ cases
2024-01-31 11:39:52 +00:00
Alejandro García
c5aa473dc3
Merge pull request #7020 from alvasw/test_all_maker_bsq_cases
Test all Maker BSQ Cases
2024-01-31 11:39:01 +00:00
Alejandro García
51e15e3e61
Merge pull request #7019 from alvasw/test_all_taker_btc_cases
Test All Taker BTC Cases
2024-01-31 11:38:03 +00:00
Alejandro García
21f97feb59
Merge pull request #7015 from alvasw/test_all_maker_btc_cases
Test All Maker BTC Cases
2024-01-31 11:36:14 +00:00
Alejandro García
98933e16e8
Merge pull request #7014 from alvasw/test_taker_tx_vouts
Refactor and Add Maker Transaction Vouts Tests
2024-01-31 11:33:50 +00:00
Alejandro García
07def78e4d
Merge pull request #7013 from alvasw/test_maker_tx_vouts
Test Maker Transaction Vouts
2024-01-31 11:32:25 +00:00
Alva Swanson
d93340abcd
Test all Taker BSQ cases
- unconfirmedTransaction
- newBsqTx
- takerExactFeeMatchBsqTest
- takerHigherBsqFeeThanExpected
- takerLowerButWithinToleranceBsqFee
- takerPassFilterFeeCheck
- takerFailFilterFeeCheck
- takerNoFilterFeeMatchesDifferentDaoParameter
- takerNoFilterFeeTooLow
2024-01-29 14:40:28 +01:00
Alva Swanson
36cc5e84df
Test all Maker BSQ cases
- unconfirmedTransaction
- newBsqTx
- makerExactFeeMatchBsqTest
- makerHigherBsqFeeThanExpected
- makerLowerButWithinToleranceBsqFee
- makerPassFilterFeeCheck
- makerFailFilterFeeCheck
- makerNoFilterFeeMatchesDifferentDaoParameter
- makerNoFilterFeeTooLow
2024-01-29 14:40:28 +01:00
Alva Swanson
a3fa6e73c0
Test all Taker BTC cases
- takerCheckFeeAddressBtcInvalidFeeAddress
- takerCheckFeeAddressBtcTooOldValidFee
- takerExactFeeMatchBtcTest
- takerHigherBtcFeeThanExpected
- takerLowerButWithinToleranceBtcFee
- takerPassFilterFeeCheck
- takerFailFilterFeeCheck
- takerNoFilterFeeMatchesDifferentDaoParameter
- takerNoFilterFeeTooLow
2024-01-27 14:17:40 +01:00
Alva Swanson
6e05fc7fbe
Add takerInvalidFeeBtcAddressTest 2024-01-27 14:17:40 +01:00
Alejandro García
e9e62b9e48
Merge pull request #7003 from alvasw/fix_crash_on_missing_vin_0_prevout
TxValidator: Fix crash on missing vin[0].prevout
2024-01-25 11:26:35 +00:00
Alejandro García
23b5424d53
Merge pull request #6974 from kiocosta/release/v1.9.14
Update 'reason for payment' warning instructions
2024-01-25 11:24:48 +00:00
Alva Swanson
000b7a78aa
Test all Maker BTC cases
- makerCheckFeeAddressBtcInvalidFeeAddress
- makerCheckFeeAddressBtcTooOldValidFee
- makerExactFeeMatchBtcTest
- makerHigherBtcFeeThanExpected
- makerLowerButWithinToleranceBtcFee
- makerPassFilterFeeCheck
- makerFailFilterFeeCheck
- makerNoFilterFeeMatchesDifferentDaoParameter
- makerNoFilterFeeTooLow
2024-01-24 15:12:55 +01:00
Alva Swanson
077c5f5e71
TakerTxSanityCheckTests: Add checkFeeAmountMissingVoutValue test 2024-01-24 15:12:55 +01:00
Alva Swanson
873757e865
MakerTxSanityCheckTests: Add checkFeeAmountMissingVoutValue test 2024-01-24 15:12:55 +01:00
Alva Swanson
9fd48c0cd0
Add getValidBtcMakerFeeMempoolJsonResponseString test asset 2024-01-24 15:12:55 +01:00
Alva Swanson
c81ba0d686
TakerTxSanityCheckTests: Add checkFeeAmountMissingVinPreVoutValue test 2024-01-24 15:12:55 +01:00
Alva Swanson
49725689ca
MakerTxSanityCheckTests: Add checkFeeAmountMissingVinPreVoutValue test 2024-01-24 15:12:55 +01:00
Alva Swanson
b0d5712070
Fix: Call parseJsonValidateTakerFeeTx in taker tests 2024-01-24 15:12:55 +01:00
Alva Swanson
3a7a67d7ca
MakerTxSanityCheckTests: Handle test asset IOException locally 2024-01-24 15:12:55 +01:00
Alva Swanson
8d331a6de1
Reuse makerTx in TakerTxValidatorSanityCheckTests 2024-01-24 15:12:55 +01:00
jmacxx
997bf0d6b8
Add BSQ market cap chart. 2024-01-22 14:33:11 -06:00
Alva Swanson
516d3c8d7d
TxValidator: Fix crash on missing vin[0].prevout
The `checkFeeAmountBTC` method looks up the `value` field of the
`vin[0].prevout` field without checking whether `vin[0].prevout` exists.
When the field is missing `JsonElement jsonVIn0Value =
jsonVin0.getAsJsonObject("prevout").get("value");` (line 193) throws a
NullPointerException.
2024-01-15 10:29:49 +01:00
Alva Swanson
ba09db4356
Test too few outputs in fee payment 2024-01-15 10:29:49 +01:00
Alva Swanson
05dfbca07d
Test too few inputs in fee payment 2024-01-15 10:29:48 +01:00
Caio Costa
77479fffdf
Update 'reason for payment' warning instructions 2024-01-14 23:50:34 +00:00
Alejandro García
4d4c9e3186
Merge pull request #7000 from alvasw/txvalidator_fix_crash_on_invalid_vin_vout_json_array
TxValidator: Fix crash on invalid vin or vout JSON Array
2024-01-14 11:50:17 +00:00