mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf: query bytecodes with &B256 to avoid copying code hash (#13559)
This commit is contained in:
@ -999,7 +999,7 @@ mod tests {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
fn bytecode_by_hash(&self, _code_hash: B256) -> ProviderResult<Option<Bytecode>> {
|
||||
fn bytecode_by_hash(&self, _code_hash: &B256) -> ProviderResult<Option<Bytecode>> {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
@ -228,9 +228,9 @@ impl<N: NodePrimitives> StateProvider for MemoryOverlayStateProviderRef<'_, N> {
|
||||
self.historical.storage(address, storage_key)
|
||||
}
|
||||
|
||||
fn bytecode_by_hash(&self, code_hash: B256) -> ProviderResult<Option<Bytecode>> {
|
||||
fn bytecode_by_hash(&self, code_hash: &B256) -> ProviderResult<Option<Bytecode>> {
|
||||
for block in &self.in_memory {
|
||||
if let Some(contract) = block.execution_output.bytecode(&code_hash) {
|
||||
if let Some(contract) = block.execution_output.bytecode(code_hash) {
|
||||
return Ok(Some(contract));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user