mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-10-12 13:30:58 -04:00
Make sure all error messages start with an uppercase letter
These might potentially be shown to a user, let's make them all consistent.
This commit is contained in:
parent
816e8b9b96
commit
4138039ea0
16 changed files with 49 additions and 39 deletions
|
@ -107,7 +107,7 @@ impl TxRedeem {
|
|||
let sig = sigs
|
||||
.into_iter()
|
||||
.find(|sig| verify_sig(&B, &self.digest(), &sig).is_ok())
|
||||
.context("neither signature on witness stack verifies against B")?;
|
||||
.context("Neither signature on witness stack verifies against B")?;
|
||||
|
||||
Ok(sig)
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ impl TxRefund {
|
|||
let sig = sigs
|
||||
.into_iter()
|
||||
.find(|sig| verify_sig(&B, &self.digest(), &sig).is_ok())
|
||||
.context("neither signature on witness stack verifies against B")?;
|
||||
.context("Neither signature on witness stack verifies against B")?;
|
||||
|
||||
Ok(sig)
|
||||
}
|
||||
|
|
|
@ -74,13 +74,23 @@ impl Wallet {
|
|||
}
|
||||
|
||||
pub async fn balance(&self) -> Result<Amount> {
|
||||
let balance = self.inner.lock().await.get_balance().context("Failed to calculate Bitcoin 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().context("Failed to get new Bitcoin address")?;
|
||||
let address = self
|
||||
.inner
|
||||
.lock()
|
||||
.await
|
||||
.get_new_address()
|
||||
.context("Failed to get new Bitcoin address")?;
|
||||
|
||||
Ok(address)
|
||||
}
|
||||
|
@ -111,7 +121,7 @@ impl Wallet {
|
|||
.lock()
|
||||
.await
|
||||
.sync(noop_progress(), None)
|
||||
.context("failed to sync balance of Bitcoin wallet")?;
|
||||
.context("Failed to sync balance of Bitcoin wallet")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -166,7 +176,7 @@ impl Wallet {
|
|||
.await
|
||||
.broadcast(transaction)
|
||||
.with_context(|| {
|
||||
format!("failed to broadcast Bitcoin {} transaction {}", kind, txid)
|
||||
format!("Failed to broadcast Bitcoin {} transaction {}", kind, txid)
|
||||
})?;
|
||||
|
||||
tracing::info!("Published Bitcoin {} transaction as {}", txid, kind);
|
||||
|
@ -209,7 +219,7 @@ impl Wallet {
|
|||
Result::<_, backoff::Error<Error>>::Ok(tx)
|
||||
})
|
||||
.await
|
||||
.context("transient errors to be retried")?;
|
||||
.context("Transient errors should be retried")?;
|
||||
|
||||
Ok(tx)
|
||||
}
|
||||
|
@ -230,7 +240,7 @@ impl Wallet {
|
|||
Result::<_, backoff::Error<Error>>::Ok(height)
|
||||
})
|
||||
.await
|
||||
.context("transient errors to be retried")?;
|
||||
.context("Transient errors should be retried")?;
|
||||
|
||||
Ok(BlockHeight::new(height))
|
||||
}
|
||||
|
@ -261,7 +271,7 @@ impl Wallet {
|
|||
Result::<_, backoff::Error<Error>>::Ok(block_height)
|
||||
})
|
||||
.await
|
||||
.context("transient errors to be retried")?;
|
||||
.context("Transient errors should be retried")?;
|
||||
|
||||
Ok(BlockHeight::new(height))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue