diff --git a/graph/src/blockchain/types.rs b/graph/src/blockchain/types.rs index 18d03b390ba..7caac94c246 100644 --- a/graph/src/blockchain/types.rs +++ b/graph/src/blockchain/types.rs @@ -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]) }