Skip to content

Commit

Permalink
address comments and test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mojoX911 committed Jan 8, 2025
1 parent 6c545fa commit fddb185
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ Coinswap v0.1.0 marketplace is now live on Testnet4.

This library is currently under beta development and is in an experimental stage. There are known and unknown bugs. **Mainnet use is strictly NOT recommended.**

Additionally, note that this code is currently designed to run exclusively on Linux systems.

# About

Coinswap is a decentralized [atomic swap](https://bitcoinops.org/en/topics/coinswap/) protocol that enables trustless swaps of Bitcoin UTXOs through a decentralized, Sybil-resistant marketplace.
Expand Down Expand Up @@ -94,7 +92,7 @@ taker --help

`maker-cli`: The RPC controler of the server deamon. This can be used to manage the server, access internal wallet, see swap statistics, etc. App demo [here](https://github.com/citadel-tech/coinswap/blob/master/docs/app%20demos/maker-cli.md)

`taker`: The swap client app. This acts as a regular bitcoin wallet with swap capability. App dmeo [here](https://github.com/citadel-tech/coinswap/blob/master/docs/app%20demos/taker-tutorial.md)
`taker`: The swap client app. This acts as a regular bitcoin wallet with swap capability. App demo [here](https://github.com/citadel-tech/coinswap/blob/master/docs/app%20demos/taker-tutorial.md)

All the apps will require a Bitcoin Core RPC connection running on testnet4. For running bitcoin instrcutions, see [here](https://github.com/citadel-tech/coinswap/blob/master/docs/app%20demos/bitcoind.md)

Expand Down
2 changes: 1 addition & 1 deletion docs/app demos/maker-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ $ ./maker-cli show-fidelity
```
**Output:**
```json
```bash
{
0: (
FidelityBond {
Expand Down
5 changes: 5 additions & 0 deletions tests/abort1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ fn test_stop_taker_after_setup() {
};
taker.do_coinswap(swap_params).unwrap();

// After Swap is done, wait for maker threads to conclude.
makers
.iter()
.for_each(|maker| maker.shutdown.store(true, Relaxed));

// After Swap is done, wait for maker threads to conclude.
maker_threads
.into_iter()
Expand Down
5 changes: 5 additions & 0 deletions tests/abort3_case3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ fn abort3_case3_close_at_hash_preimage_handover() {
};
taker.do_coinswap(swap_params).unwrap();

// After Swap is done, wait for maker threads to conclude.
makers
.iter()
.for_each(|maker| maker.shutdown.store(true, Relaxed));

maker_threads
.into_iter()
.for_each(|thread| thread.join().unwrap());
Expand Down
6 changes: 4 additions & 2 deletions tests/test_framework/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,12 @@ pub fn verify_swap_results(
);

assert_eq!(fidelity_balance, Amount::from_btc(0.05).unwrap());
// Live contract balance will remain

// Live contract balance can be non-zero, if a maker shuts down in middle of recovery.
assert!(
live_contract_balance == Amount::ZERO
|| live_contract_balance == Amount::from_btc(0.004605).unwrap() // for cases like abort3_case3: where the fauly maker doesn't recover.
|| live_contract_balance == Amount::from_btc(0.00460500).unwrap() // For the first maker in hop
|| live_contract_balance == Amount::from_btc(0.00435642).unwrap() // For the second maker in hop
);

// Check spendable balance difference.
Expand Down

0 comments on commit fddb185

Please sign in to comment.