Skip to content

Commit

Permalink
clean: use dprint
Browse files Browse the repository at this point in the history
  • Loading branch information
Einliterflasche committed Aug 26, 2024
1 parent e3547fb commit a57e3af
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 18 deletions.
105 changes: 103 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# `xmr-btc-swap`

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
- [`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).
- [`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
- [`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).
6 changes: 5 additions & 1 deletion docs/asb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ First use `swap` or `asb` with the `export-bitcoin-wallet` subcommand.
Output example:

```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
Expand Down
9 changes: 6 additions & 3 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ macro_rules! tauri_command {
context: tauri::State<'_, Arc<Context>>,
args: $request_name,
) -> Result<<$request_name as swap::cli::api::request::Request>::Response, String> {
<$request_name as swap::cli::api::request::Request>::request(args, context.inner().clone())
.await
.to_string_result()
<$request_name as swap::cli::api::request::Request>::request(
args,
context.inner().clone(),
)
.await
.to_string_result()
}
};
}
Expand Down
4 changes: 2 additions & 2 deletions swap/src/api/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use tracing::Instrument;
use typeshare::typeshare;
use uuid::Uuid;

/// This trait is implemented by all types of request args that
/// the CLI can handle.
/// This trait is implemented by all types of request args that
/// the CLI can handle.
/// It provides a unified abstraction that can be useful for generics.
#[allow(async_fn_in_trait)]
pub trait Request {
Expand Down
2 changes: 1 addition & 1 deletion swap/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
pub mod api;
mod behaviour;
pub mod cancel_and_refund;
pub mod command;
mod event_loop;
mod list_sellers;
pub mod tracing;
pub mod transport;
pub mod api;

pub use behaviour::{Behaviour, OutEvent};
pub use cancel_and_refund::{cancel, cancel_and_refund, refund};
Expand Down
2 changes: 1 addition & 1 deletion swap/src/cli/api/request.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::tauri_bindings::TauriHandle;
use crate::bitcoin::{CancelTimelock, ExpiredTimelocks, PunishTimelock, TxLock};
use crate::cli::api::tauri_bindings::{TauriEmitter, TauriSwapProgressEvent};
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::libp2p_ext::MultiAddrExt;
use crate::network::quote::{BidQuote, ZeroQuoteReceived};
Expand Down
2 changes: 1 addition & 1 deletion swap/src/cli/command.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::bitcoin::{bitcoin_address, Amount};
use crate::cli::api::request::{
BalanceArgs, BuyXmrArgs, CancelAndRefundArgs, ExportBitcoinWalletArgs, GetConfigArgs,
GetHistoryArgs, ListSellersArgs, MoneroRecoveryArgs, Request, ResumeSwapArgs, StartDaemonArgs,
WithdrawBtcArgs,
};
use crate::cli::api::Context;
use crate::bitcoin::{bitcoin_address, Amount};
use crate::monero;
use crate::monero::monero_address;
use anyhow::Result;
Expand Down
2 changes: 1 addition & 1 deletion swap/src/protocol/bob/swap.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::cli::api::tauri_bindings::{TauriEmitter, TauriHandle, TauriSwapProgressEvent};
use crate::bitcoin::{ExpiredTimelocks, TxCancel, TxRefund};
use crate::cli::api::tauri_bindings::{TauriEmitter, TauriHandle, TauriSwapProgressEvent};
use crate::cli::EventLoopHandle;
use crate::network::cooperative_xmr_redeem_after_punish::Response::{Fullfilled, Rejected};
use crate::network::swap_setup::bob::NewSwap;
Expand Down
2 changes: 1 addition & 1 deletion swap/src/rpc/methods.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::bitcoin::bitcoin_address;
use crate::cli::api::request::{
get_current_swap, get_history, get_raw_states, suspend_current_swap, BalanceArgs, BuyXmrArgs,
CancelAndRefundArgs, GetSwapInfoArgs, ListSellersArgs, MoneroRecoveryArgs, Request,
ResumeSwapArgs, WithdrawBtcArgs,
};
use crate::cli::api::Context;
use crate::bitcoin::bitcoin_address;
use crate::monero::monero_address;
use crate::{bitcoin, monero};
use anyhow::Result;
Expand Down

0 comments on commit a57e3af

Please sign in to comment.