Skip to content

Commit

Permalink
fix hash_as_h256?
Browse files Browse the repository at this point in the history
  • Loading branch information
mangas committed May 13, 2024
1 parent af086dd commit b353601
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions graph/src/blockchain/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ impl BlockPtr {
//
// workaround for arweave
pub fn hash_as_h256(&self) -> H256 {
let slice = self.hash_slice();

if slice.is_empty() {
return H256::zero();
}

H256::from_slice(&self.hash_slice()[..32])
}

Expand Down

0 comments on commit b353601

Please sign in to comment.