Commit graph

4840 commits

Author SHA1 Message Date
chimp1984
968a6df550
Refactor: Rename run to runTasks 2020-09-23 12:50:22 -05:00
chimp1984
9505179bed
Use FluentProcess for boilerplate code (WIP - some custom code is commented out atm, will be fixed in follow up commits)
Add setTaskRunner method
Add addTasks method
Add run method
2020-09-23 12:49:42 -05:00
chimp1984
faf07f623f
Refactor: Rename fromAny to expectedPhases 2020-09-23 12:14:40 -05:00
chimp1984
d91e44c9ab
Refactor: Rename from to expectedPhase 2020-09-23 12:14:18 -05:00
chimp1984
3f80d1b1ea
Refactor: Rename condition to preCondition 2020-09-23 12:13:07 -05:00
chimp1984
2b53312af9
Various improvements
- Add time outs per request/response cycle.
- Use custom timeouts
- Stop timeout if condition not met
- Allow multiple condition calls (all need to be true)
- Move  processModel.setTradeMessage(tradeMessage); and processModel.setTempTradingPeerNodeAddress(peerNodeAddress); calls to FluentProcess
- Add Validator.isTradeIdValid method
- Replace Validator.checkTradeId(processModel.getOfferId(), tradeMessage); by isTradeIdValid in FluentProcess
- Add DisputeEvent
- Derive info string from message or event at handleTaskRunnerSuccess
- Add from method
- Add withTimeout method
- Add BuyerEvent.STARTUP
- Rename onMessage to on
- Rename onEvent to on
- Rename tradeMesage to message
- Rename sener/peerNodeAddress to peer
2020-09-23 12:07:38 -05:00
chimp1984
de008457cb
Remove empty file (from merge) 2020-09-23 08:28:04 -05: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
chimp1984
6fa2225b65
Use fluent interface for checking state and conditions 2020-09-23 01:48:02 -05:00
chimp1984
7c6f0ac9b2
Use ifInPhase APi for testing expected phase(s)
Add ifInPhase method to allow alternative phases. We can have parallel branches how we reach a new state, e.g. receiving the tx from network or receiving it from the peer. no guarantee which will happen first.

Allow phase transition to skip a future phase as we have phases only relevant for one role. This is not good for treading it as a state machine state, we need to redesign the state/phase handling...
2020-09-22 21:09:09 -05:00
chimp1984
48241af316
Change isTradeInPhase APi to fluent interface with ifInPhase 2020-09-22 20:18:59 -05:00
ghubstan
3c0c443680
Change API's createoffer return value from bool to Offer 2020-09-22 22:13:42 -03:00
chimp1984
5f8f30a8b3
Add BuyerSendCounterCurrencyTransferStartedMessage as second optional task instead of starting a new task runner 2020-09-22 19:53:19 -05:00
chimp1984
1abe6adac6
Remove empty tasks. 2020-09-22 19:40:15 -05:00
chimp1984
8ce5ebadea
Refactoring: rename, cleanups 2020-09-22 19:35:24 -05:00
chimp1984
4b7307e07f
Add checks for state at handle CounterCurrencyTransferStartedMessage
Add ApplyFilter task
2020-09-22 19:35:01 -05:00
chimp1984
c7e0c51875
Use same model as in SellerSendsDepositTxAndDelayedPayoutTxMessage
Reason: the other model was already tested quite a lot and seems to work correctly.
We gain a lot of resiliance with min. costs (repeated mailbox messages - as they are the same
they will not cause higher number of msg, just a bit more traffic)
2020-09-22 19:34:14 -05:00
chimp1984
96221317e2
Change order of tasks
Call BuyerSetupPayoutTxListener before BuyerSendCounterCurrencyTransferStartedMessage
We will change BuyerSendCounterCurrencyTransferStartedMessage so that it
does not complete until the message has been ACKed by the peer.
It is more transparent to leave the task uncompleted and if it is the last task we dont have issues.
The caller would not get the result handler called though until all is completed. But the result handler in the UI was anyway empty.
2020-09-22 19:01:51 -05:00
chimp1984
b13e1a3edb
Resend DepositTxAndDelayedPayoutTxMessage at
SellerSendsDepositTxAndDelayedPayoutTxMessage if no ACK received

Add checks for valid trade state transitions
2020-09-22 18:50:45 -05:00
ghubstan
e63a6c5771
Remove comment 2020-09-22 18:45:50 -03:00
ghubstan
8896372a0f
Move test dispute agent type constants to core
The string constants deleted from the test case are re-defined as enums,
but the test harness still passes around strings (enum.name()) because
the handling of invalid dispute agent type string args needs to be
tested.  (Reminder:  CLI does not accept any enum arguments.)
2020-09-22 15:31:38 -03:00
Oscar Guindzberg
6ba0d6197e
Remove unnecessary comment 2020-09-22 15:06:43 -03:00
Oscar Guindzberg
f529e463d3
Remove unnecessary code 2020-09-22 15:06:43 -03:00
Oscar Guindzberg
ab4333eaaa
Rename kcg to kcgBuilder 2020-09-22 15:06:43 -03:00
Oscar Guindzberg
4558bf4c0c
Remove unused imports 2020-09-22 15:06:42 -03:00
Oscar Guindzberg
1becf89371
Remove unused WalletConfig.walletFactory 2020-09-22 15:06:42 -03:00
Oscar Guindzberg
59124e3e33
Replace deprecated bitcoinj methods
Replace output.getAddressFromP2PKHScript() and
output.getAddressFromP2SH() with
output.getScriptPubKey().getToAddress()
2020-09-22 14:55:47 -03:00
Oscar Guindzberg
c1c9ff3de8
Fix logging message 2020-09-22 14:07:31 -03:00
Christoph Atteneder
e3b3c625b3
Merge pull request #4548 from ghubstan/use-legacyaddress-frombase58
Remove unused, broken accessor
2020-09-22 16:32:50 +02:00
Christoph Atteneder
44bf29b67e
Merge pull request #4546 from oscarguindzberg/code-cleanup
Minor code cleanup changes
2020-09-22 16:23:31 +02:00
Christoph Atteneder
64d4b9b136
Merge pull request #4544 from oscarguindzberg/removeListeners
Remove unnecessary listeners in TransactionsView
2020-09-22 16:22:37 +02:00
Christoph Atteneder
69d533d9ea
Merge pull request #4520 from cd2357/show-qubes-info-popup
Show info popup if Bisq started under Qubes OS
2020-09-22 16:21:03 +02:00
ghubstan
86c62c1333
Revert WalletService change (accessor breaks build)
The accessor added in commit e2bd89f broke the build, and was not
used as originally intended -- by CoreWalletsService -- because the
the api's wallet methods need addresses from the wallet, not just
a valid address.
2020-09-22 11:16:53 -03:00
sqrrm
3d07c064e4
Merge pull request #4534 from ghubstan/daemon-status-scratch
Give core api a simple way to verify init status
2020-09-22 11:41:12 +02:00
sqrrm
dee92670c5
Merge pull request #4539 from ghubstan/refactor-bisqdaemonmain
Refactor API & add registerdisputeagent method to CLI
2020-09-22 11:37:18 +02: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
33c816acf6
Move SellerPublishesDepositTx after SellerSendsDepositTxAndDelayedPayoutTxMessage
This should help to avoid that the buyer does not get the delayed payout tx.
If a timeout at deposit tx broadcast would prevent that it get out, the peer has at least both transactions.
The timeout could be Bisq internal but the tx gets in reality published. With the previous code we would get interrupted at
SellerPublishesDepositTx and then the SellerSendsDepositTxAndDelayedPayoutTxMessage would never get executed.
2020-09-21 23:41:24 -05:00
chimp1984
971cd57984
Refactoring: cleanups, rename cleanupTradableOnFault 2020-09-21 23:34:07 -05:00
chimp1984
538db2f36f
Move contractHash creation to MakerCreateAndSignContract 2020-09-21 23:26:51 -05:00
chimp1984
0f36ae8928
Refactoring: cleanups 2020-09-21 23:17:50 -05:00
chimp1984
853dac7544
Remove empty task runner 2020-09-21 23:04:45 -05:00
chimp1984
17baf18844
Refactoring: cleanups 2020-09-21 23:01:33 -05:00
chimp1984
e960e12084
Refactoring: cleanups 2020-09-21 22:58:13 -05:00
chimp1984
fdde4b552c
Refactoring: cleanups 2020-09-21 22:29:13 -05:00
chimp1984
9966f9a9a8
Move contractHash creation to TakerVerifyAndSignContract 2020-09-21 22:25:48 -05:00
chimp1984
2aa5feebc1
Move stopTimeout to second message handler 2020-09-21 22:23:01 -05:00
chimp1984
a725227ff3
Refactor: set string at success handlers correctly 2020-09-21 22:20:08 -05:00
chimp1984
53526e3c20
Remove repeated TakerVerifyMakerAccount and TakerVerifyMakerFeePayment from taker protocol 2020-09-21 22:08:24 -05:00
chimp1984
a8a3318f67
Refactoring: cleanups 2020-09-21 22:07:51 -05:00
chimp1984
5705d8e67a
Refactoring: rename inputsForDepositTxResponse , add more checkNotNull checks 2020-09-21 22:01:30 -05:00