Skip to content

Commit 00b38bd

Browse files
emhanelwedge99
authored andcommitted
test(op-revm): Full test coverage OpTransactionError (bluealloy#2818)
* Fix typos * Cover OpTransactionError::Base in test display * fixup! Fix typos
1 parent 37b6d09 commit 00b38bd

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

crates/op-revm/src/transaction/error.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ pub enum OpTransactionError {
1818
/// was deprecated in the Regolith hardfork, and this error is thrown if a `Deposit` transaction
1919
/// is found with this field set to `true` after the hardfork activation.
2020
///
21-
/// In addition, this error is internal, and bubbles up into a [OpHaltReason::FailedDeposit][crate::OpHaltReason::FailedDeposit] error
21+
/// In addition, this error is internal, and bubbles up into an [OpHaltReason::FailedDeposit][crate::OpHaltReason::FailedDeposit] error
2222
/// in the `revm` handler for the consumer to easily handle. This is due to a state transition
2323
/// rule on OP Stack chains where, if for any reason a deposit transaction fails, the transaction
2424
/// must still be included in the block, the sender nonce is bumped, the `mint` value persists, and
2525
/// special gas accounting rules are applied. Normally on L1, [EVMError::Transaction] errors
2626
/// are cause for non-inclusion, so a special [OpHaltReason][crate::OpHaltReason] variant was introduced to handle this
2727
/// case for failed deposit transactions.
2828
DepositSystemTxPostRegolith,
29-
/// Deposit transaction haults bubble up to the global main return handler, wiping state and
29+
/// Deposit transaction halts bubble up to the global main return handler, wiping state and
3030
/// only increasing the nonce + persisting the mint value.
3131
///
32-
/// This is a catch-all error for any deposit transaction that is results in a [OpHaltReason][crate::OpHaltReason] error
32+
/// This is a catch-all error for any deposit transaction that results in an [OpHaltReason][crate::OpHaltReason] error
3333
/// post-regolith hardfork. This allows for a consumer to easily handle special cases where
3434
/// a deposit transaction fails during validation, but must still be included in the block.
3535
///
36-
/// In addition, this error is internal, and bubbles up into a [OpHaltReason::FailedDeposit][crate::OpHaltReason::FailedDeposit] error
36+
/// In addition, this error is internal, and bubbles up into an [OpHaltReason::FailedDeposit][crate::OpHaltReason::FailedDeposit] error
3737
/// in the `revm` handler for the consumer to easily handle. This is due to a state transition
3838
/// rule on OP Stack chains where, if for any reason a deposit transaction fails, the transaction
3939
/// must still be included in the block, the sender nonce is bumped, the `mint` value persists, and
@@ -86,6 +86,11 @@ mod test {
8686

8787
#[test]
8888
fn test_display_op_errors() {
89+
assert_eq!(
90+
OpTransactionError::Base(InvalidTransaction::NonceTooHigh { tx: 2, state: 1 })
91+
.to_string(),
92+
"nonce 2 too high, expected 1"
93+
);
8994
assert_eq!(
9095
OpTransactionError::DepositSystemTxPostRegolith.to_string(),
9196
"deposit system transactions post regolith hardfork are not supported"

0 commit comments

Comments
 (0)