Fix cargo audit RUSTSEC-2024-0336 (#5612)

* replace unmaintained rust_yaml with serde_yml

* update warp
This commit is contained in:
João Oliveira
2024-04-22 14:01:06 +01:00
committed by GitHub
parent 5a9e973f04
commit 9b5895ca89
4 changed files with 826 additions and 401 deletions

1209
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -174,7 +174,7 @@ tree_hash = "0.5"
tree_hash_derive = "0.5"
url = "2"
uuid = { version = "0.8", features = ["serde", "v4"] }
warp = { version = "0.3.6", default-features = false, features = ["tls"] }
warp = { version = "0.3.7", default-features = false, features = ["tls"] }
zeroize = { version = "1", features = ["zeroize_derive"] }
zip = "0.6"
@@ -182,7 +182,7 @@ zip = "0.6"
account_utils = { path = "common/account_utils" }
beacon_chain = { path = "beacon_node/beacon_chain" }
beacon_node = { path = "beacon_node" }
beacon_processor = { path = "beacon_node/beacon_processor" }
beacon_processor = { path = "beacon_node/beacon_processor" }
bls = { path = "crypto/bls" }
cached_tree_hash = { path = "consensus/cached_tree_hash" }
clap_utils = { path = "common/clap_utils" }
@@ -219,7 +219,7 @@ network = { path = "beacon_node/network" }
operation_pool = { path = "beacon_node/operation_pool" }
pretty_reqwest_error = { path = "common/pretty_reqwest_error" }
proto_array = { path = "consensus/proto_array" }
safe_arith = {path = "consensus/safe_arith"}
safe_arith = { path = "consensus/safe_arith" }
sensitive_url = { path = "common/sensitive_url" }
slasher = { path = "slasher" }
slashing_protection = { path = "validator_client/slashing_protection" }

View File

@@ -8,5 +8,5 @@ edition = { workspace = true }
bytes = { workspace = true }
[dev-dependencies]
yaml-rust = "0.4.4"
hex = { workspace = true }
serde_yml = "0.0.4"

View File

@@ -78,8 +78,7 @@ pub fn int_to_bytes96(int: u64) -> Vec<u8> {
#[cfg(test)]
mod tests {
use super::*;
use std::{fs::File, io::prelude::*, path::PathBuf};
use yaml_rust::yaml;
use std::{collections::HashMap, fs::File, io::prelude::*, path::PathBuf};
#[test]
fn fixed_bytes32() {
@@ -111,14 +110,13 @@ mod tests {
file.read_to_string(&mut yaml_str).unwrap();
let docs = yaml::YamlLoader::load_from_str(&yaml_str).unwrap();
let doc = &docs[0];
let test_cases = doc["test_cases"].as_vec().unwrap();
let docs: HashMap<String, serde_yml::Value> = serde_yml::from_str(&yaml_str).unwrap();
let test_cases = docs["test_cases"].as_sequence().unwrap();
for test_case in test_cases {
let byte_length = test_case["byte_length"].as_i64().unwrap() as u64;
let int = test_case["int"].as_i64().unwrap() as u64;
let bytes_string = test_case["bytes"].clone().into_string().unwrap();
let bytes_string = test_case["bytes"].as_str().unwrap();
let bytes = hex::decode(bytes_string.replace("0x", "")).unwrap();
match byte_length {