mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore: rm uneccessary lifetimes in evm config (#9609)
This commit is contained in:
@ -107,10 +107,10 @@ impl ConfigureEvmEnv for EthEvmConfig {
|
|||||||
impl ConfigureEvm for EthEvmConfig {
|
impl ConfigureEvm for EthEvmConfig {
|
||||||
type DefaultExternalContext<'a> = ();
|
type DefaultExternalContext<'a> = ();
|
||||||
|
|
||||||
fn evm<'a, DB: Database + 'a>(
|
fn evm<DB: Database>(
|
||||||
&self,
|
&self,
|
||||||
db: DB,
|
db: DB,
|
||||||
) -> reth_revm::Evm<'a, Self::DefaultExternalContext<'a>, DB> {
|
) -> reth_revm::Evm<'_, Self::DefaultExternalContext<'_>, DB> {
|
||||||
EvmBuilder::default().with_db(db).build()
|
EvmBuilder::default().with_db(db).build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,17 +42,17 @@ pub trait ConfigureEvm: ConfigureEvmEnv {
|
|||||||
/// This does not automatically configure the EVM with [`ConfigureEvmEnv`] methods. It is up to
|
/// This does not automatically configure the EVM with [`ConfigureEvmEnv`] methods. It is up to
|
||||||
/// the caller to call an appropriate method to fill the transaction and block environment
|
/// the caller to call an appropriate method to fill the transaction and block environment
|
||||||
/// before executing any transactions using the provided EVM.
|
/// before executing any transactions using the provided EVM.
|
||||||
fn evm<'a, DB: Database + 'a>(&self, db: DB) -> Evm<'a, Self::DefaultExternalContext<'a>, DB>;
|
fn evm<DB: Database>(&self, db: DB) -> Evm<'_, Self::DefaultExternalContext<'_>, DB>;
|
||||||
|
|
||||||
/// Returns a new EVM with the given database configured with the given environment settings,
|
/// Returns a new EVM with the given database configured with the given environment settings,
|
||||||
/// including the spec id.
|
/// including the spec id.
|
||||||
///
|
///
|
||||||
/// This will preserve any handler modifications
|
/// This will preserve any handler modifications
|
||||||
fn evm_with_env<'a, DB: Database + 'a>(
|
fn evm_with_env<DB: Database>(
|
||||||
&self,
|
&self,
|
||||||
db: DB,
|
db: DB,
|
||||||
env: EnvWithHandlerCfg,
|
env: EnvWithHandlerCfg,
|
||||||
) -> Evm<'a, Self::DefaultExternalContext<'a>, DB> {
|
) -> Evm<'_, Self::DefaultExternalContext<'_>, DB> {
|
||||||
let mut evm = self.evm(db);
|
let mut evm = self.evm(db);
|
||||||
evm.modify_spec_id(env.spec_id());
|
evm.modify_spec_id(env.spec_id());
|
||||||
evm.context.evm.env = env.env;
|
evm.context.evm.env = env.env;
|
||||||
@ -65,12 +65,12 @@ pub trait ConfigureEvm: ConfigureEvmEnv {
|
|||||||
/// This will use the given external inspector as the EVM external context.
|
/// This will use the given external inspector as the EVM external context.
|
||||||
///
|
///
|
||||||
/// This will preserve any handler modifications
|
/// This will preserve any handler modifications
|
||||||
fn evm_with_env_and_inspector<'a, DB, I>(
|
fn evm_with_env_and_inspector<DB, I>(
|
||||||
&self,
|
&self,
|
||||||
db: DB,
|
db: DB,
|
||||||
env: EnvWithHandlerCfg,
|
env: EnvWithHandlerCfg,
|
||||||
inspector: I,
|
inspector: I,
|
||||||
) -> Evm<'a, I, DB>
|
) -> Evm<'_, I, DB>
|
||||||
where
|
where
|
||||||
DB: Database,
|
DB: Database,
|
||||||
I: GetInspector<DB>,
|
I: GetInspector<DB>,
|
||||||
@ -86,9 +86,9 @@ pub trait ConfigureEvm: ConfigureEvmEnv {
|
|||||||
/// Caution: This does not automatically configure the EVM with [`ConfigureEvmEnv`] methods. It
|
/// Caution: This does not automatically configure the EVM with [`ConfigureEvmEnv`] methods. It
|
||||||
/// is up to the caller to call an appropriate method to fill the transaction and block
|
/// is up to the caller to call an appropriate method to fill the transaction and block
|
||||||
/// environment before executing any transactions using the provided EVM.
|
/// environment before executing any transactions using the provided EVM.
|
||||||
fn evm_with_inspector<'a, DB, I>(&self, db: DB, inspector: I) -> Evm<'a, I, DB>
|
fn evm_with_inspector<DB, I>(&self, db: DB, inspector: I) -> Evm<'_, I, DB>
|
||||||
where
|
where
|
||||||
DB: Database + 'a,
|
DB: Database,
|
||||||
I: GetInspector<DB>,
|
I: GetInspector<DB>,
|
||||||
{
|
{
|
||||||
EvmBuilder::default()
|
EvmBuilder::default()
|
||||||
|
|||||||
@ -113,13 +113,13 @@ impl ConfigureEvmEnv for OptimismEvmConfig {
|
|||||||
impl ConfigureEvm for OptimismEvmConfig {
|
impl ConfigureEvm for OptimismEvmConfig {
|
||||||
type DefaultExternalContext<'a> = ();
|
type DefaultExternalContext<'a> = ();
|
||||||
|
|
||||||
fn evm<'a, DB: Database + 'a>(&self, db: DB) -> Evm<'a, Self::DefaultExternalContext<'a>, DB> {
|
fn evm<DB: Database>(&self, db: DB) -> Evm<'_, Self::DefaultExternalContext<'_>, DB> {
|
||||||
EvmBuilder::default().with_db(db).optimism().build()
|
EvmBuilder::default().with_db(db).optimism().build()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn evm_with_inspector<'a, DB, I>(&self, db: DB, inspector: I) -> Evm<'a, I, DB>
|
fn evm_with_inspector<DB, I>(&self, db: DB, inspector: I) -> Evm<'_, I, DB>
|
||||||
where
|
where
|
||||||
DB: Database + 'a,
|
DB: Database,
|
||||||
I: GetInspector<DB>,
|
I: GetInspector<DB>,
|
||||||
{
|
{
|
||||||
EvmBuilder::default()
|
EvmBuilder::default()
|
||||||
|
|||||||
@ -109,7 +109,7 @@ impl ConfigureEvmEnv for MyEvmConfig {
|
|||||||
impl ConfigureEvm for MyEvmConfig {
|
impl ConfigureEvm for MyEvmConfig {
|
||||||
type DefaultExternalContext<'a> = ();
|
type DefaultExternalContext<'a> = ();
|
||||||
|
|
||||||
fn evm<'a, DB: Database + 'a>(&self, db: DB) -> Evm<'a, Self::DefaultExternalContext<'a>, DB> {
|
fn evm<DB: Database>(&self, db: DB) -> Evm<'_, Self::DefaultExternalContext<'_>, DB> {
|
||||||
EvmBuilder::default()
|
EvmBuilder::default()
|
||||||
.with_db(db)
|
.with_db(db)
|
||||||
// add additional precompiles
|
// add additional precompiles
|
||||||
@ -117,9 +117,9 @@ impl ConfigureEvm for MyEvmConfig {
|
|||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn evm_with_inspector<'a, DB, I>(&self, db: DB, inspector: I) -> Evm<'a, I, DB>
|
fn evm_with_inspector<DB, I>(&self, db: DB, inspector: I) -> Evm<'_, I, DB>
|
||||||
where
|
where
|
||||||
DB: Database + 'a,
|
DB: Database,
|
||||||
I: GetInspector<DB>,
|
I: GetInspector<DB>,
|
||||||
{
|
{
|
||||||
EvmBuilder::default()
|
EvmBuilder::default()
|
||||||
|
|||||||
@ -166,7 +166,7 @@ impl ConfigureEvmEnv for MyEvmConfig {
|
|||||||
impl ConfigureEvm for MyEvmConfig {
|
impl ConfigureEvm for MyEvmConfig {
|
||||||
type DefaultExternalContext<'a> = ();
|
type DefaultExternalContext<'a> = ();
|
||||||
|
|
||||||
fn evm<'a, DB: Database + 'a>(&self, db: DB) -> Evm<'a, Self::DefaultExternalContext<'a>, DB> {
|
fn evm<DB: Database>(&self, db: DB) -> Evm<'_, Self::DefaultExternalContext<'_>, DB> {
|
||||||
let new_cache = self.precompile_cache.clone();
|
let new_cache = self.precompile_cache.clone();
|
||||||
EvmBuilder::default()
|
EvmBuilder::default()
|
||||||
.with_db(db)
|
.with_db(db)
|
||||||
@ -177,9 +177,9 @@ impl ConfigureEvm for MyEvmConfig {
|
|||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn evm_with_inspector<'a, DB, I>(&self, db: DB, inspector: I) -> Evm<'a, I, DB>
|
fn evm_with_inspector<DB, I>(&self, db: DB, inspector: I) -> Evm<'_, I, DB>
|
||||||
where
|
where
|
||||||
DB: Database + 'a,
|
DB: Database,
|
||||||
I: GetInspector<DB>,
|
I: GetInspector<DB>,
|
||||||
{
|
{
|
||||||
let new_cache = self.precompile_cache.clone();
|
let new_cache = self.precompile_cache.clone();
|
||||||
|
|||||||
Reference in New Issue
Block a user