mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
chore: bump revm (#17153)
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
This commit is contained in:
@@ -191,11 +191,12 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
let calldata = input.data;
|
||||
let result = self.precompile.call(input);
|
||||
|
||||
match &result {
|
||||
Ok(output) => {
|
||||
let key = CacheKey::new(self.spec_id.clone(), Bytes::copy_from_slice(input.data));
|
||||
let key = CacheKey::new(self.spec_id.clone(), Bytes::copy_from_slice(calldata));
|
||||
let size = self.cache.insert(key, CacheEntry(output.clone()));
|
||||
self.set_precompile_cache_size_metric(size as f64);
|
||||
self.increment_by_one_precompile_cache_misses();
|
||||
@@ -240,7 +241,9 @@ mod tests {
|
||||
use std::hash::DefaultHasher;
|
||||
|
||||
use super::*;
|
||||
use revm::precompile::PrecompileOutput;
|
||||
use reth_evm::EvmInternals;
|
||||
use reth_revm::db::EmptyDB;
|
||||
use revm::{context::JournalTr, precompile::PrecompileOutput, Journal};
|
||||
use revm_primitives::{hardfork::SpecId, U256};
|
||||
|
||||
#[test]
|
||||
@@ -341,6 +344,7 @@ mod tests {
|
||||
gas: gas_limit,
|
||||
caller: Address::ZERO,
|
||||
value: U256::ZERO,
|
||||
internals: EvmInternals::new(&mut Journal::<_>::new(EmptyDB::new())),
|
||||
})
|
||||
.unwrap();
|
||||
assert_eq!(result1.bytes.as_ref(), b"output_from_precompile_1");
|
||||
@@ -353,6 +357,7 @@ mod tests {
|
||||
gas: gas_limit,
|
||||
caller: Address::ZERO,
|
||||
value: U256::ZERO,
|
||||
internals: EvmInternals::new(&mut Journal::<_>::new(EmptyDB::new())),
|
||||
})
|
||||
.unwrap();
|
||||
assert_eq!(result2.bytes.as_ref(), b"output_from_precompile_2");
|
||||
@@ -364,6 +369,7 @@ mod tests {
|
||||
gas: gas_limit,
|
||||
caller: Address::ZERO,
|
||||
value: U256::ZERO,
|
||||
internals: EvmInternals::new(&mut Journal::<_>::new(EmptyDB::new())),
|
||||
})
|
||||
.unwrap();
|
||||
assert_eq!(result3.bytes.as_ref(), b"output_from_precompile_1");
|
||||
|
||||
Reference in New Issue
Block a user