Change ssz to use extend_from_slice()

This is instead of `append` which empties the source vector. This
doens't really ssem suitable for what we're doing.
This commit is contained in:
Paul Hauner
2018-09-10 08:52:21 +02:00
parent e12a93783d
commit ffaffbcd90
3 changed files with 17 additions and 13 deletions

View File

@@ -18,7 +18,7 @@ impl Encodable for AttestationRecord {
s.append(&self.shard_id);
s.append_vec(&self.oblique_parent_hashes);
s.append(&self.shard_block_hash);
s.append(&self.attester_bitfield);
s.append_vec(&self.attester_bitfield.to_be_vec());
// TODO: add aggregate signature
}
}

View File

@@ -47,11 +47,10 @@ impl Block {
impl Encodable for Block {
fn ssz_append(&self, s: &mut SszStream) {
let mut s = SszStream::new();
s.append(&self.parent_hash);
s.append(&self.slot_number);
s.append(&self.randao_reveal);
s.append(&self.attestations);
s.append_vec(&self.attestations);
s.append(&self.pow_chain_ref);
s.append(&self.active_state_root);
s.append(&self.crystallized_state_root);