@@ -2,7 +2,7 @@ use crate::test_case_summary::{Single, TestCaseSummary};
2
2
use anyhow:: anyhow;
3
3
use blockifier:: abi:: constants;
4
4
use blockifier:: context:: TransactionContext ;
5
- use blockifier:: execution:: call_info:: { ChargedResources , EventSummary , ExecutionSummary } ;
5
+ use blockifier:: execution:: call_info:: EventSummary ;
6
6
use blockifier:: fee:: resources:: {
7
7
ArchivalDataResources , ComputationResources , MessageResources , StarknetResources ,
8
8
StateResources , TransactionResources ,
@@ -18,7 +18,6 @@ use shared::print::print_as_warning;
18
18
use starknet_api:: execution_resources:: { GasAmount , GasVector } ;
19
19
use starknet_api:: transaction:: EventContent ;
20
20
use starknet_api:: transaction:: fields:: GasVectorComputationMode ;
21
- use std:: collections:: HashSet ;
22
21
23
22
pub fn calculate_used_gas (
24
23
transaction_context : & TransactionContext ,
@@ -72,29 +71,15 @@ fn get_archival_data_resources(events: Vec<EventContent>) -> ArchivalDataResourc
72
71
event_summary. total_event_keys += u64_from_usize ( event. keys . len ( ) ) ;
73
72
}
74
73
75
- // TODO(#2978) this is a workaround because we cannot create `ArchivalDataResources` directly yet
76
- // because of private fields
77
- let dummy_execution_summary = ExecutionSummary {
78
- charged_resources : ChargedResources :: default ( ) ,
79
- executed_class_hashes : HashSet :: default ( ) ,
80
- visited_storage_entries : HashSet :: default ( ) ,
81
- l2_to_l1_payload_lengths : vec ! [ ] ,
74
+ // calldata length, signature length and code size are set to 0, because
75
+ // we don't include them in estimations
76
+ // ref: https://github.com/foundry-rs/starknet-foundry/blob/5ce15b029135545452588c00aae580c05eb11ca8/docs/src/testing/gas-and-resource-estimation.md?plain=1#L73
77
+ ArchivalDataResources {
82
78
event_summary,
83
- } ;
84
-
85
- let dummy_starknet_resources = StarknetResources :: new (
86
- // calldata length, signature length and code size are set to 0, because
87
- // we don't include them in estimations
88
- // ref: https://github.com/foundry-rs/starknet-foundry/blob/5ce15b029135545452588c00aae580c05eb11ca8/docs/src/testing/gas-and-resource-estimation.md?plain=1#L73
89
- 0 ,
90
- 0 ,
91
- 0 ,
92
- StateResources :: default ( ) ,
93
- None ,
94
- dummy_execution_summary,
95
- ) ;
96
-
97
- dummy_starknet_resources. archival_data
79
+ calldata_length : 0 ,
80
+ signature_length : 0 ,
81
+ code_size : 0 ,
82
+ }
98
83
}
99
84
100
85
// Put together from a few blockifier functions
0 commit comments