mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-24 14:15:55 -04:00
fix(monero-sys): sweep_multi argument type switch to non-option
This commit is contained in:
parent
97d7996a64
commit
bb396ad3b5
2 changed files with 8 additions and 6 deletions
|
@ -503,14 +503,16 @@ impl MoneroWallet {
|
||||||
/// Sweep multiple addresses with different ratios
|
/// Sweep multiple addresses with different ratios
|
||||||
/// If the address is `None`, the address will be set to the primary address of the
|
/// If the address is `None`, the address will be set to the primary address of the
|
||||||
/// main wallet.
|
/// main wallet.
|
||||||
pub async fn sweep_multi(&self, addresses: &[impl Into<Option<Address>> + Clone], ratios: &[f64]) -> Result<TxReceipt> {
|
pub async fn sweep_multi(
|
||||||
|
&self,
|
||||||
|
addresses: &[Address],
|
||||||
|
ratios: &[f64],
|
||||||
|
) -> Result<TxReceipt> {
|
||||||
tracing::info!("`{}` sweeping multi ({:?})", self.name, ratios);
|
tracing::info!("`{}` sweeping multi ({:?})", self.name, ratios);
|
||||||
self.balance().await?;
|
self.balance().await?;
|
||||||
|
|
||||||
let addresses: Vec<Option<Address>> = addresses.iter().map(|a| a.clone().into()).collect();
|
|
||||||
|
|
||||||
self.wallet
|
self.wallet
|
||||||
.sweep_multi(&addresses, ratios)
|
.sweep_multi(addresses, ratios)
|
||||||
.await
|
.await
|
||||||
.context("Failed to perform sweep")?
|
.context("Failed to perform sweep")?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|
|
@ -440,11 +440,11 @@ impl WalletHandle {
|
||||||
/// wallet
|
/// wallet
|
||||||
pub async fn sweep_multi(
|
pub async fn sweep_multi(
|
||||||
&self,
|
&self,
|
||||||
addresses: &[Option<monero::Address>],
|
addresses: &[monero::Address],
|
||||||
percentages: &[f64],
|
percentages: &[f64],
|
||||||
) -> anyhow::Result<Vec<TxReceipt>> {
|
) -> anyhow::Result<Vec<TxReceipt>> {
|
||||||
tracing::debug!(addresses=?addresses, percentages=?percentages, "Sweeping multi");
|
tracing::debug!(addresses=?addresses, percentages=?percentages, "Sweeping multi");
|
||||||
|
|
||||||
let percentages = percentages.to_vec();
|
let percentages = percentages.to_vec();
|
||||||
let addresses = addresses.to_vec();
|
let addresses = addresses.to_vec();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue