fix: dprint

This commit is contained in:
binarybaron 2024-07-24 22:46:25 +02:00
parent 9ede610958
commit 799fdfc363
No known key found for this signature in database
GPG Key ID: 99B75D3E1476A26E
2 changed files with 12 additions and 7 deletions

View File

@ -81,12 +81,11 @@ where
)
.await?;
let monero_receive_address =
monero_address::validate_is_testnet(monero_receive_address, is_testnet)?;
let bitcoin_change_address = bitcoin_change_address.map(|address| {
bitcoin_address::validate_is_testnet(address, is_testnet)
}).transpose()?;
let bitcoin_change_address = bitcoin_change_address
.map(|address| bitcoin_address::validate_is_testnet(address, is_testnet))
.transpose()?;
let request = Request::new(Method::BuyXmr {
seller,

View File

@ -140,11 +140,17 @@ pub fn register_modules(context: Arc<Context>) -> Result<RpcModule<Arc<Context>>
.map(|addr_str| {
bitcoin::Address::from_str(addr_str)
.map_err(|err| {
jsonrpsee_core::Error::Custom(format!("Could not parse bitcoin address: {}", err))
jsonrpsee_core::Error::Custom(format!(
"Could not parse bitcoin address: {}",
err
))
})
.and_then(|address| {
bitcoin_address::validate(address, context.config.env_config.bitcoin_network)
.map_err(|err| jsonrpsee_core::Error::Custom(err.to_string()))
bitcoin_address::validate(
address,
context.config.env_config.bitcoin_network,
)
.map_err(|err| jsonrpsee_core::Error::Custom(err.to_string()))
})
})
.transpose()?;