Commit Graph

75 Commits

Author SHA1 Message Date
chimp1984
21bd85c488
Remove signature from GetInventoryRequest (as monitor is public it does not make sense to limit requests).
Add html output and webserver
2020-10-23 01:17:33 -05:00
chimp1984
ca7fe94c06
Add signature to request to limit the feature to requests from trusted nodes (monitor) 2020-10-23 01:17:32 -05:00
chimp1984
9dab186086
Move inventory package to core as we want to include other domain data as well like DAO state
Add more data to inventory map and change type of value to String.
2020-10-23 01:17:32 -05:00
ghubstan
e809af37cc
Add 'takeoffer' API method
- Add new core.offer.takeoffer.TakeOfferModel

	Would have been nice to move more logic from
	bisq.desktop.main.offer.takeoffer.TakeOfferDataModel,
	but it has JFX dependencies that cannot be use in :core.

- Add grpc protos to support takeoffer, confirmpaymentsent, confirmpaymentreceived

	Only takeoffer is implemented in this commit.

- Refactor OfferInfo grpc proto wrapper, and add offer state field

- Add new TradeInfo grpc proto wrapper

- Implement takeoffer on server and cli side

- Refactor offer/trade tests, add test cases
2020-10-20 16:00:05 -03:00
Christoph Atteneder
ebe4618bfe
Merge pull request #4655 from bisq-network/release/v1.4.0
Release/v1.4.0 and v1.4.1
2020-10-20 09:10:12 +02:00
chimp1984
5f9d3d1f0d
Add GetInventory messages
This will be used for monitoring seed nodes.
Instead of requesting all data (we cannot request all in fact as it is too large)
we request the number of items the node has.

This code will not have any impact atm. It will be triggered once a new monitor module gets added which
will send the GetInventoryRequest to the seeds.
2020-10-13 23:30:39 -05:00
chimp1984
6766835af6
Use TradeStatistics3 in protobuf file 2020-10-08 18:49:14 -05:00
chimp1984
6d43c09b33
Delete TradeStatistics (version 1) 2020-10-08 18:48:52 -05:00
chimp1984
00bed02839
Add TradeStatistics3 and related classes
Add TRADE_STATISTICS_3 Capability
Add TradeStatistics3 to proto resolvers
Make message TradeStatistics2 deprecated
2020-10-08 18:48:17 -05:00
Oscar Guindzberg
ced357ce25
AddressEntry: Add boolean segwit flag 2020-10-08 16:33:49 -03:00
ghubstan
29d1905f31
Add new 'getoffer offer-id' api method
There are a number of use cases where a user may want to see a single
offer instead of every offer for a currency pair on the buy or sell side.
The changes are:

- Add getoffer to grpc.proto
- Add new method to GrpcOffersService, CoreApi, CoreOffersService
- Add new method to CLI
- Adjust create offer tests to use this new convenience
2020-10-07 12:09:13 -03:00
chimp1984
ccfda5b043
Cleanups, add generics, add final, remove unused code/comments/todos, 2020-10-03 12:48:21 -05:00
chimp1984
fa0d261397
Fix remaining issues, cleanups, add persit calls, remove unused code,...
Sorry too tired to create another 20 commits...
2020-10-03 12:48:21 -05:00
sqrrm
f051a03d29
Merge pull request #4559 from ghubstan/cli-create-offer
Build out 'createoffer' API method
2020-10-03 17:04:11 +02:00
chimp1984
ef7f5a7f63
Revert nonce index at PreliminaryGetDataRequest protobuf entry to 21 as it was the version used in master as well. We cannot change that without breaking compatibility. 2020-10-02 13:13:45 -05:00
chimp1984
5027c861e3
Fix proto field index 2020-10-01 16:33:33 -05:00
chimp1984
384152fb6b
Add version field to data requests classes 2020-10-01 15:05:31 -05:00
chimp1984
fb41a1984b
Merge branch 'master_upstream' into fix-delayed-payout-tx-issues
# Conflicts:
#	core/src/main/java/bisq/core/trade/TradeManager.java
#	desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java
2020-10-01 09:24:46 -05:00
sqrrm
0b1894a939
Merge pull request #4554 from ghubstan/create-offer
Change 'createoffer' api method return type
2020-10-01 14:48:38 +02:00
ghubstan
2f3e3a31e1
Add simple mkt-price service & test calculated offer prices
A gRPC price service was added, and api create-offer tests can check
mkt based price margin calculations.
2020-09-25 20:48:26 -03:00
chimp1984
10bedee803
Merge branch 'dispute-agent-branch' into fix-delayed-payout-tx-issues
# Conflicts:
#	core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerSetupDepositTxListener.java
2020-09-25 15:03:28 -05:00
chimp1984
25c4b4d0fc
Merge branch 'master_upstream' into dispute-agent-branch
# Conflicts:
#	core/src/main/java/bisq/core/trade/DelayedPayoutTxValidation.java
2020-09-25 14:53:20 -05:00
ghubstan
6cdbc137c1
Move 'createoffer' price arg transform to server & test it
The CreateOfferRequest's price field type was changed from long to string,
so a CLI param like 10000.0055 can be passed to the server as is, to be
scaled and converted there.  In general, we want to keep validation logic
on the CLI as simple as possible, and use existing core logic to
validate args and convert arg types when needed.
2020-09-24 18:13:19 -03:00
chimp1984
0fa45650b6
Merge branch 'dispute-agent-branch' into wip-merge-tradeprot
# Conflicts:
#	core/src/main/java/bisq/core/trade/DelayedPayoutTxValidation.java
#	core/src/main/java/bisq/core/trade/protocol/tasks/buyer/BuyerVerifiesFinalDelayedPayoutTx.java
#	desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java
#	desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep1View.java
#	desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java
2020-09-23 08:27:09 -05:00
ghubstan
3c0c443680
Change API's createoffer return value from bool to Offer 2020-09-22 22:13:42 -03:00
ghubstan
1f307c8263
Fix indentation 2020-09-22 16:31:31 -03:00
chimp1984
527f1537a9
Add listener on BuyerSendCounterCurrencyTransferStartedMessage to resend msg case it has not arrived
Add signed witness to PayoutTxPublishedMessage
Remove usage of RefreshTradeStateRequest but leave it for backward compatibility
Move removeMailboxMessageAfterProcessing calls in finally branch
Rename methods
2020-09-22 00:32:28 -05:00
chimp1984
2943316f90
Remove agentsUid from protobuf, rename to uid 2020-09-20 21:31:51 -05:00
ghubstan
e2bd89f39a
Refactor API & add registerdisputeagent method to CLI
This commit contains most of the changes suggested by @chimp1984 in
his api-suggestions branch.  See
961703ecea

A new 'registerdisputeagent' method was also added to MainCli, finishing
the work to support registration of mediators and refund agents on
arbitration daemons running in regtest mode.  This method cannot be
used to register dispute agents on mainnet;  users will see an error
msg if they try.
2020-09-18 11:33:16 -03:00
chimp1984
45cee2a272
Add check for disputes with duplicated trade ID or payout tx ids 2020-09-17 19:05:55 -05:00
chimp1984
1c0bef787a
Merge branch 'master_upstream' into verify-donation-address-for-refund-agent 2020-09-16 20:40:08 -05:00
ghubstan
15b6044587
Add dispute agents service proto def to grpc.proto 2020-09-14 10:44:19 -03:00
ghubstan
359037a3ba
Move version service proto def to bottom of grpc.proto 2020-09-14 10:43:31 -03:00
chimp1984
4f1cbbd00e
Add check for refund agent if donation address is valid 2020-09-11 15:35:47 -05:00
chimp1984
039860935d
Merge master
- fix tests
2020-09-01 19:53:23 -05:00
sqrrm
5b1d9cb759
Merge pull request #4453 from chimp1984/add-username-to-revolut
Add support for user name for Revolut accounts
2020-09-01 19:52:40 +02:00
chimp1984
d36306a73c
More refactoring.... 2020-09-01 00:56:54 -05:00
chimp1984
9a142be86e
Add bannedPrivilegedDevPubKeys field 2020-08-31 12:51:01 -05:00
chimp1984
cc20a3b6c7
- Add support for multiple pubKeys
- Add more validation
- Add SignerPubKeyAsHex to filter
- Refactor add/remove filter code
2020-08-31 12:33:45 -05:00
chimp1984
f8b5c30fb4
Refactor:
- Rename AutoConfirmResult to AssetTxProofResult
- Update protobuf entry
2020-08-30 19:35:26 -05:00
chimp1984
595c968f2d
Various small cleanups... 2020-08-30 16:44:45 -05:00
chimp1984
ed5078c0f1
Add abstract AutoConfirmResult class to get better support if we want
to add auto confirm for other currencies in the future. The generic part
is only used where we would have issues with backward compatibility like
in the protobuf objects. Most of the current classes are kept XMR
specific and could be generalized once we add other assets, but that
would be an internal refactoring without breaking any network or
storage data. I think it would be premature to go further here as we
don't know the details of other use cases. I added the methods used from
clients to AutoConfirmResult, not sure if the API is well defined by
that, but as said that could become subject of a future refactoring once
another auto confirm feature gets added. Goal of that refactoring was
to avoid that we need more fields for trade and the the UI would have to
deal with lots of switch cases based on currency.

Sorry that is a larger commit, would have been hard to break up...
2020-08-30 15:45:47 -05:00
chimp1984
3e728c69f7
- Remove AutoConfirmResult enum from protobuf and add a AutoConfirmResult
instead which stores the stateName. [1]

- Adjust protobuf methods

- Add UNDEFINED to AutoConfirmResult.State to support cases where we
get no data to set the enum.

- Add NO_MATCH_FOUND (used in follow up commits)

- Refactoring: Improve constructors

[1]
Enums in protobuf are not well supported. They are global so an enum
with name (e.g. State) inside Trade conflicts with another enum inside
Message with the same name. So they do not reflect encapsulation in the
class like in java.
We moved over time to the strategy to use strings (from enum.name())
instead of the enum, avoiding also cumbersome fromProto and toProto
code and being more flexible with updates.
The autoConfirmResultState enum inside Trade was a bit confusing to me
as it was a different structure as in the java code. We try to mirror
the structure as far as possible.
2020-08-30 14:39:44 -05:00
chimp1984
6c60e1739d
Add support for user name for Revolut accounts
If a user has an existing account with phone number or email as
account ID we show a popup at startup where we require that he sets the
user name. This popup has no close button so he is forced to enter a
value. If there are multiple account multiple popups will be shown.

To not break signed accounts we keep accountId as internal id used for signing.
Old accounts get a popup to add the new required field userName but accountId is
left unchanged. Newly created accounts fill accountId with the value of userName.
In the UI we only use userName.

Input validation does only check for length (5-100 chars). Not sure what
are the requirements at Revolut. Can be changes easily if anyone gets
the specs.
2020-08-30 12:58:31 -05:00
chimp1984
5501822128
Merge branch 'master_upstream' into xmr 2020-08-29 23:03:13 -05:00
chimp1984
7a4fc3d6b7
Merge branch 'master_upstream' into refactor-filter 2020-08-29 12:56:29 -05:00
chimp1984
f52beadc47
Improve dispute views
Add re-open dispute button to mediation views (not refund agent as
there it might be dangerous if he would close 2 times and pay out twice.

If a dispute was reopened and a message was sent afterwards the receiver
will auto-reopen the dispute as well and the UI shows the number
indicator.

Add search field to traders dispute views.

Fix DisputeMsgEvents which was handling only legacy arbitration cases
and now uses mediation and refund agent. Used to update state in case
the UI is not selected.

Add "send private notification" button for mediators and refund agents.

Add report button for mediators and refund agents
Generates report text of all disputes with more detailed information
which should be used for reporting.

Add "Dump text of all disputes" button for getting a text representation
of all disputes including the messages for mediators and refund agents.
This is not used for report but might be useful for search, etc.

Do not show legacy arbitration tabs (for traders as well for
arbitrators) if no cases available.

Add 5 new enum entries for Reason for dispute:
OPTION_TRADE
SELLER_NOT_RESPONDING
WRONG_SENDER_ACCOUNT,
TRADE_ALREADY_SETTLED,
PEER_WAS_LATE

Hide NO_REPLY, SCAM and PROTOCOL_VIOLATION in UI (still in code if we still
need it and re-activate them).
2020-08-28 22:15:11 -05:00
chimp1984
fa9f799186
Improve dispute views
Add report button:
Generates report text of all disputes with more detailed information
which should be used for reporting.

Add "Dump text of all disputes" button for getting a text representation
of all disputes including the messages. This is not used for report but
might be useful for search, etc.

Do not show legacy arbitration tabs (for traders as well for
arbitrators) if no cases available.

Add 3 new enum entries for Reason for dispute:
OPTION_TRADE
SELLER_NOT_RESPONDING
WRONG_SENDER_ACCOUNT
Hide NO_REPLY and PROTOCOL_VIOLATION in UI (still in code if we still
need it and re-activate them)
2020-08-28 13:48:28 -05:00
jmacxx
e3bf0735f7
Persist the auto confirm state of Trade object
Auto confirmed trades will be indicated as such on Trade details.
2020-08-28 12:13:50 -05:00
chimp1984
2f291a6acb
Cleanup Filter value object. Remove nullables from old versions. Keep signatureAsBase64 nullable as it is set null at creation time and set later after signing. We use filter protobuf data as input for signature so we have to set signature to null and apply the signature afterwards. To keep object immutable we clone it with static clone method. Similar we handle signature verification. We clone the filter with a null value for the signature and do the validation with that cloned object.
Use now the complete object data for signature creation. We use the protobuf data for creating the signature with DER encoding. We restict ourself more regarding backward compatibility but I think it is not a big problem.
If a new field is added to Filter and deployed the maintainer needs to publishes a new filter object. By using the new version he cannot remove the old filter from the network as the protobuf data is different and sig verification on the P2P datastorage level will fail. This is intended to keep the old filter alive for some time to support not updated users. We do not remove invalid filters anymore from our local storage to enable seed nodes to support also old filter objects.
For not updated users the new filter will fail at sig verification because the protobuf data is different. So they ignore the new filter and still use the old filter. For updated users the old filter will fail and the new filter is accepted. As it has a newer date it would also replace the old filter anyway. If the maintainer wants to delete the old filter from the network he can use the old app version and remove the filter. It is recommended to keep a copy of the data directory before the update so that the removal of the older filter is possible.

Refacorings:
- Rename isPeersPaymentAccountDataAreBanned to arePeersPaymentAccountDataBanned
- Rename isSignerPubKeyBanned to isWitnessSignerPubKeyBanned
2020-08-27 21:23:02 -05:00