Commit Graph

9 Commits

Author SHA1 Message Date
Thomas Eizinger
e266fb07ef
Don't stutter 2021-04-26 12:45:39 +10:00
Daniel Karzel
c976358c37
Multiple swaps with the same peer
- Swap-id is exchanged during execution setup. CLI (Bob) sends the swap-id to be used in his first message.
- Transfer poof and encryption signature messages include the swap-id so it can be properly associated with the correct swap.
- ASB: Encryption signatures are associated with swaps by swap-id, not peer-id.
- ASB: Transfer proofs are still associated to peer-ids (because they have to be sent to the respective peer), but the ASB can buffer multiple
- CLI: Incoming transfer proofs are checked for matching swap-id. If a transfer proof with a different swap-id than the current executing swap is received it will be ignored. We can change this to saving into the database.

Includes concurrent swap tests with the same Bob.

- One test that pauses and starts an additional swap after the transfer proof was received. Results in both swaps being redeemed after resuming the first swap.
- One test that pauses and starts an additional swap before the transfer proof is sent (just after BTC locked). Results in the second swap redeeming and the first swap being refunded (because the transfer proof on Bob's side is lost). Once we store transfer proofs that we receive during executing a different swap into the database both swaps should redeem.

Note that the monero harness was adapted to allow creating wallets with multiple outputs, which is needed for Alice.
2021-04-13 18:16:19 +10:00
Thomas Eizinger
b9d8cbeaa2
Rename testutils to harness
This allows us to bring in a dependency named `testutils`.
2021-03-30 12:59:34 +11:00
bors[bot]
95acbc6277
Merge #307
307: Reduce load on electrum r=thomaseizinger a=rishflab

.

Co-authored-by: rishflab <rishflab@hotmail.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2021-03-17 05:10:50 +00:00
Thomas Eizinger
a0830f099f
Pass relevant execution params into wallet instead of via functions
The execution params don't change throughout the lifetime of the
program. They can be set in the wallet at the very beginning.
This simplifies the interface of the wallet functions.
2021-03-16 19:24:31 +11:00
Daniel Karzel
ea05c306e0 Alice spawns swaps outside the event loop
Instead of spawning the swap inside the event loop we send the swap back
to the caller to be spawned. This means we no longer need the remote handle
that was only used in the tests.
This now properly logs the swap results in production.
It also gives us more control over Alice's swap in the tests.
2021-03-16 18:31:46 +11:00
Thomas Eizinger
5953037b81
Don't repeat the module name within the type 2021-03-05 15:49:13 +11:00
Thomas Eizinger
6d9b21cb47
Change imports_granularity to module
This reduces the overall amount of LoC that imports take up in our
codebase by almost 100.
It also makes merge-conflicts less likely because there is less
grouping together of imports that may lead to layout changes which
in turn can cause merge conflicts.
2021-03-04 14:48:13 +11:00
Franck Royer
eb39add5ff
Fix typo 2021-02-10 16:42:55 +11:00