Commit Graph

10 Commits

Author SHA1 Message Date
Thomas Eizinger
cde3f0f74a
Remove connection handling from swap execution
The swap should not be concerned with connection handling. This is
the responsibility of the overall application.

All but the execution-setup NetworkBehaviour are `request-response`
behaviours. These have built-in functionality to automatically emit
a dial attempt in case we are not connected at the time we want to
send a message. We remove all of the manual dialling code from the
swap in favor of this behaviour.

Additionally, we make sure to establish a connection as soon as the
EventLoop gets started. In case we ever loose the connection to Alice,
we try to re-establish it.
2021-03-24 15:17:54 +11:00
Franck Royer
1e4b115556
Separate Bob restart tests
To stabilize CI
2020-12-21 12:19:04 +11:00
Franck Royer
e366d3a73b
Join all futures to avoid hanging tests 2020-12-21 12:17:40 +11:00
Franck Royer
1a4bd0e2b4
Bob refunds swap after restart that requires communication
As Bob is dialing Alice, we now ensure that we are connected to Alice
at each step that needs communication.
If we are not connected, we proceed with dialing.

In an attempt to improve libp2p usage, we also add known address of
Alice first and only use peer_id to dial.
This ensures that we use the expected peer id.
2020-12-21 08:31:21 +11:00
Franck Royer
638143a10d
Replace hard coded port by dynamic available one
Fixes #84.
2020-12-21 08:19:31 +11:00
bors[bot]
3db71997d3
Merge #99
99: Cleanup resume_from_database functions only used in tests r=da-kami a=da-kami

Follow up of https://github.com/comit-network/xmr-btc-swap/pull/88

Co-authored-by: Daniel Karzel <daniel@comit.network>
2020-12-18 03:01:18 +00:00
Daniel Karzel
773eebc723 Cleanup resume_from_database functions only used in tests 2020-12-18 10:50:32 +11:00
rishflab
9d266fc648 Add balance assertions to restart tests 2020-12-15 13:11:16 +11:00
Franck Royer
5ba830f3bf
Replace swap recover terminology with resume 2020-12-15 11:52:00 +11:00
Daniel Karzel
b83ab71669
Split up tests into separate files to overcome CI failure 2020-12-15 11:43:28 +11:00