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.
267: Use gtar to create release archive on Mac r=thomaseizinger a=rishflab
Follow up commit uses 7zip to create a zip for windows and appends the binary with a .exe
Here are the releases produced by this PR on my fork:
https://github.com/rishflab/xmr-btc-swap/releases/tag/0.34.0
I have tested the above releases to work up to asking for a btc deposit on :
- [x] macOS
- [x] windows
- [ ] ubuntu
Fixes#251.
Co-authored-by: rishflab <rishflab@hotmail.com>
265: Replace quote with spot-price protocol r=thomaseizinger a=thomaseizinger
This is essentially functionally equivalent but includes some
cleanups by removing a layer of abstraction: `spot_price::Behaviour`
is now just a type-alias for a request-response behaviour.
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Windows users may not have a tar extractor installed by default so 7z
was used to create a zip archive. I attempted to add the action names to
the strategy matrix so we dont need if statements to choose the
appropriate create release archive action but github did not like when
I passed a field under strategy.matrix.include into steps.uses.
tar was producing an archived that binary that was failing to execute on
developer machines. Since gtar is not available on windows or ubuntu,
the windows and ubuntu releases was removed.
261: Sweep xmr funds from generated temp wallet r=da-kami a=da-kami
Fixes#252
Please review by commit :)
Did a few cleanups before actually doing the feature.
Please note the comment that influenced this solution: https://github.com/comit-network/xmr-btc-swap/issues/252#issuecomment-789387074
Co-authored-by: Daniel Karzel <daniel@comit.network>
This way, we are co-locating the type with the expression that requires it.
This makes it easier to take this expression and compose it with other ones
without having to touch the type hint on the variable.
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
This is essentially functionally equivalent but includes some
cleanups by removing a layer of abstraction: `spot_price::Behaviour`
is now just a type-alias for a request-response behaviour.
257: Allow ASB to be configured with max BTC buy amount r=thomaseizinger a=thomaseizinger
This will make it easier to also configure the CLI to display an appropriate max amount the user has to deal with.
This is the first step in working towards https://github.com/comit-network/xmr-btc-swap/issues/255.
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Container initialization and wallet initialization have to ensure to use the same wallet name.
In order to avoid problems constants are introduced to ensure we use the same wallet name.
Prefixing docker-containers and -networks is a necessity to be able to spin up multiple containers and networks.
However, there is no reason to prefix the wallet names that live inside a container. One cannot add a wallet with
the same name twice, so the prefixing of wallets does not bring any advantage. When re-opening a wallet by name
the wallet name prefix is cumbersome and was thus removed.
The wallet is an instance of a wallet that has a name.
When we use `CreateWalletForOutputThenReloadWallet` we actually unload the wallet.
It would be cleaner to create a new instance that does that swap, but I did not go that far.
264: Untangle Bob's `EventLoop` from the `Builder` r=thomaseizinger a=thomaseizinger
This is work towards #255.
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Instead of instantiating the `EventLoop` within the builder, we only
pass in the necessary arguments (which is the `EventLoopHandle`) to
the Builder upon `new`.
This is work towards #255 which will require us to perform network
communication (which implies having the `EventLoop`) before starting
a swap.
If our expression directly evaluates to a future, we don't need to
create an async block.
This requires us to have `EventLoopRun::run` consume the instance
instead of just taking a mutable reference (otherwise we run into
lifetime issues). However, that is better anyway because `run` is
an endless loop so you never get to use the handle afterwards
anyway.
256: Give GitHub some time to process the deletion of the release r=thomaseizinger a=thomaseizinger
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
253: Monero rpc installer for windows r=rishflab a=rishflab
I could not find an async zip archive extractor. The download is still async. One potential follow up could be to spawn the extraction of the zip in the windows path.
Closes#228
Co-authored-by: rishflab <rishflab@hotmail.com>
Previously we were ignoring if the monero wallet rpc was not found and
unpacked from archive leading to a failure down the line when trying to
run a non-existent executable. Bail when the executable is no found in
the archive.
248: Wait for wallet to catch up instead of block generation r=thomaseizinger a=da-kami
The monero harness wallet always starts a miner that mines new blocks every second.
This can conflict with additionally triggering block generation and cause this error:
```
monero_rpc::rpc::monerod: generate blocks response: {
"error": {
"code": -7,
"message": "Block not accepted"
},
"id": "1",
"jsonrpc": "2.0"
}
```
See error in CI run here: https://github.com/comit-network/xmr-btc-swap/runs/2001131193
Since the miner is generating blocks anyway we can wait for the wallet to catch up.
Refresh is done upon querying the balance, thus the refresh calls were removed.
---
Note: we could also opt for starting the miner optionally. This would make this test more efficient, but is a more intrusive change, thus I opted for this fix for now.
Co-authored-by: Daniel Karzel <daniel@comit.network>
243: Some cleanup + improve logging of the `swap_cli` r=thomaseizinger a=thomaseizinger
Please see commit messages for details. I've also included a few minor cleanups that I noticed on the way.
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
254: Smoke test the binary in the release workflow + create 'latest' release r=thomaseizinger a=thomaseizinger
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>