Skip to content

Commit f83eed9

Browse files
authored
Trim commit bounds (#84)
* refactor: remove DatabaseCommit bounds wherever possible * nit: import
1 parent 4b8add3 commit f83eed9

File tree

6 files changed

+133
-79
lines changed

6 files changed

+133
-79
lines changed

src/connect.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1+
use crate::{
2+
Block, Cfg, EvmErrored, EvmNeedsBlock, EvmNeedsCfg, EvmNeedsTx, EvmReady, EvmTransacted, Tx,
3+
};
14
use core::convert::Infallible;
25
use revm::{
36
primitives::{EVMError, ResultAndState},
4-
Database, DatabaseCommit,
7+
Database,
58
};
69
use std::format;
710

8-
use crate::{
9-
Block, Cfg, EvmErrored, EvmNeedsBlock, EvmNeedsCfg, EvmNeedsTx, EvmReady, EvmTransacted, Tx,
10-
};
11-
1211
/// Trait for types that can be used to connect to a database.
1312
///
1413
/// Connectors should contain configuration information like filesystem paths.
@@ -21,7 +20,7 @@ use crate::{
2120
/// threads.
2221
pub trait DbConnect<'a>: Sync {
2322
/// The database type returned when connecting.
24-
type Database: Database + DatabaseCommit;
23+
type Database: Database;
2524

2625
/// The error type returned when connecting to the database.
2726
type Error: core::error::Error;
@@ -32,7 +31,7 @@ pub trait DbConnect<'a>: Sync {
3231

3332
impl<Db> DbConnect<'_> for Db
3433
where
35-
Db: Database + DatabaseCommit + Clone + Sync,
34+
Db: Database + Clone + Sync,
3635
{
3736
type Database = Self;
3837

src/driver/block.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::{Block, EvmBlockDriverErrored, EvmNeedsBlock, EvmNeedsTx};
2-
use revm::{primitives::EVMError, Database, DatabaseCommit};
2+
use revm::{primitives::EVMError, Database};
33

44
/// The result of running transactions for a block driver.
55
pub type RunTxResult<'a, Ext, Db, T> =
@@ -23,13 +23,13 @@ pub trait BlockDriver<Ext> {
2323
fn block(&self) -> &Self::Block;
2424

2525
/// Run the transactions for the block.
26-
fn run_txns<'a, Db: Database + DatabaseCommit>(
26+
fn run_txns<'a, Db: Database>(
2727
&mut self,
2828
trevm: EvmNeedsTx<'a, Ext, Db>,
2929
) -> RunTxResult<'a, Ext, Db, Self>;
3030

3131
/// Run post
32-
fn post_block<Db: Database + DatabaseCommit>(
32+
fn post_block<Db: Database>(
3333
&mut self,
3434
trevm: &EvmNeedsBlock<'_, Ext, Db>,
3535
) -> Result<(), Self::Error<Db>>;

0 commit comments

Comments
 (0)