feat: add canonical_headers_range (#1795)

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
This commit is contained in:
Matthias Seitz
2023-03-17 01:06:32 +01:00
committed by GitHub
parent 57894f7b98
commit 241ec32abf
16 changed files with 114 additions and 49 deletions

View File

@ -63,6 +63,7 @@ impl<DB: StateProvider> DatabaseRef for State<DB> {
}
fn block_hash(&self, number: U256) -> Result<H256, Self::Error> {
Ok(self.0.block_hash(number)?.unwrap_or_default())
// Note: this unwrap is potentially unsafe
Ok(self.0.block_hash(number.try_into().unwrap())?.unwrap_or_default())
}
}