1- use crate::context::calls::PublicStaticCall ;
21use crate::context::PrivateContext ;
3- use crate::protocol::abis::function_selector::FunctionSelector ;
4- use crate::protocol::constants ::PUBLIC_CHECKS_ADDRESS ;
2+ use crate::public_checks_interface::PublicChecksInterface ;
3+ use standard_addresses ::PUBLIC_CHECKS_ADDRESS ;
54
65// docs:start:helper_public_checks_functions
76/// Asserts that the current timestamp in the enqueued public call enqueued by `check_timestamp` satisfies
@@ -10,14 +9,7 @@ use crate::protocol::constants::PUBLIC_CHECKS_ADDRESS;
109/// This conceals an address of the calling contract by setting `context.msg_sender` to the public checks contract
1110/// address.
1211pub fn privately_check_timestamp (operation : u8 , value : u64 , context : &mut PrivateContext ) {
13- let selector = comptime { FunctionSelector ::from_signature ("check_timestamp(u8,u64)" ) };
14- PublicStaticCall ::<15 , 2 , ()>::new (
15- PUBLIC_CHECKS_ADDRESS ,
16- selector ,
17- "check_timestamp" ,
18- [operation as Field , value as Field ],
19- )
20- .enqueue_view_incognito (context );
12+ PublicChecksInterface ::at (PUBLIC_CHECKS_ADDRESS ).check_timestamp (operation , value ).enqueue_view_incognito (context );
2113}
2214
2315/// Asserts that the current block number in the enqueued public call enqueued by `check_block_number` satisfies
@@ -27,14 +19,7 @@ pub fn privately_check_timestamp(operation: u8, value: u64, context: &mut Privat
2719/// address.
2820pub fn privately_check_block_number (operation : u8 , value : u32 , context : &mut PrivateContext ) {
2921 // docs:start:enqueueing
30- let selector = comptime { FunctionSelector ::from_signature ("check_block_number(u8,u32)" ) };
31- PublicStaticCall ::<18 , 2 , ()>::new (
32- PUBLIC_CHECKS_ADDRESS ,
33- selector ,
34- "check_block_number" ,
35- [operation as Field , value as Field ],
36- )
37- .enqueue_view_incognito (context );
22+ PublicChecksInterface ::at (PUBLIC_CHECKS_ADDRESS ).check_block_number (operation , value ).enqueue_view_incognito (context );
3823 // docs:end:enqueueing
3924}
4025// docs:end:helper_public_checks_functions
0 commit comments