Struct elrond_wasm_node::VmApiImpl
source · [−]pub struct VmApiImpl {}
Expand description
The reference to the API implementation based on Arwen hooks. It continas no data, can be embedded at no cost. Cloning it is a no-op.
Trait Implementations
sourceimpl BigFloatApi for VmApiImpl
impl BigFloatApi for VmApiImpl
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::ManagedBufferHandle
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::ManagedBufferHandle,
y: Self::ManagedBufferHandle
) -> Ordering
fn bf_sign(&self, x: Self::ManagedBufferHandle) -> 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
sourceimpl BigIntApi for VmApiImpl
impl BigIntApi for VmApiImpl
fn bi_new(&self, value: i64) -> Self::BigIntHandle
fn bi_set_int64(&self, destination: Self::BigIntHandle, value: i64)
fn bi_unsigned_byte_length(&self, x: Self::BigIntHandle) -> usize
fn bi_get_unsigned_bytes(&self, handle: Self::BigIntHandle) -> BoxedBytes
fn bi_set_unsigned_bytes(&self, destination: Self::BigIntHandle, bytes: &[u8])
fn bi_signed_byte_length(&self, x: Self::BigIntHandle) -> usize
fn bi_get_signed_bytes(&self, handle: Self::BigIntHandle) -> BoxedBytes
fn bi_set_signed_bytes(&self, destination: Self::BigIntHandle, bytes: &[u8])
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_sub_unsigned(
&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) -> u32
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,
result_handle: Self::ManagedBufferHandle
)
fn bi_new_zero(&self) -> Self::BigIntHandle
sourceimpl BlockchainApi for VmApiImpl
impl BlockchainApi for VmApiImpl
type BlockchainApiImpl = VmApiImpl
fn blockchain_api_impl() -> Self::BlockchainApiImpl
sourceimpl BlockchainApiImpl for VmApiImpl
impl BlockchainApiImpl for VmApiImpl
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 get_owner_address_legacy(&self) -> Address
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 get_state_root_hash_legacy(&self) -> H256
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 get_block_random_seed_legacy(&self) -> Box<[u8; 48]>ⓘNotable traits for Box<I, A>impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
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]>ⓘNotable traits for Box<I, A>impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
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
)
sourcefn load_esdt_token_data_unmanaged<M: ManagedTypeApi>(
&self,
m_address: &ManagedAddress<M>,
token: &TokenIdentifier<M>,
nonce: u64
) -> EsdtTokenData<M>
fn load_esdt_token_data_unmanaged<M: ManagedTypeApi>(
&self,
m_address: &ManagedAddress<M>,
token: &TokenIdentifier<M>,
nonce: u64
) -> EsdtTokenData<M>
Only used for limited backwards compatibility tests. Never use! Use load_esdt_token_data
instead.
fn load_esdt_token_data<M: ManagedTypeApi>(
&self,
address: &ManagedAddress<M>,
token: &TokenIdentifier<M>,
nonce: u64
) -> EsdtTokenData<M>
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
sourceimpl CallValueApi for VmApiImpl
impl CallValueApi for VmApiImpl
type CallValueApiImpl = VmApiImpl
fn call_value_api_impl() -> Self::CallValueApiImpl
sourceimpl CallValueApiImpl for VmApiImpl
impl CallValueApiImpl for VmApiImpl
fn check_not_payable(&self)
sourcefn load_egld_value(&self, dest: Self::BigIntHandle)
fn load_egld_value(&self, dest: Self::BigIntHandle)
Retrieves the EGLD call value from the VM. Will return 0 in case of an ESDT transfer (cannot have both EGLD and ESDT transfer simultaneously). Read more
sourcefn load_all_esdt_transfers(&self, dest_handle: Self::ManagedBufferHandle)
fn load_all_esdt_transfers(&self, dest_handle: Self::ManagedBufferHandle)
Loads all ESDT call values into a managed vec. Overwrites destination.
fn esdt_num_transfers(&self) -> usize
sourcefn load_single_esdt_value(&self, dest: Self::BigIntHandle)
fn load_single_esdt_value(&self, dest: Self::BigIntHandle)
Retrieves the ESDT call value from the VM. Will return 0 in case of an EGLD transfer (cannot have both EGLD and ESDT transfer simultaneously). Read more
sourcefn token(&self) -> Option<Self::ManagedBufferHandle>
fn token(&self) -> Option<Self::ManagedBufferHandle>
Returns the call value token identifier of the current call. The identifier is wrapped in a TokenIdentifier object, to hide underlying logic. Read more
sourcefn esdt_token_nonce(&self) -> u64
fn esdt_token_nonce(&self) -> u64
Returns the nonce of the received ESDT token. Will return 0 in case of EGLD or fungible ESDT transfer. Read more
sourcefn esdt_token_type(&self) -> EsdtTokenType
fn esdt_token_type(&self) -> EsdtTokenType
Returns the ESDT token type. Will return “Fungible” for EGLD. Read more
fn esdt_value_by_index(&self, index: usize) -> Self::BigIntHandle
fn token_by_index(&self, index: usize) -> Self::ManagedBufferHandle
fn esdt_token_nonce_by_index(&self, index: usize) -> u64
fn esdt_token_type_by_index(&self, index: usize) -> EsdtTokenType
sourceimpl CryptoApi for VmApiImpl
impl CryptoApi for VmApiImpl
type CryptoApiImpl = VmApiImpl
fn crypto_api_impl() -> Self::CryptoApiImpl
sourceimpl CryptoApiImpl for VmApiImpl
impl CryptoApiImpl for VmApiImpl
fn sha256_legacy(&self, data: &[u8]) -> [u8; 32]
fn sha256_managed(
&self,
result_handle: Self::ManagedBufferHandle,
data_handle: Self::ManagedBufferHandle
)
fn keccak256_legacy(&self, data: &[u8]) -> [u8; 32]
fn keccak256_managed(
&self,
result_handle: Self::ManagedBufferHandle,
data_handle: Self::ManagedBufferHandle
)
fn ripemd160_legacy(&self, data: &[u8]) -> [u8; 20]
fn ripemd160_managed(
&self,
dest: Self::ManagedBufferHandle,
data_handle: Self::ManagedBufferHandle
)
fn verify_bls_legacy(&self, key: &[u8], message: &[u8], signature: &[u8]) -> bool
fn verify_bls_managed(
&self,
key: Self::ManagedBufferHandle,
message: Self::ManagedBufferHandle,
signature: Self::ManagedBufferHandle
) -> bool
fn verify_ed25519_legacy(
&self,
key: &[u8],
message: &[u8],
signature: &[u8]
) -> bool
fn verify_ed25519_managed(
&self,
key: Self::ManagedBufferHandle,
message: Self::ManagedBufferHandle,
signature: Self::ManagedBufferHandle
) -> bool
sourcefn verify_secp256k1_legacy(
&self,
key: &[u8],
message: &[u8],
signature: &[u8]
) -> bool
fn verify_secp256k1_legacy(
&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. Read more
fn verify_secp256k1_managed(
&self,
key: Self::ManagedBufferHandle,
message: Self::ManagedBufferHandle,
signature: Self::ManagedBufferHandle
) -> bool
fn verify_custom_secp256k1_legacy(
&self,
key: &[u8],
message: &[u8],
signature: &[u8],
hash_type: MessageHashType
) -> 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_legacy(&self, r: &[u8], s: &[u8]) -> BoxedBytes
fn encode_secp256k1_der_signature_managed(
&self,
r: Self::ManagedBufferHandle,
s: Self::ManagedBufferHandle,
dest_sig_handle: Self::ManagedBufferHandle
)
sourceimpl EllipticCurveApi for VmApiImpl
impl EllipticCurveApi for VmApiImpl
fn ec_create_from_name_bytes(&self, name: &[u8]) -> Self::ManagedBufferHandle
fn ec_create_from_name_mb(
&self,
name_handle: Self::ManagedBufferHandle
) -> Self::ManagedBufferHandle
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: 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
)
sourceimpl EndpointArgumentApi for VmApiImpl
impl EndpointArgumentApi for VmApiImpl
type EndpointArgumentApiImpl = VmApiImpl
fn argument_api_impl() -> Self::EndpointArgumentApiImpl
sourceimpl EndpointArgumentApiImpl for VmApiImpl
impl EndpointArgumentApiImpl for VmApiImpl
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 load_argument_managed_buffer(
&self,
arg_index: i32,
dest: Self::ManagedBufferHandle
)
fn get_argument_boxed_bytes(&self, arg_index: i32) -> BoxedBytes
fn load_argument_big_int_unsigned(
&self,
arg_index: i32,
dest: Self::ManagedBufferHandle
)
fn load_argument_big_int_signed(
&self,
arg_index: i32,
dest: Self::ManagedBufferHandle
)
fn get_argument_u64(&self, arg_index: i32) -> u64
fn get_argument_i64(&self, arg_index: i32) -> i64
sourceimpl EndpointFinishApi for VmApiImpl
impl EndpointFinishApi for VmApiImpl
type EndpointFinishApiImpl = VmApiImpl
fn finish_api_impl() -> Self::EndpointFinishApiImpl
sourceimpl EndpointFinishApiImpl for VmApiImpl
impl EndpointFinishApiImpl for VmApiImpl
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: 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)
sourceimpl ErrorApi for VmApiImpl
impl ErrorApi for VmApiImpl
type ErrorApiImpl = VmApiImpl
fn error_api_impl() -> Self
sourceimpl ErrorApiImpl for VmApiImpl
impl ErrorApiImpl for VmApiImpl
fn signal_error(&self, message: &[u8]) -> !
fn signal_error_from_buffer(
&self,
message_handle: Self::ManagedBufferHandle
) -> !
sourceimpl HandleTypeInfo for VmApiImpl
impl HandleTypeInfo for VmApiImpl
type ManagedBufferHandle = i32
type BigIntHandle = i32
type BigFloatHandle = i32
type EllipticCurveHandle = i32
sourceimpl LogApi for VmApiImpl
impl LogApi for VmApiImpl
type LogApiImpl = VmApiImpl
fn log_api_impl() -> Self::LogApiImpl
sourceimpl LogApiImpl for VmApiImpl
impl LogApiImpl for VmApiImpl
Interface to only be used by code generated by the macros. The smart contract code doesn’t have access to these methods directly.
sourcefn write_event_log(&self, topics_buffer: &ArgBuffer, data: &[u8])
fn write_event_log(&self, topics_buffer: &ArgBuffer, data: &[u8])
Saves an event log.
sourcefn write_legacy_log(&self, topics: &[[u8; 32]], data: &[u8])
fn write_legacy_log(&self, topics: &[[u8; 32]], data: &[u8])
The legacy Arwen hook for saving event logs. It does the same, but only accepts 32-byte topics. Only kept for backwards compatibility. Read more
fn managed_write_log(
&self,
topics_handle: Self::ManagedBufferHandle,
data_handle: Self::ManagedBufferHandle
)
sourceimpl ManagedBufferApi for VmApiImpl
impl ManagedBufferApi for VmApiImpl
sourcefn mb_new_empty(&self) -> Self::ManagedBufferHandle
fn mb_new_empty(&self) -> Self::ManagedBufferHandle
Requests a new handle from the VM. No longer used extensively.
sourcefn mb_new_from_bytes(&self, bytes: &[u8]) -> Self::ManagedBufferHandle
fn mb_new_from_bytes(&self, bytes: &[u8]) -> Self::ManagedBufferHandle
Requests a new handle from the VM, initialized with some data. No longer used extensively.
fn mb_len(&self, handle: Self::ManagedBufferHandle) -> usize
fn mb_to_boxed_bytes(&self, handle: Self::ManagedBufferHandle) -> BoxedBytes
sourcefn 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>
TODO: investigate the impact of using Result<(), ()>
on the wasm output.
sourcefn 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>
TODO: investigate the impact of using Result<(), ()>
on the wasm output.
fn mb_copy_to_slice_pad_right(
&self,
handle: Self::ManagedBufferHandle,
destination: &mut [u8]
)
fn mb_overwrite(&self, handle: Self::ManagedBufferHandle, bytes: &[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
)
sourceimpl ManagedTypeApi for VmApiImpl
impl ManagedTypeApi for VmApiImpl
type ManagedTypeApiImpl = VmApiImpl
fn managed_type_impl() -> Self
sourceimpl ManagedTypeApiImpl for VmApiImpl
impl ManagedTypeApiImpl for VmApiImpl
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
sourceimpl PrintApi for VmApiImpl
impl PrintApi for VmApiImpl
type PrintApiImpl = VmApiImpl
fn print_api_impl() -> Self::PrintApiImpl
sourceimpl PrintApiImpl for VmApiImpl
impl PrintApiImpl for VmApiImpl
type Buffer = FormatBufferIgnore
type Buffer = FormatBufferIgnore
Buffer used for printing only.
fn print_buffer(&self, _buffer: Self::Buffer)
sourceimpl SendApi for VmApiImpl
impl SendApi for VmApiImpl
type SendApiImpl = VmApiImpl
fn send_api_impl() -> Self::SendApiImpl
sourceimpl SendApiImpl for VmApiImpl
impl SendApiImpl for VmApiImpl
fn transfer_value_legacy<M>(
&self,
to: &Address,
amount: &BigUint<M>,
data: &BoxedBytes
) where
M: ManagedTypeApi,
sourcefn transfer_value_execute<M: ManagedTypeApi>(
&self,
to: &ManagedAddress<M>,
amount: &BigUint<M>,
gas_limit: u64,
endpoint_name: &ManagedBuffer<M>,
arg_buffer: &ManagedArgBuffer<M>
) -> Result<(), &'static [u8]>
fn transfer_value_execute<M: ManagedTypeApi>(
&self,
to: &ManagedAddress<M>,
amount: &BigUint<M>,
gas_limit: u64,
endpoint_name: &ManagedBuffer<M>,
arg_buffer: &ManagedArgBuffer<M>
) -> Result<(), &'static [u8]>
Sends EGLD to an address (optionally) and executes like an async call, but without callback.
fn transfer_value_execute_legacy<M: ManagedTypeApi>(
&self,
to: &Address,
amount: &BigUint<M>,
gas_limit: u64,
endpoint_name: &BoxedBytes,
arg_buffer: &ArgBuffer
) -> Result<(), &'static [u8]>
sourcefn transfer_esdt_execute<M: ManagedTypeApi>(
&self,
to: &ManagedAddress<M>,
token: &TokenIdentifier<M>,
amount: &BigUint<M>,
gas_limit: u64,
endpoint_name: &ManagedBuffer<M>,
arg_buffer: &ManagedArgBuffer<M>
) -> Result<(), &'static [u8]>
fn transfer_esdt_execute<M: ManagedTypeApi>(
&self,
to: &ManagedAddress<M>,
token: &TokenIdentifier<M>,
amount: &BigUint<M>,
gas_limit: u64,
endpoint_name: &ManagedBuffer<M>,
arg_buffer: &ManagedArgBuffer<M>
) -> Result<(), &'static [u8]>
Sends ESDT to an address and executes like an async call, but without callback.
fn transfer_esdt_execute_legacy<M: ManagedTypeApi>(
&self,
to: &Address,
token: &TokenIdentifier<M>,
amount: &BigUint<M>,
gas_limit: u64,
endpoint_name: &BoxedBytes,
arg_buffer: &ArgBuffer
) -> Result<(), &'static [u8]>
sourcefn transfer_esdt_nft_execute<M: ManagedTypeApi>(
&self,
to: &ManagedAddress<M>,
token: &TokenIdentifier<M>,
nonce: u64,
amount: &BigUint<M>,
gas_limit: u64,
endpoint_name: &ManagedBuffer<M>,
arg_buffer: &ManagedArgBuffer<M>
) -> Result<(), &'static [u8]>
fn transfer_esdt_nft_execute<M: ManagedTypeApi>(
&self,
to: &ManagedAddress<M>,
token: &TokenIdentifier<M>,
nonce: u64,
amount: &BigUint<M>,
gas_limit: u64,
endpoint_name: &ManagedBuffer<M>,
arg_buffer: &ManagedArgBuffer<M>
) -> Result<(), &'static [u8]>
Sends ESDT NFT to an address and executes like an async call, but without callback.
fn transfer_esdt_nft_execute_legacy<M: ManagedTypeApi>(
&self,
to: &Address,
token: &TokenIdentifier<M>,
nonce: u64,
amount: &BigUint<M>,
gas_limit: u64,
endpoint_name: &BoxedBytes,
arg_buffer: &ArgBuffer
) -> Result<(), &'static [u8]>
fn multi_transfer_esdt_nft_execute<M: ManagedTypeApi>(
&self,
to: &ManagedAddress<M>,
payments: &ManagedVec<M, EsdtTokenPayment<M>>,
gas_limit: u64,
endpoint_name: &ManagedBuffer<M>,
arg_buffer: &ManagedArgBuffer<M>
) -> Result<(), &'static [u8]>
fn multi_transfer_esdt_nft_execute_legacy<M: ManagedTypeApi>(
&self,
to: &Address,
payments: &[EsdtTokenPayment<M>],
gas_limit: u64,
endpoint_name: &BoxedBytes,
arg_buffer: &ArgBuffer
) -> Result<(), &'static [u8]>
sourcefn async_call_raw<M: ManagedTypeApi>(
&self,
to: &ManagedAddress<M>,
amount: &BigUint<M>,
endpoint_name: &ManagedBuffer<M>,
arg_buffer: &ManagedArgBuffer<M>
) -> !
fn async_call_raw<M: ManagedTypeApi>(
&self,
to: &ManagedAddress<M>,
amount: &BigUint<M>,
endpoint_name: &ManagedBuffer<M>,
arg_buffer: &ManagedArgBuffer<M>
) -> !
Sends an asynchronous call to another contract. Calling this method immediately terminates tx execution. Using it directly is generally discouraged. Read more
fn async_call_raw_legacy<M: ManagedTypeApi>(
&self,
to: &Address,
amount: &BigUint<M>,
endpoint_name: &BoxedBytes,
arg_buffer: &ArgBuffer
) -> !
fn create_async_call_raw<M: ManagedTypeApi>(
&self,
to: &ManagedAddress<M>,
amount: &BigUint<M>,
endpoint_name: &ManagedBuffer<M>,
success: &'static [u8],
error: &'static [u8],
gas: u64,
extra_gas_for_callback: u64,
arg_buffer: &ManagedArgBuffer<M>
)
sourcefn deploy_contract<M: ManagedTypeApi>(
&self,
gas: u64,
amount: &BigUint<M>,
code: &ManagedBuffer<M>,
code_metadata: CodeMetadata,
arg_buffer: &ManagedArgBuffer<M>
) -> (ManagedAddress<M>, ManagedVec<M, ManagedBuffer<M>>)
fn deploy_contract<M: ManagedTypeApi>(
&self,
gas: u64,
amount: &BigUint<M>,
code: &ManagedBuffer<M>,
code_metadata: CodeMetadata,
arg_buffer: &ManagedArgBuffer<M>
) -> (ManagedAddress<M>, ManagedVec<M, ManagedBuffer<M>>)
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 returned Read more
fn deploy_contract_legacy<M: ManagedTypeApi>(
&self,
gas: u64,
amount: &BigUint<M>,
code: &BoxedBytes,
code_metadata: CodeMetadata,
arg_buffer: &ArgBuffer
) -> (ManagedAddress<M>, ManagedVec<M, ManagedBuffer<M>>)
sourcefn deploy_from_source_contract<M: ManagedTypeApi>(
&self,
gas: u64,
amount: &BigUint<M>,
source_contract_address: &ManagedAddress<M>,
code_metadata: CodeMetadata,
arg_buffer: &ManagedArgBuffer<M>
) -> (ManagedAddress<M>, ManagedVec<M, ManagedBuffer<M>>)
fn deploy_from_source_contract<M: ManagedTypeApi>(
&self,
gas: u64,
amount: &BigUint<M>,
source_contract_address: &ManagedAddress<M>,
code_metadata: CodeMetadata,
arg_buffer: &ManagedArgBuffer<M>
) -> (ManagedAddress<M>, ManagedVec<M, ManagedBuffer<M>>)
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 Read more
fn deploy_from_source_contract_legacy<M: ManagedTypeApi>(
&self,
gas: u64,
amount: &BigUint<M>,
source_contract_address: &Address,
code_metadata: CodeMetadata,
arg_buffer: &ArgBuffer
) -> (ManagedAddress<M>, ManagedVec<M, ManagedBuffer<M>>)
fn upgrade_from_source_contract<M: ManagedTypeApi>(
&self,
sc_address: &ManagedAddress<M>,
gas: u64,
amount: &BigUint<M>,
source_contract_address: &ManagedAddress<M>,
code_metadata: CodeMetadata,
arg_buffer: &ManagedArgBuffer<M>
)
fn upgrade_from_source_contract_legacy<M: ManagedTypeApi>(
&self,
sc_address: &Address,
gas: u64,
amount: &BigUint<M>,
source_contract_address: &Address,
code_metadata: CodeMetadata,
arg_buffer: &ArgBuffer
)
sourcefn upgrade_contract<M: ManagedTypeApi>(
&self,
sc_address: &ManagedAddress<M>,
gas: u64,
amount: &BigUint<M>,
code: &ManagedBuffer<M>,
code_metadata: CodeMetadata,
arg_buffer: &ManagedArgBuffer<M>
)
fn upgrade_contract<M: ManagedTypeApi>(
&self,
sc_address: &ManagedAddress<M>,
gas: u64,
amount: &BigUint<M>,
code: &ManagedBuffer<M>,
code_metadata: CodeMetadata,
arg_buffer: &ManagedArgBuffer<M>
)
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 Read more
fn upgrade_contract_legacy<M: ManagedTypeApi>(
&self,
sc_address: &Address,
gas: u64,
amount: &BigUint<M>,
code: &BoxedBytes,
code_metadata: CodeMetadata,
arg_buffer: &ArgBuffer
)
sourcefn execute_on_dest_context_raw<M: ManagedTypeApi>(
&self,
gas: u64,
to: &ManagedAddress<M>,
amount: &BigUint<M>,
endpoint_name: &ManagedBuffer<M>,
arg_buffer: &ManagedArgBuffer<M>
) -> ManagedVec<M, ManagedBuffer<M>>
fn execute_on_dest_context_raw<M: ManagedTypeApi>(
&self,
gas: u64,
to: &ManagedAddress<M>,
amount: &BigUint<M>,
endpoint_name: &ManagedBuffer<M>,
arg_buffer: &ManagedArgBuffer<M>
) -> ManagedVec<M, ManagedBuffer<M>>
Same shard, in-line execution of another contract.
fn execute_on_dest_context_raw_legacy<M: ManagedTypeApi>(
&self,
gas: u64,
to: &Address,
amount: &BigUint<M>,
endpoint_name: &BoxedBytes,
arg_buffer: &ArgBuffer
) -> ManagedVec<M, ManagedBuffer<M>>
fn execute_on_same_context_raw<M: ManagedTypeApi>(
&self,
gas: u64,
to: &ManagedAddress<M>,
amount: &BigUint<M>,
endpoint_name: &ManagedBuffer<M>,
arg_buffer: &ManagedArgBuffer<M>
) -> ManagedVec<M, ManagedBuffer<M>>
fn execute_on_same_context_raw_legacy<M: ManagedTypeApi>(
&self,
gas: u64,
to: &Address,
amount: &BigUint<M>,
endpoint_name: &BoxedBytes,
arg_buffer: &ArgBuffer
) -> ManagedVec<M, ManagedBuffer<M>>
fn execute_on_dest_context_readonly_raw<M: ManagedTypeApi>(
&self,
gas: u64,
to: &ManagedAddress<M>,
endpoint_name: &ManagedBuffer<M>,
arg_buffer: &ManagedArgBuffer<M>
) -> ManagedVec<M, ManagedBuffer<M>>
fn execute_on_dest_context_readonly_raw_legacy<M: ManagedTypeApi>(
&self,
gas: u64,
to: &Address,
endpoint_name: &BoxedBytes,
arg_buffer: &ArgBuffer
) -> ManagedVec<M, ManagedBuffer<M>>
fn clean_return_data(&self)
fn delete_from_return_data(&self, index: usize)
sourceimpl StaticVarApi for VmApiImpl
impl StaticVarApi for VmApiImpl
type StaticVarApiImpl = VmApiImpl
fn static_var_api_impl() -> Self::StaticVarApiImpl
sourceimpl StaticVarApiImpl for VmApiImpl
impl StaticVarApiImpl for VmApiImpl
fn with_lockable_static_buffer<R, F: FnOnce(&mut LockableStaticBuffer) -> R>(
&self,
f: F
) -> R
fn set_external_view_target_address_handle(
&self,
handle: Self::ManagedBufferHandle
)
fn get_external_view_target_address_handle(&self) -> Self::ManagedBufferHandle
fn next_handle<H: HandleConstraints>(&self) -> H
fn set_num_arguments(&self, num_arguments: i32)
fn get_num_arguments(&self) -> i32
fn set_call_value_egld_handle(&self, handle: Self::BigIntHandle)
fn get_call_value_egld_handle(&self) -> Self::BigIntHandle
fn set_call_value_multi_esdt_handle(&self, handle: Self::ManagedBufferHandle)
fn get_call_value_multi_esdt_handle(&self) -> Self::ManagedBufferHandle
sourceimpl StorageReadApi for VmApiImpl
impl StorageReadApi for VmApiImpl
type StorageReadApiImpl = VmApiImpl
fn storage_read_api_impl() -> Self::StorageReadApiImpl
sourceimpl StorageReadApiImpl for VmApiImpl
impl StorageReadApiImpl for VmApiImpl
fn storage_load_len(&self, key: &[u8]) -> usize
fn storage_load_to_heap(&self, key: &[u8]) -> Box<[u8]>ⓘNotable traits for Box<I, A>impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn storage_load_big_uint_raw(&self, key: &[u8], dest: Self::ManagedBufferHandle)
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)
sourceimpl StorageWriteApi for VmApiImpl
impl StorageWriteApi for VmApiImpl
type StorageWriteApiImpl = VmApiImpl
fn storage_write_api_impl() -> Self::StorageWriteApiImpl
sourceimpl StorageWriteApiImpl for VmApiImpl
impl StorageWriteApiImpl for VmApiImpl
fn storage_store_slice_u8(&self, key: &[u8], value: &[u8])
fn storage_store_big_uint_raw(&self, key: &[u8], value_handle: Self::BigIntHandle)
fn storage_store_managed_buffer_raw(
&self,
key_handle: Self::ManagedBufferHandle,
value_handle: Self::ManagedBufferHandle
)
fn storage_store_managed_buffer_clear(
&self,
key_handle: Self::ManagedBufferHandle
)
sourceimpl VMApi for VmApiImpl
impl VMApi for VmApiImpl
fn has_location(location: EndpointLocationAbi) -> bool
fn init_static()
impl CallTypeApi for VmApiImpl
impl Eq for VmApiImpl
impl StorageMapperApi for VmApiImpl
Auto Trait Implementations
impl CodecFromSelf for VmApiImpl
impl RefUnwindSafe for VmApiImpl
impl Send for VmApiImpl
impl Sync for VmApiImpl
impl Unpin for VmApiImpl
impl UnwindSafe for VmApiImpl
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more