@@ -10,13 +10,15 @@ pub(crate) const ESTIMATED_DEPLOY_STEPS: usize = 0;
10
10
pub ( crate ) const ESTIMATED_DEPLOY_ACCOUNT_STEPS : usize = 3612 ;
11
11
pub ( crate ) const ESTIMATED_L1_HANDLER_STEPS : usize = 1068 ;
12
12
13
+ /// Represents the operating system resources associated with syscalls and transactions.
13
14
#[ derive( Debug , Clone ) ]
14
15
pub struct OsResources {
15
16
execute_syscalls : HashMap < String , ExecutionResources > ,
16
17
execute_txs_inner : HashMap < TransactionType , ExecutionResources > ,
17
18
}
18
19
19
20
impl Default for OsResources {
21
+ /// Provide default values for `OsResources`.
20
22
fn default ( ) -> Self {
21
23
let execute_txs_inner: HashMap < TransactionType , ExecutionResources > = HashMap :: from ( [
22
24
(
@@ -261,6 +263,8 @@ impl Default for OsResources {
261
263
}
262
264
}
263
265
266
+ /// Calculate the additional operating system resources required to execute a transaction
267
+ /// given a set of syscalls invoked and a transaction type.
264
268
pub fn get_additional_os_resources (
265
269
syscall_counter : HashMap < String , u64 > ,
266
270
tx_type : & TransactionType ,
@@ -289,6 +293,7 @@ pub fn get_additional_os_resources(
289
293
Ok ( additional_os_resources)
290
294
}
291
295
296
+ /// Test for the `get_additional_os_resources` function.
292
297
#[ test]
293
298
fn get_additional_os_resources_test ( ) {
294
299
let syscall_counter = HashMap :: from ( [ ( "storage_read" . into ( ) , 2 ) , ( "storage_write" . into ( ) , 3 ) ] ) ;
0 commit comments