@@ -136,14 +136,7 @@ impl StorageArgs {
136
136
artifact. get_deployed_bytecode_bytes ( ) . is_some_and ( |b| * b == address_code)
137
137
} ) ;
138
138
if let Some ( ( _, artifact) ) = artifact {
139
- return fetch_and_print_storage (
140
- provider,
141
- address,
142
- block,
143
- artifact,
144
- !shell:: is_json ( ) ,
145
- )
146
- . await ;
139
+ return fetch_and_print_storage ( provider, address, block, artifact) . await ;
147
140
}
148
141
}
149
142
@@ -224,7 +217,7 @@ impl StorageArgs {
224
217
// Clear temp directory
225
218
root. close ( ) ?;
226
219
227
- fetch_and_print_storage ( provider, address, block, artifact, !shell :: is_json ( ) ) . await
220
+ fetch_and_print_storage ( provider, address, block, artifact) . await
228
221
}
229
222
}
230
223
@@ -272,15 +265,14 @@ async fn fetch_and_print_storage<P: Provider<AnyNetwork>>(
272
265
address : Address ,
273
266
block : Option < BlockId > ,
274
267
artifact : & ConfigurableContractArtifact ,
275
- pretty : bool ,
276
268
) -> Result < ( ) > {
277
269
if is_storage_layout_empty ( & artifact. storage_layout ) {
278
270
sh_warn ! ( "Storage layout is empty." ) ?;
279
271
Ok ( ( ) )
280
272
} else {
281
273
let layout = artifact. storage_layout . as_ref ( ) . unwrap ( ) . clone ( ) ;
282
274
let values = fetch_storage_slots ( provider, address, block, & layout) . await ?;
283
- print_storage ( layout, values, pretty )
275
+ print_storage ( layout, values)
284
276
}
285
277
}
286
278
@@ -305,8 +297,8 @@ async fn fetch_storage_slots<P: Provider<AnyNetwork>>(
305
297
futures:: future:: try_join_all ( requests) . await
306
298
}
307
299
308
- fn print_storage ( layout : StorageLayout , values : Vec < StorageValue > , pretty : bool ) -> Result < ( ) > {
309
- if !pretty {
300
+ fn print_storage ( layout : StorageLayout , values : Vec < StorageValue > ) -> Result < ( ) > {
301
+ if shell :: is_json ( ) {
310
302
let values: Vec < _ > = layout
311
303
. storage
312
304
. iter ( )
0 commit comments