From 06f6aa1fa925faa5f5b55bb43fccbceb292b45eb Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 22 Nov 2023 18:49:43 +0100 Subject: [PATCH 1/2] test: add test for cast proof --- crates/cast/bin/opts.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/cast/bin/opts.rs b/crates/cast/bin/opts.rs index b763821fa06d..c834c5a7a270 100644 --- a/crates/cast/bin/opts.rs +++ b/crates/cast/bin/opts.rs @@ -883,6 +883,24 @@ mod tests { use cast::SimpleCast; use ethers_core::types::BlockNumber; + #[test] + fn parse_proof_slot() { + let args: Opts = Opts::parse_from([ + "foundry-cli", + "proof", + "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "0", + "1", + "0x0000000000000000000000000000000000000000000000000000000000000000", + ]); + match args.sub { + Subcommands::Proof { slots, .. } => { + assert_eq!(slots, vec![B256::ZERO, U256::from(1).into(), B256::ZERO]); + } + _ => unreachable!(), + }; + } + #[test] fn parse_call_data() { let args: Opts = Opts::parse_from([ From ad366f8f2ffdde34f3601b399641a9d84615f623 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 22 Nov 2023 18:57:06 +0100 Subject: [PATCH 2/2] add additional cases --- crates/cast/bin/opts.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/cast/bin/opts.rs b/crates/cast/bin/opts.rs index c834c5a7a270..dcd557d310fa 100644 --- a/crates/cast/bin/opts.rs +++ b/crates/cast/bin/opts.rs @@ -892,10 +892,21 @@ mod tests { "0", "1", "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x1", + "0x01", ]); match args.sub { Subcommands::Proof { slots, .. } => { - assert_eq!(slots, vec![B256::ZERO, U256::from(1).into(), B256::ZERO]); + assert_eq!( + slots, + vec![ + B256::ZERO, + U256::from(1).into(), + B256::ZERO, + U256::from(1).into(), + U256::from(1).into() + ] + ); } _ => unreachable!(), };