Skip to content

Commit 89d1a62

Browse files
committed
fix: more states in states macro
1 parent 8e23a18 commit 89d1a62

File tree

1 file changed

+40
-6
lines changed

1 file changed

+40
-6
lines changed

src/states.rs

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,17 @@ pub type EvmNeedsNextBlock<'a, Ext, Db> = Trevm<'a, Ext, Db, NeedsNextBlock>;
4444
/// [`Tx`]: crate::Tx
4545
pub type EvmNeedsTx<'a, Ext, Db, C> = Trevm<'a, Ext, Db, NeedsTx<C>>;
4646

47+
/// A [`Trevm`] that is ready to execute a transaction.
48+
///
49+
/// The transaction may be executed with [`EvmReady::run`] or cleared
50+
/// with [`EvmReady::clear_tx`]
51+
pub type EvmReady<'a, Ext, Db, C> = Trevm<'a, Ext, Db, Ready<C>>;
52+
4753
/// A [`Trevm`] that encountered an error during transaction execution.
54+
///
55+
/// Expected continuations include:
56+
/// - [`EvmTransacted::reject`]
57+
/// - [`EvmTransacted::accept`]
4858
pub type EvmTransacted<'a, Ext, Db, C> = Trevm<'a, Ext, Db, TransactedState<C>>;
4959

5060
/// A [`Trevm`] that encountered an error during transaction execution.
@@ -55,12 +65,6 @@ pub type EvmTransacted<'a, Ext, Db, C> = Trevm<'a, Ext, Db, TransactedState<C>>;
5565
pub type EvmErrored<'a, Ext, Db, C, E = <C as BlockContext<Ext, Db>>::Error> =
5666
Trevm<'a, Ext, Db, ErroredState<C, E>>;
5767

58-
/// A [`Trevm`] that is ready to execute a transaction.
59-
///
60-
/// The transaction may be executed with [`EvmReady::run`] or cleared
61-
/// with [`EvmReady::clear_tx`]
62-
pub type EvmReady<'a, Ext, Db, C> = Trevm<'a, Ext, Db, Ready<C>>;
63-
6468
#[allow(dead_code)]
6569
#[allow(unnameable_types)]
6670
pub(crate) mod sealed {
@@ -271,6 +275,21 @@ macro_rules! trevm_aliases {
271275
/// The transaction may be executed with [`Trevm::execute_tx`] or
272276
/// cleared with [`Trevm::clear_tx`]
273277
pub type EvmReady<'a, C> = $crate::EvmReady<'a, $ext, $db, C>;
278+
279+
/// A [`Trevm`] that encountered an error during transaction execution.
280+
///
281+
/// Expected continuations include:
282+
/// - [`EvmTransacted::reject`]
283+
/// - [`EvmTransacted::accept`]
284+
pub type EvmTransacted<'a, C> = $crate::EvmTransacted<'a, $ext, $db, C>;
285+
286+
/// A [`Trevm`] that encountered an error during transaction execution.
287+
///
288+
/// Expected continuations include:
289+
/// - [`EvmErrored::discard_error`]
290+
/// - [`EvmErrored::into_error`]
291+
pub type EvmErrored<'a, C, E = <C as $crate::BlockContext<$ext, $db>>::Error> =
292+
$crate::EvmErrored<'a, $ext, $db, C, E>;
274293
}
275294
};
276295

@@ -337,6 +356,21 @@ macro_rules! trevm_aliases {
337356
/// The transaction may be executed with [`Trevm::execute_tx`] or
338357
/// cleared with [`Trevm::clear_tx`]
339358
pub type EvmReady<C> = $crate::EvmReady<'static, $ext, $db, C>;
359+
360+
/// A [`Trevm`] that encountered an error during transaction execution.
361+
///
362+
/// Expected continuations include:
363+
/// - [`EvmTransacted::reject`]
364+
/// - [`EvmTransacted::accept`]
365+
pub type EvmTransacted<C> = $crate::EvmTransacted<'static, $ext, $db, C>;
366+
367+
/// A [`Trevm`] that encountered an error during transaction execution.
368+
///
369+
/// Expected continuations include:
370+
/// - [`EvmErrored::discard_error`]
371+
/// - [`EvmErrored::into_error`]
372+
pub type EvmErrored<C, E = <C as $crate::BlockContext<$ext, $db>>::Error> =
373+
$crate::EvmErrored<'static, $ext, $db, C, E>;
340374
}
341375
};
342376
}

0 commit comments

Comments
 (0)