pub struct TxContext {
pub blockchain_info_box: Box<BlockchainTxInfo>,
pub tx_input_box: Box<TxInput>,
pub tx_output_cell: Rc<RefCell<TxOutput>>,
}Fields§
§blockchain_info_box: Box<BlockchainTxInfo>§tx_input_box: Box<TxInput>§tx_output_cell: Rc<RefCell<TxOutput>>Implementations§
Source§impl TxContext
impl TxContext
pub fn insert_new_big_uint(&self, value: BigUint) -> BigUint<Self>
pub fn insert_new_big_uint_zero(&self) -> BigUint<Self>
pub fn big_uint_value(&self, bu: &BigUint<Self>) -> BigUint
Trait Implementations§
Source§impl BigIntApi for TxContext
impl BigIntApi for TxContext
fn bi_new(&self, value: i64) -> Handle
fn bi_unsigned_byte_length(&self, handle: Handle) -> usize
fn bi_get_unsigned_bytes(&self, handle: Handle) -> BoxedBytes
fn bi_set_unsigned_bytes(&self, dest: Handle, bytes: &[u8])
fn bi_signed_byte_length(&self, handle: Handle) -> usize
fn bi_get_signed_bytes(&self, handle: Handle) -> BoxedBytes
fn bi_set_signed_bytes(&self, dest: Handle, bytes: &[u8])
fn bi_to_i64(&self, handle: Handle) -> Option<i64>
fn bi_add(&self, dest: Handle, x: Handle, y: Handle)
fn bi_sub(&self, dest: Handle, x: Handle, y: Handle)
fn bi_sub_unsigned(&self, dest: Handle, x: Handle, y: Handle)
fn bi_mul(&self, dest: Handle, x: Handle, y: Handle)
fn bi_t_div(&self, dest: Handle, x: Handle, y: Handle)
fn bi_t_mod(&self, dest: Handle, x: Handle, y: Handle)
fn bi_abs(&self, dest: Handle, x: Handle)
fn bi_neg(&self, dest: Handle, x: Handle)
fn bi_sign(&self, x: Handle) -> Sign
fn bi_cmp(&self, x: Handle, y: Handle) -> Ordering
fn bi_sqrt(&self, dest: Handle, x: Handle)
fn bi_pow(&self, dest: Handle, x: Handle, y: Handle)
fn bi_log2(&self, x: Handle) -> u32
fn bi_and(&self, dest: Handle, x: Handle, y: Handle)
fn bi_or(&self, dest: Handle, x: Handle, y: Handle)
fn bi_xor(&self, dest: Handle, x: Handle, y: Handle)
fn bi_shr(&self, dest: Handle, x: Handle, bits: usize)
fn bi_shl(&self, dest: Handle, x: Handle, bits: usize)
fn bi_new_zero(&self) -> i32
Source§impl BlockchainApi for TxContext
impl BlockchainApi for TxContext
fn get_sc_address_legacy(&self) -> Address
fn get_owner_address_legacy(&self) -> Address
fn get_shard_of_address_legacy(&self, _address: &Address) -> u32
fn is_smart_contract_legacy(&self, _address: &Address) -> bool
fn get_caller_legacy(&self) -> Address
fn get_balance_legacy(&self, address: &Address) -> BigUint<Self>
fn get_state_root_hash_legacy(&self) -> H256
fn get_tx_hash_legacy(&self) -> H256
fn get_gas_left(&self) -> u64
fn get_block_timestamp(&self) -> u64
fn get_block_nonce(&self) -> u64
fn get_block_round(&self) -> u64
fn get_block_epoch(&self) -> u64
fn get_block_random_seed_legacy(&self) -> Box<[u8; 48]>
fn get_prev_block_timestamp(&self) -> u64
fn get_prev_block_nonce(&self) -> u64
fn get_prev_block_round(&self) -> u64
fn get_prev_block_epoch(&self) -> u64
fn get_prev_block_random_seed_legacy(&self) -> Box<[u8; 48]>
fn get_current_dcdt_nft_nonce( &self, _address: &Address, _token: &TokenIdentifier<Self>, ) -> u64
fn get_dcdt_balance( &self, address: &ManagedAddress<Self>, token: &TokenIdentifier<Self>, _nonce: u64, ) -> BigUint<Self>
fn get_dcdt_token_data( &self, _address: &ManagedAddress<Self>, _token: &TokenIdentifier<Self>, _nonce: u64, ) -> DcdtTokenData<Self>
fn get_caller(&self) -> ManagedAddress<Self>
fn get_sc_address(&self) -> ManagedAddress<Self>
fn get_owner_address(&self) -> ManagedAddress<Self>
fn get_shard_of_address(&self, address: &ManagedAddress<Self>) -> u32
fn is_smart_contract(&self, address: &ManagedAddress<Self>) -> bool
fn get_balance(&self, address: &ManagedAddress<Self>) -> BigUint<Self>
fn get_state_root_hash(&self) -> ManagedByteArray<Self, 32>
fn get_tx_hash(&self) -> ManagedByteArray<Self, 32>
fn get_block_random_seed(&self) -> ManagedByteArray<Self, 48>
fn get_prev_block_random_seed(&self) -> ManagedByteArray<Self, 48>
Source§impl CallValueApi for TxContext
impl CallValueApi for TxContext
fn check_not_payable(&self)
Source§fn rewa_value(&self) -> BigUint<Self>
fn rewa_value(&self) -> BigUint<Self>
Retrieves the REWA call value from the VM.
Will return 0 in case of an DCDT transfer (cannot have both REWA and DCDT transfer simultaneously).
Source§fn dcdt_value(&self) -> BigUint<Self>
fn dcdt_value(&self) -> BigUint<Self>
Retrieves the DCDT call value from the VM.
Will return 0 in case of an REWA transfer (cannot have both REWA and DCDT transfer simultaneously).
Source§fn token(&self) -> TokenIdentifier<Self>
fn token(&self) -> TokenIdentifier<Self>
Returns the call value token identifier of the current call.
The identifier is wrapped in a TokenIdentifier object, to hide underlying logic. Read more
Source§fn dcdt_token_nonce(&self) -> u64
fn dcdt_token_nonce(&self) -> u64
Returns the nonce of the received DCDT token.
Will return 0 in case of REWA or fungible DCDT transfer.
Source§fn dcdt_token_type(&self) -> DcdtTokenType
fn dcdt_token_type(&self) -> DcdtTokenType
Returns the DCDT token type.
Will return “Fungible” for REWA.
fn dcdt_num_transfers(&self) -> usize
fn dcdt_value_by_index(&self, _index: usize) -> BigUint<Self>
fn token_by_index(&self, _index: usize) -> TokenIdentifier<Self>
fn dcdt_token_nonce_by_index(&self, _index: usize) -> u64
fn dcdt_token_type_by_index(&self, _index: usize) -> DcdtTokenType
Source§fn require_rewa(&self) -> BigUint<Self>
fn require_rewa(&self) -> BigUint<Self>
Will return the REWA call value,
but also fail with an error if DCDT is sent.
Especially used in the auto-generated call value processing.
Source§fn require_dcdt(&self, token: &[u8]) -> BigUint<Self>
fn require_dcdt(&self, token: &[u8]) -> BigUint<Self>
Will return the DCDT call value,
but also fail with an error if REWA or the wrong DCDT token is sent.
Especially used in the auto-generated call value processing.
Source§fn payment_token_pair(&self) -> (BigUint<Self>, TokenIdentifier<Self>)
fn payment_token_pair(&self) -> (BigUint<Self>, TokenIdentifier<Self>)
Returns both the call value (either REWA or DCDT) and the token identifier.
Especially used in the `#[payable(“*”)] auto-generated snippets.
The method might seem redundant, but there is such a hook in Andes
that might be used in this scenario in the future.
fn get_all_dcdt_transfers(&self) -> ManagedVec<Self, DcdtTokenPayment<Self>>
Source§impl CryptoApi for TxContext
impl CryptoApi for TxContext
fn sha256(&self, data: &[u8]) -> H256
fn keccak256(&self, data: &[u8]) -> H256
fn ripemd160(&self, _data: &[u8]) -> Box<[u8; 20]>
fn verify_bls(&self, _key: &[u8], _message: &[u8], _signature: &[u8]) -> bool
fn verify_ed25519( &self, _key: &[u8], _message: &[u8], _signature: &[u8], ) -> bool
Source§fn verify_secp256k1(
&self,
_key: &[u8],
_message: &[u8],
_signature: &[u8],
) -> bool
fn verify_secp256k1( &self, _key: &[u8], _message: &[u8], _signature: &[u8], ) -> bool
Note: the signature is minimum 2 bytes in length,
the second byte encodes the length of the remaining signature bytes.
fn verify_custom_secp256k1( &self, _key: &[u8], _message: &[u8], _signature: &[u8], _hash_type: MessageHashType, ) -> bool
fn encode_secp256k1_der_signature(&self, _r: &[u8], _s: &[u8]) -> BoxedBytes
Source§impl EllipticCurveApi for TxContext
impl EllipticCurveApi for TxContext
fn ec_create(&self, _name: &[u8]) -> Handle
fn ec_get_values( &self, _ec_handle: Handle, _field_order_handle: Handle, _base_point_order_handle: Handle, _eq_constant_handle: Handle, _x_base_point_handle: Handle, _y_base_point_handle: Handle, )
fn ec_curve_length(&self, _ec_handle: Handle) -> u32
fn ec_private_key_byte_length(&self, _ec_handle: Handle) -> u32
fn ec_add( &self, _x_result_handle: Handle, _y_result_handle: Handle, _ec_handle: Handle, _x_first_point: Handle, _y_first_point: Handle, _x_second_point: Handle, _y_second_point: Handle, )
fn ec_double( &self, _x_result_handle: Handle, _y_result_handle: Handle, _ec_handle: Handle, _x_point_handle: Handle, _y_point_handle: Handle, )
fn ec_is_on_curve( &self, _ec_handle: Handle, _x_point_handle: Handle, _y_point_handle: Handle, ) -> bool
fn ec_scalar_mult( &self, _x_result_handle: Handle, _y_result_handle: Handle, _ec_handle: Handle, _x_point_handle: Handle, _y_point_handle: Handle, _data: &[u8], )
fn ec_scalar_base_mult( &self, _x_result_handle: Handle, _y_result_handle: Handle, _ec_handle: Handle, _data: &[u8], )
fn ec_marshal( &self, _ec_handle: Handle, _x_pair_handle: Handle, _y_pair_handle: Handle, ) -> BoxedBytes
fn ec_marshal_compressed( &self, _ec_handle: Handle, _x_pair_handle: Handle, _y_pair_handle: Handle, ) -> BoxedBytes
fn ec_unmarshal( &self, _x_result_handle: Handle, _y_result_handle: Handle, _ec_handle: Handle, _data: &[u8], )
fn ec_unmarshal_compressed( &self, _x_result_handle: Handle, _y_result_handle: Handle, _ec_handle: Handle, _data: &[u8], )
fn ec_generate_key( &self, _x_pub_key_handle: Handle, _y_pub_key_handle: Handle, _ec_handle: Handle, ) -> BoxedBytes
Source§impl EndpointArgumentApi for TxContext
Interface to only be used by code generated by the macros.
The smart contract code doesn’t have access to these methods directly.
impl EndpointArgumentApi for TxContext
Interface to only be used by code generated by the macros. The smart contract code doesn’t have access to these methods directly.
fn get_num_arguments(&self) -> i32
fn get_argument_len(&self, arg_index: i32) -> usize
fn copy_argument_to_slice(&self, _arg_index: i32, _slice: &mut [u8])
fn get_argument_vec_u8(&self, arg_index: i32) -> Vec<u8> ⓘ
fn get_argument_boxed_bytes(&self, arg_index: i32) -> BoxedBytes
fn get_argument_big_uint_raw(&self, arg_index: i32) -> Handle
fn get_argument_big_int_raw(&self, arg_index: i32) -> i32
fn get_argument_managed_buffer_raw(&self, arg_index: i32) -> Handle
fn get_argument_i64(&self, arg_index: i32) -> i64
fn get_argument_u64(&self, arg_index: i32) -> u64
fn check_num_arguments(&self, expected: i32)
Source§impl EndpointFinishApi for TxContext
Interface to only be used by code generated by the macros.
The smart contract code doesn’t have access to these methods directly.
impl EndpointFinishApi for TxContext
Interface to only be used by code generated by the macros. The smart contract code doesn’t have access to these methods directly.
fn finish_slice_u8(&self, slice: &[u8])
fn finish_big_int_raw(&self, handle: Handle)
fn finish_big_uint_raw(&self, handle: Handle)
fn finish_managed_buffer_raw(&self, handle: Handle)
fn finish_i64(&self, value: i64)
fn finish_u64(&self, value: u64)
Source§impl ErrorApi for TxContext
impl ErrorApi for TxContext
fn signal_error(&self, message: &[u8]) -> !
fn signal_error_from_buffer(&self, message_handle: Handle) -> !
Source§impl LogApi for TxContext
Interface to only be used by code generated by the macros.
The smart contract code doesn’t have access to these methods directly.
impl LogApi for TxContext
Interface to only be used by code generated by the macros. The smart contract code doesn’t have access to these methods directly.
Source§fn write_event_log(&self, topics_buffer: &ArgBuffer, data: &[u8])
fn write_event_log(&self, topics_buffer: &ArgBuffer, data: &[u8])
Saves an event log.
Source§fn write_legacy_log(&self, topics: &[[u8; 32]], data: &[u8])
fn write_legacy_log(&self, topics: &[[u8; 32]], data: &[u8])
The legacy Andes hook for saving event logs. It does the same, but only accepts 32-byte topics.
Only kept for backwards compatibility.
fn managed_write_log(&self, topics_handle: Handle, data_handle: Handle)
Source§impl ManagedBufferApi for TxContext
impl ManagedBufferApi for TxContext
fn mb_new_empty(&self) -> Handle
fn mb_new_from_bytes(&self, bytes: &[u8]) -> Handle
fn mb_len(&self, handle: Handle) -> usize
fn mb_to_boxed_bytes(&self, handle: Handle) -> BoxedBytes
Source§fn mb_load_slice(
&self,
source_handle: Handle,
starting_position: usize,
dest_slice: &mut [u8],
) -> Result<(), InvalidSliceError>
fn mb_load_slice( &self, source_handle: Handle, starting_position: usize, dest_slice: &mut [u8], ) -> Result<(), InvalidSliceError>
TODO: investigate the impact of using
Result<(), ()> on the wasm output.Source§fn mb_copy_slice(
&self,
source_handle: Handle,
starting_position: usize,
slice_len: usize,
dest_handle: Handle,
) -> Result<(), InvalidSliceError>
fn mb_copy_slice( &self, source_handle: Handle, starting_position: usize, slice_len: usize, dest_handle: Handle, ) -> Result<(), InvalidSliceError>
TODO: investigate the impact of using
Result<(), ()> on the wasm output.fn mb_copy_to_slice_pad_right(&self, handle: Handle, destination: &mut [u8])
fn mb_overwrite(&self, handle: Handle, value: &[u8])
fn mb_append(&self, accumulator_handle: Handle, data_handle: Handle)
fn mb_append_bytes(&self, accumulator_handle: Handle, bytes: &[u8])
fn mb_eq(&self, handle1: Handle, handle2: Handle) -> bool
Source§impl ManagedTypeApi for TxContext
impl ManagedTypeApi for TxContext
fn mb_to_big_int_unsigned(&self, buffer_handle: Handle) -> Handle
fn mb_to_big_int_signed(&self, buffer_handle: Handle) -> Handle
fn mb_from_big_int_unsigned(&self, big_int_handle: Handle) -> Handle
fn mb_from_big_int_signed(&self, big_int_handle: Handle) -> Handle
Source§impl SendApi for TxContext
impl SendApi for TxContext
Source§fn direct_rewa<D>(
&self,
to: &ManagedAddress<Self>,
amount: &BigUint<Self>,
_data: D,
)where
D: ManagedInto<Self, ManagedBuffer<Self>>,
fn direct_rewa<D>(
&self,
to: &ManagedAddress<Self>,
amount: &BigUint<Self>,
_data: D,
)where
D: ManagedInto<Self, ManagedBuffer<Self>>,
Sends REWA to a given address, directly.
Used especially for sending REWA to regular accounts.
Source§fn direct_rewa_execute(
&self,
_to: &ManagedAddress<Self>,
_amount: &BigUint<Self>,
_gas_limit: u64,
_endpoint_name: &ManagedBuffer<Self>,
_arg_buffer: &ManagedArgBuffer<Self>,
) -> Result<(), &'static [u8]>
fn direct_rewa_execute( &self, _to: &ManagedAddress<Self>, _amount: &BigUint<Self>, _gas_limit: u64, _endpoint_name: &ManagedBuffer<Self>, _arg_buffer: &ManagedArgBuffer<Self>, ) -> Result<(), &'static [u8]>
Sends REWA to an address (optionally) and executes like an async call, but without callback.
Source§fn direct_dcdt_execute(
&self,
to: &ManagedAddress<Self>,
token: &TokenIdentifier<Self>,
amount: &BigUint<Self>,
_gas: u64,
_endpoint_name: &ManagedBuffer<Self>,
_arg_buffer: &ManagedArgBuffer<Self>,
) -> Result<(), &'static [u8]>
fn direct_dcdt_execute( &self, to: &ManagedAddress<Self>, token: &TokenIdentifier<Self>, amount: &BigUint<Self>, _gas: u64, _endpoint_name: &ManagedBuffer<Self>, _arg_buffer: &ManagedArgBuffer<Self>, ) -> Result<(), &'static [u8]>
Sends DCDT to an address and executes like an async call, but without callback.
Source§fn direct_dcdt_nft_execute(
&self,
_to: &ManagedAddress<Self>,
_token: &TokenIdentifier<Self>,
_nonce: u64,
_amount: &BigUint<Self>,
_gas_limit: u64,
_endpoint_name: &ManagedBuffer<Self>,
_arg_buffer: &ManagedArgBuffer<Self>,
) -> Result<(), &'static [u8]>
fn direct_dcdt_nft_execute( &self, _to: &ManagedAddress<Self>, _token: &TokenIdentifier<Self>, _nonce: u64, _amount: &BigUint<Self>, _gas_limit: u64, _endpoint_name: &ManagedBuffer<Self>, _arg_buffer: &ManagedArgBuffer<Self>, ) -> Result<(), &'static [u8]>
Sends DCDT NFT to an address and executes like an async call, but without callback.
fn direct_multi_dcdt_transfer_execute( &self, _to: &ManagedAddress<Self>, _payments: &ManagedVec<Self, DcdtTokenPayment<Self>>, _gas_limit: u64, _endpoint_name: &ManagedBuffer<Self>, _arg_buffer: &ManagedArgBuffer<Self>, ) -> Result<(), &'static [u8]>
Source§fn async_call_raw(
&self,
to: &ManagedAddress<Self>,
amount: &BigUint<Self>,
endpoint_name: &ManagedBuffer<Self>,
arg_buffer: &ManagedArgBuffer<Self>,
) -> !
fn async_call_raw( &self, to: &ManagedAddress<Self>, amount: &BigUint<Self>, endpoint_name: &ManagedBuffer<Self>, arg_buffer: &ManagedArgBuffer<Self>, ) -> !
Sends an asynchronous call to another contract.
Calling this method immediately terminates tx execution.
Using it directly is generally discouraged. Read more
Source§fn deploy_contract(
&self,
_gas: u64,
_amount: &BigUint<Self>,
_code: &ManagedBuffer<Self>,
_code_metadata: CodeMetadata,
_arg_buffer: &ManagedArgBuffer<Self>,
) -> (ManagedAddress<Self>, ManagedVec<Self, ManagedBuffer<Self>>)
fn deploy_contract( &self, _gas: u64, _amount: &BigUint<Self>, _code: &ManagedBuffer<Self>, _code_metadata: CodeMetadata, _arg_buffer: &ManagedArgBuffer<Self>, ) -> (ManagedAddress<Self>, ManagedVec<Self, ManagedBuffer<Self>>)
Deploys a new contract in the same shard.
Unlike
async_call_raw, the deployment is synchronous and tx execution continues afterwards.
Also unlike async_call_raw, it uses an argument buffer to pass arguments
If the deployment fails, Option::None is returnedSource§fn deploy_from_source_contract(
&self,
_gas: u64,
_amount: &BigUint<Self>,
_source_contract_address: &ManagedAddress<Self>,
_code_metadata: CodeMetadata,
_arg_buffer: &ManagedArgBuffer<Self>,
) -> (ManagedAddress<Self>, ManagedVec<Self, ManagedBuffer<Self>>)
fn deploy_from_source_contract( &self, _gas: u64, _amount: &BigUint<Self>, _source_contract_address: &ManagedAddress<Self>, _code_metadata: CodeMetadata, _arg_buffer: &ManagedArgBuffer<Self>, ) -> (ManagedAddress<Self>, ManagedVec<Self, ManagedBuffer<Self>>)
Deploys a new contract in the same shard by re-using the code of an already deployed source contract.
The deployment is done synchronously and the new contract’s address is returned.
If the deployment fails, Option::None is returned
Source§fn upgrade_contract(
&self,
_sc_address: &ManagedAddress<Self>,
_gas: u64,
_amount: &BigUint<Self>,
_code: &ManagedBuffer<Self>,
_code_metadata: CodeMetadata,
_arg_buffer: &ManagedArgBuffer<Self>,
)
fn upgrade_contract( &self, _sc_address: &ManagedAddress<Self>, _gas: u64, _amount: &BigUint<Self>, _code: &ManagedBuffer<Self>, _code_metadata: CodeMetadata, _arg_buffer: &ManagedArgBuffer<Self>, )
Upgrades a child contract of the currently executing contract.
The upgrade is synchronous, and the current transaction will fail if the upgrade fails.
The child contract’s new init function will be called with the provided arguments
Source§fn execute_on_dest_context_raw(
&self,
_gas: u64,
_to: &ManagedAddress<Self>,
_value: &BigUint<Self>,
_endpoint_name: &ManagedBuffer<Self>,
_arg_buffer: &ManagedArgBuffer<Self>,
) -> ManagedVec<Self, ManagedBuffer<Self>>
fn execute_on_dest_context_raw( &self, _gas: u64, _to: &ManagedAddress<Self>, _value: &BigUint<Self>, _endpoint_name: &ManagedBuffer<Self>, _arg_buffer: &ManagedArgBuffer<Self>, ) -> ManagedVec<Self, ManagedBuffer<Self>>
Same shard, in-line execution of another contract.
Source§fn execute_on_dest_context_raw_custom_result_range<F>(
&self,
_gas: u64,
_to: &ManagedAddress<Self>,
_value: &BigUint<Self>,
_endpoint_name: &ManagedBuffer<Self>,
_arg_buffer: &ManagedArgBuffer<Self>,
_range_closure: F,
) -> ManagedVec<Self, ManagedBuffer<Self>>
fn execute_on_dest_context_raw_custom_result_range<F>( &self, _gas: u64, _to: &ManagedAddress<Self>, _value: &BigUint<Self>, _endpoint_name: &ManagedBuffer<Self>, _arg_buffer: &ManagedArgBuffer<Self>, _range_closure: F, ) -> ManagedVec<Self, ManagedBuffer<Self>>
Same shard, in-line execution of another contract.
Allows the contract to specify which result range to extract as sync call result.
This is a workaround to handle nested sync calls.
Please do not use this method unless there is absolutely no other option.
Will be eliminated after some future Andes hook redesign.
range_closure takes the number of results before, the number of results after,
and is expected to return the start index (inclusive) and end index (exclusive).fn execute_on_dest_context_by_caller_raw( &self, _gas: u64, _to: &ManagedAddress<Self>, _value: &BigUint<Self>, _endpoint_name: &ManagedBuffer<Self>, _arg_buffer: &ManagedArgBuffer<Self>, ) -> ManagedVec<Self, ManagedBuffer<Self>>
fn execute_on_same_context_raw( &self, _gas: u64, _to: &ManagedAddress<Self>, _value: &BigUint<Self>, _endpoint_name: &ManagedBuffer<Self>, _arg_buffer: &ManagedArgBuffer<Self>, ) -> ManagedVec<Self, ManagedBuffer<Self>>
fn execute_on_dest_context_readonly_raw( &self, _gas: u64, _to: &ManagedAddress<Self>, _endpoint_name: &ManagedBuffer<Self>, _arg_buffer: &ManagedArgBuffer<Self>, ) -> ManagedVec<Self, ManagedBuffer<Self>>
Source§fn storage_store_tx_hash_key(&self, data: &ManagedBuffer<Self>)
fn storage_store_tx_hash_key(&self, data: &ManagedBuffer<Self>)
Used to store data between async call and callback.
Source§fn storage_load_tx_hash_key(&self) -> ManagedBuffer<Self>
fn storage_load_tx_hash_key(&self) -> ManagedBuffer<Self>
Used to store data between async call and callback.
Source§fn call_local_dcdt_built_in_function(
&self,
_gas: u64,
_function_name: &ManagedBuffer<Self>,
_arg_buffer: &ManagedArgBuffer<Self>,
) -> ManagedVec<Self, ManagedBuffer<Self>>
fn call_local_dcdt_built_in_function( &self, _gas: u64, _function_name: &ManagedBuffer<Self>, _arg_buffer: &ManagedArgBuffer<Self>, ) -> ManagedVec<Self, ManagedBuffer<Self>>
Allows synchronously calling a local function by name. Execution is resumed afterwards.
You should never have to call this function directly.
Use the other specific methods instead.
Source§impl StorageReadApi for TxContext
impl StorageReadApi for TxContext
fn storage_load_len(&self, key: &[u8]) -> usize
fn storage_load_vec_u8(&self, key: &[u8]) -> Vec<u8> ⓘ
fn storage_load_big_uint_raw(&self, key: &[u8]) -> Handle
fn storage_load_managed_buffer_raw(&self, key_handle: Handle) -> Handle
fn storage_load_managed_buffer_len(&self, key_handle: Handle) -> usize
fn storage_load_u64(&self, key: &[u8]) -> u64
fn storage_load_i64(&self, key: &[u8]) -> i64
fn storage_load_boxed_bytes(&self, key: &[u8]) -> BoxedBytes
Source§impl StorageWriteApi for TxContext
impl StorageWriteApi for TxContext
fn storage_store_slice_u8(&self, key: &[u8], value: &[u8])
fn storage_store_big_uint_raw(&self, key: &[u8], handle: i32)
fn storage_store_managed_buffer_raw( &self, key_handle: Handle, value_handle: Handle, )
fn storage_store_managed_buffer_clear(&self, key_handle: Handle)
fn storage_store_u64(&self, key: &[u8], value: u64)
fn storage_store_i64(&self, key: &[u8], value: i64)
Source§impl TryStaticCast for TxContext
impl TryStaticCast for TxContext
fn type_eq<U>() -> boolwhere
U: TryStaticCast,
fn try_cast<U>(self) -> Option<U>where
U: TryStaticCast,
fn try_cast_ref<U>(&self) -> Option<&U>where
U: TryStaticCast,
impl VMApi for TxContext
Auto Trait Implementations§
impl Freeze for TxContext
impl !RefUnwindSafe for TxContext
impl !Send for TxContext
impl !Sync for TxContext
impl Unpin for TxContext
impl !UnwindSafe for TxContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more