clean: use dprint

This commit is contained in:
Einliterflasche 2024-08-26 16:19:11 +02:00
parent e3547fbec2
commit a57e3aff75
No known key found for this signature in database
GPG key ID: 15660BC9C11F9F69
10 changed files with 127 additions and 18 deletions

105
Cargo.lock generated
View file

@ -141,6 +141,12 @@ version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
[[package]]
name = "arrayvec"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
[[package]] [[package]]
name = "arrayvec" name = "arrayvec"
version = "0.7.4" version = "0.7.4"
@ -884,8 +890,10 @@ checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
dependencies = [ dependencies = [
"android-tzdata", "android-tzdata",
"iana-time-zone", "iana-time-zone",
"js-sys",
"num-traits", "num-traits",
"serde", "serde",
"wasm-bindgen",
"windows-targets 0.52.6", "windows-targets 0.52.6",
] ]
@ -2398,6 +2406,12 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46"
[[package]]
name = "hex_fmt"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f"
[[package]] [[package]]
name = "hmac" name = "hmac"
version = "0.11.0" version = "0.11.0"
@ -2931,7 +2945,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arrayvec", "arrayvec 0.7.4",
"async-lock", "async-lock",
"async-trait", "async-trait",
"beef", "beef",
@ -3122,7 +3136,9 @@ dependencies = [
"lazy_static", "lazy_static",
"libp2p-core", "libp2p-core",
"libp2p-dns", "libp2p-dns",
"libp2p-gossipsub",
"libp2p-identify", "libp2p-identify",
"libp2p-kad",
"libp2p-metrics", "libp2p-metrics",
"libp2p-mplex", "libp2p-mplex",
"libp2p-noise", "libp2p-noise",
@ -3167,6 +3183,7 @@ dependencies = [
"rand 0.8.5", "rand 0.8.5",
"ring 0.16.20", "ring 0.16.20",
"rw-stream-sink", "rw-stream-sink",
"serde",
"sha2 0.10.8", "sha2 0.10.8",
"smallvec", "smallvec",
"thiserror", "thiserror",
@ -3188,6 +3205,36 @@ dependencies = [
"trust-dns-resolver", "trust-dns-resolver",
] ]
[[package]]
name = "libp2p-gossipsub"
version = "0.35.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "385ae5f44e84f51e17014c9f1d98464121d3b1b182c167a0b4482d6250c61926"
dependencies = [
"asynchronous-codec",
"base64 0.13.1",
"byteorder",
"bytes",
"fnv",
"futures",
"futures-timer",
"hex_fmt",
"instant",
"libp2p-core",
"libp2p-swarm",
"log",
"open-metrics-client",
"pin-project 1.1.5",
"prost",
"prost-build",
"rand 0.7.3",
"regex",
"serde",
"sha2 0.10.8",
"smallvec",
"unsigned-varint",
]
[[package]] [[package]]
name = "libp2p-identify" name = "libp2p-identify"
version = "0.33.0" version = "0.33.0"
@ -3205,6 +3252,35 @@ dependencies = [
"smallvec", "smallvec",
] ]
[[package]]
name = "libp2p-kad"
version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eeaa28a4c7a8c574874e090c2a731ecc7b81595911fee425b552c799a20abbb"
dependencies = [
"arrayvec 0.5.2",
"asynchronous-codec",
"bytes",
"either",
"fnv",
"futures",
"futures-timer",
"instant",
"libp2p-core",
"libp2p-swarm",
"log",
"prost",
"prost-build",
"rand 0.7.3",
"serde",
"sha2 0.10.8",
"smallvec",
"thiserror",
"uint",
"unsigned-varint",
"void",
]
[[package]] [[package]]
name = "libp2p-metrics" name = "libp2p-metrics"
version = "0.3.0" version = "0.3.0"
@ -3751,6 +3827,7 @@ dependencies = [
"digest 0.9.0", "digest 0.9.0",
"generic-array", "generic-array",
"multihash-derive", "multihash-derive",
"serde",
"sha2 0.9.9", "sha2 0.9.9",
"unsigned-varint", "unsigned-varint",
] ]
@ -5120,7 +5197,7 @@ version = "1.35.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a" checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a"
dependencies = [ dependencies = [
"arrayvec", "arrayvec 0.7.4",
"borsh", "borsh",
"bytes", "bytes",
"num-traits", "num-traits",
@ -6396,6 +6473,7 @@ dependencies = [
"sqlx", "sqlx",
"structopt", "structopt",
"strum", "strum",
"tauri",
"tempfile", "tempfile",
"testcontainers", "testcontainers",
"thiserror", "thiserror",
@ -6413,6 +6491,7 @@ dependencies = [
"tracing-appender", "tracing-appender",
"tracing-futures", "tracing-futures",
"tracing-subscriber 0.3.18", "tracing-subscriber 0.3.18",
"typeshare",
"url", "url",
"uuid", "uuid",
"vergen", "vergen",
@ -7437,6 +7516,28 @@ version = "1.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
[[package]]
name = "typeshare"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04f17399b76c2e743d58eac0635d7686e9c00f48cd4776f00695d9882a7d3187"
dependencies = [
"chrono",
"serde",
"serde_json",
"typeshare-annotation",
]
[[package]]
name = "typeshare-annotation"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a615d6c2764852a2e88a4f16e9ce1ea49bb776b5872956309e170d63a042a34f"
dependencies = [
"quote",
"syn 2.0.69",
]
[[package]] [[package]]
name = "ucd-trie" name = "ucd-trie"
version = "0.1.6" version = "0.1.6"

View file

@ -1,9 +1,10 @@
# `xmr-btc-swap` # `xmr-btc-swap`
This is the monorepo containing the source code for all of our core projects: This is the monorepo containing the source code for all of our core projects:
- [`swap`](swap/README.md) contains the source code for the main swapping binaries, `asb` and `swap`
- [`gui`](src-gui/README.md) contains the new tauri based user interface - [`swap`](swap/README.md) contains the source code for the main swapping binaries, `asb` and `swap`
- [`tauri`](src-tauri/) contains the tauri bindings between binaries and user interface - [`gui`](src-gui/README.md) contains the new tauri based user interface
- and other crates we use in our binaries - [`tauri`](src-tauri/) contains the tauri bindings between binaries and user interface
- and other crates we use in our binaries
If you're just here for the software, head over to the [releases](https://github.com/UnstoppableSwap/xmr-btc-swap/releases/latest) tab and grab the binary for your operating system! If you're just looking for documentation, check out our [docs page](https://docs.unstoppableswap.net/) or our [github docs](docs/README.md). If you're just here for the software, head over to the [releases](https://github.com/UnstoppableSwap/xmr-btc-swap/releases/latest) tab and grab the binary for your operating system! If you're just looking for documentation, check out our [docs page](https://docs.unstoppableswap.net/) or our [github docs](docs/README.md).

View file

@ -172,7 +172,11 @@ First use `swap` or `asb` with the `export-bitcoin-wallet` subcommand.
Output example: Output example:
```json ```json
{"descriptor":"wpkh(tprv8Zgredacted.../84'/1'/0'/0/*)","blockheight":2415616,"label":"asb-testnet"} {
"descriptor": "wpkh(tprv8Zgredacted.../84'/1'/0'/0/*)",
"blockheight": 2415616,
"label": "asb-testnet"
}
``` ```
The wallet can theoretically be directly imported into The wallet can theoretically be directly imported into

View file

@ -44,9 +44,12 @@ macro_rules! tauri_command {
context: tauri::State<'_, Arc<Context>>, context: tauri::State<'_, Arc<Context>>,
args: $request_name, args: $request_name,
) -> Result<<$request_name as swap::cli::api::request::Request>::Response, String> { ) -> Result<<$request_name as swap::cli::api::request::Request>::Response, String> {
<$request_name as swap::cli::api::request::Request>::request(args, context.inner().clone()) <$request_name as swap::cli::api::request::Request>::request(
.await args,
.to_string_result() context.inner().clone(),
)
.await
.to_string_result()
} }
}; };
} }

View file

@ -1,3 +1,4 @@
pub mod api;
mod behaviour; mod behaviour;
pub mod cancel_and_refund; pub mod cancel_and_refund;
pub mod command; pub mod command;
@ -5,7 +6,6 @@ mod event_loop;
mod list_sellers; mod list_sellers;
pub mod tracing; pub mod tracing;
pub mod transport; pub mod transport;
pub mod api;
pub use behaviour::{Behaviour, OutEvent}; pub use behaviour::{Behaviour, OutEvent};
pub use cancel_and_refund::{cancel, cancel_and_refund, refund}; pub use cancel_and_refund::{cancel, cancel_and_refund, refund};

View file

@ -1,7 +1,7 @@
use super::tauri_bindings::TauriHandle; use super::tauri_bindings::TauriHandle;
use crate::bitcoin::{CancelTimelock, ExpiredTimelocks, PunishTimelock, TxLock};
use crate::cli::api::tauri_bindings::{TauriEmitter, TauriSwapProgressEvent}; use crate::cli::api::tauri_bindings::{TauriEmitter, TauriSwapProgressEvent};
use crate::cli::api::Context; use crate::cli::api::Context;
use crate::bitcoin::{CancelTimelock, ExpiredTimelocks, PunishTimelock, TxLock};
use crate::cli::{list_sellers as list_sellers_impl, EventLoop, SellerStatus}; use crate::cli::{list_sellers as list_sellers_impl, EventLoop, SellerStatus};
use crate::libp2p_ext::MultiAddrExt; use crate::libp2p_ext::MultiAddrExt;
use crate::network::quote::{BidQuote, ZeroQuoteReceived}; use crate::network::quote::{BidQuote, ZeroQuoteReceived};

View file

@ -1,10 +1,10 @@
use crate::bitcoin::{bitcoin_address, Amount};
use crate::cli::api::request::{ use crate::cli::api::request::{
BalanceArgs, BuyXmrArgs, CancelAndRefundArgs, ExportBitcoinWalletArgs, GetConfigArgs, BalanceArgs, BuyXmrArgs, CancelAndRefundArgs, ExportBitcoinWalletArgs, GetConfigArgs,
GetHistoryArgs, ListSellersArgs, MoneroRecoveryArgs, Request, ResumeSwapArgs, StartDaemonArgs, GetHistoryArgs, ListSellersArgs, MoneroRecoveryArgs, Request, ResumeSwapArgs, StartDaemonArgs,
WithdrawBtcArgs, WithdrawBtcArgs,
}; };
use crate::cli::api::Context; use crate::cli::api::Context;
use crate::bitcoin::{bitcoin_address, Amount};
use crate::monero; use crate::monero;
use crate::monero::monero_address; use crate::monero::monero_address;
use anyhow::Result; use anyhow::Result;

View file

@ -1,5 +1,5 @@
use crate::cli::api::tauri_bindings::{TauriEmitter, TauriHandle, TauriSwapProgressEvent};
use crate::bitcoin::{ExpiredTimelocks, TxCancel, TxRefund}; use crate::bitcoin::{ExpiredTimelocks, TxCancel, TxRefund};
use crate::cli::api::tauri_bindings::{TauriEmitter, TauriHandle, TauriSwapProgressEvent};
use crate::cli::EventLoopHandle; use crate::cli::EventLoopHandle;
use crate::network::cooperative_xmr_redeem_after_punish::Response::{Fullfilled, Rejected}; use crate::network::cooperative_xmr_redeem_after_punish::Response::{Fullfilled, Rejected};
use crate::network::swap_setup::bob::NewSwap; use crate::network::swap_setup::bob::NewSwap;

View file

@ -1,10 +1,10 @@
use crate::bitcoin::bitcoin_address;
use crate::cli::api::request::{ use crate::cli::api::request::{
get_current_swap, get_history, get_raw_states, suspend_current_swap, BalanceArgs, BuyXmrArgs, get_current_swap, get_history, get_raw_states, suspend_current_swap, BalanceArgs, BuyXmrArgs,
CancelAndRefundArgs, GetSwapInfoArgs, ListSellersArgs, MoneroRecoveryArgs, Request, CancelAndRefundArgs, GetSwapInfoArgs, ListSellersArgs, MoneroRecoveryArgs, Request,
ResumeSwapArgs, WithdrawBtcArgs, ResumeSwapArgs, WithdrawBtcArgs,
}; };
use crate::cli::api::Context; use crate::cli::api::Context;
use crate::bitcoin::bitcoin_address;
use crate::monero::monero_address; use crate::monero::monero_address;
use crate::{bitcoin, monero}; use crate::{bitcoin, monero};
use anyhow::Result; use anyhow::Result;