From 7fcb73039515d9815b32e6ca4202cbab5f3b9553 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 22 Nov 2023 19:09:28 +0100 Subject: [PATCH] test: add cast proof test (#6403) * test: add test for cast proof * add additional cases --- crates/cast/bin/opts.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/crates/cast/bin/opts.rs b/crates/cast/bin/opts.rs index b763821fa06d..dcd557d310fa 100644 --- a/crates/cast/bin/opts.rs +++ b/crates/cast/bin/opts.rs @@ -883,6 +883,35 @@ 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", + "0x1", + "0x01", + ]); + match args.sub { + Subcommands::Proof { slots, .. } => { + assert_eq!( + slots, + vec![ + B256::ZERO, + U256::from(1).into(), + B256::ZERO, + U256::from(1).into(), + U256::from(1).into() + ] + ); + } + _ => unreachable!(), + }; + } + #[test] fn parse_call_data() { let args: Opts = Opts::parse_from([