pub struct VMHooksApi<S: VMHooksApiBackend> { /* private fields */ }
Implementations§
Source§impl VMHooksApi<DebugApiBackend>
impl VMHooksApi<DebugApiBackend>
Source§impl VMHooksApi<SingleTxApiBackend>
impl VMHooksApi<SingleTxApiBackend>
pub fn clear_global()
pub fn with_global<F, R>(f: F) -> Rwhere
F: FnOnce(&mut SingleTxApiData) -> R,
pub fn with_global_default_account<F, R>(f: F) -> Rwhere
F: FnOnce(&mut AccountData) -> R,
Source§impl VMHooksApi<StaticApiBackend>
impl VMHooksApi<StaticApiBackend>
Sourcepub fn is_current_address_placeholder(address: &Address) -> bool
pub fn is_current_address_placeholder(address: &Address) -> bool
The static API does not allow interrogating the Tx input, but does offer a placeholder for the current (“SC”) address, to help with contract calls.
This placeholder then needs to be converted to something useful.
pub fn reset()
Source§impl<VHB: VMHooksApiBackend> VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> VMHooksApi<VHB>
pub fn api_impl() -> VMHooksApi<VHB>
Sourcepub fn with_vm_hooks<R, F>(&self, f: F) -> R
pub fn with_vm_hooks<R, F>(&self, f: F) -> R
All communication with the VM happens via this method.
Sourcepub fn with_vm_hooks_ctx_1<R, F>(&self, handle: &VHB::HandleType, f: F) -> R
pub fn with_vm_hooks_ctx_1<R, F>(&self, handle: &VHB::HandleType, f: F) -> R
Works with the VM hooks given by the context of 1 handle.
Sourcepub fn with_vm_hooks_ctx_2<R, F>(
&self,
handle1: &VHB::HandleType,
handle2: &VHB::HandleType,
f: F,
) -> R
pub fn with_vm_hooks_ctx_2<R, F>( &self, handle1: &VHB::HandleType, handle2: &VHB::HandleType, f: F, ) -> R
Works with the VM hooks given by the context of 2 handles.
Sourcepub fn with_vm_hooks_ctx_3<R, F>(
&self,
handle1: &VHB::HandleType,
handle2: &VHB::HandleType,
handle3: &VHB::HandleType,
f: F,
) -> R
pub fn with_vm_hooks_ctx_3<R, F>( &self, handle1: &VHB::HandleType, handle2: &VHB::HandleType, handle3: &VHB::HandleType, f: F, ) -> R
Works with the VM hooks given by the context of 3 handles.
Sourcepub fn assert_live_handle(&self, handle: &VHB::HandleType)
pub fn assert_live_handle(&self, handle: &VHB::HandleType)
Checks that the handle refers to the current active context (if possible).
This is to prevent working with handles pointing to the wrong context, when debugging.
Sourcepub fn with_static_data<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&StaticVarData) -> R,
pub fn with_static_data<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&StaticVarData) -> R,
Static data does not belong to the VM, or to the VM hooks. It belongs to the contract only.
Source§impl<VHB: VMHooksApiBackend> VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> VMHooksApi<VHB>
Sourcepub fn printed_messages_clear()
pub fn printed_messages_clear()
Clears static buffer used for testing.
Sourcepub fn printed_messages() -> Vec<String>
pub fn printed_messages() -> Vec<String>
Whenever using sc_print!
, the message gets printed to console, but also gets saved in a static buffer, for testing.
This method retrieves a copy of the contents of that static print message buffer.
Trait Implementations§
Source§impl<VHB: VMHooksApiBackend> BigFloatApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> BigFloatApiImpl for VMHooksApi<VHB>
fn bf_from_parts( &self, integral_part_value: i32, fractional_part_value: i32, exponent_value: i32, ) -> Self::BigFloatHandle
fn bf_from_frac( &self, numerator_value: i64, denominator_value: i64, ) -> Self::BigFloatHandle
fn bf_from_sci( &self, significand_value: i64, exponent_value: i64, ) -> Self::BigFloatHandle
fn bf_add( &self, dest: Self::BigFloatHandle, x: Self::BigFloatHandle, y: Self::BigFloatHandle, )
fn bf_sub( &self, dest: Self::BigFloatHandle, x: Self::BigFloatHandle, y: Self::BigFloatHandle, )
fn bf_mul( &self, dest: Self::BigFloatHandle, x: Self::BigFloatHandle, y: Self::BigFloatHandle, )
fn bf_div( &self, dest: Self::BigFloatHandle, x: Self::BigFloatHandle, y: Self::BigFloatHandle, )
fn bf_neg(&self, dest: Self::BigFloatHandle, x: Self::BigFloatHandle)
fn bf_abs(&self, dest: Self::BigFloatHandle, x: Self::BigFloatHandle)
fn bf_cmp(&self, x: Self::BigFloatHandle, y: Self::BigFloatHandle) -> Ordering
fn bf_sign(&self, x: Self::BigFloatHandle) -> Sign
fn bf_clone(&self, dest: Self::BigFloatHandle, x: Self::BigFloatHandle)
fn bf_sqrt(&self, dest: Self::BigFloatHandle, x: Self::BigFloatHandle)
fn bf_pow(&self, dest: Self::BigFloatHandle, x: Self::BigFloatHandle, exp: i32)
fn bf_floor(&self, dest: Self::BigIntHandle, x: Self::BigFloatHandle)
fn bf_ceil(&self, dest: Self::BigIntHandle, x: Self::BigFloatHandle)
fn bf_trunc(&self, dest: Self::BigIntHandle, x: Self::BigFloatHandle)
fn bf_is_bi(&self, x: Self::BigFloatHandle) -> bool
fn bf_set_i64(&self, dest: Self::BigFloatHandle, value: i64)
fn bf_set_bi(&self, dest: Self::BigFloatHandle, x: Self::BigIntHandle)
fn bf_get_const_e(&self, dest: Self::BigFloatHandle)
fn bf_get_const_pi(&self, dest: Self::BigFloatHandle)
fn bf_new_zero(&self) -> Self::BigFloatHandle
Source§impl<VHB: VMHooksApiBackend> BigIntApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> BigIntApiImpl for VMHooksApi<VHB>
fn bi_new(&self, value: i64) -> Self::BigIntHandle
fn bi_set_int64(&self, destination: Self::BigIntHandle, value: i64)
fn bi_to_i64(&self, reference: Self::BigIntHandle) -> Option<i64>
fn bi_add( &self, dest: Self::BigIntHandle, x: Self::BigIntHandle, y: Self::BigIntHandle, )
fn bi_sub( &self, dest: Self::BigIntHandle, x: Self::BigIntHandle, y: Self::BigIntHandle, )
fn bi_mul( &self, dest: Self::BigIntHandle, x: Self::BigIntHandle, y: Self::BigIntHandle, )
fn bi_t_div( &self, dest: Self::BigIntHandle, x: Self::BigIntHandle, y: Self::BigIntHandle, )
fn bi_t_mod( &self, dest: Self::BigIntHandle, x: Self::BigIntHandle, y: Self::BigIntHandle, )
fn bi_abs(&self, dest: Self::BigIntHandle, x: Self::BigIntHandle)
fn bi_neg(&self, dest: Self::BigIntHandle, x: Self::BigIntHandle)
fn bi_sign(&self, x: Self::BigIntHandle) -> Sign
fn bi_cmp(&self, x: Self::BigIntHandle, y: Self::BigIntHandle) -> Ordering
fn bi_sqrt(&self, dest: Self::BigIntHandle, x: Self::BigIntHandle)
fn bi_pow( &self, dest: Self::BigIntHandle, x: Self::BigIntHandle, y: Self::BigIntHandle, )
fn bi_log2(&self, x: Self::BigIntHandle) -> i32
fn bi_and( &self, dest: Self::BigIntHandle, x: Self::BigIntHandle, y: Self::BigIntHandle, )
fn bi_or( &self, dest: Self::BigIntHandle, x: Self::BigIntHandle, y: Self::BigIntHandle, )
fn bi_xor( &self, dest: Self::BigIntHandle, x: Self::BigIntHandle, y: Self::BigIntHandle, )
fn bi_shr(&self, dest: Self::BigIntHandle, x: Self::BigIntHandle, bits: usize)
fn bi_shl(&self, dest: Self::BigIntHandle, x: Self::BigIntHandle, bits: usize)
fn bi_to_string( &self, bi_handle: Self::BigIntHandle, str_handle: Self::ManagedBufferHandle, )
fn bi_new_zero(&self) -> Self::BigIntHandle
fn bi_sub_unsigned( &self, dest: Self::BigIntHandle, x: Self::BigIntHandle, y: Self::BigIntHandle, )
Source§impl<VHB: VMHooksApiBackend> BlockchainApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> BlockchainApi for VMHooksApi<VHB>
type BlockchainApiImpl = VMHooksApi<VHB>
fn blockchain_api_impl() -> Self::BlockchainApiImpl
Source§impl<VHB: VMHooksApiBackend> BlockchainApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> BlockchainApiImpl for VMHooksApi<VHB>
fn get_caller_legacy(&self) -> Address
fn load_caller_managed(&self, dest: Self::ManagedBufferHandle)
fn get_sc_address_legacy(&self) -> Address
fn load_sc_address_managed(&self, dest: Self::ManagedBufferHandle)
fn load_owner_address_managed(&self, dest: Self::ManagedBufferHandle)
fn get_shard_of_address_legacy(&self, _address: &Address) -> u32
fn get_shard_of_address(&self, address_handle: Self::ManagedBufferHandle) -> u32
fn is_smart_contract_legacy(&self, _address: &Address) -> bool
fn is_smart_contract(&self, address_handle: Self::ManagedBufferHandle) -> bool
fn load_balance_legacy(&self, _dest: Self::BigIntHandle, _address: &Address)
fn load_balance( &self, dest: Self::BigIntHandle, address_handle: Self::ManagedBufferHandle, )
fn load_state_root_hash_managed(&self, _dest: Self::ManagedBufferHandle)
fn get_tx_hash_legacy(&self) -> H256
fn load_tx_hash_managed(&self, dest: Self::ManagedBufferHandle)
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 load_block_random_seed_managed(&self, dest: Self::ManagedBufferHandle)
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 load_prev_block_random_seed_managed(&self, dest: Self::ManagedBufferHandle)
fn get_current_esdt_nft_nonce( &self, address_handle: Self::ManagedBufferHandle, token_id_handle: Self::ManagedBufferHandle, ) -> u64
fn load_esdt_balance( &self, address_handle: Self::ManagedBufferHandle, token_id_handle: Self::ManagedBufferHandle, nonce: u64, dest: Self::BigIntHandle, )
fn managed_get_esdt_token_data( &self, address_handle: RawHandle, token_id_handle: RawHandle, nonce: u64, value_handle: RawHandle, properties_handle: RawHandle, hash_handle: RawHandle, name_handle: RawHandle, attributes_handle: RawHandle, creator_handle: RawHandle, royalties_handle: RawHandle, uris_handle: RawHandle, )
fn managed_get_back_transfers( &self, esdt_transfer_value_handle: RawHandle, call_value_handle: RawHandle, )
fn check_esdt_frozen( &self, address_handle: Self::ManagedBufferHandle, token_id_handle: Self::ManagedBufferHandle, nonce: u64, ) -> bool
fn check_esdt_paused(&self, token_id_handle: Self::ManagedBufferHandle) -> bool
fn check_esdt_limited_transfer( &self, token_id_handle: Self::ManagedBufferHandle, ) -> bool
fn load_esdt_local_roles( &self, token_id_handle: Self::ManagedBufferHandle, ) -> EsdtLocalRoleFlags
fn managed_is_builtin_function( &self, function_name_handle: Self::ManagedBufferHandle, ) -> bool
fn managed_get_code_metadata( &self, address_handle: Self::ManagedBufferHandle, response_handle: Self::ManagedBufferHandle, )
Source§impl<VHB: VMHooksApiBackend> CallValueApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> CallValueApi for VMHooksApi<VHB>
type CallValueApiImpl = VMHooksApi<VHB>
fn call_value_api_impl() -> Self::CallValueApiImpl
Source§impl<VHB: VMHooksApiBackend> CallValueApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> CallValueApiImpl for VMHooksApi<VHB>
fn check_not_payable(&self)
Source§fn load_egld_value(&self, dest: Self::BigIntHandle)
fn load_egld_value(&self, dest: Self::BigIntHandle)
Source§fn load_all_esdt_transfers(&self, dest_handle: Self::ManagedBufferHandle)
fn load_all_esdt_transfers(&self, dest_handle: Self::ManagedBufferHandle)
Source§fn esdt_num_transfers(&self) -> usize
fn esdt_num_transfers(&self) -> usize
Source§impl<S: Clone + VMHooksApiBackend> Clone for VMHooksApi<S>
impl<S: Clone + VMHooksApiBackend> Clone for VMHooksApi<S>
Source§fn clone(&self) -> VMHooksApi<S>
fn clone(&self) -> VMHooksApi<S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<VHB: VMHooksApiBackend> CryptoApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> CryptoApi for VMHooksApi<VHB>
type CryptoApiImpl = VMHooksApi<VHB>
fn crypto_api_impl() -> Self::CryptoApiImpl
Source§impl<VHB: VMHooksApiBackend> CryptoApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> CryptoApiImpl for VMHooksApi<VHB>
fn sha256_managed( &self, result_handle: Self::ManagedBufferHandle, data_handle: Self::ManagedBufferHandle, )
fn keccak256_managed( &self, result_handle: Self::ManagedBufferHandle, data_handle: Self::ManagedBufferHandle, )
fn ripemd160_managed( &self, _dest: Self::ManagedBufferHandle, _data_handle: Self::ManagedBufferHandle, )
fn verify_bls_managed( &self, _key: Self::ManagedBufferHandle, _message: Self::ManagedBufferHandle, _signature: Self::ManagedBufferHandle, )
fn verify_ed25519_managed( &self, key: Self::ManagedBufferHandle, message: Self::ManagedBufferHandle, signature: Self::ManagedBufferHandle, )
Source§fn verify_secp256k1_managed(
&self,
_key: Self::ManagedBufferHandle,
_message: Self::ManagedBufferHandle,
_signature: Self::ManagedBufferHandle,
) -> bool
fn verify_secp256k1_managed( &self, _key: Self::ManagedBufferHandle, _message: Self::ManagedBufferHandle, _signature: Self::ManagedBufferHandle, ) -> bool
fn verify_custom_secp256k1_managed( &self, _key: Self::ManagedBufferHandle, _message: Self::ManagedBufferHandle, _signature: Self::ManagedBufferHandle, _hash_type: MessageHashType, ) -> bool
fn encode_secp256k1_der_signature_managed( &self, _r: Self::ManagedBufferHandle, _s: Self::ManagedBufferHandle, _dest: Self::ManagedBufferHandle, )
fn verify_secp256r1_managed( &self, _key: Self::ManagedBufferHandle, _message: Self::ManagedBufferHandle, _signature: Self::ManagedBufferHandle, )
fn verify_bls_aggregated_signature_managed( &self, _key: Self::ManagedBufferHandle, _message: Self::ManagedBufferHandle, _signature: Self::ManagedBufferHandle, )
Source§impl<S: Debug + VMHooksApiBackend> Debug for VMHooksApi<S>
impl<S: Debug + VMHooksApiBackend> Debug for VMHooksApi<S>
Source§impl<VHB: VMHooksApiBackend> EllipticCurveApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> EllipticCurveApiImpl for VMHooksApi<VHB>
fn ec_create_from_name_bytes(&self, _name: &[u8]) -> Self::EllipticCurveHandle
fn ec_create_from_name_mb( &self, _name_handle: Self::ManagedBufferHandle, ) -> Self::EllipticCurveHandle
fn ec_get_values( &self, _ec_handle: Self::EllipticCurveHandle, _field_order_handle: Self::BigIntHandle, _base_point_order_handle: Self::BigIntHandle, _eq_constant_handle: Self::BigIntHandle, _x_base_point_handle: Self::BigIntHandle, _y_base_point_handle: Self::BigIntHandle, )
fn ec_curve_length(&self, _ec_handle: Self::EllipticCurveHandle) -> u32
fn ec_private_key_byte_length( &self, _ec_handle: Self::EllipticCurveHandle, ) -> u32
fn ec_add( &self, _x_result_handle: Self::BigIntHandle, _y_result_handle: Self::BigIntHandle, _ec_handle: Self::EllipticCurveHandle, _x_first_point: Self::BigIntHandle, _y_first_point: Self::BigIntHandle, _x_second_point: Self::BigIntHandle, _y_second_point: Self::BigIntHandle, )
fn ec_double( &self, _x_result_handle: Self::BigIntHandle, _y_result_handle: Self::BigIntHandle, _ec_handle: Self::EllipticCurveHandle, _x_point_handle: Self::BigIntHandle, _y_point_handle: Self::BigIntHandle, )
fn ec_is_on_curve( &self, _ec_handle: Self::EllipticCurveHandle, _x_point_handle: Self::BigIntHandle, _y_point_handle: Self::BigIntHandle, ) -> bool
fn ec_scalar_mult_legacy( &self, _x_result_handle: Self::BigIntHandle, _y_result_handle: Self::BigIntHandle, _ec_handle: Self::EllipticCurveHandle, _x_point_handle: Self::BigIntHandle, _y_point_handle: Self::BigIntHandle, _data: &[u8], )
fn ec_scalar_mult( &self, _x_result_handle: Self::BigIntHandle, _y_result_handle: Self::BigIntHandle, _ec_handle: Self::EllipticCurveHandle, _x_point_handle: Self::BigIntHandle, _y_point_handle: Self::BigIntHandle, _data_handle: Self::ManagedBufferHandle, )
fn ec_scalar_base_mult_legacy( &self, _x_result_handle: Self::BigIntHandle, _y_result_handle: Self::BigIntHandle, _ec_handle: Self::EllipticCurveHandle, _data: &[u8], )
fn ec_scalar_base_mult( &self, _x_result_handle: Self::BigIntHandle, _y_result_handle: Self::BigIntHandle, _ec_handle: Self::EllipticCurveHandle, _data_handle: Self::ManagedBufferHandle, )
fn ec_marshal_legacy( &self, _ec_handle: Self::EllipticCurveHandle, _x_pair_handle: Self::BigIntHandle, _y_pair_handle: Self::BigIntHandle, ) -> BoxedBytes
fn ec_marshal( &self, _ec_handle: Self::EllipticCurveHandle, _x_pair_handle: Self::BigIntHandle, _y_pair_handle: Self::BigIntHandle, _result_handle: Self::ManagedBufferHandle, )
fn ec_marshal_compressed_legacy( &self, _ec_handle: Self::EllipticCurveHandle, _x_pair_handle: Self::BigIntHandle, _y_pair_handle: Self::BigIntHandle, ) -> BoxedBytes
fn ec_marshal_compressed( &self, _ec_handle: Self::EllipticCurveHandle, _x_pair_handle: Self::BigIntHandle, _y_pair_handle: Self::BigIntHandle, _result_handle: Self::ManagedBufferHandle, )
fn ec_unmarshal_legacy( &self, _x_result_handle: Self::BigIntHandle, _y_result_handle: Self::BigIntHandle, _ec_handle: Self::EllipticCurveHandle, _data: &[u8], )
fn ec_unmarshal( &self, _x_result_handle: Self::BigIntHandle, _y_result_handle: Self::BigIntHandle, _ec_handle: Self::EllipticCurveHandle, _data_handle: Self::ManagedBufferHandle, )
fn ec_unmarshal_compressed_legacy( &self, _x_result_handle: Self::BigIntHandle, _y_result_handle: Self::BigIntHandle, _ec_handle: Self::EllipticCurveHandle, _data: &[u8], )
fn ec_unmarshal_compressed( &self, _x_result_handle: Self::BigIntHandle, _y_result_handle: Self::BigIntHandle, _ec_handle: Self::EllipticCurveHandle, _data_handle: Self::ManagedBufferHandle, )
fn ec_generate_key_legacy( &self, _x_pub_key_handle: Self::BigIntHandle, _y_pub_key_handle: Self::BigIntHandle, _ec_handle: Self::EllipticCurveHandle, ) -> BoxedBytes
fn ec_generate_key( &self, _x_pub_key_handle: Self::BigIntHandle, _y_pub_key_handle: Self::BigIntHandle, _ec_handle: Self::EllipticCurveHandle, _result_handle: Self::ManagedBufferHandle, )
Source§impl<VHB: VMHooksApiBackend> EndpointArgumentApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> EndpointArgumentApi for VMHooksApi<VHB>
type EndpointArgumentApiImpl = VMHooksApi<VHB>
fn argument_api_impl() -> Self::EndpointArgumentApiImpl
Source§impl<VHB: VMHooksApiBackend> EndpointArgumentApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> EndpointArgumentApiImpl for VMHooksApi<VHB>
fn get_num_arguments(&self) -> i32
fn load_argument_managed_buffer( &self, arg_id: i32, dest: Self::ManagedBufferHandle, )
fn load_callback_closure_buffer(&self, dest: Self::ManagedBufferHandle)
fn get_argument_u64(&self, arg_index: i32) -> u64
fn get_argument_i64(&self, arg_index: i32) -> i64
fn get_argument_len(&self, arg_index: i32) -> usize
fn get_argument_boxed_bytes(&self, arg_index: i32) -> BoxedBytes
fn load_argument_big_int_unsigned( &self, arg_index: i32, dest: Self::BigIntHandle, )
fn load_argument_big_int_signed(&self, arg_index: i32, dest: Self::BigIntHandle)
Source§impl<VHB: VMHooksApiBackend> EndpointFinishApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> EndpointFinishApi for VMHooksApi<VHB>
type EndpointFinishApiImpl = VMHooksApi<VHB>
fn finish_api_impl() -> Self::EndpointFinishApiImpl
Source§impl<VHB: VMHooksApiBackend> EndpointFinishApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> EndpointFinishApiImpl for VMHooksApi<VHB>
fn finish_slice_u8(&self, bytes: &[u8])
fn finish_big_int_raw(&self, handle: Self::BigIntHandle)
fn finish_big_uint_raw(&self, handle: Self::BigIntHandle)
fn finish_managed_buffer_raw(&self, handle: Self::ManagedBufferHandle)
fn finish_u64(&self, value: u64)
fn finish_i64(&self, value: i64)
Source§impl<VHB: VMHooksApiBackend> ErrorApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> ErrorApi for VMHooksApi<VHB>
type ErrorApiImpl = VMHooksApi<VHB>
fn error_api_impl() -> Self::ErrorApiImpl
Source§impl<VHB: VMHooksApiBackend> ErrorApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> ErrorApiImpl for VMHooksApi<VHB>
fn signal_error(&self, message: &[u8]) -> !
fn signal_error_from_buffer( &self, message_handle: Self::ManagedBufferHandle, ) -> !
Source§impl<VHB: VMHooksApiBackend> HandleTypeInfo for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> HandleTypeInfo for VMHooksApi<VHB>
type ManagedBufferHandle = <VHB as VMHooksApiBackend>::HandleType
type BigIntHandle = <VHB as VMHooksApiBackend>::HandleType
type BigFloatHandle = <VHB as VMHooksApiBackend>::HandleType
type EllipticCurveHandle = <VHB as VMHooksApiBackend>::HandleType
type ManagedMapHandle = <VHB as VMHooksApiBackend>::HandleType
Source§impl<VHB: VMHooksApiBackend> LogApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> LogApi for VMHooksApi<VHB>
type LogApiImpl = VMHooksApi<VHB>
fn log_api_impl() -> Self::LogApiImpl
Source§impl<VHB: VMHooksApiBackend> LogApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> LogApiImpl for VMHooksApi<VHB>
Source§fn managed_write_log(
&self,
topics_handle: Self::ManagedBufferHandle,
data_handle: Self::ManagedBufferHandle,
)
fn managed_write_log( &self, topics_handle: Self::ManagedBufferHandle, data_handle: Self::ManagedBufferHandle, )
Source§impl<VHB: VMHooksApiBackend> ManagedBufferApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> ManagedBufferApiImpl for VMHooksApi<VHB>
Source§fn mb_new_empty(&self) -> Self::ManagedBufferHandle
fn mb_new_empty(&self) -> Self::ManagedBufferHandle
Source§fn mb_new_from_bytes(&self, bytes: &[u8]) -> Self::ManagedBufferHandle
fn mb_new_from_bytes(&self, bytes: &[u8]) -> Self::ManagedBufferHandle
fn mb_len(&self, handle: Self::ManagedBufferHandle) -> usize
fn mb_to_boxed_bytes(&self, handle: Self::ManagedBufferHandle) -> BoxedBytes
Source§fn mb_load_slice(
&self,
source_handle: Self::ManagedBufferHandle,
starting_position: usize,
dest_slice: &mut [u8],
) -> Result<(), InvalidSliceError>
fn mb_load_slice( &self, source_handle: Self::ManagedBufferHandle, starting_position: usize, dest_slice: &mut [u8], ) -> Result<(), InvalidSliceError>
Result<(), ()>
on the wasm output.Source§fn mb_copy_slice(
&self,
source_handle: Self::ManagedBufferHandle,
starting_pos: usize,
slice_len: usize,
dest_handle: Self::ManagedBufferHandle,
) -> Result<(), InvalidSliceError>
fn mb_copy_slice( &self, source_handle: Self::ManagedBufferHandle, starting_pos: usize, slice_len: usize, dest_handle: Self::ManagedBufferHandle, ) -> Result<(), InvalidSliceError>
Result<(), ()>
on the wasm output.fn mb_overwrite(&self, handle: Self::ManagedBufferHandle, value: &[u8])
fn mb_set_slice( &self, dest_handle: Self::ManagedBufferHandle, starting_position: usize, source_slice: &[u8], ) -> Result<(), InvalidSliceError>
fn mb_set_random(&self, dest_handle: Self::ManagedBufferHandle, length: usize)
fn mb_append( &self, accumulator_handle: Self::ManagedBufferHandle, data_handle: Self::ManagedBufferHandle, )
fn mb_append_bytes( &self, accumulator_handle: Self::ManagedBufferHandle, bytes: &[u8], )
fn mb_eq( &self, handle1: Self::ManagedBufferHandle, handle2: Self::ManagedBufferHandle, ) -> bool
fn mb_to_hex( &self, source_handle: Self::ManagedBufferHandle, dest_handle: Self::ManagedBufferHandle, )
Source§impl<VHB: VMHooksApiBackend> ManagedMapApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> ManagedMapApiImpl for VMHooksApi<VHB>
Source§fn mm_new(&self) -> Self::ManagedMapHandle
fn mm_new(&self) -> Self::ManagedMapHandle
fn mm_get( &self, map_handle: Self::ManagedMapHandle, key_handle: Self::ManagedBufferHandle, out_value_handle: Self::ManagedBufferHandle, )
fn mm_put( &self, map_handle: Self::ManagedMapHandle, key_handle: Self::ManagedBufferHandle, value_handle: Self::ManagedBufferHandle, )
fn mm_remove( &self, map_handle: Self::ManagedMapHandle, key_handle: Self::ManagedBufferHandle, out_value_handle: Self::ManagedBufferHandle, )
fn mm_contains( &self, map_handle: Self::ManagedMapHandle, key_handle: Self::ManagedBufferHandle, ) -> bool
Source§impl<VHB: VMHooksApiBackend> ManagedTypeApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> ManagedTypeApi for VMHooksApi<VHB>
type ManagedTypeApiImpl = VMHooksApi<VHB>
fn managed_type_impl() -> Self::ManagedTypeApiImpl
Source§impl<VHB: VMHooksApiBackend> ManagedTypeApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> ManagedTypeApiImpl for VMHooksApi<VHB>
fn mb_to_big_int_unsigned( &self, buffer_handle: Self::ManagedBufferHandle, big_int_handle: Self::BigIntHandle, )
fn mb_to_big_int_signed( &self, buffer_handle: Self::ManagedBufferHandle, big_int_handle: Self::BigIntHandle, )
fn mb_from_big_int_unsigned( &self, big_int_handle: Self::BigIntHandle, buffer_handle: Self::ManagedBufferHandle, )
fn mb_from_big_int_signed( &self, big_int_handle: Self::BigIntHandle, buffer_handle: Self::ManagedBufferHandle, )
fn mb_to_big_float( &self, buffer_handle: Self::ManagedBufferHandle, big_float_handle: Self::BigFloatHandle, )
fn mb_from_big_float( &self, big_float_handle: Self::BigFloatHandle, buffer_handle: Self::ManagedBufferHandle, )
fn validate_token_identifier( &self, token_id_handle: Self::ManagedBufferHandle, ) -> bool
fn get_token_ticker_len(&self, token_id_len: usize) -> usize
Source§impl<VHB: VMHooksApiBackend> PartialEq for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> PartialEq for VMHooksApi<VHB>
Source§impl<VHB: VMHooksApiBackend> PrintApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> PrintApi for VMHooksApi<VHB>
type PrintApiImpl = VMHooksApi<VHB>
fn print_api_impl() -> Self::PrintApiImpl
Source§impl<VHB: VMHooksApiBackend> PrintApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> PrintApiImpl for VMHooksApi<VHB>
Source§type Buffer = ManagedBufferBuilder<VMHooksApi<VHB>>
type Buffer = ManagedBufferBuilder<VMHooksApi<VHB>>
fn print_buffer(&self, buffer: Self::Buffer)
Source§impl<VHB: VMHooksApiBackend> SendApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> SendApi for VMHooksApi<VHB>
type SendApiImpl = VMHooksApi<VHB>
fn send_api_impl() -> Self::SendApiImpl
Source§impl<VHB: VMHooksApiBackend> SendApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> SendApiImpl for VMHooksApi<VHB>
Source§fn transfer_value_execute(
&self,
to_handle: RawHandle,
amount_handle: RawHandle,
gas_limit: u64,
endpoint_name_handle: RawHandle,
arg_buffer_handle: RawHandle,
) -> Result<(), &'static [u8]>
fn transfer_value_execute( &self, to_handle: RawHandle, amount_handle: RawHandle, gas_limit: u64, endpoint_name_handle: RawHandle, arg_buffer_handle: RawHandle, ) -> Result<(), &'static [u8]>
fn multi_transfer_esdt_nft_execute( &self, to_handle: RawHandle, payments_handle: RawHandle, gas_limit: u64, endpoint_name_handle: RawHandle, arg_buffer_handle: RawHandle, ) -> Result<(), &'static [u8]>
Source§fn async_call_raw(
&self,
to_handle: RawHandle,
egld_value_handle: RawHandle,
endpoint_name_handle: RawHandle,
arg_buffer_handle: RawHandle,
) -> !
fn async_call_raw( &self, to_handle: RawHandle, egld_value_handle: RawHandle, endpoint_name_handle: RawHandle, arg_buffer_handle: RawHandle, ) -> !
fn create_async_call_raw( &self, to_handle: RawHandle, egld_value_handle: RawHandle, endpoint_name_handle: RawHandle, arg_buffer_handle: RawHandle, success_callback: &'static str, error_callback: &'static str, gas: u64, extra_gas_for_callback: u64, callback_closure_handle: RawHandle, )
Source§fn deploy_contract(
&self,
gas: u64,
egld_value_handle: RawHandle,
code_handle: RawHandle,
code_metadata_handle: RawHandle,
arg_buffer_handle: RawHandle,
new_address_handle: RawHandle,
result_handle: RawHandle,
)
fn deploy_contract( &self, gas: u64, egld_value_handle: RawHandle, code_handle: RawHandle, code_metadata_handle: RawHandle, arg_buffer_handle: RawHandle, new_address_handle: RawHandle, result_handle: RawHandle, )
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,
egld_value_handle: RawHandle,
source_contract_address_handle: RawHandle,
code_metadata_handle: RawHandle,
arg_buffer_handle: RawHandle,
new_address_handle: RawHandle,
result_handle: RawHandle,
)
fn deploy_from_source_contract( &self, gas: u64, egld_value_handle: RawHandle, source_contract_address_handle: RawHandle, code_metadata_handle: RawHandle, arg_buffer_handle: RawHandle, new_address_handle: RawHandle, result_handle: RawHandle, )
fn upgrade_from_source_contract( &self, sc_address_handle: RawHandle, gas: u64, egld_value_handle: RawHandle, source_contract_address_handle: RawHandle, code_metadata_handle: RawHandle, arg_buffer_handle: RawHandle, )
Source§fn upgrade_contract(
&self,
sc_address_handle: RawHandle,
gas: u64,
egld_value_handle: RawHandle,
code_handle: RawHandle,
code_metadata_handle: RawHandle,
arg_buffer_handle: RawHandle,
)
fn upgrade_contract( &self, sc_address_handle: RawHandle, gas: u64, egld_value_handle: RawHandle, code_handle: RawHandle, code_metadata_handle: RawHandle, arg_buffer_handle: RawHandle, )
Source§fn execute_on_dest_context_raw(
&self,
gas: u64,
to_handle: RawHandle,
egld_value_handle: RawHandle,
endpoint_name_handle: RawHandle,
arg_buffer_handle: RawHandle,
result_handle: RawHandle,
)
fn execute_on_dest_context_raw( &self, gas: u64, to_handle: RawHandle, egld_value_handle: RawHandle, endpoint_name_handle: RawHandle, arg_buffer_handle: RawHandle, result_handle: RawHandle, )
fn execute_on_same_context_raw( &self, _gas: u64, _to_handle: RawHandle, _egld_value_handle: RawHandle, _endpoint_name_handle: RawHandle, _arg_buffer_handle: RawHandle, _result_handle: RawHandle, )
fn execute_on_dest_context_readonly_raw( &self, _gas: u64, _to_handle: RawHandle, _endpoint_name_handle: RawHandle, _arg_buffer_handle: RawHandle, _result_handle: RawHandle, )
fn clean_return_data(&self)
fn delete_from_return_data(&self, index: usize)
Source§impl<VHB: VMHooksApiBackend> StaticVarApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> StaticVarApi for VMHooksApi<VHB>
type StaticVarApiImpl = VMHooksApi<VHB>
fn static_var_api_impl() -> Self::StaticVarApiImpl
Source§impl<VHB: VMHooksApiBackend> StaticVarApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> StaticVarApiImpl for VMHooksApi<VHB>
fn with_lockable_static_buffer<R, F: FnOnce(&mut LockableStaticBuffer) -> R>( &self, f: F, ) -> R
fn set_external_view_target_address_handle(&self, handle: RawHandle)
fn get_external_view_target_address_handle(&self) -> RawHandle
fn next_handle(&self) -> RawHandle
fn set_num_arguments(&self, num_arguments: i32)
fn get_num_arguments(&self) -> i32
fn set_flags(&self, flags: StaticVarApiFlags)
fn get_flags(&self) -> StaticVarApiFlags
fn is_scaling_factor_cached(&self, decimals: usize) -> bool
fn set_scaling_factor_cached(&self, decimals: usize)
Source§fn flag_is_set_or_update(&self, flag: StaticVarApiFlags) -> bool
fn flag_is_set_or_update(&self, flag: StaticVarApiFlags) -> bool
Source§impl<VHB: VMHooksApiBackend> StorageReadApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> StorageReadApi for VMHooksApi<VHB>
type StorageReadApiImpl = VMHooksApi<VHB>
fn storage_read_api_impl() -> Self::StorageReadApiImpl
Source§impl<VHB: VMHooksApiBackend> StorageReadApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> StorageReadApiImpl for VMHooksApi<VHB>
fn storage_load_managed_buffer_raw( &self, key_handle: Self::ManagedBufferHandle, dest: Self::ManagedBufferHandle, )
fn storage_load_from_address( &self, address_handle: Self::ManagedBufferHandle, key_handle: Self::ManagedBufferHandle, dest: Self::ManagedBufferHandle, )
fn storage_read_api_init(&self)
Source§impl<VHB: VMHooksApiBackend> StorageWriteApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> StorageWriteApi for VMHooksApi<VHB>
type StorageWriteApiImpl = VMHooksApi<VHB>
fn storage_write_api_impl() -> Self::StorageWriteApiImpl
Source§impl<VHB: VMHooksApiBackend> StorageWriteApiImpl for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> StorageWriteApiImpl for VMHooksApi<VHB>
fn storage_store_managed_buffer_raw( &self, key_handle: Self::ManagedBufferHandle, value_handle: Self::ManagedBufferHandle, )
Source§impl<VHB: VMHooksApiBackend> VMApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> VMApi for VMHooksApi<VHB>
Source§fn external_view_init_override() -> bool
fn external_view_init_override() -> bool
fn init_static()
impl<VHB: VMHooksApiBackend> CallTypeApi for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> Eq for VMHooksApi<VHB>
impl<VHB: VMHooksApiBackend> StorageMapperApi for VMHooksApi<VHB>
Auto Trait Implementations§
impl<S> Freeze for VMHooksApi<S>
impl<S> RefUnwindSafe for VMHooksApi<S>where
S: RefUnwindSafe,
impl<S> Send for VMHooksApi<S>
impl<S> Sync for VMHooksApi<S>
impl<S> Unpin for VMHooksApi<S>where
S: Unpin,
impl<S> UnwindSafe for VMHooksApi<S>where
S: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> InterpretableFrom<&T> for Twhere
T: Clone,
impl<T> InterpretableFrom<&T> for Twhere
T: Clone,
fn interpret_from(from: &T, _context: &InterpreterContext) -> T
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more