PrivateContext
When finished, one can call .finish() to convert back to the abi
Fields
Field | Type |
---|---|
pub inputs | PrivateContextInputs |
pub side_effect_counter | u32 |
pub min_revertible_side_effect_counter | u32 |
pub is_fee_payer | bool |
pub args_hash | Field |
pub return_hash | Field |
pub max_block_number | MaxBlockNumber |
pub note_hash_read_requests | BoundedVec<ReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL> |
pub nullifier_read_requests | BoundedVec<ReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL> |
key_validation_requests_and_generators | BoundedVec<KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL> |
pub note_hashes | BoundedVec<NoteHash, MAX_NOTE_HASHES_PER_CALL> |
pub nullifiers | BoundedVec<Nullifier, MAX_NULLIFIERS_PER_CALL> |
pub private_call_requests | BoundedVec<PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL> |
pub public_call_requests | BoundedVec<Counted<PublicCallRequest>, MAX_ENQUEUED_CALLS_PER_CALL> |
pub public_teardown_call_request | PublicCallRequest |
pub l2_to_l1_msgs | BoundedVec<L2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL> |
pub historical_header | BlockHeader |
pub private_logs | BoundedVec<PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL> |
pub contract_class_logs_hashes | BoundedVec<LogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL> |
pub 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 |
gas_settings
PrivateContext::gas_settings(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_block_header
Returns the header of a block whose state is used during private execution (not the block the transaction is included in).
PrivateContext::get_block_header(self);
Parameters
Name | Type |
---|---|
self |
get_block_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_block_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);