Commit graph

9966 commits

Author SHA1 Message Date
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
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
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
Julian Knutsen
bdfe32bd18
[BUGFIX] Validate Entry.receiversPubKey for MailboxPayloads
The remove code checks to ensure these fields match, but the add code
never did. This could lead to a situation where a MailboxStoragePayload
could be added, but never removed.
2019-11-14 10:19:28 -08:00
Julian Knutsen
9ffbcf795e
[REFACTOR] Use common path for updating map/data store on remove
Previously, the expire path, the remove path, and the onDisconnect
all used separate logic for updating the map, signaling listeners, and
removing PersistablePaylod objects from the data store. This led to a
bug where the onDisconnect path did not update the protectedDataStore.

Combine the three code paths to ensure that the same state is updated
regardless of the context.
2019-11-14 10:08:08 -08:00
Julian Knutsen
b10a603ead
[BUGFIX] Correctly remove PersistablePayload in onDisconnect path
The code to remove expired Entrys in the onDisconnect path was not
correctly removing the Entry from the protectedDataStore.

This patch adds a test that failed and fixes the bug.
2019-11-14 10:08:07 -08:00
Julian Knutsen
8ecb5b9cb1
[REFACTOR] Clean up removeExpiredEntries
* All of this work is done on the UserThread so there is no need to
clone the map.

* ArrayList objects are faster to iterate than HashSets and the data is
  guaranteed to be unique since the source is a ConcurrentHashMap

* Finding all items to remove first, then removing them all is an easier
  to read code pattern instead of removing during iteration.
2019-11-14 10:04:59 -08:00
Julian Knutsen
bdef1e46ea
Add payload safety checks in ProtectedStorageEntry
It is currently possible to construct a valid Payload object
that implements both the ProtectedStoragePayload and
PersistableNetworkPayload interfaces even though this combination is
invalid.

Instead of depending on future reviewers to catch an error, assert that
ProtectedStoragePayloads and PersistableNetworkPayloads are incompatible
as objects inside a ProtectedStorageEntry.

This allows cleanup of removeExpiredEntries that branched on this
behavior.
2019-11-14 08:42:47 -08:00
Christoph Atteneder
21b76cb869
Updating trading instructions for XMR (Monero) (#3596)
* Updating trading instructions for XMR (Monero)

Prove payments:
- clarifying that the official wallets (Monero GUI or CLI) are NOT required to send XMR, since user can use some alternative wallets (desktop: MyMonero, Exodus / mobile: Cake Wallet, MyMonero, Monerujo) that provide the information required to prove a payment (transaction key, transaction ID and destination address). This information is not provided by the remaining desktop and mobile wallets that currently support Monero, but since they could provide it in the future, I kept the warning about using other wallets different from the previously mentioned.
- listing Monero GUI as first option (for most users), and CLI as second option (for advanced users)
- renaming "transaction hash" to "transaction ID", which is used in official wallets
- renaming "tx private key" to "transaction key", which is used in official wallets
- adding "Secret key" as synonymous for "transaction key" (used in MyMonero wallet)
- adding "destination address" and keeping  "recipient's address" as synonymous
- renaming History tab to Transactions tab in Monero GUI
- adding "save recipient address" option must be enabled in Cake Wallet settings

Check payments:
- adding Monero GUI must be in Advanced mode
- adding Monero GUI verification must be done in Check Transaction section of Prove/check page
- adding parameters TXID TXKEY ADDRESS to the command check_tx_key in Monero CLI, as instructions in (https://www.getmonero.org/resources/user-guides/prove-payment.html)
- adding Explore Monero website (https://www.exploremonero.com/receipt) as alternative to verify payments
- removing payment ID instructions (it is being deprecated at the end of November in v0.15)

More info:
- directing to subreddit Monero support (https://www.reddit.com/r/monerosupport/), which is actively maintained, instead of Monero forum (https://forum.getmonero.org).

* Add max allowed message option to Popup and increase window size for Monero to improve readability
2019-11-14 17:01:27 +01:00
Christoph Atteneder
fa39258d71
Add max allowed message option to Popup and increase window size for Monero to improve readability 2019-11-14 15:21:30 +01:00
Christoph Atteneder
7e08d66a5d
Merge pull request #3575 from beingindot/account_validation
Account validation
2019-11-14 14:49:54 +01:00
beingindot
4432d80061
Added empty check validation for popmoney/revolut/uphold/zelle 2019-11-14 12:31:07 +05:30
Christoph Atteneder
459646ad68
Merge pull request #3573 from beingindot/account_validate_mg_nationalbank
Added check for empty validation
2019-11-13 17:40:47 +01:00
beingindot
755ca19ef6
Added check for empty validation
This commit is for github issue #3458 and #3459
check added for moneybeam and national bank transfer
2019-11-13 21:18:02 +05:30
Julian Knutsen
c81f8a6da3
[TESTS] Rename P2PDataStoreTest
File name now reflects the actual tests run after everything
was split up.
2019-11-12 18:06:47 -08:00
Julian Knutsen
14c78c1c85
[TESTS] Add missing license text to test files 2019-11-12 18:05:25 -08:00
Julian Knutsen
fc553121bf
[TESTS] Make SavedTestState ctor private to TestState
All test callers now just ask the TestState for a SavedTestState instead
of SavedTestState ctor. This makes more sense with the object
relationship since SavedTestState is only used internally to TestState.
2019-11-12 18:05:25 -08:00
Julian Knutsen
fa82c177f1
[TESTS] Clean up TestState static methods
All users pass in an instance of TestState, just make it an instance
method instead of static.
2019-11-12 18:05:25 -08:00
Julian Knutsen
10384acdcc
[TESTS] Split monolithic P2PDataStoreTest into separate files
One monolithic test was useful when it was under development to reduce
code churn, but now that the tests are complete it is easier to find
and run a specific test when separated into separate test files.

This also fixes a downside of Enclosed.class that didn't allow individual
tests to be run in intellij.
2019-11-12 18:05:20 -08:00
Julian Knutsen
eb2f8f315e
[TESTS] Add JavaDocs for test objects
Add JavaDocs for the various Stub and Fake objects that are used
in the P2PDataStore test so future developers can understand why they
exist.
2019-11-12 17:59:16 -08:00