Skip to content

Commit

Permalink
Comment why we wrap the blockhash in get_tipset_cid
Browse files Browse the repository at this point in the history
  • Loading branch information
fridrik01 committed Jan 26, 2024
1 parent 02461cf commit 1851ac5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fendermint/vm/interpreter/src/fvm/externs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ where
};

match actor_state.get_block_hash(&bstore, epoch) {
// the block hash retrieved from state was saved raw from how we received it
// from Tendermint (which is Sha2_256) and we simply wrap it here in a cid
Ok(Some(v)) => match Code::Blake2b256.wrap(&v) {
Ok(w) => Ok(Cid::new_v1(DAG_CBOR, w)),
Err(err) => Err(anyhow!("failed to wrap block hash, error: {}", err)),
Expand Down

0 comments on commit 1851ac5

Please sign in to comment.