Update all crates versions

This commit is contained in:
Age Manning
2020-05-06 21:23:50 +10:00
parent 040beb78f4
commit c68e678cac
73 changed files with 550 additions and 1061 deletions

View File

@@ -6,14 +6,14 @@ edition = "2018"
[dependencies]
int_to_bytes = { path = "../utils/int_to_bytes" }
parking_lot = "0.9.0"
parking_lot = "0.10.2"
types = { path = "../types" }
state_processing = { path = "../state_processing" }
eth2_ssz = "0.1.2"
eth2_ssz_derive = "0.1.0"
serde = "1.0.102"
serde_derive = "1.0.102"
serde = "1.0.106"
serde_derive = "1.0.106"
store = { path = "../../beacon_node/store" }
[dev-dependencies]
rand = "0.7.2"
rand = "0.7.3"

View File

@@ -9,11 +9,11 @@ name = "proto_array_fork_choice"
path = "src/bin.rs"
[dependencies]
parking_lot = "0.9.0"
parking_lot = "0.10.2"
types = { path = "../types" }
itertools = "0.8.1"
itertools = "0.9.0"
eth2_ssz = "0.1.2"
eth2_ssz_derive = "0.1.0"
serde = "1.0.102"
serde_derive = "1.0.102"
serde = "1.0.106"
serde_derive = "1.0.106"
serde_yaml = "0.8.11"

View File

@@ -9,10 +9,10 @@ name = "benches"
harness = false
[dev-dependencies]
criterion = "0.3.0"
criterion = "0.3.2"
env_logger = "0.7.1"
serde = "1.0.102"
serde_derive = "1.0.102"
serde = "1.0.106"
serde_derive = "1.0.106"
lazy_static = "1.4.0"
serde_yaml = "0.8.11"
beacon_chain = { path = "../../beacon_node/beacon_chain" }
@@ -21,20 +21,20 @@ store = { path = "../../beacon_node/store" }
[dependencies]
bls = { path = "../utils/bls" }
integer-sqrt = "0.1.2"
itertools = "0.8.1"
integer-sqrt = "0.1.3"
itertools = "0.9.0"
eth2_ssz = "0.1.2"
eth2_ssz_types = { path = "../utils/ssz_types" }
merkle_proof = { path = "../utils/merkle_proof" }
log = "0.4.8"
safe_arith = { path = "../utils/safe_arith" }
tree_hash = "0.1.0"
tree_hash_derive = "0.2"
tree_hash_derive = "0.2.0"
types = { path = "../types" }
rayon = "1.2.0"
eth2_hashing = { path = "../utils/eth2_hashing" }
rayon = "1.3.0"
eth2_hashing = "0.1.0"
int_to_bytes = { path = "../utils/int_to_bytes" }
arbitrary = { version = "0.4.3", features = ["derive"], optional = true }
arbitrary = { version = "0.4.4", features = ["derive"], optional = true }
[features]
fake_crypto = ["bls/fake_crypto"]

View File

@@ -13,19 +13,19 @@ bls = { path = "../utils/bls" }
compare_fields = { path = "../utils/compare_fields" }
compare_fields_derive = { path = "../utils/compare_fields_derive" }
dirs = "2.0.2"
derivative = "1.0.3"
derivative = "2.1.1"
eth2_interop_keypairs = { path = "../utils/eth2_interop_keypairs" }
ethereum-types = "0.9.1"
eth2_hashing = "0.1.0"
hex = "0.3"
hex = "0.4.2"
int_to_bytes = { path = "../utils/int_to_bytes" }
log = "0.4.8"
merkle_proof = { path = "../utils/merkle_proof" }
rayon = "1.2.0"
rand = "0.7.2"
rayon = "1.3.0"
rand = "0.7.3"
safe_arith = { path = "../utils/safe_arith" }
serde = "1.0.102"
serde_derive = "1.0.102"
serde = "1.0.106"
serde_derive = "1.0.106"
slog = "2.5.2"
eth2_ssz = "0.1.2"
eth2_ssz_derive = "0.1.0"
@@ -33,17 +33,17 @@ eth2_ssz_types = { path = "../utils/ssz_types" }
swap_or_not_shuffle = { path = "../utils/swap_or_not_shuffle" }
test_random_derive = { path = "../utils/test_random_derive" }
tree_hash = "0.1.0"
tree_hash_derive = "0.2"
tree_hash_derive = "0.2.0"
rand_xorshift = "0.2.0"
cached_tree_hash = { path = "../utils/cached_tree_hash" }
serde_yaml = "0.8.11"
tempfile = "3.1.0"
arbitrary = { version = "0.4", features = ["derive"], optional = true }
arbitrary = { version = "0.4.4", features = ["derive"], optional = true }
[dev-dependencies]
env_logger = "0.7.1"
serde_json = "1.0.41"
criterion = "0.3.0"
serde_json = "1.0.52"
criterion = "0.3.2"
[features]
arbitrary-fuzz = [

View File

@@ -7,15 +7,15 @@ edition = "2018"
[dependencies]
milagro_bls = { git = "https://github.com/sigp/milagro_bls", tag = "v1.0.1" }
eth2_hashing = "0.1.0"
hex = "0.3"
rand = "0.7.2"
serde = "1.0.102"
serde_derive = "1.0.102"
hex = "0.4.2"
rand = "0.7.3"
serde = "1.0.106"
serde_derive = "1.0.106"
serde_hex = { path = "../serde_hex" }
eth2_ssz = "0.1.2"
eth2_ssz_types = { path = "../ssz_types" }
tree_hash = "0.1.0"
arbitrary = { version = "0.4", features = ["derive"], optional = true }
arbitrary = { version = "0.4.4", features = ["derive"], optional = true }
[features]
fake_crypto = []

View File

@@ -5,17 +5,17 @@ authors = ["Michael Sproul <michael@sigmaprime.io>"]
edition = "2018"
[dependencies]
ethereum-types = "0.9"
ethereum-types = "0.9.1"
eth2_ssz_types = { path = "../ssz_types" }
eth2_hashing = "0.1"
eth2_hashing = "0.1.0"
eth2_ssz_derive = "0.1.0"
eth2_ssz = "0.1.2"
tree_hash = "0.1"
smallvec = "1.2.0"
tree_hash = "0.1.0"
smallvec = "1.4.0"
[dev-dependencies]
quickcheck = "0.9"
quickcheck_macros = "0.8"
quickcheck = "0.9.2"
quickcheck_macros = "0.9.1"
[features]
arbitrary = ["ethereum-types/arbitrary"]

View File

@@ -8,8 +8,8 @@ edition = "2018"
[dependencies]
clap = "2.33.0"
hex = "0.3"
dirs = "2.0"
hex = "0.4.2"
dirs = "2.0.2"
types = { path = "../../types" }
eth2_testnet_config = { path = "../eth2_testnet_config" }
eth2_ssz = { path = "../ssz" }
eth2_ssz = "0.1.2"

View File

@@ -8,5 +8,5 @@ edition = "2018"
proc-macro = true
[dependencies]
syn = "0.15"
quote = "0.6"
syn = "1.0.18"
quote = "1.0.4"

View File

@@ -8,7 +8,7 @@ use syn::{parse_macro_input, DeriveInput};
fn is_slice(field: &syn::Field) -> bool {
field.attrs.iter().any(|attr| {
attr.path.is_ident("compare_fields")
&& attr.tts.to_string().replace(" ", "") == "(as_slice)"
&& attr.tokens.to_string().replace(" ", "") == "(as_slice)"
})
}

View File

@@ -7,11 +7,11 @@ edition = "2018"
build = "build.rs"
[build-dependencies]
reqwest = "0.9.20"
serde_json = "1.0"
reqwest = { version = "0.10.4", features = ["blocking", "json"] }
serde_json = "1.0.52"
[dependencies]
types = { path = "../../types"}
eth2_ssz = { path = "../ssz"}
tree_hash = { path = "../tree_hash"}
ethabi = "12.0"
eth2_ssz = "0.1.2"
tree_hash = "0.1.0"
ethabi = "12.0.0"

View File

@@ -56,8 +56,8 @@ pub fn download_deposit_contract(
if abi_file.exists() {
// Nothing to do.
} else {
match reqwest::get(url) {
Ok(mut response) => {
match reqwest::blocking::get(url) {
Ok(response) => {
let mut abi_file = File::create(abi_file)
.map_err(|e| format!("Failed to create local abi file: {:?}", e))?;
let mut bytecode_file = File::create(bytecode_file)

View File

@@ -5,7 +5,7 @@ authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies]
serde = "1.0.102"
serde_derive = "1.0.102"
toml = "0.5.4"
serde = "1.0.106"
serde_derive = "1.0.106"
toml = "0.5.6"
types = { path = "../../types" }

View File

@@ -13,13 +13,13 @@ lazy_static = { version = "1.4.0", optional = true }
ring = "0.16.9"
[target.'cfg(target_arch = "wasm32")'.dependencies]
sha2 = "0.8.0"
sha2 = "0.8.1"
[dev-dependencies]
rustc-hex = "2.0.1"
rustc-hex = "2.1.0"
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.3.2"
wasm-bindgen-test = "0.3.12"
[features]
default = ["zero_hash_cache"]

View File

@@ -8,13 +8,13 @@ edition = "2018"
[dependencies]
lazy_static = "1.4.0"
num-bigint = "0.2.3"
num-bigint = "0.2.6"
eth2_hashing = "0.1.0"
hex = "0.3"
hex = "0.4.2"
milagro_bls = { git = "https://github.com/sigp/milagro_bls", tag = "v1.0.1" }
serde_yaml = "0.8.11"
serde = "1.0.102"
serde_derive = "1.0.102"
serde = "1.0.106"
serde_derive = "1.0.106"
[dev-dependencies]
base64 = "0.11.0"
base64 = "0.12.0"

View File

@@ -7,15 +7,14 @@ edition = "2018"
build = "build.rs"
[build-dependencies]
reqwest = "0.9.20"
reqwest = { version = "0.10.4", features = ["blocking"] }
[dev-dependencies]
tempdir = "0.3"
reqwest = "0.9.20"
tempdir = "0.3.7"
[dependencies]
serde = "1.0"
serde_yaml = "0.8"
serde = "1.0.106"
serde_yaml = "0.8.11"
types = { path = "../../types"}
eth2-libp2p = { path = "../../../beacon_node/eth2-libp2p"}
eth2_ssz = { path = "../ssz"}
eth2_ssz = "0.1.2"

View File

@@ -45,11 +45,9 @@ pub fn get_file(filename: &str) -> Result<(), String> {
let mut file =
File::create(path).map_err(|e| format!("Failed to create {}: {:?}", filename, e))?;
let mut response =
reqwest::get(&url).map_err(|e| format!("Failed to download {}: {}", filename, e))?;
let mut contents: Vec<u8> = vec![];
response
.copy_to(&mut contents)
let contents = reqwest::blocking::get(&url)
.map_err(|e| format!("Failed to download {}: {}", filename, e))?
.bytes()
.map_err(|e| format!("Failed to read {} response bytes: {}", filename, e))?;
file.write(&contents)

View File

@@ -1,164 +0,0 @@
//! A simple hashmap object coupled with a `delay_queue` which has entries that expire after a
//! fixed time.
//!
//! A `HashMapDelay` implements `Stream` which removes expired items from the map.
/// The default delay for entries, in seconds. This is only used when `insert()` is used to add
/// entries.
const DEFAULT_DELAY: u64 = 30;
use futures::prelude::*;
use std::{
collections::HashMap,
pin::Pin,
task::{Context, Poll},
time::Duration,
};
use tokio::time::delay_queue::{self, DelayQueue};
pub struct HashMapDelay<K, V>
where
K: std::cmp::Eq + std::hash::Hash + std::clone::Clone + Unpin,
{
/// The given entries.
entries: HashMap<K, MapEntry<V>>,
/// A queue holding the timeouts of each entry.
expirations: DelayQueue<K>,
/// The default expiration timeout of an entry.
default_entry_timeout: Duration,
}
/// A wrapping around entries that adds the link to the entry's expiration, via a `delay_queue` key.
struct MapEntry<V> {
/// The expiration key for the entry.
key: delay_queue::Key,
/// The actual entry.
value: V,
}
impl<K, V> Default for HashMapDelay<K, V>
where
K: std::cmp::Eq + std::hash::Hash + std::clone::Clone + Unpin,
{
fn default() -> Self {
HashMapDelay::new(Duration::from_secs(DEFAULT_DELAY))
}
}
impl<K, V> HashMapDelay<K, V>
where
K: std::cmp::Eq + std::hash::Hash + std::clone::Clone + Unpin,
{
/// Creates a new instance of `HashMapDelay`.
pub fn new(default_entry_timeout: Duration) -> Self {
HashMapDelay {
entries: HashMap::new(),
expirations: DelayQueue::new(),
default_entry_timeout,
}
}
/// Insert an entry into the mapping. Entries will expire after the `default_entry_timeout`.
pub fn insert(&mut self, key: K, value: V) {
self.insert_at(key, value, self.default_entry_timeout);
}
/// Inserts an entry that will expire at a given instant.
pub fn insert_at(&mut self, key: K, value: V, entry_duration: Duration) {
let delay_key = self.expirations.insert(key.clone(), entry_duration);
let entry = MapEntry {
key: delay_key,
value,
};
self.entries.insert(key, entry);
}
/// Gets a reference to an entry if it exists.
///
/// Returns None if the entry does not exist.
pub fn get(&self, key: &K) -> Option<&V> {
self.entries.get(key).map(|entry| &entry.value)
}
/// Gets a mutable reference to an entry if it exists.
///
/// Returns None if the entry does not exist.
pub fn get_mut(&mut self, key: &K) -> Option<&mut V> {
self.entries.get_mut(key).map(|entry| &mut entry.value)
}
/// Returns true if the key exists, false otherwise.
pub fn contains_key(&self, key: &K) -> bool {
self.entries.contains_key(key)
}
/// Returns the length of the mapping.
pub fn len(&self) -> usize {
self.entries.len()
}
/// Updates the timeout for a given key. Returns true if the key existed, false otherwise.
///
/// Panics if the duration is too far in the future.
pub fn update_timeout(&mut self, key: &K, timeout: Duration) -> bool {
if let Some(entry) = self.entries.get(key) {
self.expirations.reset(&entry.key, timeout);
true
} else {
false
}
}
/// Removes a key from the map returning the value associated with the key that was in the map.
///
/// Return None if the key was not in the map.
pub fn remove(&mut self, key: &K) -> Option<V> {
if let Some(entry) = self.entries.remove(key) {
self.expirations.remove(&entry.key);
return Some(entry.value);
}
return None;
}
/// Retains only the elements specified by the predicate.
///
/// In other words, remove all pairs `(k, v)` such that `f(&k,&mut v)` returns false.
pub fn retain<F: FnMut(&K, &mut V) -> bool>(&mut self, mut f: F) {
let expiration = &mut self.expirations;
self.entries.retain(|key, entry| {
let result = f(key, &mut entry.value);
if !result {
expiration.remove(&entry.key);
}
result
})
}
/// Removes all entries from the map.
pub fn clear(&mut self) {
self.entries.clear();
self.expirations.clear();
}
}
impl<K, V> Stream for HashMapDelay<K, V>
where
K: std::cmp::Eq + std::hash::Hash + std::clone::Clone + Unpin,
V: Unpin,
{
type Item = Result<(K, V), String>;
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
match self.expirations.poll_expired(cx) {
Poll::Ready(Some(Ok(key))) => match self.entries.remove(key.get_ref()) {
Some(entry) => Poll::Ready(Some(Ok((key.into_inner(), entry.value)))),
None => Poll::Ready(Some(Err("Value no longer exists in expirations".into()))),
},
Poll::Ready(Some(Err(e))) => {
Poll::Ready(Some(Err(format!("delay queue error: {:?}", e))))
}
Poll::Ready(None) => Poll::Ready(None),
Poll::Pending => Poll::Pending,
}
}
}

View File

@@ -1,21 +0,0 @@
//! This crate provides two objects:
//! - `HashMapDelay`
//! - `HashSetDelay`
//!
//! # HashMapDelay
//!
//! This provides a `HashMap` coupled with a `DelayQueue`. Objects that are inserted into
//! the map are inserted with an expiry. `Stream` is implemented on the `HashMapDelay`
//! which return objects that have expired. These objects are removed from the mapping.
//!
//! # HashSetDelay
//!
//! This is similar to a `HashMapDelay` except the mapping maps to the expiry time. This
//! allows users to add objects and check their expiry deadlines before the `Stream`
//! consumes them.
mod hashmap_delay;
mod hashset_delay;
pub use crate::hashmap_delay::HashMapDelay;
pub use crate::hashset_delay::HashSetDelay;

View File

@@ -1,12 +1,12 @@
[package]
name = "hashmap_delay"
name = "hashset_delay"
version = "0.2.0"
authors = ["Age Manning <Age@AgeManning.com>"]
edition = "2018"
[dependencies]
futures = "0.3.4"
tokio = { version = "0.2.19", features = ["time"] }
tokio = { version = "0.2.20", features = ["time"] }
[dev-dependencies]
tokio = { version = "0.2.19", features = ["time", "rt-threaded", "macros"] }
tokio = { version = "0.2.20", features = ["time", "rt-threaded", "macros"] }

View File

@@ -0,0 +1,12 @@
//! This crate provides a single type (its counter-part HashMapDelay has been removed as it
//! currently is not in use in lighthouse):
//! - `HashSetDelay`
//!
//! # HashSetDelay
//!
//! This is similar to a `HashMapDelay` except the mapping maps to the expiry time. This
//! allows users to add objects and check their expiry deadlines before the `Stream`
//! consumes them.
mod hashset_delay;
pub use crate::hashset_delay::HashSetDelay;

View File

@@ -5,8 +5,8 @@ authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies]
bytes = "0.4.12"
bytes = "0.5.4"
[dev-dependencies]
yaml-rust = "0.4.3"
hex = "0.3"
hex = "0.4.2"

View File

@@ -8,4 +8,4 @@ edition = "2018"
[dependencies]
lazy_static = "1.4.0"
prometheus = "0.7.0"
prometheus = "0.8.0"

View File

@@ -6,6 +6,6 @@ edition = "2018"
[dependencies]
slog = "2.5.2"
slog-term = "2.4.2"
slog-term = "2.5.0"
lighthouse_metrics = { path = "../lighthouse_metrics" }
lazy_static = "1.4.0"

View File

@@ -5,14 +5,14 @@ authors = ["Michael Sproul <michael@sigmaprime.io>"]
edition = "2018"
[dependencies]
ethereum-types = "0.9"
ethereum-types = "0.9.1"
eth2_hashing = "0.1.0"
lazy_static = "1.4.0"
safe_arith = { path = "../safe_arith" }
[dev-dependencies]
quickcheck = "0.9.0"
quickcheck_macros = "0.8.0"
quickcheck = "0.9.2"
quickcheck_macros = "0.9.1"
[features]
arbitrary = ["ethereum-types/arbitrary"]

View File

@@ -7,15 +7,15 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
reqwest = { version = "0.10", features = ["json"] }
url = "1.2"
serde = "1.0"
reqwest = { version = "0.10.4", features = ["json"] }
url = "2.1.1"
serde = "1.0.106"
futures = "0.3.4"
types = { path = "../../../eth2/types" }
rest_types = { path = "../rest_types" }
hex = "0.3"
eth2_ssz = { path = "../../../eth2/utils/ssz" }
serde_json = "^1.0"
hex = "0.4.2"
eth2_ssz = "0.1.2"
serde_json = "1.0.52"
eth2_config = { path = "../../../eth2/utils/eth2_config" }
proto_array_fork_choice = { path = "../../../eth2/proto_array_fork_choice" }
operation_pool = { path = "../../../eth2/operation_pool" }

View File

@@ -6,11 +6,11 @@ edition = "2018"
[dependencies]
types = { path = "../../types" }
eth2_ssz_derive = { path = "../ssz_derive" }
eth2_ssz = { path = "../ssz" }
eth2_hashing = { path = "../eth2_hashing" }
tree_hash = { path = "../tree_hash" }
eth2_ssz_derive = "0.1.0"
eth2_ssz = "0.1.2"
eth2_hashing = "0.1.0"
tree_hash = "0.1.0"
state_processing = { path = "../../state_processing" }
bls = { path = "../bls" }
serde = { version = "1.0.102", features = ["derive"] }
serde = { version = "1.0.106", features = ["derive"] }
rayon = "1.3.0"

View File

@@ -5,5 +5,5 @@ authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies]
serde = "1.0.102"
hex = "0.3"
serde = "1.0.106"
hex = "0.4.2"

View File

@@ -1,17 +1,10 @@
use hex::ToHex;
use serde::de::{self, Visitor};
use std::fmt;
pub fn encode<T: AsRef<[u8]>>(data: T) -> String {
let mut hex = String::with_capacity(data.as_ref().len() * 2);
// Writing to a string never errors, so we can unwrap here.
data.write_hex(&mut hex).unwrap();
let hex = hex::encode(data);
let mut s = "0x".to_string();
s.push_str(hex.as_str());
s
}

View File

@@ -8,4 +8,4 @@ edition = "2018"
types = { path = "../../types" }
lazy_static = "1.4.0"
lighthouse_metrics = { path = "../lighthouse_metrics" }
parking_lot = "0.9.0"
parking_lot = "0.10.2"

View File

@@ -14,7 +14,7 @@ eth2_ssz_derive = "0.1.0"
[dependencies]
ethereum-types = "0.9.1"
smallvec = "1.2.0"
smallvec = "1.4.0"
[features]
arbitrary = ["ethereum-types/arbitrary"]

View File

@@ -11,5 +11,5 @@ name = "ssz_derive"
proc-macro = true
[dependencies]
syn = "0.15"
quote = "0.6"
syn = "1.0.18"
quote = "1.0.4"

View File

@@ -54,7 +54,8 @@ fn get_serializable_field_types<'a>(struct_data: &'a syn::DataStruct) -> Vec<&'a
/// The field attribute is: `#[ssz(skip_serializing)]`
fn should_skip_serializing(field: &syn::Field) -> bool {
field.attrs.iter().any(|attr| {
attr.path.is_ident("ssz") && attr.tts.to_string().replace(" ", "") == "(skip_serializing)"
attr.path.is_ident("ssz")
&& attr.tokens.to_string().replace(" ", "") == "(skip_serializing)"
})
}
@@ -148,7 +149,8 @@ pub fn ssz_encode_derive(input: TokenStream) -> TokenStream {
/// The field attribute is: `#[ssz(skip_deserializing)]`
fn should_skip_deserializing(field: &syn::Field) -> bool {
field.attrs.iter().any(|attr| {
attr.path.is_ident("ssz") && attr.tts.to_string().replace(" ", "") == "(skip_deserializing)"
attr.path.is_ident("ssz")
&& attr.tokens.to_string().replace(" ", "") == "(skip_deserializing)"
})
}

View File

@@ -9,13 +9,13 @@ name = "ssz_types"
[dependencies]
tree_hash = "0.1.0"
serde = "1.0.102"
serde_derive = "1.0.102"
serde = "1.0.106"
serde_derive = "1.0.106"
serde_hex = { path = "../serde_hex" }
eth2_ssz = "0.1.2"
typenum = "1.11.2"
arbitrary = { version = "0.4", features = ["derive"], optional = true }
typenum = "1.12.0"
arbitrary = { version = "0.4.4", features = ["derive"], optional = true }
[dev-dependencies]
serde_yaml = "0.8.11"
tree_hash_derive = "0.2"
tree_hash_derive = "0.2.0"

View File

@@ -9,9 +9,9 @@ name = "benches"
harness = false
[dev-dependencies]
criterion = "0.3.0"
criterion = "0.3.2"
yaml-rust = "0.4.3"
hex = "0.3"
hex = "0.4.2"
[dependencies]
eth2_hashing = "0.1.0"

View File

@@ -9,5 +9,5 @@ description = "Procedural derive macros for implementation of TestRandom trait"
proc-macro = true
[dependencies]
syn = "0.15"
quote = "0.6"
syn = "1.0.18"
quote = "1.0.4"

View File

@@ -10,7 +10,7 @@ use syn::{parse_macro_input, DeriveInput};
/// The field attribute is: `#[test_random(default)]`
fn should_use_default(field: &syn::Field) -> bool {
field.attrs.iter().any(|attr| {
attr.path.is_ident("test_random") && attr.tts.to_string().replace(" ", "") == "(default)"
attr.path.is_ident("test_random") && attr.tokens.to_string().replace(" ", "") == "(default)"
})
}

View File

@@ -11,16 +11,16 @@ name = "benches"
harness = false
[dev-dependencies]
criterion = "0.3.0"
rand = "0.7.2"
tree_hash_derive = "0.2"
criterion = "0.3.2"
rand = "0.7.3"
tree_hash_derive = "0.2.0"
types = { path = "../../types" }
lazy_static = "1.4.0"
[dependencies]
ethereum-types = "0.9"
ethereum-types = "0.9.1"
eth2_hashing = "0.1.0"
smallvec = "1.2.0"
smallvec = "1.4.0"
[features]
arbitrary = ["ethereum-types/arbitrary"]

View File

@@ -10,5 +10,5 @@ license = "Apache-2.0"
proc-macro = true
[dependencies]
syn = "0.15"
quote = "0.6"
syn = "1.0.18"
quote = "1.0.4"

View File

@@ -51,7 +51,7 @@ fn get_cache_field_for(field: &syn::Field) -> Option<syn::Ident> {
let parsed_attrs = cached_tree_hash_attr_metas(&field.attrs);
if let [Meta::List(MetaList { nested, .. })] = &parsed_attrs[..] {
nested.iter().find_map(|x| match x {
NestedMeta::Meta(Meta::Word(cache_field_ident)) => Some(cache_field_ident.clone()),
NestedMeta::Meta(Meta::Path(path)) => path.get_ident().cloned(),
_ => None,
})
} else {
@@ -73,7 +73,8 @@ fn cached_tree_hash_attr_metas(attrs: &[Attribute]) -> Vec<Meta> {
/// The field attribute is: `#[tree_hash(skip_hashing)]`
fn should_skip_hashing(field: &syn::Field) -> bool {
field.attrs.iter().any(|attr| {
attr.path.is_ident("tree_hash") && attr.tts.to_string().replace(" ", "") == "(skip_hashing)"
attr.path.is_ident("tree_hash")
&& attr.tokens.to_string().replace(" ", "") == "(skip_hashing)"
})
}