Commit Graph

10010 Commits

Author SHA1 Message Date
Dimitris Apostolou
ce8804b418
Fix typos and cleanup 2019-11-20 01:24:48 +02:00
Christoph Atteneder
95257b10f9
Refactor of FilterWindow - eliminate duplicates (#3616)
* Extract setupFieldFromList method in FilterWindow

* Extract readAsPaymentAccountFiltersList method in FilterWindow

* Extract setupFieldFromPaymentAccountFiltersList method in FilterWindow

* Reformat sendButton handler in FilterWindow
2019-11-19 10:39:59 +01:00
Christoph Atteneder
8c8c7117d3
Refactorings for api support (#3611)
* Remove trailing spaces

* Add toProtoTradeStatistics2 method

API will use getTradeStatistics and expect TradeStatistics2 not
PersistableNetworkPayload

* Add CreateOfferService class

* Remove commented out code

* User weaker access, add final

* Add getRandomOfferId method

* Add getSellerSecurityDeposit method

* Add getEstimatedFeeAndTxSize method

- Rename estimateTxSize to updateEstimatedFeeAndTxSize
- Add getEstimatedFeeAndTxSize method to CreateOfferService
- Add dependent methods and fields

* Use methods from createOfferService

- Use getBuyerSecurityDepositAsCoin and getSellerSecurityDepositAsCoin
from CreateOfferService

* Use txFeeFromFeeService from createOfferService

- Use getEstimatedFeeAndTxSize from CreateOfferService for
txFeeFromFeeService

* Use getPriceAsLong from createOfferService

* Use marketPriceMarginParam from createOfferService

* Pass useMarketBasedPriceValue to getPriceAsLong

* Use getMaxTradeLimit from createOfferService

* Use createAndGetOffer from createOfferService

* Remove unused fields

* Add createOfferService, remove unused params

* Use weaker access

* Add null checks

* Add log of params, Cleanup

* Remove unused fields

* Use weaker access

* Remove trivial methods

* Remove trivial methods, rename methods

* Sort params for offer as they are used

* Use getReservedFundsForOffer from createOfferService

* Add MakerFeeProvider

* Adjust to new super class params

* Remove sellerSecurityDeposit field, refactor placeOffer

* Adjust tests to new params
2019-11-19 09:49:38 +01:00
Christoph Atteneder
30b1f0229b
Reduce bs formatter interface (#3253)
* Extract FormattingUtils from BSFormatter

All formatting related functions that are depended on by core and
desktop jars are extracted to the new class FormattingUtils.

* Remove dead Code from BSFormatter

* Move Currency related helpers out of BSFormatter to CurrencyUtils

* Move functions that only have 1 call-site out of BSFormatter

Make them private instance functions at call site to minimize
dependencies.
2019-11-19 09:44:41 +01:00
Justin Carter
cfaa23effc
Move functions that only have 1 call-site out of BSFormatter
Make them private instance functions at call site to minimize
dependencies.
2019-11-19 09:24:06 +01:00
Justin Carter
dc741984ce
Move Currency related helpers out of BSFormatter to CurrencyUtils 2019-11-19 09:24:05 +01:00
Justin Carter
06c2fa5ea0
Remove dead Code from BSFormatter 2019-11-19 09:24:05 +01:00
Justin Carter
df6812a4c9
Extract FormattingUtils from BSFormatter
All formatting related functions that are depended on by core and
desktop jars are extracted to the new class FormattingUtils.
2019-11-19 09:23:57 +01:00
Christoph Atteneder
e157ac3121
Merge pull request #3630 from devinbileck/bump-javafx-version
Bump javafx version to 11.0.2
2019-11-19 09:07:12 +01:00
Christoph Atteneder
ad0cfd288e
Merge pull request #3631 from devinbileck/fix-package.bat
Fix package.bat version parsing
2019-11-19 08:58:05 +01:00
Devin Bileck
3f91f60cd3
Fix package.bat version parsing
The package.bat script parses the first 3 tokens of the version string
to determine the file version. This is done to strip "-SNAPSHOT" from
the version string since the file version can only contain a numeric
version number.
2019-11-18 23:36:40 -08:00
Devin Bileck
8f6f05be56
Bump javafx version to 11.0.2
Aside from various fixes and improvements, it appears that this
should resolve #2279, as fixed in
https://bugs.openjdk.java.net/browse/JDK-8210411

Reference:
https://github.com/javafxports/openjdk-jfx/blob/jfx-11/doc-files/release-notes-11.0.1.md
https://github.com/javafxports/openjdk-jfx/blob/jfx-11/doc-files/release-notes-11.0.2.md
2019-11-18 23:28:38 -08:00
Christoph Atteneder
906a2526e0
Merge pull request #3624 from rafaelpac/tooltip-colon
Add colon after "Payment method" on tooltip
2019-11-18 16:03:03 +01:00
Christoph Atteneder
7c83230724
Merge pull request #3625 from rafaelpac/account-validation-bug
[BUGFIX] Account validation comparing user trade limit with MAX amount of offer
2019-11-18 16:00:01 +01:00
Christoph Atteneder
ec5e2b76d4
Avoid unchecked casts/assignments/calls (#3626)
* Don't extend ActivatableViewAndModel when the model is empty

Remove the no-arg constructor from ActivatableViewAndModel, which sets
a dummy Activatable singleton as the model. (Since the model type param
can't be checked at runtime, improper use of the constructor could cause
heap pollution.)

Instead, extend 'ActivatableView<R, Void>' consistently, as other views
without a model currently do.

* Improve type safety of the fluent interface of Overlay<T>

Refactor all the unchecked casts from Overlay<T> to T into a single
private cast() method. Also add a runtime type check to the constructor
to prevent creation of window objects of the form "A extends Overlay<B>"
for unrelated A & B, as such casts would then subvert the type system.

* Improve type safety of ProtoUtil.collectionToProto(Collection)

Add a Class<T> parameter to the method, in order to avoid an unchecked
cast to the Message type T. The cast was wrapped in a try-catch block,
which is useless due to erasure, so use Class.cast(..) instead.

* Avoid raw types to prevent unchecked casts in Log.java

Add missing ILoggingEvent type arg to local variable declarations.

* Avoid unchecked casts when deserializing JSON using Gson

* Fix unchecked casts in views due to raw chart point types

Add missing 'Number' coord type args to some XYChart.(Data|Series) &
AreaChart declarations, and avoid passing them as generic varargs, in
order to eliminate some more unchecked cast warnings.

Also simplify OfferBookChartView.updateChartData() by unboxing the x-
coordinate of each (buy & sell) datapoint.

* Avoid raw type bounds in class declarations to fix unchecked warnings

Make sure the generic classes MutableOfferView & AgentRegistrationView
don't use raw bounds for their associated view models, as that leads to
unchecked assignments from the model fields further down.

* Fix some remaining suppressed unchecked casts in the UI logic

(This still leaves a few more which are hard to avoid.)

* Fix a few remaining unsuppressed unchecked warnings
2019-11-18 15:41:23 +01:00
Christoph Atteneder
18fc573196
Merge pull request #3623 from wiz/add-blocknotify-script
Add missing blocknotify.sh script and README instructions
2019-11-18 15:14:00 +01:00
Christoph Atteneder
69398caa0c
Merge pull request #3609 from julianknutsen/fix-mailbox-key-check
(13/13) [BUGFIX] Validate Entry.receiversPubKey when adding a MailboxPayload
2019-11-18 15:10:11 +01:00
Christoph Atteneder
b078e92664
Merge pull request #3584 from julianknutsen/entry-stubs-test
(8/8) Clean up integration tests now that Entrys are mockable
2019-11-18 12:24:31 +01:00
Christoph Atteneder
f8372f454f
Merge pull request #3583 from julianknutsen/entry-oo
(7/8) Develop APIs for ProtectedStorageEntry to enable testing and code refactoring
2019-11-18 12:21:02 +01:00
Christoph Atteneder
874e5251f4
Merge pull request #3582 from julianknutsen/refactor-refresh-ttl
(6/8) Remove mutating functions of ProtectedStorageEntry
2019-11-18 11:39:20 +01:00
Christoph Atteneder
b38c695a86
Merge pull request #3568 from julianknutsen/manual-clock-in-tests
(5/8) Test P2PDataStore expiration code and make testing time sensitive code easier.
2019-11-18 11:31:19 +01:00
Christoph Atteneder
fe1dd20b35
Merge pull request #3558 from julianknutsen/update-duplicate-behavior
(4/8) Update behavior of add/remove/refresh on duplicate sequence numbers
2019-11-18 11:01:51 +01:00
Christoph Atteneder
d484617385
Merge pull request #3557 from julianknutsen/refactor-add-remove-refresh
(3/8) [REFACTOR] P2PDataStore::add/remove/refresh
2019-11-18 10:49:50 +01:00
Christoph Atteneder
60f02e9923
Merge pull request #3556 from julianknutsen/fix-remove-bug
(2/8) [BUGFIX] Don't try and remove() if addMailboxData() fails
2019-11-18 10:21:33 +01:00
Christoph Atteneder
5fe71fa0a5
Bump gradle wrapper to version 5.6.4 (#3627)
* Bump gradle wrapper to version 5.6.4

* Add distributionSha256Sum to gradle-wrapper.properties

Gradle will self-verify the sha of the downloaded wrapper
zip upon its first download.
2019-11-18 09:31:58 +01:00
Pac
894a2c6b90
[BUGFIX] Account validation was comparing user trade limit with MAX amount of offer
Fixes issues #3601 and #3537.
The bug only happens when the offer has MIN-MAX value range.
The new isAmountValidForOffer in PaymentAccountUtil.java consider only the MAX amount, but the button to take the offer is ungrayed considering the MIN amount, which causes the bug.
2019-11-17 19:24:22 -03:00
Steven Barclay
5e69073280
Fix a few remaining unsuppressed unchecked warnings 2019-11-17 22:00:40 +00:00
Pac
2e85195299
Update OfferBookViewModel.java 2019-11-17 18:50:58 -03:00
wiz
7021babba9
Add missing blocknotify.sh script and README instructions 2019-11-17 04:29:49 -10:00
Steven Barclay
53b7167e68
Fix some remaining suppressed unchecked casts in the UI logic
(This still leaves a few more which are hard to avoid.)
2019-11-17 01:25:12 +00:00
Steven Barclay
f3456f1920
Avoid raw type bounds in class declarations to fix unchecked warnings
Make sure the generic classes MutableOfferView & AgentRegistrationView
don't use raw bounds for their associated view models, as that leads to
unchecked assignments from the model fields further down.
2019-11-17 01:25:12 +00:00
Steven Barclay
96ac86dd25
Fix unchecked casts in views due to raw chart point types
Add missing 'Number' coord type args to some XYChart.(Data|Series) &
AreaChart declarations, and avoid passing them as generic varargs, in
order to eliminate some more unchecked cast warnings.

Also simplify OfferBookChartView.updateChartData() by unboxing the x-
coordinate of each (buy & sell) datapoint.
2019-11-17 01:25:11 +00:00
Steven Barclay
77a8c20ce9
Avoid unchecked casts when deserializing JSON using Gson 2019-11-17 01:25:11 +00:00
Steven Barclay
09a964ff27
Avoid raw types to prevent unchecked casts in Log.java
Add missing ILoggingEvent type arg to local variable declarations.
2019-11-17 01:25:11 +00:00
Steven Barclay
dd6db4687c
Improve type safety of ProtoUtil.collectionToProto(Collection)
Add a Class<T> parameter to the method, in order to avoid an unchecked
cast to the Message type T. The cast was wrapped in a try-catch block,
which is useless due to erasure, so use Class.cast(..) instead.
2019-11-17 01:25:10 +00:00
Steven Barclay
2f61b025f5
Improve type safety of the fluent interface of Overlay<T>
Refactor all the unchecked casts from Overlay<T> to T into a single
private cast() method. Also add a runtime type check to the constructor
to prevent creation of window objects of the form "A extends Overlay<B>"
for unrelated A & B, as such casts would then subvert the type system.
2019-11-17 01:24:46 +00:00
Steven Barclay
6b0da3d08b
Don't extend ActivatableViewAndModel when the model is empty
Remove the no-arg constructor from ActivatableViewAndModel, which sets
a dummy Activatable singleton as the model. (Since the model type param
can't be checked at runtime, improper use of the constructor could cause
heap pollution.)

Instead, extend 'ActivatableView<R, Void>' consistently, as other views
without a model currently do.
2019-11-17 01:18:58 +00:00
lusarz
a6ee5d5c45
Reformat sendButton handler in FilterWindow 2019-11-15 17:39:41 +01:00
lusarz
0c2639a87b
Extract setupFieldFromPaymentAccountFiltersList method in FilterWindow 2019-11-15 17:39:40 +01:00
lusarz
415648e257
Extract readAsPaymentAccountFiltersList method in FilterWindow 2019-11-15 17:39:40 +01:00
lusarz
96046fa110
Extract setupFieldFromList method in FilterWindow 2019-11-15 17:39:36 +01:00
Christoph Atteneder
fb96ad3550
Merge pull request #3612 from chimp1984/fix-bug-with-account-delete
Fix bug with mutating account after saving
2019-11-15 14:55:10 +01:00
Christoph Atteneder
b536db38fa
Update contributing.md (#3613)
* Fixed spelling in Contributing.md

* Added PR timeout info

* Remove optional signing info
2019-11-15 14:44:21 +01:00
Florian Reimair
8b76a443b0
Remove optional signing info 2019-11-15 11:16:24 +01:00
Florian Reimair
95d7b0ef6b
Added PR timeout info 2019-11-15 11:16:05 +01:00
Florian Reimair
5a9cf88787
Fixed spelling in Contributing.md 2019-11-15 11:14:55 +01:00
chimp1984
4e5bbbd563
Fixes https://github.com/bisq-network/bisq/pull/3572
We saved the account and afterwards called setSelectedTradeCurrency.
That caused a bug with remove as the hash at insert was different as at
remove.
2019-11-15 01:07:17 -05:00
chimp1984
9092160700
Adjust tests to new params 2019-11-15 00:03:52 -05:00
chimp1984
50fc1393e0
Remove sellerSecurityDeposit field, refactor placeOffer 2019-11-14 23:58:31 -05:00
chimp1984
44781e1fba
Adjust to new super class params 2019-11-14 23:57:12 -05:00