From 89c9eb2f698a0887505c33bb2f559c89e2e616d7 Mon Sep 17 00:00:00 2001 From: shuimuliang Date: Mon, 9 Oct 2023 12:44:20 +0800 Subject: [PATCH] build: update crates version bls-signatures fvm_shared anyhow base64 clap pbkdf2 --- Cargo.toml | 13 +++++++------ anychain-filecoin/src/transaction.rs | 14 ++++++++++---- anychain-kms/src/bip39/crypto.rs | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 975a02b..88e4efc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "anychain-core", "anychain-bitcoin", @@ -27,7 +28,7 @@ blake2b_simd = "1.0.0" bech32 = "0.9.0" hex = "0.4.2" libsecp256k1 = "0.7.1" -bls-signatures = "0.13.0" +bls-signatures = "0.14.0" base58 = { version = "0.2" } rand = { version = "0.8.5" } rand_core = { version = "0.6.3", default-features = false } @@ -35,7 +36,7 @@ rlp = { version = "0.5.2", features = ["derive"] } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } sha2 = { version = "0.10.2", default-features = false } serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] } -fvm_shared = "0.8.0" +fvm_shared = "3.3.1" data-encoding = "2.3.2" data-encoding-macro = "0.1.12" fvm_ipld_encoding = "0.2.2" @@ -44,21 +45,21 @@ num-traits = "0.2.15" lazy_static = "1.4.0" unsigned-varint = "0.7.1" num-bigint = "0.4.3" -anyhow = "1.0.72" +anyhow = "1.0.75" forest_encoding = "0.2.2" cid = "0.8.6" -base64 = "0.13.0" +base64 = "0.21.1" bytes = "1.0" protobuf = { version = "3.3.0" } chrono = "0.4" ethabi = "17.2.0" regex = { version = "1.3" } -clap = "4.3.10" +clap = "4.4.6" primitive-types = { version = "0.11.1", features = ["rlp"] } rustc-hash = "1.1.0" hmac = "0.12.1" bs58 = { version = "0.4", default-features = false, features = ["check"] } -pbkdf2 = { version = "0.11.0", default-features = false } +pbkdf2 = { version = "0.12.1", default-features = false } unicode-normalization = "0.1.22" zeroize = { version = "1.5.5", default-features = false } once_cell = { version = "1.18.0" } diff --git a/anychain-filecoin/src/transaction.rs b/anychain-filecoin/src/transaction.rs index 0e00f40..6178dbb 100644 --- a/anychain-filecoin/src/transaction.rs +++ b/anychain-filecoin/src/transaction.rs @@ -356,6 +356,7 @@ pub mod parameter_json { use super::FilecoinAmount; use super::FilecoinTransactionParameters; use super::RawBytes; + use base64::{engine::general_purpose, Engine as _}; use cid::Cid; use serde::{de, ser, Deserialize, Deserializer, Serialize, Serializer}; @@ -420,7 +421,7 @@ pub mod parameter_json { gas_fee_cap: params.gas_fee_cap.clone(), gas_premium: params.gas_premium.clone(), method_num: params.method_num, - params: Some(base64::encode(params.params.bytes())), + params: Some(general_purpose::STANDARD.encode(params.params.bytes())), cid: Some(params.cid().map_err(ser::Error::custom)?), } .serialize(serializer) @@ -442,7 +443,9 @@ pub mod parameter_json { gas_premium: m.gas_premium, method_num: m.method_num, params: RawBytes::new( - base64::decode(m.params.unwrap_or_default()).map_err(de::Error::custom)?, + general_purpose::STANDARD + .decode(m.params.unwrap_or_default()) + .map_err(de::Error::custom)?, ), }) } @@ -450,6 +453,7 @@ pub mod parameter_json { pub mod signature_json { use super::{FilecoinSignature, FilecoinSignatureType}; + use base64::{engine::general_purpose, Engine as _}; use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; // Wrapper for serializing and deserializing a Signature from JSON. @@ -476,7 +480,7 @@ pub mod signature_json { { JsonHelper { sig_type: sig.sig_type, - bytes: base64::encode(&sig.bytes), + bytes: general_purpose::STANDARD.encode(&sig.bytes), } .serialize(serializer) } @@ -488,7 +492,9 @@ pub mod signature_json { let JsonHelper { sig_type, bytes } = Deserialize::deserialize(deserializer)?; Ok(FilecoinSignature { sig_type, - bytes: base64::decode(bytes).map_err(de::Error::custom)?, + bytes: general_purpose::STANDARD + .decode(bytes) + .map_err(de::Error::custom)?, }) } diff --git a/anychain-kms/src/bip39/crypto.rs b/anychain-kms/src/bip39/crypto.rs index a32fe79..0b0dcd5 100644 --- a/anychain-kms/src/bip39/crypto.rs +++ b/anychain-kms/src/bip39/crypto.rs @@ -37,7 +37,7 @@ pub(crate) fn gen_random_bytes(byte_length: usize) -> Vec { pub(crate) fn pbkdf2(input: &[u8], salt: &str) -> Vec { let mut seed = vec![0u8; PBKDF2_BYTES]; - pbkdf2::pbkdf2::>(input, salt.as_bytes(), PBKDF2_ROUNDS, &mut seed); + let _ = pbkdf2::pbkdf2::>(input, salt.as_bytes(), PBKDF2_ROUNDS, &mut seed); seed }