mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
perf: use existing block hash functions (#11858)
This commit is contained in:
@ -82,11 +82,10 @@ pub trait BlockIdReader: BlockNumReader + Send + Sync {
|
|||||||
BlockNumberOrTag::Pending => self
|
BlockNumberOrTag::Pending => self
|
||||||
.pending_block_num_hash()
|
.pending_block_num_hash()
|
||||||
.map(|res_opt| res_opt.map(|num_hash| num_hash.hash)),
|
.map(|res_opt| res_opt.map(|num_hash| num_hash.hash)),
|
||||||
_ => self
|
BlockNumberOrTag::Finalized => self.finalized_block_hash(),
|
||||||
.convert_block_number(num)?
|
BlockNumberOrTag::Safe => self.safe_block_hash(),
|
||||||
.map(|num| self.block_hash(num))
|
BlockNumberOrTag::Earliest => self.block_hash(0),
|
||||||
.transpose()
|
BlockNumberOrTag::Number(num) => self.block_hash(num),
|
||||||
.map(|maybe_hash| maybe_hash.flatten()),
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user