Skip to content

Commit

Permalink
Init view 1 with empty payload as well
Browse files Browse the repository at this point in the history
  • Loading branch information
bfish713 committed Jan 24, 2024
1 parent c199b83 commit 5cbb87c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/hotshot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,16 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> SystemContext<TYPES, I> {
let mut saved_payloads = BTreeMap::new();
saved_leaves.insert(anchored_leaf.commit(), anchored_leaf.clone());
if let Some(payload) = anchored_leaf.get_block_payload() {
let encoded_txns = match payload.encode() {
let encoded_txns: Vec<u8> = match payload.encode() {
// TODO (Keyao) [VALIDATED_STATE] - Avoid collect/copy on the encoded transaction bytes.
// <https://github.com/EspressoSystems/HotShot/issues/2115>
Ok(encoded) => encoded.into_iter().collect(),
Err(e) => {
return Err(HotShotError::BlockError { source: e });
}
};
saved_payloads.insert(anchored_leaf.get_view_number(), encoded_txns);
saved_payloads.insert(anchored_leaf.get_view_number(), encoded_txns.clone());
saved_payloads.insert(TYPES::Time::new(1), encoded_txns);
}

let start_view = anchored_leaf.get_view_number();
Expand Down

0 comments on commit 5cbb87c

Please sign in to comment.