@@ -3,7 +3,7 @@ use super::{
33 TracingInspector ,
44} ;
55use alloy_primitives:: { map:: AddressHashMap , Address , Bytes , Log , TxKind , U256 } ;
6- use foundry_cheatcodes:: CheatcodesExecutor ;
6+ use foundry_cheatcodes:: { CheatcodesExecutor , Wallets } ;
77use foundry_evm_core:: { backend:: DatabaseExt , InspectorExt } ;
88use foundry_evm_coverage:: HitMaps ;
99use foundry_evm_traces:: { SparsedTraceArena , TraceMode } ;
@@ -57,6 +57,8 @@ pub struct InspectorStackBuilder {
5757 pub enable_isolation : bool ,
5858 /// Whether to enable Alphanet features.
5959 pub alphanet : bool ,
60+ /// The wallets to set in the cheatcodes context.
61+ pub wallets : Option < Wallets > ,
6062}
6163
6264impl InspectorStackBuilder {
@@ -87,6 +89,13 @@ impl InspectorStackBuilder {
8789 self
8890 }
8991
92+ /// Set the wallets.
93+ #[ inline]
94+ pub fn wallets ( mut self , wallets : Wallets ) -> Self {
95+ self . wallets = Some ( wallets) ;
96+ self
97+ }
98+
9099 /// Set the fuzzer inspector.
91100 #[ inline]
92101 pub fn fuzzer ( mut self , fuzzer : Fuzzer ) -> Self {
@@ -161,13 +170,20 @@ impl InspectorStackBuilder {
161170 chisel_state,
162171 enable_isolation,
163172 alphanet,
173+ wallets,
164174 } = self ;
165175 let mut stack = InspectorStack :: new ( ) ;
166176
167177 // inspectors
168178 if let Some ( config) = cheatcodes {
169- stack. set_cheatcodes ( Cheatcodes :: new ( config) ) ;
179+ let mut cheatcodes = Cheatcodes :: new ( config) ;
180+ // Set wallets if they are provided
181+ if let Some ( wallets) = wallets {
182+ cheatcodes. set_wallets ( wallets) ;
183+ }
184+ stack. set_cheatcodes ( cheatcodes) ;
170185 }
186+
171187 if let Some ( fuzzer) = fuzzer {
172188 stack. set_fuzzer ( fuzzer) ;
173189 }
0 commit comments