Commit Graph

14 Commits (5a3675a06fcafe2dcc2ab9ff2c0096423362431c)

Author SHA1 Message Date
Byron Hambly 5a3675a06f
Update dependencies and rust-toolchain to 1.59
This commit updates the rust-toolchain to the current stable version
1.59, and fixes a number of new clippy warnings from that change.

Other changes:
    - updates backoff to 0.4
    - updates swap to 2021 edition
    - updates comfy-table to 5.0
    - updates monero-wallet to 2021 edition
    - updates moneor-harness to 2021 edition
    - updates bdk and rust_decimal
    - updates tokio-util to 0.7
    - updates workflow to use actions/setup-python@3
    - updates pem and serde_with
    - adds stable rust toolchain notice to readme
2 years ago
rishflab 394adb0a4f Add subcommand to print config
This subcommand has been introduced to make it easy for users to find
the location of the deprecated sled database in case they wish to delete
it. This feature should also resolve difficulties users were facing when
 trying to find where xmr-btc-swap was storing their data.
3 years ago
dependabot[bot] a2ab124a7f
Bump time from 0.2.27 to 0.3.2
Bumps [time](https://github.com/time-rs/time) from 0.2.27 to 0.3.2.
- [Release notes](https://github.com/time-rs/time/releases)
- [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md)
- [Commits](https://github.com/time-rs/time/compare/v0.2.27...v0.3.2)

---
updated-dependencies:
- dependency-name: time
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Daniel Karzel 529de8d5fd
ASB aborts if CLI does not lock BTC
Includes a new state that is used to await BTC lock tx finality. Upon starting the swap we initially only wait for the BTC lock tx to be seen in the mempool.
This is guarded by a short timeout (3 mins), because it is assumed that in the current setup (sport_price + execution_setup only triggered upon funds being available already) the lock transaction should be picked up almost instanly after the execution setup succeeded.
3 years ago
Daniel Karzel 2db470f099
Bitcoin=2 Monero=10 default finality confirmations
It is currently not expected that ASB and CLI are used for swaps > 10_000$ equivalent to XMR/BTC, thus the finality confirmations were reduced to an equivalent of 20 mins of work (2 blocks for Bitcoin, 10 for Monero).
Monero enforces 10 unlocking blocks until the balance is spendable, so the finality confirmations cannot be set lower than 10.
3 years ago
Daniel Karzel f2e43ea565
Let testnet setup reflect mainnet
Our test values should reflect what we test on mainnet more closely to avoid bugs that are only observed when using mainnet settings.
3 years ago
Daniel Karzel 7f8af7926d
ASB config may specify finality confirmations
By default the finality confirmations of the network's `env::Config` will be applied and no finality confirmations will be persisted on disk in the config file.
It is however possible to set finality confirmations in the config file for bitcoin and monero for power users at their own risk.
If set the defaults will be overwritten with the parameter from the config file upon startup.
3 years ago
Daniel Karzel af60d3bb54
Network check upon spot price request 3 years ago
Daniel Karzel 9ac5b635d7
Introduce own de-/serializable `monero::Network` 3 years ago
Daniel Karzel 69cf12620d
Activate mainnet for the CLI
This includes testing CLI commandline args
Clap's `default_value_with` actually did not work on `Subcommand`s because the parent's flags were not picked up.
This was fixed by changing parameters dependent on testnet/mainnet to options.
This problem should have been detected by tests, that's why the command line parameter tests were finally (re-)added.

Thanks to @rishflab for some pre-work for this.
3 years ago
rishflab 86f312e143 Safely abort swap if TxLock is not confirmed in a reasonable time
If TxLock does not confirm in a reasonable amount of time, Alice should
give up on the swap rather than waiting forever. Watching for TxLock in
the mempool is not required and it causes unnecessary complexity. What
if Alice does not see the transaction in mempool but it is already
confirmed? She will abort the swap for no reason.
3 years ago
Thomas Eizinger 5616683d7d
Monero confirmations are a u64
Trying to deserialize the number as a u32 caused deserialization
errors.
3 years ago
Thomas Eizinger ce78075932
Make Monero and Bitcoin wallet use a generalized sync interval
We define the sync interval as 1/10th of the blocktime. For the
special case of our tests, we however check at max once per second.
The tests have a super fast blocktime. As such we shouldn't hammer
the nodes with a request every 100ms.
3 years ago
Thomas Eizinger 09c41f89c4
Rename ExecutionParams to EnvironmentConfig 3 years ago