Upgrade to Rust 1.53

Also fix all clippy lints that came up.
pull/576/head
Thomas Eizinger 3 years ago
parent b7064578ca
commit ac0b0150e6
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96

@ -1,4 +1,4 @@
[toolchain] [toolchain]
channel = "1.52" channel = "1.53"
components = ["clippy"] components = ["clippy"]
targets = ["armv7-unknown-linux-gnueabihf"] targets = ["armv7-unknown-linux-gnueabihf"]

@ -343,7 +343,7 @@ async fn determine_btc_to_swap<FB, TB, FMG, TMG, FS, TS>(
bid_quote: impl Future<Output = Result<BidQuote>>, bid_quote: impl Future<Output = Result<BidQuote>>,
get_new_address: impl Future<Output = Result<bitcoin::Address>>, get_new_address: impl Future<Output = Result<bitcoin::Address>>,
balance: FB, balance: FB,
max_giveable: FMG, max_giveable_fn: FMG,
sync: FS, sync: FS,
) -> Result<(bitcoin::Amount, bitcoin::Amount)> ) -> Result<(bitcoin::Amount, bitcoin::Amount)>
where where
@ -363,11 +363,9 @@ where
"Received quote: 1 XMR ~ ", "Received quote: 1 XMR ~ ",
); );
let mut current_maximum_giveable = max_giveable().await?; let mut max_giveable = max_giveable_fn().await?;
let max_giveable = if current_maximum_giveable == bitcoin::Amount::ZERO if max_giveable == bitcoin::Amount::ZERO || max_giveable < bid_quote.min_quantity {
|| current_maximum_giveable < bid_quote.min_quantity
{
let deposit_address = get_new_address.await?; let deposit_address = get_new_address.await?;
let minimum_amount = bid_quote.min_quantity; let minimum_amount = bid_quote.min_quantity;
let maximum_amount = bid_quote.max_quantity; let maximum_amount = bid_quote.max_quantity;
@ -378,7 +376,7 @@ where
info!( info!(
%deposit_address, %deposit_address,
%current_maximum_giveable, %max_giveable,
%minimum_amount, %minimum_amount,
%maximum_amount, %maximum_amount,
"Please deposit BTC you want to swap to", "Please deposit BTC you want to swap to",
@ -387,19 +385,19 @@ where
loop { loop {
sync().await?; sync().await?;
let new_max_givable = max_giveable().await?; let new_max_givable = max_giveable_fn().await?;
if new_max_givable != current_maximum_giveable { if new_max_givable != max_giveable {
current_maximum_giveable = new_max_givable; max_giveable = new_max_givable;
let new_balance = balance().await?; let new_balance = balance().await?;
tracing::info!( tracing::info!(
%new_balance, %new_balance,
%current_maximum_giveable, %max_giveable,
"Received BTC", "Received BTC",
); );
if current_maximum_giveable >= bid_quote.min_quantity { if max_giveable >= bid_quote.min_quantity {
break; break;
} else { } else {
tracing::info!( tracing::info!(
@ -412,10 +410,6 @@ where
tokio::time::sleep(Duration::from_secs(1)).await; tokio::time::sleep(Duration::from_secs(1)).await;
} }
current_maximum_giveable
} else {
current_maximum_giveable
}; };
let balance = balance().await?; let balance = balance().await?;

@ -157,7 +157,7 @@ impl State0 {
let valid = CROSS_CURVE_PROOF_SYSTEM.verify( let valid = CROSS_CURVE_PROOF_SYSTEM.verify(
&msg.dleq_proof_s_a, &msg.dleq_proof_s_a,
( (
msg.S_a_bitcoin.clone().into(), msg.S_a_bitcoin.into(),
msg.S_a_monero msg.S_a_monero
.point .point
.decompress() .decompress()

Loading…
Cancel
Save