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]
channel = "1.52"
channel = "1.53"
components = ["clippy"]
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>>,
get_new_address: impl Future<Output = Result<bitcoin::Address>>,
balance: FB,
max_giveable: FMG,
max_giveable_fn: FMG,
sync: FS,
) -> Result<(bitcoin::Amount, bitcoin::Amount)>
where
@ -363,11 +363,9 @@ where
"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
|| current_maximum_giveable < bid_quote.min_quantity
{
if max_giveable == bitcoin::Amount::ZERO || max_giveable < bid_quote.min_quantity {
let deposit_address = get_new_address.await?;
let minimum_amount = bid_quote.min_quantity;
let maximum_amount = bid_quote.max_quantity;
@ -378,7 +376,7 @@ where
info!(
%deposit_address,
%current_maximum_giveable,
%max_giveable,
%minimum_amount,
%maximum_amount,
"Please deposit BTC you want to swap to",
@ -387,19 +385,19 @@ where
loop {
sync().await?;
let new_max_givable = max_giveable().await?;
let new_max_givable = max_giveable_fn().await?;
if new_max_givable != current_maximum_giveable {
current_maximum_giveable = new_max_givable;
if new_max_givable != max_giveable {
max_giveable = new_max_givable;
let new_balance = balance().await?;
tracing::info!(
%new_balance,
%current_maximum_giveable,
%max_giveable,
"Received BTC",
);
if current_maximum_giveable >= bid_quote.min_quantity {
if max_giveable >= bid_quote.min_quantity {
break;
} else {
tracing::info!(
@ -412,10 +410,6 @@ where
tokio::time::sleep(Duration::from_secs(1)).await;
}
current_maximum_giveable
} else {
current_maximum_giveable
};
let balance = balance().await?;

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

Loading…
Cancel
Save