Skip to content

Commit

Permalink
deps: update base64 requirement from 0.20.0 to 0.21.0
Browse files Browse the repository at this point in the history
Pull-Request: #3315.
  • Loading branch information
dependabot[bot] authored Feb 24, 2023
1 parent 19a5549 commit 6383e1e
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 17 deletions.
12 changes: 3 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ring = { version = "0.16.9", features = ["alloc", "std"], default-features = fal

[dev-dependencies]
async-std = { version = "1.6.2", features = ["attributes"] }
base64 = "0.20.0"
base64 = "0.21.0"
criterion = "0.4"
libp2p-mplex = { path = "../muxers/mplex" }
libp2p-noise = { path = "../transports/noise" }
Expand Down
3 changes: 2 additions & 1 deletion core/src/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ impl TryFrom<keys_proto::PublicKey> for PublicKey {
#[cfg(test)]
mod tests {
use super::*;
use base64::prelude::*;
use std::str::FromStr;

#[test]
Expand All @@ -353,7 +354,7 @@ mod tests {
let expected_peer_id =
PeerId::from_str("12D3KooWEChVMMMzV8acJ53mJHrw1pQ27UAGkCxWXLJutbeUMvVu").unwrap();

let encoded = base64::decode(base_64_encoded).unwrap();
let encoded = BASE64_STANDARD.decode(base_64_encoded).unwrap();

let keypair = Keypair::from_protobuf_encoding(&encoded).unwrap();
let peer_id = keypair.public().to_peer_id();
Expand Down
2 changes: 1 addition & 1 deletion misc/keygen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ zeroize = "1"
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.93"
libp2p-core = { version = "0.39.0", path = "../../core" }
base64 = "0.20.0"
base64 = "0.21.0"
3 changes: 2 additions & 1 deletion misc/keygen/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use base64::prelude::*;
use serde::{Deserialize, Serialize};
use std::error::Error;
use std::path::Path;
Expand All @@ -17,7 +18,7 @@ impl Config {
}

pub fn from_key_material(peer_id: PeerId, keypair: &Keypair) -> Result<Self, Box<dyn Error>> {
let priv_key = base64::encode(keypair.to_protobuf_encoding()?);
let priv_key = BASE64_STANDARD.encode(keypair.to_protobuf_encoding()?);
let peer_id = peer_id.to_base58();
Ok(Self {
identity: Identity { peer_id, priv_key },
Expand Down
3 changes: 2 additions & 1 deletion misc/keygen/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use base64::prelude::*;
use std::error::Error;
use std::path::PathBuf;
use std::str::{self, FromStr};
Expand Down Expand Up @@ -54,7 +55,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let config = Zeroizing::new(config::Config::from_file(config.as_ref())?);

let keypair = identity::Keypair::from_protobuf_encoding(&Zeroizing::new(
base64::decode(config.identity.priv_key.as_bytes())?,
BASE64_STANDARD.decode(config.identity.priv_key.as_bytes())?,
))?;

let peer_id = keypair.public().into();
Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ asynchronous-codec = "0.6"
unsigned-varint = { version = "0.7.0", features = ["asynchronous_codec"] }
log = "0.4.11"
sha2 = "0.10.0"
base64 = "0.20.0"
base64 = "0.21.0"
smallvec = "1.6.1"
prost = "0.11"
prost-codec = { version = "0.3", path = "../../misc/prost-codec" }
Expand Down
4 changes: 2 additions & 2 deletions protocols/gossipsub/src/topic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// DEALINGS IN THE SOFTWARE.

use crate::rpc_proto;
use base64::encode;
use base64::prelude::*;
use prometheus_client::encoding::EncodeLabelSet;
use prost::Message;
use sha2::{Digest, Sha256};
Expand Down Expand Up @@ -56,7 +56,7 @@ impl Hasher for Sha256Hash {
topic_descripter
.encode(&mut bytes)
.expect("buffer is large enough");
let hash = encode(Sha256::digest(&bytes).as_slice());
let hash = BASE64_STANDARD.encode(Sha256::digest(&bytes));
TopicHash { hash }
}
}
Expand Down

0 comments on commit 6383e1e

Please sign in to comment.