@@ -10,7 +10,7 @@ use crate::execution::contract_class::{
10
10
FeltSizeCount ,
11
11
NestedFeltCounts ,
12
12
} ;
13
- use crate :: execution:: execution_utils:: poseidon_hash_many_cost;
13
+ use crate :: execution:: execution_utils:: { encode_and_blake_hash_resources , poseidon_hash_many_cost} ;
14
14
use crate :: utils:: u64_from_usize;
15
15
16
16
#[ cfg( test) ]
@@ -151,8 +151,7 @@ trait EstimateCasmHashResources {
151
151
/// Estimates the Cairo execution resources used when applying the hash function during CASM
152
152
/// hashing.
153
153
fn estimated_resources_of_hash_function (
154
- & mut self ,
155
- _felt_count : FeltSizeCount ,
154
+ _felt_size_groups : & FeltSizeCount ,
156
155
) -> EstimatedExecutionResources ;
157
156
158
157
/// Estimates the Cairo execution resources for `compiled_class_hash` in the
@@ -177,12 +176,11 @@ impl EstimateCasmHashResources for CasmV1HashResourceEstimate {
177
176
}
178
177
179
178
fn estimated_resources_of_hash_function (
180
- & mut self ,
181
- felt_count : FeltSizeCount ,
179
+ felt_size_groups : & FeltSizeCount ,
182
180
) -> EstimatedExecutionResources {
183
181
EstimatedExecutionResources :: V1Hash {
184
182
// TODO(AvivG): Consider inlining `poseidon_hash_many_cost` logic here.
185
- resources : poseidon_hash_many_cost ( felt_count . n_felts ( ) ) ,
183
+ resources : poseidon_hash_many_cost ( felt_size_groups . n_felts ( ) ) ,
186
184
}
187
185
}
188
186
}
@@ -197,10 +195,8 @@ impl EstimateCasmHashResources for CasmV2HashResourceEstimate {
197
195
}
198
196
199
197
fn estimated_resources_of_hash_function (
200
- & mut self ,
201
- _felt_count : FeltSizeCount ,
198
+ felt_size_groups : & FeltSizeCount ,
202
199
) -> EstimatedExecutionResources {
203
- // TODO(AvivG): Use `cost_of_encode_felt252_data_and_calc_blake_hash` once it returns ER.
204
- EstimatedExecutionResources :: new ( HashVersion :: V2 )
200
+ encode_and_blake_hash_resources ( felt_size_groups)
205
201
}
206
202
}
0 commit comments