diff --git a/xmr-btc/src/alice.rs b/xmr-btc/src/alice.rs index 4a017b65..07ed68e0 100644 --- a/xmr-btc/src/alice.rs +++ b/xmr-btc/src/alice.rs @@ -1,7 +1,3 @@ -use anyhow::{anyhow, Result}; -use ecdsa_fun::adaptor::{Adaptor, EncryptedSignature}; -use rand::{CryptoRng, RngCore}; - use crate::{ bitcoin, bitcoin::{BroadcastSignedTransaction, WatchForRawTransaction}, @@ -9,7 +5,12 @@ use crate::{ monero::{ImportOutput, Transfer}, transport::SendReceive, }; -use ecdsa_fun::nonce::Deterministic; +use anyhow::{anyhow, Result}; +use ecdsa_fun::{ + adaptor::{Adaptor, EncryptedSignature}, + nonce::Deterministic, +}; +use rand::{CryptoRng, RngCore}; use sha2::Sha256; use std::convert::{TryFrom, TryInto}; diff --git a/xmr-btc/src/alice/message.rs b/xmr-btc/src/alice/message.rs index 5901a050..89965f81 100644 --- a/xmr-btc/src/alice/message.rs +++ b/xmr-btc/src/alice/message.rs @@ -1,10 +1,8 @@ use anyhow::Result; -use ecdsa_fun::adaptor::EncryptedSignature; +use ecdsa_fun::{adaptor::EncryptedSignature, Signature}; +use std::convert::TryFrom; use crate::{bitcoin, monero}; -use ecdsa_fun::Signature; - -use std::convert::TryFrom; #[derive(Debug)] pub enum Message { diff --git a/xmr-btc/src/bitcoin.rs b/xmr-btc/src/bitcoin.rs index 1a6dec22..5bad1f9d 100644 --- a/xmr-btc/src/bitcoin.rs +++ b/xmr-btc/src/bitcoin.rs @@ -8,6 +8,7 @@ use bitcoin::{ util::psbt::PartiallySignedTransaction, SigHash, Transaction, }; +pub use bitcoin::{Address, Amount, OutPoint, Txid}; use ecdsa_fun::{ adaptor::Adaptor, fun::{ @@ -17,14 +18,13 @@ use ecdsa_fun::{ nonce::Deterministic, ECDSA, }; +pub use ecdsa_fun::{adaptor::EncryptedSignature, Signature}; use miniscript::{Descriptor, Segwitv0}; use rand::{CryptoRng, RngCore}; use sha2::Sha256; use std::str::FromStr; pub use crate::bitcoin::transactions::{TxCancel, TxLock, TxPunish, TxRedeem, TxRefund}; -pub use bitcoin::{Address, Amount, OutPoint, Txid}; -pub use ecdsa_fun::{adaptor::EncryptedSignature, Signature}; pub const TX_FEE: u64 = 10_000; diff --git a/xmr-btc/src/bob/message.rs b/xmr-btc/src/bob/message.rs index fe767a46..8164dbd6 100644 --- a/xmr-btc/src/bob/message.rs +++ b/xmr-btc/src/bob/message.rs @@ -1,7 +1,6 @@ use crate::{bitcoin, monero}; use anyhow::Result; use ecdsa_fun::{adaptor::EncryptedSignature, Signature}; - use std::convert::TryFrom; #[derive(Debug)] diff --git a/xmr-btc/src/monero.rs b/xmr-btc/src/monero.rs index aefe858d..d4832f1b 100644 --- a/xmr-btc/src/monero.rs +++ b/xmr-btc/src/monero.rs @@ -1,11 +1,9 @@ -use std::ops::Add; - use anyhow::Result; use async_trait::async_trait; -use rand::{CryptoRng, RngCore}; - pub use curve25519_dalek::scalar::Scalar; pub use monero::{Address, PrivateKey, PublicKey}; +use rand::{CryptoRng, RngCore}; +use std::ops::Add; pub fn random_private_key(rng: &mut R) -> PrivateKey { let scalar = Scalar::random(rng); diff --git a/xmr-btc/tests/e2e.rs b/xmr-btc/tests/e2e.rs index da1fb70b..b0174cec 100644 --- a/xmr-btc/tests/e2e.rs +++ b/xmr-btc/tests/e2e.rs @@ -3,10 +3,8 @@ use crate::{ transport::Transport, }; use bitcoin_harness::Bitcoind; - use monero_harness::Monero; use rand::rngs::OsRng; - use testcontainers::clients::Cli; use tokio::sync::{ mpsc, diff --git a/xmr-btc/tests/transport.rs b/xmr-btc/tests/transport.rs index b4be445d..f69b2683 100644 --- a/xmr-btc/tests/transport.rs +++ b/xmr-btc/tests/transport.rs @@ -1,5 +1,4 @@ use anyhow::{anyhow, Result}; - use async_trait::async_trait; use tokio::{ stream::StreamExt,