Upgrade toolchain

Needed to use libp2p-async-await
This commit is contained in:
Franck Royer 2021-02-03 16:20:59 +11:00
parent e82383bcf6
commit c316ea5244
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
15 changed files with 31 additions and 43 deletions

View File

@ -1,7 +1,7 @@
edition = "2018"
condense_wildcard_suffixes = true
format_macro_matchers = true
merge_imports = true
imports_granularity = "Crate"
use_field_init_shorthand = true
format_code_in_doc_comments = true
normalize_comments = true

View File

@ -303,14 +303,11 @@ impl IntoIterator for Args {
type IntoIter = ::std::vec::IntoIter<String>;
fn into_iter(self) -> <Self as IntoIterator>::IntoIter {
let mut args = Vec::new();
args.push("/bin/bash".into());
args.push("-c".into());
let cmd = format!("{} ", self.image_args.args());
args.push(cmd);
args.into_iter()
vec![
"/bin/bash".to_string(),
"-c".to_string(),
format!("{} ", self.image_args.args()),
]
.into_iter()
}
}

View File

@ -1 +1 @@
nightly-2020-08-13
nightly-2021-01-31

View File

@ -1,7 +1,7 @@
edition = "2018"
condense_wildcard_suffixes = true
format_macro_matchers = true
merge_imports = true
imports_granularity = "Crate"
use_field_init_shorthand = true
format_code_in_doc_comments = true
normalize_comments = true

View File

@ -157,8 +157,7 @@ impl TransactionBlockHeight for Wallet {
.await
.map_err(|_| backoff::Error::Transient(Error::Io))?;
let block_height =
block_height.ok_or_else(|| backoff::Error::Transient(Error::NotYetMined))?;
let block_height = block_height.ok_or(backoff::Error::Transient(Error::NotYetMined))?;
Result::<_, backoff::Error<Error>>::Ok(block_height)
})

View File

@ -17,7 +17,7 @@ impl Seed {
Ok(Seed(seed::Seed::random()?))
}
pub fn from_file_or_generate(data_dir: &PathBuf) -> Result<Self, Error> {
pub fn from_file_or_generate(data_dir: &Path) -> Result<Self, Error> {
let file_path_buf = data_dir.join("seed.pem");
let file_path = Path::new(&file_path_buf);

View File

@ -247,9 +247,7 @@ async fn run_until_internal(
.await;
match publishded_redeem_tx {
Ok(_) => {
AliceState::BtcRedeemed
}
Ok(_) => AliceState::BtcRedeemed,
Err(e) => {
bail!("Waiting for Bitcoin transaction finality failed with {}! The redeem transaction was published, but it is not ensured that the transaction was included! You're screwed.", e)
}

View File

@ -19,8 +19,10 @@ async fn given_bob_restarts_after_lock_proof_received_resume_swap() {
assert!(matches!(bob_state, BobState::XmrLockProofReceived { .. }));
let bob_swap = ctx.stop_and_resume_bob_from_db(bob_join_handle).await;
assert!(matches!(bob_swap.state, BobState::XmrLockProofReceived
{..}));
assert!(matches!(
bob_swap.state,
BobState::XmrLockProofReceived { .. }
));
let bob_state = bob::run(bob_swap).await.unwrap();

View File

@ -15,8 +15,7 @@ async fn given_alice_restarts_after_xmr_is_locked_refund_swap() {
let bob_handle = tokio::spawn(bob);
let alice_state = alice::run_until(alice_swap, is_xmr_locked).await.unwrap();
assert!(matches!(alice_state,
AliceState::XmrLocked {..}));
assert!(matches!(alice_state, AliceState::XmrLocked { .. }));
// Alice does not act, Bob refunds
let bob_state = bob_handle.await.unwrap();

View File

@ -34,8 +34,7 @@ async fn given_alice_restarts_after_enc_sig_learned_and_bob_already_cancelled_re
// Once bob has finished Alice is restarted and refunds as well
let alice_swap = ctx.stop_and_resume_alice_from_db(alice_join_handle).await;
assert!(
matches!(alice_swap.state, AliceState::EncSigLearned
{..}),
matches!(alice_swap.state, AliceState::EncSigLearned { .. }),
"Alice state is not EncSigLearned: {:?}",
alice_state
);

View File

@ -478,17 +478,11 @@ pub mod alice_run_until {
use swap::protocol::alice::AliceState;
pub fn is_xmr_locked(state: &AliceState) -> bool {
matches!(
state,
AliceState::XmrLocked{..}
)
matches!(state, AliceState::XmrLocked { .. })
}
pub fn is_encsig_learned(state: &AliceState) -> bool {
matches!(
state,
AliceState::EncSigLearned{..}
)
matches!(state, AliceState::EncSigLearned { .. })
}
}