From ec82c7b3d0ee149d246c6d36f854cd346b6e4f5d Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 10 Apr 2024 16:50:46 +0200 Subject: [PATCH] test: add bundle test --- crates/rpc-types/src/eth/call.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/rpc-types/src/eth/call.rs b/crates/rpc-types/src/eth/call.rs index b7fe39833ab..c9eca4fa181 100644 --- a/crates/rpc-types/src/eth/call.rs +++ b/crates/rpc-types/src/eth/call.rs @@ -135,4 +135,18 @@ mod tests { assert_eq!(bundle.transactions.len(), 1); assert_eq!(bundle.block_override.unwrap().time.unwrap().to::(), 1711546233); } + + #[test] + fn full_bundle() { + // + let s = r#"{"transactions":[{"from":"0x0000000000000011110000000000000000000000","to":"0x1100000000000000000000000000000000000000","value":"0x1111111","maxFeePerGas":"0x3a35294400","maxPriorityFeePerGas":"0x3b9aca00"}]}"#; + let bundle = serde_json::from_str::(s).unwrap(); + assert_eq!(bundle.transactions.len(), 1); + assert_eq!( + bundle.transactions[0].from, + Some("0x0000000000000011110000000000000000000000".parse().unwrap()) + ); + assert_eq!(bundle.transactions[0].value, Some("0x1111111".parse().unwrap())); + assert_eq!(bundle.transactions[0].max_priority_fee_per_gas, Some(1000000000)); + } }