Skip to content

Commit

Permalink
chore(executor): Test Coverage over Executor Utilities (#650)
Browse files Browse the repository at this point in the history
* chore(executor): test executor utils

* fix: remove gas lim tests
  • Loading branch information
refcell authored Oct 8, 2024
1 parent 0a1ca04 commit 25af581
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions crates/executor/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,27 @@ pub(crate) const fn is_system_transaction(tx: &OpTxEnvelope) -> bool {
_ => false,
}
}

#[cfg(test)]
mod tests {
use super::*;
use op_alloy_consensus::TxDeposit;

#[test]
fn test_is_system_transaction() {
let mut inner = TxDeposit::default();
let tx = OpTxEnvelope::Deposit(inner.clone());
assert!(!is_system_transaction(&tx));
inner.is_system_transaction = true;
let tx = OpTxEnvelope::Deposit(inner);
assert!(is_system_transaction(&tx));
}

#[test]
fn test_extract_tx_gas_limit_deposit() {
let mut inner = TxDeposit::default();
assert_eq!(extract_tx_gas_limit(&OpTxEnvelope::Deposit(inner.clone())), 0);
inner.gas_limit = 100;
assert_eq!(extract_tx_gas_limit(&OpTxEnvelope::Deposit(inner)), 100);
}
}

0 comments on commit 25af581

Please sign in to comment.