Commit Graph

461 Commits

Author SHA1 Message Date
Franck Royer
b8a9356d1b
Change expiries depending on the test goal 2021-01-29 13:29:24 +11:00
Franck Royer
49b8d19e41
test: Log state on failure 2021-01-29 11:36:13 +11:00
rishflab
0b69573129
Run tests on one thread, increase T1 2021-01-29 11:36:13 +11:00
rishflab
1597f5336b
Restart event loop in tests
Alice was attempting to create a new event loop using the same listen addr as the old one which was still running. This commit aborts the event loop before creating a new one.
2021-01-29 11:36:13 +11:00
rishflab
77fc5743a2
Upgrade tokio to 1.0
Upgrade bitcoin harness dependency to latest commit

Upgrade backoff to fix failing tests. The previous version of backoff had a broken version of the retry function. Upgraded to a newer comit which fixes this problem.

Upgrade hyper to 0.14 as the 0.13 was bringing in tokio 0.2.24

Upgraded bitcoin harness to version that uses tokio 1.0 and reqwest 0.11

Upgrade reqwest to 0.11. Reqwest 0.11 uses tokio 1.0

Upgrade libp2p to 0.34 in preparation for tokio 1.0 upgrade
2021-01-29 11:36:10 +11:00
Franck Royer
2073e88683
Remove wrapping if ReadOneError when unnecessary 2021-01-27 14:33:43 +11:00
Franck Royer
2929a8f101
Use the correct protocol support 2021-01-27 14:27:59 +11:00
Franck Royer
b62ef9c2d9
Harmonizing naming 2021-01-27 14:25:45 +11:00
Franck Royer
8fd2620b83
Improve names for messages 4 and 5 2021-01-27 14:16:31 +11:00
Franck Royer
33db688e3a
Bob peer id can be retrieved from the DB
This remove branches where Alice resumes from the DB but cannot contact
Bob.
2021-01-22 17:19:20 +11:00
Franck Royer
a910bc2046
Box all messages in enum
The messages are very different, best to box them and save size on the
stack as an enum takes as much space on the stack than its bigger
variant.
2021-01-22 17:19:20 +11:00
Franck Royer
d2a1937f51
Use Message4 2021-01-22 17:19:20 +11:00
Franck Royer
124d6f1ebb
Introduced Message 4 sent by Alice to replace message 2 response 2021-01-22 17:00:40 +11:00
Franck Royer
edb93624f3
Introduce one shot code
To allow alice to be the requester for message 4.
2021-01-22 16:57:34 +11:00
Franck Royer
9a5e35c1bd
Rename bob::Message2 to Message5
As per the proposed changed in the sequence diagram.
The aim is to have a unique terminology per message instead of having
the same name for 2 consequent messages that share the same behaviour.

Note that the aim is to remove the shared `RequestResponse` behaviours.
2021-01-22 16:57:32 +11:00
Franck Royer
10eeecfe54
Remove dependency of main.rs on lib.rs 2021-01-22 09:00:49 +11:00
Franck Royer
f2a25ee49b
Move definitions out of lib.rs 2021-01-22 09:00:46 +11:00
Franck Royer
b88a777bae
Remove dead code 2021-01-22 08:59:09 +11:00
Daniel Karzel
33a9057b1f Move run_until is_target_state comparison functions into testutils 2021-01-21 23:39:55 +11:00
Daniel Karzel
3593f5323a Bob saves lock proof after received so he can resume swap 2021-01-21 23:35:54 +11:00
Daniel Karzel
433704e48c Top to bottom pub mod then mod then pub use then use (incl. use crate and use self) 2021-01-21 19:10:51 +11:00
Daniel Karzel
44c4b5dcea Remove newlines from import statements to avoid problems
Rust fmt automatically groups the imports (from top to bottom) as `pub use` `use crate` and `use`.
There is no need to introduce sections which cause annoyance when auto importing using the IDE.
2021-01-21 19:10:51 +11:00
bors[bot]
4e858197c9
Merge #149
149: Fix Alice redeem scenario r=da-kami a=da-kami

Follow up of #144, partial fix of https://github.com/comit-network/xmr-btc-swap/issues/137

 Fix Alice redeem scenario

- Properly check the timelocks before trying to redeem
- Distinguish different failure scenarios and reactions to it.
    - if we fail to construct the redeem transaction: wait for cancel.
    - if we fail to publish the redeem transaction: wait for cancel but let the user know that restarting the application will result in retrying to publish the tx.
    - if we succeed to publish the tx but then fail when waiting for finality, print error to the user (secreat already leaked, the user has to check manually if the tx was included)



Co-authored-by: Daniel Karzel <daniel@comit.network>
2021-01-21 06:27:38 +00:00
Franck Royer
8c76abcd37
Remove TODO
This can be tackle when migrating to SQLite
2021-01-21 12:27:32 +11:00
Franck Royer
898b8bf8b0
Remove dead code 2021-01-21 12:27:32 +11:00
Franck Royer
ae8134f04e
Replace amounts messages with swap res/req 2021-01-21 12:27:30 +11:00
Daniel Karzel
6a75c840b5 Fix Alice redeem scenario
- Properly check the timelocks before trying to redeem
- Distinguish different failure scenarios and reactions to it.
    - if we fail to construct the redeem transaction: wait for cancel.
    - if we fail to publish the redeem transaction: wait for cancel but let the user know that restarting the application will result in retrying to publish the tx.
    - if we succeed to publish the tx but then fail when waiting for finality, print error to the user (secreat already leaked, the user has to check manually if the tx was included)
2021-01-21 12:13:02 +11:00
Daniel Karzel
8a7d746e96 Wait for Bob's refund finality
For Alice we ensure to wait for redeem/punish finality, so it should be the same for Bob.
2021-01-21 10:36:08 +11:00
Franck Royer
94045b9a69
Use builder in tests 2021-01-20 21:42:35 +11:00
Franck Royer
c44b867d01
Delay the wrapping in Arc 2021-01-20 14:56:10 +11:00
Franck Royer
83b72c0a45
Make make_init_state and init_loop associated to alice::SwapFactory 2021-01-20 14:56:10 +11:00
Franck Royer
c11042ff0d
Use builder terminology instead of factory
This is not really a factory as a factory design pattern is about
producing several instances.

In the current usage, we are only interested in one swap instance. Once
the swap instance is created, the factory becomes useless. Hence, it is
more of a builder pattern.
2021-01-20 14:56:06 +11:00
Franck Royer
9148af2dbe
bob::SwapFactory should be consumed once a swap is returned 2021-01-20 14:51:37 +11:00
Franck Royer
652bfa14a9
Remove unnecessary pub qualifiers 2021-01-20 14:51:36 +11:00
Franck Royer
b21dc03ed0
alice::SwapFactory should be consumed once a swap is returned 2021-01-20 14:51:36 +11:00
Franck Royer
9b32409b8d
Remove unnecessary allow(clippy) 2021-01-20 14:51:35 +11:00
Franck Royer
9e3ef7ea24
Remove StartingBalances from release code 2021-01-20 14:51:35 +11:00
Franck Royer
181999e04f
Remove unnecessary alice qualifiers in alice::SwapFactor 2021-01-20 14:51:35 +11:00
Franck Royer
3bc76a91c6
Make init_state associated to bob::SwapFactory 2021-01-20 14:51:34 +11:00
Franck Royer
f0e6e45d56
Remove unecessary bob qualifier 2021-01-20 14:51:34 +11:00
Franck Royer
dbc633ea06
Remove unecessary connect qualifier 2021-01-20 14:51:34 +11:00
Franck Royer
e26629b593
Remove unecessary fields from bob::SwapFactory 2021-01-20 14:51:34 +11:00
Franck Royer
3c68026cfe
Move init event loop in bob::SwapFactory 2021-01-20 14:51:33 +11:00
Franck Royer
96b1b18037
Keep terminology consistent
Also avoid redundant qualifiers.
2021-01-20 14:51:33 +11:00
Daniel Karzel
28429fa9fe Revert log statement 2021-01-20 13:30:35 +11:00
Daniel Karzel
37f619dbfc Move StartingBalances into protocol module 2021-01-20 13:29:46 +11:00
Daniel Karzel
41e335fc2d Error messages instead of unreachable
Currently this code is actually not reachable, but that is semantically applied by the program's flow (the resume command includes the swap direction).
It is still preferred to have an error message rather than an unreachable statement.
2021-01-20 13:14:25 +11:00
Daniel Karzel
2dceab28a4 Derive Default 2021-01-20 10:44:24 +11:00
Daniel Karzel
acfd43ee79 Rename Test to TestContext and argument to ctx 2021-01-20 10:40:40 +11:00
Daniel Karzel
e91987e23f Fix rand import 2021-01-20 10:38:28 +11:00
Daniel Karzel
170e90ffed Rename do_run_until to _run_until_internal 2021-01-20 10:37:16 +11:00
Daniel Karzel
82974412b2 Remove roles from SwapFactory name as implied by module and cleanup 2021-01-19 09:43:50 +11:00
Daniel Karzel
75f89f3b25 Use Bob swap factory in production 2021-01-19 09:16:05 +11:00
Daniel Karzel
e56c48ee23 Remove unused type 2021-01-19 09:16:05 +11:00
Daniel Karzel
3398ef8236 Use Alice swap factory in production 2021-01-19 09:16:05 +11:00
Daniel Karzel
67e925fe1f Refactor Bob's peer-id and identity to be handled on the outside
Doing this in the behaviour is a weird indirection that is not needed.
2021-01-19 09:16:04 +11:00
Daniel Karzel
0c19af9090 Refactor Alice's peer-id and identity to be handled on the outside
Doing this in the behaviour is a weird indirection that is not needed.
2021-01-19 09:16:04 +11:00
Daniel Karzel
8bf467b550 Make the factory code usable in production
- Introduce Test abstraction instead of tow harnesses, move test specific data into Test
- Change the abstraction from actors to swap, because we are creating swaps, not actors
- rename actor::swap  to run, because we are running a swap
2021-01-19 09:16:04 +11:00
Daniel Karzel
e4795fa4ee Fix recursive call to swap by using run_until
We should call run_until instead of swap.
2021-01-19 09:06:44 +11:00
bors[bot]
35c42263df
Merge #145
145: Make lock-tx id available in redeem/punish state to be able to assert exact fees r=da-kami a=da-kami

We can do exact assertions for Bob's redeem as well, but have to store Bob's tx_lock id in the respective final state. Make tx_lock available in BtcRedeemed and BtcPunished to have better assertions / harmonize test behaviour.

Storing this information is strictly speaking not needed for the production environment. But it is static information that can be seen as additional information that can be handy for a user. We could potentially extract it inside the tests as well (for redeem without restart would be a bit tricky), but I think this solution is more elegant. 

Co-authored-by: Daniel Karzel <daniel@comit.network>
Co-authored-by: Franck Royer <franck@coblox.tech>
Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
2021-01-18 11:07:36 +00:00
bors[bot]
a7f68e4aa1
Merge #144
144: Test refactor r=da-kami a=da-kami

This PR is pure refactoring, keeping the logic of the tests we had before. No production code is touched besides re-exports in early commits (no logic changes).

In the follow ups improvements will be introduced, that touch the production code as well.

All remaining tasks actioned since Friday: 

- [x] `happy_path_bob _restart` (trivial)
- [x] add refund assertions to harnesses (trivial)
- [x] convert all refund scenarios currently being tested (trivial)
- [x] remove dead test init code once all old tests are converted
- [ ] ~~(optional) move alice and bob harness code into separate files~~ -> might action this once re-using test code in production.

Out of scope, follow up:
- [x] https://github.com/comit-network/xmr-btc-swap/pull/145 - We can do exact assertions for Bob's redeem as well, but have to store Bob's `tx_lock` id in the respective final state. Make `tx_lock` available in `BtcRedeemed` and `BtcPunished` to have better assertions / harmonize test behaviour. 
- [ ] update the production code to use the `Alice` and `Bob` structs to bundle the params - update tests to use the production struct.
- [ ] Re-use test swap setup in production (i.e. `Alice-/BobHarness::new`) to setup the swap.
- [ ] add additional tests
- [ ] re-try moving the tests from `test` to `src` (if the peer_id was the only problem this should be trivial now - but should be done after the refactor is finished)
- [ ] creating new wallets upon restart
- [ ] aborting the old event loop after restart

Co-authored-by: rishflab <rishflab@hotmail.com>
Co-authored-by: Daniel Karzel <daniel@comit.network>
2021-01-18 04:49:52 +00:00
Franck Royer
9a823dca4c
Do not introduced State6 2021-01-18 15:27:38 +11:00
bors[bot]
974b6ebf6f
Merge #136
136: Testnet resume fixes r=da-kami a=da-kami

Add a few log statements on Bob's side to make the user experience better.
Update / remove ToDos.

I set the log level to `Info` in main again, `Debug` heavily clutters the output. In order to make `Debug` more usable we might want to review printing all those `rpc` messages. But this goes beyond the scope of this PR.


Co-authored-by: Daniel Karzel <daniel@comit.network>
2021-01-18 03:51:45 +00:00
Daniel Karzel
d4316f0cfe Print each monero confirmation for Bob
This is to provide more context to the user.
2021-01-18 14:50:59 +11:00
Daniel Karzel
8615aaed6e Make lock-tx id available in redeem/punish state to be able to assert exact fees 2021-01-18 14:45:47 +11:00
Daniel Karzel
317b251302 Re-arrange order of structs/functions in testutils
move important things to the top and harmonize structure for alice and bob.
2021-01-18 14:10:17 +11:00
Daniel Karzel
7832ee94f3 Remove unused code and only expose necessary functionality 2021-01-18 14:10:17 +11:00
Daniel Karzel
8ef8240771 Refactor refund test 2021-01-18 14:10:16 +11:00
Daniel Karzel
55024572ae Refactor punish test and punish assertions 2021-01-18 14:10:16 +11:00
Daniel Karzel
73a2841ec5 Refactor happy path bob restart tests 2021-01-18 14:10:00 +11:00
Daniel Karzel
8a2eb07928 Harmonize names and structure
Simple renames and structure changes, no logical changes.
2021-01-15 19:34:51 +11:00
Daniel Karzel
bede1c13dd Refactor Bob's side (happy path + alice restart)
Refactor Bob's test setup in the same way as Alice's.
Introduce BobHarness that allows creating and restarting as well as asserting redeemed for Bob.
2021-01-15 19:29:26 +11:00
Daniel Karzel
59f9a1c286 Fix usage of StartingBalance in Alice and Bob 2021-01-15 19:03:11 +11:00
Daniel Karzel
87edec0d50 Rename Alice's factory to harness and include redeem assertions
This makes the redeem assertion reusable for all tests with a redeem scenario.
Since the factory was not a clean factory before and is now doing even more it was renamed to harness.
2021-01-15 18:46:14 +11:00
Daniel Karzel
152c8d7eba Refactor Alice restart test by introducing factory for creating Alices
The factory keeps all static state of Alice to be able to simulate a restart.
2021-01-15 18:14:19 +11:00
Daniel Karzel
b031bc5e42 Re-export run_until 2021-01-15 11:49:47 +11:00
rishflab
537d05e01e Add reusable test function
We introduce a reusable test function to make it easier to add new tests and make our existing tests more readable.
2021-01-15 11:26:32 +11:00
rishflab
9cbf6e9774 Re-export event loop handles 2021-01-15 10:42:49 +11:00
rishflab
6040f2ae63 Re-export event loops 2021-01-15 10:31:25 +11:00
rishflab
e8fdf62623 Re-export swap function 2021-01-15 10:20:18 +11:00
rishflab
f5cfe014be Fix imports 2021-01-15 10:13:39 +11:00
Franck Royer
31c63f0c4d
Remove dead code 2021-01-14 11:40:34 +11:00
Franck Royer
0852f90473
Remove unused variant 2021-01-14 11:36:38 +11:00
Daniel Karzel
f8848aca55 Describe additional state for ToDo that might cause trouble
If we wait for lock transaction confirmations immediately after sending the transaction without saving this state to the DB this might cause locking the money twice.
An additional state is needed for such a scenario.
2021-01-12 14:39:17 +11:00
Daniel Karzel
59f01ad680 Remove Todo that was already actioned
This ToDo does not add any value, I would not know what to do here.
2021-01-12 14:39:17 +11:00
Daniel Karzel
60f3923a63 Set tracing level to Info in production code
Trace / Debug should be used when there is a problem. They print way too much in production.
2021-01-12 14:39:17 +11:00
Daniel Karzel
00b4f3110f Remove ToDo that is already actioned
We already have a second watcher for the cancel timelock, so refund is already actioned.
2021-01-12 14:39:17 +11:00
Daniel Karzel
ab9117aa4c Log Alice's lock tx proof receive on Bob's side 2021-01-12 14:39:17 +11:00
Daniel Karzel
af45206fde Remember the block-height before XMR lock for generated monero wallet restore height
Speeds up wallet creation, because only the blocks after the recorded height will be scanned.
2021-01-12 13:18:49 +11:00
bors[bot]
ca6ba78862
Merge #123
123: Small fixes after testnet usage r=da-kami a=D4nte



Co-authored-by: Franck Royer <franck@coblox.tech>
2021-01-11 04:25:26 +00:00
Daniel Karzel
664958939d Create network::Seed from swap::Seed instead of abstracting over byte array 2021-01-11 12:03:29 +11:00
Daniel Karzel
f18d01dfaf Deterministic peer id from seed for bob 2021-01-11 12:03:29 +11:00
Daniel Karzel
0a21040e08 Deterministic peer id from seed for alice
This includes the introduction of the --data-dir parameter instead of the --database.
Both the seed file and the database are stored in the data-dir, the database in sub-folder `database`.
2021-01-11 12:00:48 +11:00
Franck Royer
6ffc66867c
Typo
Co-authored-by: Daniel Karzel <daniel.karzel@coblox.tech>
2021-01-11 11:39:21 +11:00
Franck Royer
047f990d05
Improve error reporting on signature verification 2021-01-11 11:39:18 +11:00
Franck Royer
ef906876a0
Increase timelocks on testnet
To allow time for stagenet Monero transaction to be mined.
2021-01-11 11:35:52 +11:00
Franck Royer
17356eaff9
Do not guard waiting for encrypted signature with arbitrary timeout
We already select waiting for this message with the cancellation expiry,
 we do not need add another guard that tries to guess how long it would
 for the Monero transaction to be finalised.
2021-01-11 11:35:52 +11:00
Franck Royer
95ecb02e7a
Small changes to make debugging easier and tests 2021-01-11 11:35:51 +11:00
Franck Royer
9d8f8b0a1f
P2p socket should be listening for external connections 2021-01-11 11:35:51 +11:00
rishflab
1c644cb377 Rename message behaviours 2021-01-09 11:47:23 +11:00
rishflab
5d7d72c826 Remove unused import 2021-01-09 10:10:48 +11:00
rishflab
387a4da2f6 Make modules private 2021-01-08 12:34:36 +11:00
rishflab
dcea54dbf1 Move protocol parent states into appropriate module 2021-01-08 12:34:36 +11:00
rishflab
f64eede5d8 Move monero ser/deser to monero module 2021-01-08 12:34:36 +11:00
rishflab
e7c00d742e Re-export bitcoin and monero types 2021-01-08 12:34:36 +11:00
rishflab
c900d12593 Merge xmr_btc crate
Created network, storage and protocol modules. Organised
files into the modules where the belong.

xmr_btc crate moved into isolated modulein swap crate.

Remove the xmr_btc module and integrate into swap crate.

Consolidate message related code

Reorganise imports

Remove unused parent Message enum

Remove unused parent State enum

Remove unused dependencies from Cargo.toml
2021-01-08 12:34:33 +11:00
Daniel Karzel
487b880371 Cleanup unused config param that was accidentally introduced 2021-01-07 12:23:29 +11:00
Daniel Karzel
e031681369 Add minimum monero confirmations to config use it for Bob 2021-01-06 17:17:37 +11:00
Daniel Karzel
c6bc45e7a0 Wait for bitcoin tx finality before locking XMR 2021-01-05 14:31:10 +11:00
Daniel Karzel
30dd15774e Log Bitcoin and Monero transaction IDs on info instead of debug 2021-01-05 14:11:26 +11:00
Daniel Karzel
0977d36703 Set log level to info instead of trace 2021-01-05 14:00:07 +11:00
Daniel Karzel
8a2128e93a Correct monero-wallet-rpc parameter name 2021-01-05 11:00:15 +11:00
Daniel Karzel
4d9559fc2e Monero network settings and testnet 2021-01-04 20:30:47 +11:00
Daniel Karzel
1f7e72b230 Log bitcoin harness and monero harness 2021-01-04 20:30:46 +11:00
Franck Royer
dd10e68db4
Merge pull request #113 from comit-network/clippy 2021-01-04 10:10:19 +11:00
Franck Royer
bcbc54b569
Type timelock and block height
To ensure no mistake is made (and none were!)
2021-01-04 08:40:53 +11:00
Franck Royer
81cbc24c46
Use action to name trait 2020-12-23 15:40:56 +11:00
Franck Royer
e1e8533862
Embed state mod in database mod
The `Swap` struct is now database specific, no need to have a 20 lines
 module.
2020-12-23 15:30:23 +11:00
Franck Royer
59708c57e6
Move Alice and Bob db states in separate modules 2020-12-23 15:26:08 +11:00
Franck Royer
b410de01df
Move state.rs under database module
The types in state are only used for the database
2020-12-23 15:20:24 +11:00
Franck Royer
8c7964bfee
Rename storage.rs to database.rs to reduce terminology variants 2020-12-23 15:17:27 +11:00
Franck Royer
5ed18469e4
Move db state conversion with db type definition
Those conversion are specific to the database and should be defined with
in the database module.
2020-12-23 15:11:09 +11:00
Franck Royer
2a778f5644
Remove overzealous clippy overrides
We have overridden a number of clippy warnings such as
"large enum variant".

Considering that we have a number of issues
 with the stack size in CI, it is more prudent to follow clippy's advice
 and box larger items so that the enum does not take larger space.

Do note that an instance of the enum always takes as much space as its
largest variant.
2020-12-23 15:06:43 +11:00
Franck Royer
cdf2800fa5
Align clippy lints
Lints in `main.rs` are not used if there is a `lib.rs` file.
2020-12-23 14:33:29 +11:00
Franck Royer
ece689f5ca
There is only one binary, we should use main.rs naming convention 2020-12-23 14:22:04 +11:00
Franck Royer
4150e75488
Replace Try_From state conversion with From for Bob 2020-12-23 14:12:29 +11:00
Franck Royer
5d1b10cc58
Align Bob DB states with swap states 2020-12-23 14:12:29 +11:00
Franck Royer
e541f7b83d
Replace TryFrom with From for Alice states 2020-12-23 14:12:29 +11:00
Franck Royer
69e1c2bb27
Align Alice DB states with swap states 2020-12-23 14:12:29 +11:00
Franck Royer
a31db63e54
Improve state names and display 2020-12-23 14:12:29 +11:00
Franck Royer
f0736d0906
Remove Refund timelock and T0/T1/T2
There are no refund timelock, only a cancellation timelock and punish
timelock.

Refund can be done as soon as the cancellation transaction is published.
2020-12-23 14:12:26 +11:00
Franck Royer
405e377f79
Rename EncSign to EncSig
`EncSig` means "encrypted signature", the item,
not be confused with "signing", the action
2020-12-23 13:41:55 +11:00
bors[bot]
9c83ca52ad
Merge #107
107: Ensure that Bob can cancel correctly if T1 expired and Alice did not … r=da-kami a=da-kami

Bob has to check for the possibility to cancel in every state after he locked the BTC.
Otherwise Bob will try to perform actions that don't have any point and it might be impossible to use the `resume` command because it will always fail in trying to go on with Alice even though that might not be possible.

Co-authored-by: Daniel Karzel <daniel@comit.network>
2020-12-23 01:16:42 +00:00
Franck Royer
297b15e3ce
Remove async block when it is not needed 2020-12-23 09:17:56 +11:00
Franck Royer
e079b84500
Ensure we wait for other party to complete
Before we check the balances.
2020-12-23 09:17:41 +11:00
Franck Royer
1fa812b727
Separate Buy/Sell for resume command
To avoid confusing the user on whether person should enter a listen addr
or a connect peer id and address
2020-12-23 09:17:39 +11:00
Daniel Karzel
a692cf9299 Remove all short-codes because they don't add value at the moment 2020-12-22 18:10:13 +11:00
Daniel Karzel
c9d492d155 Only wait for xmr-lock until t1 expired 2020-12-22 17:08:17 +11:00
Daniel Karzel
83ce6f2c85 Ensure that Bob can cancel correctly if T1 expired and Alice did not move
Bob has to check for the possibility to cancel in every state after he locked the BTC.
Otherwise Bob will try to perform actions that don't have any point.
2020-12-22 16:27:25 +11:00
Daniel Karzel
8296490764
Merge pull request #111 from comit-network/trace-xmr-btc
Fix tracing subscribe filter for xmr-btc`
2020-12-22 16:17:27 +11:00
Daniel Karzel
5f8b7f2624 Fix tracing subscribe filter for xmr-btc` 2020-12-22 14:11:55 +11:00
Franck Royer
40a27a2438
Remove dead code 2020-12-22 13:50:36 +11:00
Franck Royer
df237f82cf
Fix clippy warning 2020-12-22 13:50:28 +11:00
Franck Royer
49b84d84b9
Add address at the start
Do not carry peer id around as we currently only expect one peer.
2020-12-22 13:47:05 +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
2abf65f3b6
Remove sleep that seems unnecessary 2020-12-21 10:25:36 +11:00
Franck Royer
4a4e23038b
Add logging to investigate add address race condition 2020-12-21 10:25:19 +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
d9ea7ab605
Only carry the tx_lock_id instead of the full state 2020-12-21 08:19:39 +11:00