1- use crate::PublicChecks ;
2- use aztec::context::PrivateContext ;
3- use aztec::protocol::constants::PUBLIC_CHECKS_ADDRESS ;
1+ use crate::context::calls::PublicStaticCall ;
2+ use crate::context::PrivateContext ;
3+ use crate::protocol::abis::function_selector::FunctionSelector ;
4+ use crate::protocol::constants::PUBLIC_CHECKS_ADDRESS ;
45
56// docs:start:helper_public_checks_functions
67/// Asserts that the current timestamp in the enqueued public call enqueued by `check_timestamp` satisfies
@@ -9,7 +10,14 @@ use aztec::protocol::constants::PUBLIC_CHECKS_ADDRESS;
910/// This conceals an address of the calling contract by setting `context.msg_sender` to the public checks contract
1011/// address.
1112pub fn privately_check_timestamp (operation : u8 , value : u64 , context : &mut PrivateContext ) {
12- PublicChecks ::at (PUBLIC_CHECKS_ADDRESS ).check_timestamp (operation , value ).enqueue_view_incognito (context );
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 );
1321}
1422
1523/// Asserts that the current block number in the enqueued public call enqueued by `check_block_number` satisfies
@@ -19,7 +27,14 @@ pub fn privately_check_timestamp(operation: u8, value: u64, context: &mut Privat
1927/// address.
2028pub fn privately_check_block_number (operation : u8 , value : u32 , context : &mut PrivateContext ) {
2129 // docs:start:enqueueing
22- PublicChecks ::at (PUBLIC_CHECKS_ADDRESS ).check_block_number (operation , value ).enqueue_view_incognito (context );
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 );
2338 // docs:end:enqueueing
2439}
2540// docs:end:helper_public_checks_functions
0 commit comments