From 1e05d9ffce0d7b9db6088cd499cff96811ff225f Mon Sep 17 00:00:00 2001 From: HDauven Date: Sun, 18 Feb 2024 18:45:23 +0100 Subject: [PATCH 1/3] Update nightly and requestty --- Cargo.toml | 2 +- rust-toolchain.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7521a4e..60a72cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ hex = "0.4" tiny-bip39 = "0.8" crossterm = "0.23" rand_core = "0.6" -requestty = "0.4.1" +requestty = "0.5.0" futures = "0.3" base64 = "0.13" crypto = "0.3" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 97f334f..be2ddb9 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2023-05-22" +channel = "nightly-2024-02-18" components = ["rustfmt", "cargo", "clippy"] \ No newline at end of file From 07d3e96df4ecb2eb0d309c1de31374a15ea15c5f Mon Sep 17 00:00:00 2001 From: HDauven Date: Sun, 18 Feb 2024 18:55:41 +0100 Subject: [PATCH 2/3] Fix clippy warnings --- src/bin/command/history.rs | 3 +-- src/bin/interactive.rs | 2 +- src/bin/main.rs | 9 +++------ src/crypto.rs | 2 +- src/currency.rs | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/bin/command/history.rs b/src/bin/command/history.rs index 9f1ce8b..60103e3 100644 --- a/src/bin/command/history.rs +++ b/src/bin/command/history.rs @@ -68,8 +68,7 @@ pub(crate) async fn transaction_from_notes( ) -> anyhow::Result> { notes.sort_by(|a, b| a.note.pos().cmp(b.note.pos())); let mut ret: Vec = vec![]; - let gql = - GraphQL::new(&settings.state.to_string(), io::status::interactive); + let gql = GraphQL::new(settings.state.to_string(), io::status::interactive); let nullifiers = notes .iter() diff --git a/src/bin/interactive.rs b/src/bin/interactive.rs index 2d706b1..b7d2995 100644 --- a/src/bin/interactive.rs +++ b/src/bin/interactive.rs @@ -330,7 +330,7 @@ pub(crate) fn load_wallet( }) { Ok(wallet) => break wallet, Err(_) if attempt > 2 => { - return Err(Error::AttemptsExhausted)?; + Err(Error::AttemptsExhausted)?; } Err(_) => { println!("Invalid password, please try again"); diff --git a/src/bin/main.rs b/src/bin/main.rs index 44c6a7f..ba0f21e 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -160,12 +160,9 @@ async fn exec() -> anyhow::Result<()> { let password = &settings.password; - match cmd { - Some(ref cmd) if cmd == &Command::Settings => { - println!("{}", &settings); - return Ok(()); - } - _ => {} + if let Some(Command::Settings) = cmd { + println!("{}", &settings); + return Ok(()); }; let file_version = dat::read_file_version(&wallet_path); diff --git a/src/crypto.rs b/src/crypto.rs index a4feca4..6547f95 100644 --- a/src/crypto.rs +++ b/src/crypto.rs @@ -23,7 +23,7 @@ pub(crate) fn encrypt(plaintext: &[u8], pwd: &[u8]) -> Result, Error> { let cipher = Aes256Cbc::new_from_slices(pwd, &iv)?; let enc = cipher.encrypt_vec(plaintext); - let ciphertext = iv.into_iter().chain(enc.into_iter()).collect(); + let ciphertext = iv.into_iter().chain(enc).collect(); Ok(ciphertext) } diff --git a/src/currency.rs b/src/currency.rs index 6b2480c..8222045 100644 --- a/src/currency.rs +++ b/src/currency.rs @@ -131,7 +131,7 @@ impl Ord for Dusk { impl PartialOrd for Dusk { fn partial_cmp(&self, other: &Self) -> Option { - self.0.partial_cmp(&other.0) + Some(self.cmp(other)) } } impl PartialOrd for Dusk { From 1778821e044baa157b2c6ffdb318739fc98aa159 Mon Sep 17 00:00:00 2001 From: HDauven Date: Sun, 18 Feb 2024 19:39:35 +0100 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e516ba..8676466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Change `dusk-wallet-core` to `0.24.0-plonk.0.16-rc.2` - Change `DEFAULT_MAX_ADDRESSES` from 255 to 25 +- Update `requestty` from `0.4.1` to `0.5.0` [#231] ## [0.20.1] - 2023-11-22 @@ -471,6 +472,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Implementation of `Store` trait from `wallet-core` - Implementation of `State` and `Prover` traits from `wallet-core` +[#231]: https://github.com/dusk-network/wallet-cli/issues/231 [#226]: https://github.com/dusk-network/wallet-cli/issues/226 [#222]: https://github.com/dusk-network/wallet-cli/issues/222 [#218]: https://github.com/dusk-network/wallet-cli/issues/218