From 4ed367e1dbc4bed77794622fceb9a38131fcc9a6 Mon Sep 17 00:00:00 2001 From: James Prestwich Date: Wed, 13 Dec 2023 08:04:29 -0800 Subject: [PATCH] fix: correct signature type for transaction rpc object (#51) * fix: correct signature type for transaction rpc object * fix: tests --- crates/rpc-types/src/eth/transaction/mod.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/crates/rpc-types/src/eth/transaction/mod.rs b/crates/rpc-types/src/eth/transaction/mod.rs index 937e0d3b0ff..8e769edeab6 100644 --- a/crates/rpc-types/src/eth/transaction/mod.rs +++ b/crates/rpc-types/src/eth/transaction/mod.rs @@ -51,10 +51,8 @@ pub struct Transaction { /// Data pub input: Bytes, /// All _flattened_ fields of the transaction signature. - /// - /// Note: this is an option so special transaction types without a signature (e.g. ) can be supported. - #[serde(flatten, skip_serializing_if = "Option::is_none")] - pub signature: Option, + #[serde(flatten)] + pub signature: Signature, /// The chain id of the transaction, if any. pub chain_id: Option, /// Contains the blob hashes for eip-4844 transactions. @@ -92,12 +90,12 @@ mod tests { gas_price: Some(U128::from(9)), gas: U256::from(10), input: Bytes::from(vec![11, 12, 13]), - signature: Some(Signature { + signature: Signature { v: U256::from(14), r: U256::from(14), s: U256::from(14), y_parity: None, - }), + }, chain_id: Some(U64::from(17)), blob_versioned_hashes: vec![], access_list: None, @@ -129,12 +127,12 @@ mod tests { gas_price: Some(U128::from(9)), gas: U256::from(10), input: Bytes::from(vec![11, 12, 13]), - signature: Some(Signature { + signature: Signature { v: U256::from(14), r: U256::from(14), s: U256::from(14), y_parity: Some(Parity(true)), - }), + }, chain_id: Some(U64::from(17)), blob_versioned_hashes: vec![], access_list: None,