Commit Graph

1025 Commits (4a2bfbf9cfee0af20f7d6ce59dbff3a9d99c6492)

Author SHA1 Message Date
dependabot[bot] 4a2bfbf9cf
Bump comfy-table from 4.0.1 to 4.1.1
Bumps [comfy-table](https://github.com/nukesor/comfy-table) from 4.0.1 to 4.1.1.
- [Release notes](https://github.com/nukesor/comfy-table/releases)
- [Changelog](https://github.com/Nukesor/comfy-table/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nukesor/comfy-table/compare/v4.0.1...v4.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Thomas Eizinger 6c446825b7
Instruct `Ping` to keep the connection alive 3 years ago
Thomas Eizinger 1af0623c85
Remove empty modules 3 years ago
COMIT Botty McBotface 7126d77dc1 Prepare release 0.8.1 3 years ago
Thomas Eizinger 0296509110
Upgrade to bdk 0.10
This fixes #546. I don't know why, but I can't reproduce the problem
with the updated dependency.
3 years ago
Thomas Eizinger 475057abda
Add proptest for max_giveable and signing PSBT 3 years ago
Thomas Eizinger e4b5e28a93
Introduce WalletBuilder for creating test instances of wallet 3 years ago
Thomas Eizinger 148fdb8d0a
Ensure the size of our locking script never changes 3 years ago
dependabot[bot] 8ea0877dc1
Bump comfy-table from 4.0.0 to 4.0.1
Bumps [comfy-table](https://github.com/nukesor/comfy-table) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/nukesor/comfy-table/releases)
- [Changelog](https://github.com/Nukesor/comfy-table/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nukesor/comfy-table/compare/v4.0.0...v4.0.1)

---
updated-dependencies:
- dependency-name: comfy-table
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
COMIT Botty McBotface 403e3d2b33 Prepare release 0.8.0 3 years ago
Thomas Eizinger d21bd556ec
Remove rendezvous point default
This also fixes a bug where an empty string wasn't actually allowed
as a rendezvous point in the ASB's initial setup wizard.
3 years ago
bors[bot] 9fc53d3f84
Merge #615
615: Update default Monero node URLs and info r=thomaseizinger a=da-kami

xmr.to nodes are not served at the xmr.to domain but moved to melo.tools

Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
Daniel Karzel 0dc3943d9c
Update default Monero node URLs and info
xmr.to nodes are not served at the xmr.to domain but moved to melo.tools
3 years ago
bors[bot] 6208689237
Merge #620
620: Revert "Prepare release 0.8.0" r=thomaseizinger a=da-kami

This reverts commit 50da9580

Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
bors[bot] 238e52228e
Merge #618
618: Don't spam on transaction status change r=da-kami a=thomaseizinger



Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
bors[bot] 00f581dee1
Merge #619
619: Disallow Bitcoin legacy addresses r=da-kami a=thomaseizinger



Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
Daniel Karzel ab24f7bce5
Revert "Prepare release 0.8.0"
This reverts commit 50da9580
3 years ago
bors[bot] b7a832eb7a
Merge #616
616: Don't spam the user while waiting for BTC to be deposited r=thomaseizinger a=thomaseizinger



Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
Thomas Eizinger 2c8bbe4913
Remove left-over "half" of log message
With the move to using tracing's fields, this log message was not
properly updated.
3 years ago
Thomas Eizinger 94f089f4f2
Disallow Bitcoin legacy addresses
These cause problems during fee estimation.
3 years ago
Thomas Eizinger 367d75cab6
Reduce code duplication and make evaluation order determinisitic
The Rust compiler doesn't guarantee in which order field initialization
are executed. By extracting them, we can make sure they run in a certain
order. This will be important as we add more validations that can
fail.
3 years ago
Thomas Eizinger 46ffc34f40
Don't spam on transaction status change 3 years ago
Thomas Eizinger 991dbf496e
Extract `print_status_change` so it is easily testable 3 years ago
Thomas Eizinger 2eb7fab0c3
Make `capture_logs` available for the whole crate 3 years ago
Daniel Karzel 6abf83f4ad
Sort seller list inside of `list_sellers`
By sorting the list inside we have a more deterministic output that makes processing in JSON easier.
3 years ago
Thomas Eizinger cacfc50fb2
Don't spam the user while waiting for BTC 3 years ago
Thomas Eizinger 56a48e71ef
Add failing test that shows spamming of output 3 years ago
Thomas Eizinger 56ea23c2a3
Assert log output for `determine_btc_to_swap` 3 years ago
Thomas Eizinger a347dd8b97
Move helper structs below tests 3 years ago
COMIT Botty McBotface 50da958078 Prepare release 0.8.0 3 years ago
Thomas Eizinger 714514edbc
Provide a commit-specific version output
For builds made directly on the tag, the output of `--version` will
not change. For builds not made on a tagged commit, the output will
look something like this:

```
> swap --version

swap 0.7.0-117-g93161f9
```

Fixes #409.
3 years ago
Thomas Eizinger 5c37fe6733
Make struct-opt docs more consistent
- Remove dots from the of help messages
- Unify wording
3 years ago
Thomas Eizinger 987f8abb9d
Include unreachable nodes in table output
We emit an `info!` log for every peer that we discover but only ever
emitted a `debug!` log if we fail to connect. This leads to a situation
where the user would run `swap list-sellers`, the logs would say
"Discovered XYZ at ABC" but then get a potentially empty table.

To not confuse the user, we include unreachable nodes in the table output.
For example:

```
Connected to rendezvous point, discovering nodes in 'xmr-btc-swap-testnet' namespace ...
Discovered peer 12D3KooWPZ69DRp4wbGB3wJsxxsg1XW1EVZ2evtVwcARCF3a1nrx at /dns4/ac4hgzmsmekwekjbdl77brufqqbylddugzze4tel6qsnlympgmr46iid.onion/tcp/8765
+-------+--------------+--------------+-------------+----------------------------------------------------------------------------------------------------------------------------------------+
| PRICE | MIN_QUANTITY | MAX_QUANTITY | STATUS      | ADDRESS                                                                                                                                |
+============================================================================================================================================================================================+
| ???   | ???          | ???          | Unreachable | /dns4/ac4hgzmsmekwekjbdl77brufqqbylddugzze4tel6qsnlympgmr46iid.onion/tcp/8765/p2p/12D3KooWPZ69DRp4wbGB3wJsxxsg1XW1EVZ2evtVwcARCF3a1nrx |
+-------+--------------+--------------+-------------+----------------------------------------------------------------------------------------------------------------------------------------+
```
3 years ago
Thomas Eizinger 09f395a26b
Don't print level and time for `list-sellers`
This is now consistent with the `buy-xmr` command.
3 years ago
Thomas Eizinger 40eccd089f
Change `--data-dir` for `--data-base-dir` 3 years ago
Thomas Eizinger 3b1789fe07
Make things private if possible 3 years ago
Thomas Eizinger 8f50eb2f34
Utilize tracing's fields more 3 years ago
Thomas Eizinger 9119ce5cc4
Tidy up log messages across the codebase
1. Clearly separate the log messages from any fields that are
captured. The log message itself should be meaningful because it
depends on the underlying formatter, how/if the fields are displayed.
2. Some log messages had very little context, expand that.
3. Wording of errors was inconsistent, hopefully all errors should
now start with `Failed to ...`.
4. Some log messages were duplicated across multiple layers (like opening
the database).
5. Some log messages were split into two where one part is now an `error!`
and the 2nd part is an `info!` on what is happening next.
6. Where appropriate, punctuation has been removed to not interrupt
the reader's flow.
3 years ago
Thomas Eizinger 78480547d5
Don't import tracing's macros
Log statements end up getting changed constantly and having to clean
up imports after that is annoying, for example, if the last `info!`
in a file disappears, you end up with an unused import warning.

Fully qualifying tracing's macros prevents that and also communicates
clearly that we are using tracing and not log.
3 years ago
Thomas Eizinger 1d0d38cd48
Explain why we clear the `bip32_derivation` map 3 years ago
Thomas Eizinger acfd2dd6bb
Store Monero receive address in database and load it on resume 3 years ago
Thomas Eizinger 5463bde4f8
Add a mandatory `--change-address` parameter to `buy-xmr`
Fixes #513.
3 years ago
Thomas Eizinger 683d565679
Make variable naming consistent 3 years ago
Thomas Eizinger 8b59ac26ba
Replace sorting with slice pattern matching
Sorting `psbt.output` by `witness_script` is at times pointless
because it might be set to `None`. To be more robust, we pattern
match against the produced transaction.
3 years ago
Thomas Eizinger 348fca0827
Add isolated test for `list_sellers` function 3 years ago
Thomas Eizinger e642f5c148
Extend `SwarmExt` with ability to listen on TCP localhost
The CLI's transport doesn't support memory addresses and it also shouldn't support those by default. To be able to use it in tests, we extend the `SwarmExt` trait with the ability to listen on local TCP addresses with a random port.
3 years ago
rishflab 93a0692998
Integrate rendezvous protocol into ASB
The rendezvous protocol allows us to register all of our external
addresses. Hence, the first step is to allow the user to configure
external addresses as part of the config. In the future, there might
be an automated way of determining these.

To register with a rendezvous node, the user needs to configure which
one. CoBloX is running a rendezvous node that acts as the default by
every spec-compliant node will do the job just fine. This behaviour
is optional which is why our custom behaviour is wrapped in a `Toggle`.

We also want our node to re-register after half the time of the
registration has passed. To make this simpler and allow for testing in
isolation, we create a custom behaviour that wraps the libp2p rendezvous
behaviour.
3 years ago
Daniel Karzel ff10edd8a4
Add the `list-sellers` command to the CLI
This command uses a rendezvous node to find sellers (i.e. ASBs) and query them for quotes.
Sellers, that can be dialed and queried for a quote will be listed.
3 years ago
Daniel Karzel f45cde84ab
`comfy-table` instead of `prettytable-rs` 3 years ago
Thomas Eizinger b4fafeba6b
Allow large enum variant lint
The docs say one needs to measure the impact of this before taking
action. We didn't measure anything. Let's not take any action.
3 years ago