From 5cbb87c13b34d4309d08722917ab311f38253b3a Mon Sep 17 00:00:00 2001 From: Brendon Fish Date: Wed, 24 Jan 2024 10:32:25 -0500 Subject: [PATCH] Init view 1 with empty payload as well --- crates/hotshot/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/hotshot/src/lib.rs b/crates/hotshot/src/lib.rs index 9612df7a78..8608902394 100644 --- a/crates/hotshot/src/lib.rs +++ b/crates/hotshot/src/lib.rs @@ -220,7 +220,7 @@ impl> SystemContext { 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 = match payload.encode() { // TODO (Keyao) [VALIDATED_STATE] - Avoid collect/copy on the encoded transaction bytes. // Ok(encoded) => encoded.into_iter().collect(), @@ -228,7 +228,8 @@ impl> SystemContext { 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();