@@ -178,6 +178,7 @@ fn test_hash_operation() {
178
178
179
179
// Manually set hash elements
180
180
let mut expected_hash = PedersenTrait :: new (0 )
181
+ . update_with (1 ) // number of calls
181
182
. update_with (target . contract_address) // call::to
182
183
. update_with (selector! (" set_number" )) // call::selector
183
184
. update_with (1 ) // call::calldata.len
@@ -228,6 +229,32 @@ fn test_hash_operation_batch() {
228
229
assert_eq! (hashed_operation , expected_hash );
229
230
}
230
231
232
+ #[test]
233
+ fn test_hash_operation_and_hash_operations () {
234
+ let (mut timelock , _ ) = setup_dispatchers ();
235
+ let predecessor = 123 ;
236
+ let salt = SALT ;
237
+
238
+ // Setup and hash single call
239
+ let to_1 = contract_address_const :: <1 >();
240
+ let selector_1 = 123 ;
241
+ let calldata_1 = array! [1 , 456 ]. span ();
242
+ let call_1 = Call { to : to_1 , selector : selector_1 , calldata : calldata_1 };
243
+
244
+ let hash_single = timelock . hash_operation (call_1 , predecessor , salt );
245
+
246
+ // Setup and hash batch of single call
247
+ let to_2 = contract_address_const :: <123 >();
248
+ let selector_2 = 2 ;
249
+ let calldata_2 = array! [456 ]. span ();
250
+ let call_2 = Call { to : to_2 , selector : selector_2 , calldata : calldata_2 };
251
+ let single_call_batch = array! [call_2 ]. span ();
252
+
253
+ let hash_batch = timelock . hash_operation_batch (single_call_batch , predecessor , salt );
254
+
255
+ assert_ne! (hash_single , hash_batch );
256
+ }
257
+
231
258
//
232
259
// schedule
233
260
//
0 commit comments