From 9378100957fe1a2fe53139fcd1fb14caa04782b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 15:30:24 +0000 Subject: [PATCH 1/3] build(deps): bump base64 from 0.13.1 to 0.22.1 Bumps [base64](https://github.com/marshallpierce/rust-base64) from 0.13.1 to 0.22.1. - [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md) - [Commits](https://github.com/marshallpierce/rust-base64/compare/v0.13.1...v0.22.1) --- updated-dependencies: - dependency-name: base64 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 20 +++++++++---------- Cargo.toml | 2 +- .../client-libs/validator-client/Cargo.toml | 2 +- common/commands/Cargo.toml | 2 +- tools/nym-cli/Cargo.toml | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 17814faec5..1070f7b681 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4316,7 +4316,7 @@ name = "nym-cli" version = "1.1.40" dependencies = [ "anyhow", - "base64 0.13.1", + "base64 0.22.1", "bip39", "bs58 0.5.1", "clap 4.5.16", @@ -4341,7 +4341,7 @@ name = "nym-cli-commands" version = "1.0.0" dependencies = [ "anyhow", - "base64 0.13.1", + "base64 0.22.1", "bip39", "bs58 0.5.1", "cfg-if", @@ -4432,7 +4432,7 @@ name = "nym-client-core" version = "1.1.15" dependencies = [ "async-trait", - "base64 0.21.7", + "base64 0.22.1", "bs58 0.5.1", "cfg-if", "clap 4.5.16", @@ -5430,7 +5430,7 @@ version = "0.1.0" dependencies = [ "axum 0.7.5", "axum-extra", - "base64 0.21.7", + "base64 0.22.1", "colored", "dashmap", "fastrand 2.1.1", @@ -5463,7 +5463,7 @@ name = "nym-node-requests" version = "0.1.0" dependencies = [ "async-trait", - "base64 0.21.7", + "base64 0.22.1", "celes", "humantime 2.1.0", "humantime-serde", @@ -5633,7 +5633,7 @@ dependencies = [ name = "nym-serde-helpers" version = "0.1.0" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bs58 0.5.1", "serde", ] @@ -5999,7 +5999,7 @@ dependencies = [ name = "nym-types" version = "1.0.0" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "cosmrs 0.17.0-pre", "cosmwasm-std", "eyre", @@ -6029,7 +6029,7 @@ name = "nym-validator-client" version = "0.1.0" dependencies = [ "async-trait", - "base64 0.13.1", + "base64 0.22.1", "bip32", "bip39", "colored", @@ -6147,7 +6147,7 @@ dependencies = [ name = "nym-wireguard" version = "0.1.0" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bincode", "chrono", "dashmap", @@ -6169,7 +6169,7 @@ dependencies = [ name = "nym-wireguard-types" version = "0.1.0" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "hmac", "log", "nym-config", diff --git a/Cargo.toml b/Cargo.toml index 4e3529fee4..8c21c0ea61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -171,7 +171,7 @@ argon2 = "0.5.0" async-trait = "0.1.81" axum = "0.7.5" axum-extra = "0.9.3" -base64 = "0.21.4" +base64 = "0.22.1" bincode = "1.3.3" bip39 = { version = "2.0.0", features = ["zeroize"] } diff --git a/common/client-libs/validator-client/Cargo.toml b/common/client-libs/validator-client/Cargo.toml index 2bf66895c0..dee9577516 100644 --- a/common/client-libs/validator-client/Cargo.toml +++ b/common/client-libs/validator-client/Cargo.toml @@ -9,7 +9,7 @@ license.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -base64 = "0.13" +base64 = "0.22" colored = { workspace = true } nym-coconut-dkg-common = { path = "../../cosmwasm-smart-contracts/coconut-dkg" } diff --git a/common/commands/Cargo.toml b/common/commands/Cargo.toml index 2045cf0d2a..bab9b86a6e 100644 --- a/common/commands/Cargo.toml +++ b/common/commands/Cargo.toml @@ -7,7 +7,7 @@ license.workspace = true [dependencies] anyhow = { workspace = true } -base64 = "0.13.0" +base64 = "0.22.1" bip39 = { workspace = true } bs58 = { workspace = true } comfy-table = { workspace = true } diff --git a/tools/nym-cli/Cargo.toml b/tools/nym-cli/Cargo.toml index e590e45141..dc8e8990f9 100644 --- a/tools/nym-cli/Cargo.toml +++ b/tools/nym-cli/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license.workspace = true [dependencies] -base64 = "0.13.0" +base64 = "0.22.1" bs58 = { workspace = true } clap = { workspace = true, features = ["derive"] } clap_complete = { workspace = true } From 3635cbdc8d919025d76c5fa057ab744f13971684 Mon Sep 17 00:00:00 2001 From: dynco-nym <173912580+dynco-nym@users.noreply.github.com> Date: Thu, 29 Aug 2024 01:22:51 +0200 Subject: [PATCH 2/3] Replace deprecated code --- .../validator-client/src/nyxd/cosmwasm_client/helpers.rs | 3 ++- common/client-libs/validator-client/src/rpc/reqwest.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/client-libs/validator-client/src/nyxd/cosmwasm_client/helpers.rs b/common/client-libs/validator-client/src/nyxd/cosmwasm_client/helpers.rs index c437125b16..b60b4982cd 100644 --- a/common/client-libs/validator-client/src/nyxd/cosmwasm_client/helpers.rs +++ b/common/client-libs/validator-client/src/nyxd/cosmwasm_client/helpers.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::nyxd::error::NyxdError; +use base64::Engine; use cosmrs::abci::TxMsgData; use cosmrs::cosmwasm::MsgExecuteContractResponse; use cosmrs::proto::cosmos::base::query::v1beta1::{PageRequest, PageResponse}; @@ -16,7 +17,7 @@ pub fn parse_msg_responses(data: Bytes) -> Vec { // it seems that currently, on wasmd 0.43 + tendermint-rs 0.37 + cosmrs 0.17.0-pre // the data is left in undecoded base64 form, but I'd imagine this might change so if the decoding fails, // use the bytes directly instead - let data = if let Ok(decoded) = base64::decode(&data) { + let data = if let Ok(decoded) = base64::prelude::BASE64_STANDARD.decode(&data) { decoded } else { error!("failed to base64-decode the 'data' field of the TxResponse - has the chain been upgraded and introduced some breaking changes?"); diff --git a/common/client-libs/validator-client/src/rpc/reqwest.rs b/common/client-libs/validator-client/src/rpc/reqwest.rs index 973fb63376..e20764d162 100644 --- a/common/client-libs/validator-client/src/rpc/reqwest.rs +++ b/common/client-libs/validator-client/src/rpc/reqwest.rs @@ -3,6 +3,7 @@ use crate::rpc::TendermintRpcClient; use async_trait::async_trait; +use base64::Engine; use cosmrs::tendermint::{block::Height, evidence::Evidence, Hash}; use reqwest::header::HeaderMap; use reqwest::{header, RequestBuilder}; @@ -13,7 +14,6 @@ use tendermint_rpc::{ query::Query, Error, Order, Response, SimpleRequest, }; - use url::Url; // copied macro from tendermint-rpc crate because that's exactly what we have to do here too @@ -206,7 +206,7 @@ pub fn extract_authorization(url: &Url) -> Option { let authority = url.authority(); if let Some((userpass, _)) = authority.split_once('@') { - Some(base64::encode(userpass)) + Some(base64::prelude::BASE64_STANDARD.encode(userpass)) } else { None } From 33b85a3ca188bccb393957b514d098f8ff547b50 Mon Sep 17 00:00:00 2001 From: dynco-nym <173912580+dynco-nym@users.noreply.github.com> Date: Thu, 29 Aug 2024 08:47:08 +0200 Subject: [PATCH 3/3] Fix additional one --- .../mixnet/operators/mixnode/keys/decode_mixnode_key.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/commands/src/validator/mixnet/operators/mixnode/keys/decode_mixnode_key.rs b/common/commands/src/validator/mixnet/operators/mixnode/keys/decode_mixnode_key.rs index 21b026c85e..54d00010af 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/keys/decode_mixnode_key.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/keys/decode_mixnode_key.rs @@ -1,6 +1,7 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 +use base64::Engine; use clap::Parser; #[derive(Debug, Parser)] @@ -10,7 +11,9 @@ pub struct Args { } pub fn decode_mixnode_key(args: Args) { - let b64_decoded = base64::decode(args.key).expect("failed to decode base64 string"); + let b64_decoded = base64::prelude::BASE64_STANDARD + .decode(args.key) + .expect("failed to decode base64 string"); let b58_encoded = bs58::encode(&b64_decoded).into_string(); println!("{b58_encoded}")