mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-31 01:58:17 -05:00
fix(ci): Optimism unit / integration tests (#5318)
This commit is contained in:
@@ -32,3 +32,7 @@ clap = { workspace = true }
|
||||
jsonrpsee = { workspace = true }
|
||||
eyre = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
[features]
|
||||
# Included solely to ignore certain tests.
|
||||
optimism = []
|
||||
|
||||
@@ -51,7 +51,11 @@ impl RethNodeCommandConfig for AutoMineConfig {
|
||||
}
|
||||
}
|
||||
|
||||
/// This test is disabled for the `optimism` feature flag due to an incompatible feature set.
|
||||
/// L1 info transactions are not included automatically, which are required for `op-reth` to
|
||||
/// process transactions.
|
||||
#[test]
|
||||
#[cfg_attr(feature = "optimism", ignore)]
|
||||
pub fn test_auto_mine() {
|
||||
// create temp path for test
|
||||
let temp_path = tempfile::TempDir::new().expect("tempdir is okay").into_path();
|
||||
|
||||
@@ -146,6 +146,7 @@ impl TxDeposit {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{Bytes, TransactionSigned};
|
||||
use alloy_rlp::Decodable;
|
||||
use bytes::BytesMut;
|
||||
@@ -166,24 +167,9 @@ mod tests {
|
||||
tx_b.encode_enveloped(&mut buf_b);
|
||||
assert_eq!(&buf_b[..], &bytes[..]);
|
||||
}
|
||||
#[test]
|
||||
fn test_tx_deposit_size() {
|
||||
let tx_deposit = TxDeposit {
|
||||
source_hash: B256::default(),
|
||||
from: Address::default(),
|
||||
to: TransactionKind::default(),
|
||||
mint: Some(100),
|
||||
value: TxValue::default(),
|
||||
gas_limit: 50000,
|
||||
is_system_transaction: false,
|
||||
input: Bytes::default(),
|
||||
};
|
||||
|
||||
assert_eq!(tx_deposit.size(), mem::size_of_val(&tx_deposit));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_encode_decode_inner() {
|
||||
fn test_encode_decode_fields() {
|
||||
let original = TxDeposit {
|
||||
source_hash: B256::default(),
|
||||
from: Address::default(),
|
||||
@@ -196,7 +182,7 @@ mod tests {
|
||||
};
|
||||
|
||||
let mut buffer = BytesMut::new();
|
||||
original.encode(&mut buffer, false);
|
||||
original.encode_fields(&mut buffer);
|
||||
let decoded = TxDeposit::decode_inner(&mut &buffer[..]).expect("Failed to decode");
|
||||
|
||||
assert_eq!(original, decoded);
|
||||
|
||||
Reference in New Issue
Block a user