Encode bitfield as list not vector

This commit is contained in:
Paul Hauner
2019-04-17 11:57:57 +10:00
parent ea8d5a3db9
commit 10a5d2657c
8 changed files with 37 additions and 15 deletions

View File

@@ -9,7 +9,7 @@ use serde_hex::{encode, PrefixedHexVisitor};
use ssz::{Decodable, Encodable};
use std::cmp;
use std::default;
use tree_hash::impl_tree_hash_for_ssz_bytes;
use tree_hash::tree_hash_ssz_encoding_as_list;
/// A BooleanBitfield represents a set of booleans compactly stored as a vector of bits.
/// The BooleanBitfield is given a fixed size during construction. Reads outside of the current size return an out-of-bounds error. Writes outside of the current size expand the size of the set.
@@ -257,7 +257,7 @@ impl<'de> Deserialize<'de> for BooleanBitfield {
}
}
impl_tree_hash_for_ssz_bytes!(BooleanBitfield);
tree_hash_ssz_encoding_as_list!(BooleanBitfield);
#[cfg(test)]
mod tests {