mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-12-25 07:29:32 -05:00
a7f68e4aa1
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> |
||
---|---|---|
.. | ||
src | ||
tests | ||
Cargo.toml |