diff --git a/ethers-core/src/types/transaction/optimism.rs b/ethers-core/src/types/transaction/optimism.rs index 6f6ffdc9c..ee4d397fb 100644 --- a/ethers-core/src/types/transaction/optimism.rs +++ b/ethers-core/src/types/transaction/optimism.rs @@ -210,6 +210,7 @@ mod test { max_priority_fee_per_gas: None, max_fee_per_gas: None, chain_id: None, + other: crate::types::OtherFields::default(), }; let rlp = deposited_tx.rlp(); diff --git a/ethers-core/src/types/transaction/response.rs b/ethers-core/src/types/transaction/response.rs index 20e1acaa2..254fcdc38 100644 --- a/ethers-core/src/types/transaction/response.rs +++ b/ethers-core/src/types/transaction/response.rs @@ -132,7 +132,7 @@ pub struct Transaction { pub chain_id: Option, /// Captures unknown fields such as additional fields used by L2s - #[cfg(not(any(feature = "celo", feature = "optimism")))] + #[cfg(not(any(feature = "celo")))] #[serde(flatten)] pub other: crate::types::OtherFields, } @@ -649,6 +649,8 @@ mod tests { max_priority_fee_per_gas: None, max_fee_per_gas: None, chain_id: None, + #[cfg(not(feature = "celo"))] + other: crate::types::OtherFields::default(), }; let encoded_rlp_bytes = deposited_tx.rlp();