Reorder: Move sweep_all after transfer

This commit is contained in:
Daniel Karzel 2021-03-03 16:34:23 +11:00
parent 5a43b3453e
commit 862c29f1a8

View File

@ -142,18 +142,6 @@ impl Wallet {
self.inner.lock().await.refresh().await
}
pub async fn sweep_all(&self, address: Address) -> Result<Vec<TxHash>> {
let sweep_all = self
.inner
.lock()
.await
.sweep_all(address.to_string().as_str())
.await?;
let tx_hashes = sweep_all.tx_hash_list.into_iter().map(TxHash).collect();
Ok(tx_hashes)
}
pub fn static_tx_fee_estimate(&self) -> Amount {
// Median tx fees on Monero as found here: https://www.monero.how/monero-transaction-fees, 0.000_015 * 2 (to be on the safe side)
Amount::from_monero(0.000_03f64).expect("static fee to be convertible without problems")
@ -251,4 +239,16 @@ impl Wallet {
Ok(())
}
pub async fn sweep_all(&self, address: Address) -> Result<Vec<TxHash>> {
let sweep_all = self
.inner
.lock()
.await
.sweep_all(address.to_string().as_str())
.await?;
let tx_hashes = sweep_all.tx_hash_list.into_iter().map(TxHash).collect();
Ok(tx_hashes)
}
}