Type Definition elrond_wasm_debug::DebugApi
source · pub type DebugApi = TxContextRef;
Implementations§
source§impl DebugApi
impl DebugApi
pub fn insert_new_managed_buffer(
&self,
value: Vec<u8>
) -> <Self as HandleTypeInfo>::ManagedBufferHandle
pub fn insert_new_managed_buffer_old(
&self,
value: Vec<u8>
) -> ManagedBuffer<Self>
pub fn mb_handle_to_value(
&self,
mb_handle: <Self as HandleTypeInfo>::ManagedBufferHandle
) -> Vec<u8> ⓘ
pub fn address_handle_to_value(
&self,
address_handle: <Self as HandleTypeInfo>::ManagedBufferHandle
) -> Address
pub fn insert_new_big_uint(
&self,
value: BigUint
) -> <Self as HandleTypeInfo>::BigIntHandle
pub fn set_big_uint(
&self,
handle: <Self as HandleTypeInfo>::BigIntHandle,
value: BigUint
)
pub fn insert_new_big_uint_old(&self, value: BigUint) -> BigUint<Self>
pub fn insert_new_big_uint_zero(&self) -> <Self as HandleTypeInfo>::BigIntHandle
pub fn big_uint_handle_to_value(
&self,
bu_handle: <Self as HandleTypeInfo>::BigIntHandle
) -> BigUint
Trait Implementations§
source§impl BigFloatApi for DebugApi
impl BigFloatApi for DebugApi
fn bf_from_parts(
&self,
integral_part: i32,
fractional_part: i32,
exponent: i32
) -> Self::ManagedBufferHandle
fn bf_from_frac(&self, numerator: i64, denominator: i64) -> Self::BigFloatHandle
fn bf_from_sci(&self, significand: i64, exponent: 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_abs(&self, dest: Self::BigFloatHandle, x: Self::BigFloatHandle)
fn bf_neg(&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, bi: Self::BigIntHandle)
fn bf_get_const_pi(&self, dest: Self::BigFloatHandle)
fn bf_get_const_e(&self, dest: Self::BigFloatHandle)
fn bf_new_zero(&self) -> Self::BigFloatHandle
source§impl BigIntApi for DebugApi
impl BigIntApi for DebugApi
fn bi_new(&self, value: i64) -> Self::BigIntHandle
fn bi_set_int64(&self, destination: Self::BigIntHandle, value: i64)
fn bi_unsigned_byte_length(&self, handle: Self::BigIntHandle) -> usize
fn bi_get_unsigned_bytes(&self, handle: Self::BigIntHandle) -> BoxedBytes
fn bi_set_unsigned_bytes(&self, dest: Self::BigIntHandle, bytes: &[u8])
fn bi_signed_byte_length(&self, handle: Self::BigIntHandle) -> usize
fn bi_get_signed_bytes(&self, handle: Self::BigIntHandle) -> BoxedBytes
fn bi_set_signed_bytes(&self, dest: Self::BigIntHandle, bytes: &[u8])
fn bi_to_i64(&self, handle: 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,
x: Self::BigIntHandle,
str_handle: Self::ManagedBufferHandle
)
fn bi_new_zero(&self) -> Self::BigIntHandle
source§impl BlockchainApi for DebugApi
impl BlockchainApi for DebugApi
type BlockchainApiImpl = TxContextRef
fn blockchain_api_impl() -> Self::BlockchainApiImpl
source§impl BlockchainApiImpl for DebugApi
impl BlockchainApiImpl for DebugApi
fn get_caller_legacy(&self) -> Address
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 load_balance_legacy(&self, dest: Self::BigIntHandle, address: &Address)
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_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 load_esdt_token_data<M: ManagedTypeApi>(
&self,
address: &ManagedAddress<M>,
token: &TokenIdentifier<M>,
nonce: u64
) -> EsdtTokenData<M>
source§fn load_esdt_token_data_unmanaged<M: ManagedTypeApi>(
&self,
_address: &ManagedAddress<M>,
_token: &TokenIdentifier<M>,
_nonce: u64
) -> EsdtTokenData<M>
fn load_esdt_token_data_unmanaged<M: ManagedTypeApi>(
&self,
_address: &ManagedAddress<M>,
_token: &TokenIdentifier<M>,
_nonce: u64
) -> EsdtTokenData<M>
👎Deprecated since 0.31.0: Only used for limited backwards compatibility tests. Never use! Use
load_esdt_token_data
instead.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 load_caller_managed(&self, dest: Self::ManagedBufferHandle)
fn load_sc_address_managed(&self, dest: Self::ManagedBufferHandle)
fn load_owner_address_managed(&self, dest: Self::ManagedBufferHandle)
fn get_shard_of_address(&self, address_handle: Self::ManagedBufferHandle) -> u32
fn is_smart_contract(&self, address_handle: Self::ManagedBufferHandle) -> bool
fn load_balance(
&self,
dest: Self::BigIntHandle,
address_handle: Self::ManagedBufferHandle
)
fn load_state_root_hash_managed(&self, dest: Self::ManagedBufferHandle)
fn load_tx_hash_managed(&self, dest: Self::ManagedBufferHandle)
fn load_block_random_seed_managed(&self, dest: Self::ManagedBufferHandle)
fn load_prev_block_random_seed_managed(&self, dest: Self::ManagedBufferHandle)
source§impl CallValueApi for DebugApi
impl CallValueApi for DebugApi
type CallValueApiImpl = TxContextRef
fn call_value_api_impl() -> Self::CallValueApiImpl
source§impl CallValueApiImpl for DebugApi
impl CallValueApiImpl for DebugApi
fn check_not_payable(&self)
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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_num_transfers(&self) -> usize
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
source§fn 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.
source§impl CryptoApi for DebugApi
impl CryptoApi for DebugApi
type CryptoApiImpl = TxContextRef
fn crypto_api_impl() -> Self::CryptoApiImpl
source§impl CryptoApiImpl for DebugApi
impl CryptoApiImpl for DebugApi
fn sha256_legacy(&self, data: &[u8]) -> [u8; 32]
fn sha256_managed(
&self,
dest: Self::ManagedBufferHandle,
data_handle: Self::ManagedBufferHandle
)
fn keccak256_legacy(&self, data: &[u8]) -> [u8; 32]
fn keccak256_managed(
&self,
dest: 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
source§fn 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: Self::ManagedBufferHandle
)
source§impl EllipticCurveApi for DebugApi
impl EllipticCurveApi for DebugApi
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_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 EndpointArgumentApi for DebugApi
impl EndpointArgumentApi for DebugApi
type EndpointArgumentApiImpl = TxContextRef
fn argument_api_impl() -> Self::EndpointArgumentApiImpl
source§impl EndpointArgumentApiImpl for DebugApi
impl EndpointArgumentApiImpl for DebugApi
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_i64(&self, arg_index: i32) -> i64
fn get_argument_u64(&self, arg_index: i32) -> u64
fn load_callback_closure_buffer(&self, dest: Self::ManagedBufferHandle)
fn endpoint_init(&self)
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 EndpointFinishApi for DebugApi
impl EndpointFinishApi for DebugApi
type EndpointFinishApiImpl = TxContextRef
fn finish_api_impl() -> Self::EndpointFinishApiImpl
source§impl EndpointFinishApiImpl for DebugApi
impl EndpointFinishApiImpl for DebugApi
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_i64(&self, value: i64)
fn finish_u64(&self, value: u64)
source§impl ErrorApi for DebugApi
impl ErrorApi for DebugApi
type ErrorApiImpl = TxContextRef
fn error_api_impl() -> Self
source§impl ErrorApiImpl for DebugApi
impl ErrorApiImpl for DebugApi
fn signal_error(&self, message: &[u8]) -> !
fn signal_error_from_buffer(
&self,
message_handle: Self::ManagedBufferHandle
) -> !
source§impl HandleTypeInfo for DebugApi
impl HandleTypeInfo for DebugApi
type ManagedBufferHandle = DebugHandle
type BigIntHandle = DebugHandle
type BigFloatHandle = DebugHandle
type EllipticCurveHandle = DebugHandle
source§impl LogApi for DebugApi
impl LogApi for DebugApi
type LogApiImpl = TxContextRef
fn log_api_impl() -> Self::LogApiImpl
source§impl LogApiImpl for DebugApi
impl LogApiImpl for DebugApi
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 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
)
source§impl ManagedBufferApi for DebugApi
impl ManagedBufferApi for DebugApi
source§fn mb_new_empty(&self) -> Self::ManagedBufferHandle
fn mb_new_empty(&self) -> Self::ManagedBufferHandle
Requests a new handle from the VM. No longer used extensively.
source§fn 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
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>
TODO: investigate the impact of using
Result<(), ()>
on the wasm output.source§fn mb_copy_slice(
&self,
source_handle: Self::ManagedBufferHandle,
starting_position: usize,
slice_len: usize,
dest_handle: Self::ManagedBufferHandle
) -> Result<(), InvalidSliceError>
fn mb_copy_slice(
&self,
source_handle: Self::ManagedBufferHandle,
starting_position: 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, 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 ManagedTypeApi for DebugApi
impl ManagedTypeApi for DebugApi
type ManagedTypeApiImpl = TxContextRef
fn managed_type_impl() -> Self
source§impl ManagedTypeApiImpl for DebugApi
impl ManagedTypeApiImpl for DebugApi
fn mb_to_big_int_unsigned(
&self,
buffer_handle: Self::ManagedBufferHandle,
dest: Self::BigIntHandle
)
fn mb_to_big_int_signed(
&self,
buffer_handle: Self::ManagedBufferHandle,
dest: Self::BigIntHandle
)
fn mb_from_big_int_unsigned(
&self,
big_int_handle: Self::BigIntHandle,
dest: Self::ManagedBufferHandle
)
fn mb_from_big_int_signed(
&self,
big_int_handle: Self::BigIntHandle,
dest: Self::ManagedBufferHandle
)
fn mb_to_big_float(
&self,
buffer_handle: Self::ManagedBufferHandle,
dest: Self::BigFloatHandle
)
fn mb_from_big_float(
&self,
big_float_handle: Self::BigFloatHandle,
dest: Self::ManagedBufferHandle
)
fn validate_token_identifier(
&self,
token_id_handle: Self::ManagedBufferHandle
) -> bool
source§impl PrintApi for DebugApi
impl PrintApi for DebugApi
type PrintApiImpl = TxContextRef
fn print_api_impl() -> Self::PrintApiImpl
source§impl PrintApiImpl for DebugApi
impl PrintApiImpl for DebugApi
§type Buffer = ManagedBufferCachedBuilder<TxContextRef>
type Buffer = ManagedBufferCachedBuilder<TxContextRef>
Buffer used for printing only.
fn print_buffer(&self, buffer: Self::Buffer)
source§impl SendApi for DebugApi
impl SendApi for DebugApi
type SendApiImpl = TxContextRef
fn send_api_impl() -> Self::SendApiImpl
source§impl SendApiImpl for DebugApi
impl SendApiImpl for DebugApi
source§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]>
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.
source§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]>
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.
source§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]>
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 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]>
source§fn 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 create_async_call_raw(
&self,
to: Self::ManagedBufferHandle,
amount: Self::BigIntHandle,
endpoint_name_handle: Self::ManagedBufferHandle,
arg_buffer_handle: Self::ManagedBufferHandle,
success_callback: &'static str,
error_callback: &'static str,
_gas: u64,
_extra_gas_for_callback: u64,
callback_closure_handle: Self::ManagedBufferHandle
)
source§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>>)
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 moresource§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>>)
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
source§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>
)
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_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>
)
source§fn execute_on_dest_context_raw<M: ManagedTypeApi>(
&self,
_gas: u64,
to: &ManagedAddress<M>,
value: &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>,
value: &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_same_context_raw<M: ManagedTypeApi>(
&self,
_gas: u64,
_to: &ManagedAddress<M>,
_value: &BigUint<M>,
_endpoint_name: &ManagedBuffer<M>,
_arg_buffer: &ManagedArgBuffer<M>
) -> 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 clean_return_data(&self)
fn delete_from_return_data(&self, index: usize)
fn transfer_value_legacy<M>(
&self,
_to: &Address,
_amount: &BigUint<M>,
_data: &BoxedBytes
)where
M: ManagedTypeApi,
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]>
fn transfer_esdt_execute_legacy<M: ManagedTypeApi>(
&self,
_to: &Address,
_token: &TokenIdentifier<M>,
_amount: &BigUint<M>,
_gas: u64,
_endpoint_name: &BoxedBytes,
_arg_buffer: &ArgBuffer
) -> Result<(), &'static [u8]>
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_legacy<M: ManagedTypeApi>(
&self,
_to: &Address,
_payments: &[EsdtTokenPayment<M>],
_gas_limit: u64,
_endpoint_name: &BoxedBytes,
_arg_buffer: &ArgBuffer
) -> Result<(), &'static [u8]>
fn async_call_raw_legacy<M: ManagedTypeApi>(
&self,
_to: &Address,
_amount: &BigUint<M>,
_endpoint_name: &BoxedBytes,
_arg_buffer: &ArgBuffer
) -> !
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>>)
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_legacy<M: ManagedTypeApi>(
&self,
_sc_address: &Address,
_gas: u64,
_amount: &BigUint<M>,
_source_contract_address: &Address,
_code_metadata: CodeMetadata,
_arg_buffer: &ArgBuffer
)
fn upgrade_contract_legacy<M: ManagedTypeApi>(
&self,
_sc_address: &Address,
_gas: u64,
_amount: &BigUint<M>,
_code: &BoxedBytes,
_code_metadata: CodeMetadata,
_arg_buffer: &ArgBuffer
)
fn execute_on_dest_context_raw_legacy<M: ManagedTypeApi>(
&self,
_gas: u64,
_to: &Address,
_value: &BigUint<M>,
_endpoint_name: &BoxedBytes,
_arg_buffer: &ArgBuffer
) -> ManagedVec<M, ManagedBuffer<M>>
fn execute_on_same_context_raw_legacy<M: ManagedTypeApi>(
&self,
_gas: u64,
_to: &Address,
_value: &BigUint<M>,
_endpoint_name: &BoxedBytes,
_arg_buffer: &ArgBuffer
) -> ManagedVec<M, ManagedBuffer<M>>
fn execute_on_dest_context_readonly_raw_legacy<M: ManagedTypeApi>(
&self,
_gas: u64,
_address: &Address,
_endpoint_name: &BoxedBytes,
_arg_buffer: &ArgBuffer
) -> ManagedVec<M, ManagedBuffer<M>>
source§impl StaticVarApi for DebugApi
impl StaticVarApi for DebugApi
type StaticVarApiImpl = TxContextRef
fn static_var_api_impl() -> DebugApi
source§impl StaticVarApiImpl for DebugApi
impl StaticVarApiImpl for DebugApi
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
source§impl StorageReadApi for DebugApi
impl StorageReadApi for DebugApi
type StorageReadApiImpl = TxContextRef
fn storage_read_api_impl() -> Self::StorageReadApiImpl
source§impl StorageReadApiImpl for DebugApi
impl StorageReadApiImpl for DebugApi
fn storage_load_len(&self, key: &[u8]) -> usize
fn storage_load_to_heap(&self, key: &[u8]) -> Box<[u8]>
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)
source§impl StorageWriteApi for DebugApi
impl StorageWriteApi for DebugApi
type StorageWriteApiImpl = TxContextRef
fn storage_write_api_impl() -> Self::StorageWriteApiImpl
source§impl StorageWriteApiImpl for DebugApi
impl StorageWriteApiImpl for DebugApi
fn storage_store_slice_u8(&self, key: &[u8], value: &[u8])
fn storage_store_big_uint_raw(&self, key: &[u8], 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
)
source§impl VMApi for DebugApi
impl VMApi for DebugApi
source§fn external_view_init_override() -> bool
fn external_view_init_override() -> bool
Slightly hacky way of overriding the constructor for external view contracts. Read more