PrivateContext
When finished, one can call .finish() to convert back to the abi
Fields
Field | Type |
---|---|
inputs | PrivateContextInputs |
side_effect_counter | u32 |
min_revertible_side_effect_counter | u32 |
is_fee_payer | bool |
args_hash | Field |
return_hash | Field |
max_block_number | MaxBlockNumber |
note_hash_read_requests | BoundedVec<ReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL> |
nullifier_read_requests | BoundedVec<ReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL> |
key_validation_requests_and_generators | BoundedVec<KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL> |
note_hashes | BoundedVec<NoteHash, MAX_NOTE_HASHES_PER_CALL> |
nullifiers | BoundedVec<Nullifier, MAX_NULLIFIERS_PER_CALL> |
private_call_requests | BoundedVec<PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL> |
public_call_requests | BoundedVec<PublicCallRequest, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL> |
public_teardown_call_request | PublicCallRequest |
l2_to_l1_msgs | BoundedVec<L2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL> |
historical_header | Header |
note_encrypted_logs_hashes | BoundedVec<NoteLogHash, MAX_NOTE_ENCRYPTED_LOGS_PER_CALL> |
encrypted_logs_hashes | BoundedVec<EncryptedLogHash, MAX_ENCRYPTED_LOGS_PER_CALL> |
unencrypted_logs_hashes | BoundedVec<LogHash, MAX_UNENCRYPTED_LOGS_PER_CALL> |
last_key_validation_requests | Option<KeyValidationRequest>; NUM_KEY_TYPES] |
Methods
new
PrivateContext::new(inputs, args_hash);
Parameters
Name | Type |
---|---|
inputs | PrivateContextInputs |
args_hash | Field |
msg_sender
PrivateContext::msg_sender(self);
Parameters
Name | Type |
---|---|
self |
this_address
PrivateContext::this_address(self);
Parameters
Name | Type |
---|---|
self |
chain_id
PrivateContext::chain_id(self);
Parameters
Name | Type |
---|---|
self |
version
PrivateContext::version(self);
Parameters
Name | Type |
---|---|
self |
selector
PrivateContext::selector(self);
Parameters
Name | Type |
---|---|
self |
get_args_hash
PrivateContext::get_args_hash(self);
Parameters
Name | Type |
---|---|
self |
push_note_hash
PrivateContext::push_note_hash(&mut self, note_hash);
Parameters
Name | Type |
---|---|
&mut self | |
note_hash | Field |
push_nullifier
PrivateContext::push_nullifier(&mut self, nullifier);
Parameters
Name | Type |
---|---|
&mut self | |
nullifier | Field |
push_nullifier_for_note_hash
PrivateContext::push_nullifier_for_note_hash(&mut self, nullifier, nullified_note_hash);
Parameters
Name | Type |
---|---|
&mut self | |
nullifier | Field |
nullified_note_hash | Field |
get_header
Returns the header of a block whose state is used during private execution (not the block the transaction is included in).
PrivateContext::get_header(self);
Parameters
Name | Type |
---|---|
self |
get_header_at
Returns the header of an arbitrary block whose block number is less than or equal to the block number of historical header.
PrivateContext::get_header_at(self, block_number);
Parameters
Name | Type |
---|---|
self | |
block_number | u32 |
set_return_hash
PrivateContext::set_return_hash(&mut self, returns_hasher);
Parameters
Name | Type |
---|---|
&mut self | |
returns_hasher | ArgsHasher |
finish
PrivateContext::finish(self);
Parameters
Name | Type |
---|---|
self |
set_as_fee_payer
PrivateContext::set_as_fee_payer(&mut self);
Parameters
Name | Type |
---|---|
&mut self |
end_setup
PrivateContext::end_setup(&mut self);
Parameters
Name | Type |
---|---|
&mut self |
set_tx_max_block_number
PrivateContext::set_tx_max_block_number(&mut self, max_block_number);
Parameters
Name | Type |
---|---|
&mut self | |
max_block_number | u32 |
push_note_hash_read_request
PrivateContext::push_note_hash_read_request(&mut self, note_hash);
Parameters
Name | Type |
---|---|
&mut self | |
note_hash | Field |
push_nullifier_read_request
PrivateContext::push_nullifier_read_request(&mut self, nullifier);
Parameters
Name | Type |
---|---|
&mut self | |
nullifier | Field |
request_nsk_app
PrivateContext::request_nsk_app(&mut self, npk_m_hash);
Parameters
Name | Type |
---|---|
&mut self | |
npk_m_hash | Field |
request_ovsk_app
PrivateContext::request_ovsk_app(&mut self, ovpk_m_hash);
Parameters
Name | Type |
---|---|
&mut self | |
ovpk_m_hash | Field |
request_sk_app
PrivateContext::request_sk_app(&mut self, pk_m_hash, key_index);
Parameters
Name | Type |
---|---|
&mut self | |
pk_m_hash | Field |
key_index | Field |
message_portal
PrivateContext::message_portal(&mut self, recipient, content);
Parameters
Name | Type |
---|---|
&mut self | |
recipient | EthAddress |
content | Field |
consume_l1_to_l2_message
PrivateContext::consume_l1_to_l2_message(&mut self, content, secret, sender, leaf_index, );
Parameters
Name | Type |
---|---|
&mut self | |
content | Field |
secret | Field |
sender | EthAddress |
leaf_index | Field |
emit_raw_event_log_with_masked_address
NB: A randomness value of 0 signals that the kernels should not mask the contract address used in siloing later on e.g. 'handshaking' contract w/ known address.
PrivateContext::emit_raw_event_log_with_masked_address(&mut self, randomness, log, log_hash, );
Parameters
Name | Type |
---|---|
&mut self | |
randomness | Field |
log | [u8; M] |
log_hash | Field |
emit_raw_note_log
PrivateContext::emit_raw_note_log(&mut self, note_hash_counter, log, log_hash, );
Parameters
Name | Type |
---|---|
&mut self | |
note_hash_counter | u32 |
log | [u8; M] |
log_hash | Field |
call_private_function
PrivateContext::call_private_function(&mut self, contract_address, function_selector, args, );
Parameters
Name | Type |
---|---|
&mut self | |
contract_address | AztecAddress |
function_selector | FunctionSelector |
args | [Field; ARGS_COUNT] |
static_call_private_function
PrivateContext::static_call_private_function(&mut self, contract_address, function_selector, args, );
Parameters
Name | Type |
---|---|
&mut self | |
contract_address | AztecAddress |
function_selector | FunctionSelector |
args | [Field; ARGS_COUNT] |
call_private_function_no_args
PrivateContext::call_private_function_no_args(&mut self, contract_address, function_selector, );
Parameters
Name | Type |
---|---|
&mut self | |
contract_address | AztecAddress |
function_selector | FunctionSelector |
static_call_private_function_no_args
PrivateContext::static_call_private_function_no_args(&mut self, contract_address, function_selector, );
Parameters
Name | Type |
---|---|
&mut self | |
contract_address | AztecAddress |
function_selector | FunctionSelector |
call_private_function_with_packed_args
PrivateContext::call_private_function_with_packed_args(&mut self, contract_address, function_selector, args_hash, is_static_call, );
Parameters
Name | Type |
---|---|
&mut self | |
contract_address | AztecAddress |
function_selector | FunctionSelector |
args_hash | Field |
is_static_call | bool |
call_public_function
PrivateContext::call_public_function(&mut self, contract_address, function_selector, args, );
Parameters
Name | Type |
---|---|
&mut self | |
contract_address | AztecAddress |
function_selector | FunctionSelector |
args | [Field; ARGS_COUNT] |
static_call_public_function
PrivateContext::static_call_public_function(&mut self, contract_address, function_selector, args, );
Parameters
Name | Type |
---|---|
&mut self | |
contract_address | AztecAddress |
function_selector | FunctionSelector |
args | [Field; ARGS_COUNT] |
call_public_function_no_args
PrivateContext::call_public_function_no_args(&mut self, contract_address, function_selector, );
Parameters
Name | Type |
---|---|
&mut self | |
contract_address | AztecAddress |
function_selector | FunctionSelector |
static_call_public_function_no_args
PrivateContext::static_call_public_function_no_args(&mut self, contract_address, function_selector, );
Parameters
Name | Type |
---|---|
&mut self | |
contract_address | AztecAddress |
function_selector | FunctionSelector |
call_public_function_with_packed_args
PrivateContext::call_public_function_with_packed_args(&mut self, contract_address, function_selector, args_hash, is_static_call, );
Parameters
Name | Type |
---|---|
&mut self | |
contract_address | AztecAddress |
function_selector | FunctionSelector |
args_hash | Field |
is_static_call | bool |
set_public_teardown_function
PrivateContext::set_public_teardown_function(&mut self, contract_address, function_selector, args, );
Parameters
Name | Type |
---|---|
&mut self | |
contract_address | AztecAddress |
function_selector | FunctionSelector |
args | [Field; ARGS_COUNT] |
set_public_teardown_function_with_packed_args
PrivateContext::set_public_teardown_function_with_packed_args(&mut self, contract_address, function_selector, args_hash, is_static_call, );
Parameters
Name | Type |
---|---|
&mut self | |
contract_address | AztecAddress |
function_selector | FunctionSelector |
args_hash | Field |
is_static_call | bool |
next_counter
PrivateContext::next_counter(&mut self);
Parameters
Name | Type |
---|---|
&mut self |
Standalone Functions
empty
empty();
Takes no parameters.