Skip to content

Commit

Permalink
build: update crates version
Browse files Browse the repository at this point in the history
bls-signatures
fvm_shared
anyhow
base64
clap
pbkdf2
  • Loading branch information
shuimuliang committed Oct 9, 2023
1 parent 6ed99d3 commit 89c9eb2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"anychain-core",
"anychain-bitcoin",
Expand Down Expand Up @@ -27,15 +28,15 @@ 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 }
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"
Expand All @@ -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" }
Expand Down
14 changes: 10 additions & 4 deletions anychain-filecoin/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -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)
Expand All @@ -442,14 +443,17 @@ 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)?,
),
})
}
}

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.
Expand All @@ -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)
}
Expand All @@ -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)?,
})
}

Expand Down
2 changes: 1 addition & 1 deletion anychain-kms/src/bip39/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub(crate) fn gen_random_bytes(byte_length: usize) -> Vec<u8> {
pub(crate) fn pbkdf2(input: &[u8], salt: &str) -> Vec<u8> {
let mut seed = vec![0u8; PBKDF2_BYTES];

pbkdf2::pbkdf2::<Hmac<sha2::Sha512>>(input, salt.as_bytes(), PBKDF2_ROUNDS, &mut seed);
let _ = pbkdf2::pbkdf2::<Hmac<sha2::Sha512>>(input, salt.as_bytes(), PBKDF2_ROUNDS, &mut seed);

seed
}

0 comments on commit 89c9eb2

Please sign in to comment.