mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-12-24 23:19:34 -05:00
Add more context to fallible functions inside bitcoin::Wallet
This commit is contained in:
parent
5c24a46298
commit
816e8b9b96
@ -74,12 +74,13 @@ impl Wallet {
|
||||
}
|
||||
|
||||
pub async fn balance(&self) -> Result<Amount> {
|
||||
let balance = self.inner.lock().await.get_balance()?;
|
||||
let balance = self.inner.lock().await.get_balance().context("Failed to calculate Bitcoin balance")?;
|
||||
|
||||
Ok(Amount::from_sat(balance))
|
||||
}
|
||||
|
||||
pub async fn new_address(&self) -> Result<Address> {
|
||||
let address = self.inner.lock().await.get_new_address()?;
|
||||
let address = self.inner.lock().await.get_new_address().context("Failed to get new Bitcoin address")?;
|
||||
|
||||
Ok(address)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user