Make BeaconState.balances a tree list!

This commit is contained in:
Michael Sproul
2021-12-01 14:14:47 +11:00
parent 4b808d3c72
commit fca92c37ad
11 changed files with 76 additions and 31 deletions

View File

@@ -17,6 +17,7 @@
use self::UpdatePattern::*;
use crate::*;
use ssz::{Decode, Encode};
use tree_hash::TreeHash;
use typenum::Unsigned;
use types::VList;
@@ -56,7 +57,7 @@ pub trait Field<E: EthSpec>: Copy {
/// The type of value stored in this field: the `T` from `FixedVector<T, N>`.
///
/// The `Default` impl will be used to fill extra vector entries.
type Value: Decode + Encode + Default + Clone + PartialEq + std::fmt::Debug;
type Value: TreeHash + Decode + Encode + Default + Clone + PartialEq + std::fmt::Debug;
/// The length of this field: the `N` from `FixedVector<T, N>`.
type Length: Unsigned;