Skip to content

Commit

Permalink
test: add bundle test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Apr 10, 2024
1 parent 8a3982a commit ec82c7b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/rpc-types/src/eth/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,18 @@ mod tests {
assert_eq!(bundle.transactions.len(), 1);
assert_eq!(bundle.block_override.unwrap().time.unwrap().to::<u64>(), 1711546233);
}

#[test]
fn full_bundle() {
// <https://github.com/paradigmxyz/reth/issues/7542>
let s = r#"{"transactions":[{"from":"0x0000000000000011110000000000000000000000","to":"0x1100000000000000000000000000000000000000","value":"0x1111111","maxFeePerGas":"0x3a35294400","maxPriorityFeePerGas":"0x3b9aca00"}]}"#;
let bundle = serde_json::from_str::<Bundle>(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));
}
}

0 comments on commit ec82c7b

Please sign in to comment.