Get the amount from the trade rather than the offer.
Log the expected amount when not matching the explorer result.
It would have made debugging this issue much more straightforward.
Fixes#4557
Before we did not apply messages if the peers key was null which can be the case at protocol start for maker side (takers key is not set yet). Makers key is in offer and available from the start.
Fix incorrect setPubKeyRing call in BuyerAsTakerProtocol and BuyerProtocol. Only taker can set it from offer. This bug was introduce in past commits of this branch.
Move FluentProtocol to own class file
Close open offer in task instead at state listener
Remove state listener
Remove default timeout as not used anymore
Add onWithdrawCompleted method to clean up when trade completed
Rearrange code in TradeProtocol
Rename doHandleDecryptedMessage to onTradeMessage
Rename doApplyMailboxTradeMessage to onMailboxMessage
- 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
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...
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)
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.
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.)