pub enum HostFnImpl {}
Expand description
Implements HostFn
for each supported target architecture.
Trait Implementations§
Source§impl HostFn for HostFnImpl
impl HostFn for HostFnImpl
Source§fn instantiate_v1(
code_hash: &[u8],
gas: u64,
value: &[u8],
input: &[u8],
address: Option<&mut &mut [u8]>,
output: Option<&mut &mut [u8]>,
salt: &[u8],
) -> Result<(), ReturnErrorCode>
fn instantiate_v1( code_hash: &[u8], gas: u64, value: &[u8], input: &[u8], address: Option<&mut &mut [u8]>, output: Option<&mut &mut [u8]>, salt: &[u8], ) -> Result<(), ReturnErrorCode>
👎Deprecated: Deprecated, use newer version instead
Instantiate a contract with the specified code hash. Read more
Source§fn instantiate_v2(
code_hash: &[u8],
ref_time_limit: u64,
proof_size_limit: u64,
deposit: Option<&[u8]>,
value: &[u8],
input: &[u8],
address: Option<&mut &mut [u8]>,
output: Option<&mut &mut [u8]>,
salt: &[u8],
) -> Result<(), ReturnErrorCode>
fn instantiate_v2( code_hash: &[u8], ref_time_limit: u64, proof_size_limit: u64, deposit: Option<&[u8]>, value: &[u8], input: &[u8], address: Option<&mut &mut [u8]>, output: Option<&mut &mut [u8]>, salt: &[u8], ) -> Result<(), ReturnErrorCode>
Instantiate a contract with the specified code hash. Read more
Source§fn call(
callee: &[u8],
gas: u64,
value: &[u8],
input_data: &[u8],
output: Option<&mut &mut [u8]>,
) -> Result<(), ReturnErrorCode>
fn call( callee: &[u8], gas: u64, value: &[u8], input_data: &[u8], output: Option<&mut &mut [u8]>, ) -> Result<(), ReturnErrorCode>
👎Deprecated: Deprecated, use newer version instead
Make a call to another contract. Read more
Source§fn call_v1(
flags: CallFlags,
callee: &[u8],
gas: u64,
value: &[u8],
input_data: &[u8],
output: Option<&mut &mut [u8]>,
) -> Result<(), ReturnErrorCode>
fn call_v1( flags: CallFlags, callee: &[u8], gas: u64, value: &[u8], input_data: &[u8], output: Option<&mut &mut [u8]>, ) -> Result<(), ReturnErrorCode>
👎Deprecated: Deprecated, use newer version instead
Make a call to another contract. Read more
Source§fn call_v2(
flags: CallFlags,
callee: &[u8],
ref_time_limit: u64,
proof_size_limit: u64,
deposit: Option<&[u8]>,
value: &[u8],
input_data: &[u8],
output: Option<&mut &mut [u8]>,
) -> Result<(), ReturnErrorCode>
fn call_v2( flags: CallFlags, callee: &[u8], ref_time_limit: u64, proof_size_limit: u64, deposit: Option<&[u8]>, value: &[u8], input_data: &[u8], output: Option<&mut &mut [u8]>, ) -> Result<(), ReturnErrorCode>
Call (possibly transferring some amount of funds) into the specified account. Read more
Source§fn caller_is_root() -> u32
fn caller_is_root() -> u32
Checks whether the caller of the current contract is root. Read more
Source§fn delegate_call(
flags: CallFlags,
code_hash: &[u8],
input: &[u8],
output: Option<&mut &mut [u8]>,
) -> Result<(), ReturnErrorCode>
fn delegate_call( flags: CallFlags, code_hash: &[u8], input: &[u8], output: Option<&mut &mut [u8]>, ) -> Result<(), ReturnErrorCode>
Execute code in the context (storage, caller, value) of the current contract. Read more
Source§fn transfer(account_id: &[u8], value: &[u8]) -> Result<(), ReturnErrorCode>
fn transfer(account_id: &[u8], value: &[u8]) -> Result<(), ReturnErrorCode>
Transfer some amount of funds into the specified account. Read more
Source§fn deposit_event(topics: &[u8], data: &[u8])
fn deposit_event(topics: &[u8], data: &[u8])
Deposit a contract event with the data buffer and optional list of topics. There is a limit
on the maximum number of topics specified by
event_topics
. Read moreSource§fn set_storage(key: &[u8], value: &[u8])
fn set_storage(key: &[u8], value: &[u8])
Set the value at the given key in the contract storage. Read more
Source§fn set_storage_v1(key: &[u8], encoded_value: &[u8]) -> Option<u32>
fn set_storage_v1(key: &[u8], encoded_value: &[u8]) -> Option<u32>
Set the value at the given key in the contract storage. Read more
Source§fn set_storage_v2(key: &[u8], encoded_value: &[u8]) -> Option<u32>
fn set_storage_v2(key: &[u8], encoded_value: &[u8]) -> Option<u32>
Set the value at the given key in the contract storage. Read more
Source§fn set_transient_storage(key: &[u8], encoded_value: &[u8]) -> Option<u32>
fn set_transient_storage(key: &[u8], encoded_value: &[u8]) -> Option<u32>
👎Deprecated: Unstable function. Behaviour can change without further notice. Use only for testing.
Set the value at the given key in the contract transient storage. Read more
Source§fn clear_storage(key: &[u8])
fn clear_storage(key: &[u8])
Clear the value at the given key in the contract storage. Read more
Source§fn clear_storage_v1(key: &[u8]) -> Option<u32>
fn clear_storage_v1(key: &[u8]) -> Option<u32>
Clear the value at the given key in the contract storage. Read more
Source§fn clear_transient_storage(key: &[u8]) -> Option<u32>
fn clear_transient_storage(key: &[u8]) -> Option<u32>
👎Deprecated: Unstable function. Behaviour can change without further notice. Use only for testing.
Clear the value at the given key in the contract transient storage. Read more
Source§fn get_storage(
key: &[u8],
output: &mut &mut [u8],
) -> Result<(), ReturnErrorCode>
fn get_storage( key: &[u8], output: &mut &mut [u8], ) -> Result<(), ReturnErrorCode>
Retrieve the value under the given key from storage. Read more
Source§fn get_storage_v1(
key: &[u8],
output: &mut &mut [u8],
) -> Result<(), ReturnErrorCode>
fn get_storage_v1( key: &[u8], output: &mut &mut [u8], ) -> Result<(), ReturnErrorCode>
Retrieve the value under the given key from storage. Read more
Source§fn get_transient_storage(
key: &[u8],
output: &mut &mut [u8],
) -> Result<(), ReturnErrorCode>
fn get_transient_storage( key: &[u8], output: &mut &mut [u8], ) -> Result<(), ReturnErrorCode>
👎Deprecated: Unstable function. Behaviour can change without further notice. Use only for testing.
Retrieve the value under the given key from transient storage. Read more
Source§fn take_storage(
key: &[u8],
output: &mut &mut [u8],
) -> Result<(), ReturnErrorCode>
fn take_storage( key: &[u8], output: &mut &mut [u8], ) -> Result<(), ReturnErrorCode>
Retrieve and remove the value under the given key from storage. Read more
Source§fn take_transient_storage(
key: &[u8],
output: &mut &mut [u8],
) -> Result<(), ReturnErrorCode>
fn take_transient_storage( key: &[u8], output: &mut &mut [u8], ) -> Result<(), ReturnErrorCode>
👎Deprecated: Unstable function. Behaviour can change without further notice. Use only for testing.
Retrieve and remove the value under the given key from transient storage. Read more
Source§fn debug_message(str: &[u8]) -> Result<(), ReturnErrorCode>
fn debug_message(str: &[u8]) -> Result<(), ReturnErrorCode>
Emit a custom debug message. Read more
Source§fn contains_storage(key: &[u8]) -> Option<u32>
fn contains_storage(key: &[u8]) -> Option<u32>
Checks whether there is a value stored under the given key. Read more
Source§fn contains_storage_v1(key: &[u8]) -> Option<u32>
fn contains_storage_v1(key: &[u8]) -> Option<u32>
Checks whether there is a value stored under the given key. Read more
Source§fn contains_transient_storage(key: &[u8]) -> Option<u32>
fn contains_transient_storage(key: &[u8]) -> Option<u32>
👎Deprecated: Unstable function. Behaviour can change without further notice. Use only for testing.
Checks whether there is a value stored under the given key in transient storage. Read more
Source§fn terminate(beneficiary: &[u8]) -> !
fn terminate(beneficiary: &[u8]) -> !
👎Deprecated: Deprecated, use newer version instead
Remove the calling account and transfer remaining balance. Read more
Source§fn terminate_v1(beneficiary: &[u8]) -> !
fn terminate_v1(beneficiary: &[u8]) -> !
Remove the calling account and transfer remaining free balance. Read more
Source§fn call_chain_extension(
func_id: u32,
input: &[u8],
output: Option<&mut &mut [u8]>,
) -> u32
fn call_chain_extension( func_id: u32, input: &[u8], output: Option<&mut &mut [u8]>, ) -> u32
Call into the chain extension provided by the chain if any. Read more
Source§fn input(output: &mut &mut [u8])
fn input(output: &mut &mut [u8])
Stores the input passed by the caller into the supplied buffer. Read more
Source§fn return_value(flags: ReturnFlags, return_value: &[u8]) -> !
fn return_value(flags: ReturnFlags, return_value: &[u8]) -> !
Cease contract execution and save a data buffer as a result of the execution. Read more
Source§fn call_runtime(call: &[u8]) -> Result<(), ReturnErrorCode>
fn call_runtime(call: &[u8]) -> Result<(), ReturnErrorCode>
Call some dispatchable of the runtime. Read more
Source§fn caller(output: &mut &mut [u8])
fn caller(output: &mut &mut [u8])
Stores the address of the caller into the supplied buffer. Read more
Source§fn block_number(output: &mut &mut [u8])
fn block_number(output: &mut &mut [u8])
Stores the current block number of the current contract into the supplied buffer. Read more
Source§fn address(output: &mut &mut [u8])
fn address(output: &mut &mut [u8])
Stores the address of the current contract into the supplied buffer. Read more
Source§fn balance(output: &mut &mut [u8])
fn balance(output: &mut &mut [u8])
Stores the free balance of the current account into the supplied buffer. Read more
Source§fn gas_left(output: &mut &mut [u8])
fn gas_left(output: &mut &mut [u8])
Stores the weight left into the supplied buffer. Read more
Source§fn value_transferred(output: &mut &mut [u8])
fn value_transferred(output: &mut &mut [u8])
Stores the value transferred along with this call/instantiate into the supplied buffer.
The data is encoded as
T::Balance
. Read moreSource§fn now(output: &mut &mut [u8])
fn now(output: &mut &mut [u8])
Load the latest block timestamp into the supplied buffer Read more
Source§fn minimum_balance(output: &mut &mut [u8])
fn minimum_balance(output: &mut &mut [u8])
Stores the minimum balance (a.k.a. existential deposit) into the supplied buffer.
The data is encoded as
T::Balance
. Read moreSource§fn gas_left_v1(output: &mut &mut [u8])
fn gas_left_v1(output: &mut &mut [u8])
👎Deprecated: Unstable function. Behaviour can change without further notice. Use only for testing.
Stores the amount of weight left into the supplied buffer.
The data is encoded as Weight. Read more
Source§fn weight_to_fee(gas: u64, output: &mut &mut [u8])
fn weight_to_fee(gas: u64, output: &mut &mut [u8])
Stores the price for the specified amount of gas into the supplied buffer. Read more
Source§fn weight_to_fee_v1(
ref_time_limit: u64,
proof_size_limit: u64,
output: &mut &mut [u8],
)
fn weight_to_fee_v1( ref_time_limit: u64, proof_size_limit: u64, output: &mut &mut [u8], )
👎Deprecated: Unstable function. Behaviour can change without further notice. Use only for testing.
Stores the price for the specified amount of gas into the supplied buffer.
The data is encoded as
T::Balance
. Read moreSource§fn hash_sha2_256(input: &[u8], output: &mut [u8; 32])
fn hash_sha2_256(input: &[u8], output: &mut [u8; 32])
Computes the sha2_256 32-bit hash on the given input buffer. Read more
Source§fn hash_keccak_256(input: &[u8], output: &mut [u8; 32])
fn hash_keccak_256(input: &[u8], output: &mut [u8; 32])
Computes the keccak_256 32-bit hash on the given input buffer. Read more
Source§fn hash_blake2_256(input: &[u8], output: &mut [u8; 32])
fn hash_blake2_256(input: &[u8], output: &mut [u8; 32])
Computes the blake2_256 32-bit hash on the given input buffer. Read more
Source§fn hash_blake2_128(input: &[u8], output: &mut [u8; 16])
fn hash_blake2_128(input: &[u8], output: &mut [u8; 16])
Computes the blake2_128 16-bit hash on the given input buffer. Read more
Source§fn ecdsa_recover(
signature: &[u8; 65],
message_hash: &[u8; 32],
output: &mut [u8; 33],
) -> Result<(), ReturnErrorCode>
fn ecdsa_recover( signature: &[u8; 65], message_hash: &[u8; 32], output: &mut [u8; 33], ) -> Result<(), ReturnErrorCode>
Recovers the ECDSA public key from the given message hash and signature. Read more
Source§fn ecdsa_to_eth_address(
pubkey: &[u8; 33],
output: &mut [u8; 20],
) -> Result<(), ReturnErrorCode>
fn ecdsa_to_eth_address( pubkey: &[u8; 33], output: &mut [u8; 20], ) -> Result<(), ReturnErrorCode>
Calculates Ethereum address from the ECDSA compressed public key and stores
it into the supplied buffer. Read more
Source§fn sr25519_verify(
signature: &[u8; 64],
message: &[u8],
pub_key: &[u8; 32],
) -> Result<(), ReturnErrorCode>
fn sr25519_verify( signature: &[u8; 64], message: &[u8], pub_key: &[u8; 32], ) -> Result<(), ReturnErrorCode>
Verify a sr25519 signature Read more
Source§fn is_contract(account_id: &[u8]) -> bool
fn is_contract(account_id: &[u8]) -> bool
Checks whether a specified address belongs to a contract. Read more
Source§fn caller_is_origin() -> bool
fn caller_is_origin() -> bool
Checks whether the caller of the current contract is the origin of the whole call stack. Read more
Source§fn set_code_hash(code_hash: &[u8]) -> Result<(), ReturnErrorCode>
fn set_code_hash(code_hash: &[u8]) -> Result<(), ReturnErrorCode>
Replace the contract code at the specified address with new code. Read more
Source§fn code_hash(
account_id: &[u8],
output: &mut [u8],
) -> Result<(), ReturnErrorCode>
fn code_hash( account_id: &[u8], output: &mut [u8], ) -> Result<(), ReturnErrorCode>
Retrieve the code hash for a specified contract address. Read more
Source§fn own_code_hash(output: &mut [u8])
fn own_code_hash(output: &mut [u8])
Retrieve the code hash of the currently executing contract. Read more
Source§fn account_reentrance_count(account: &[u8]) -> u32
fn account_reentrance_count(account: &[u8]) -> u32
👎Deprecated: Unstable function. Behaviour can change without further notice. Use only for testing.
Returns the number of times specified contract exists on the call stack. Delegated calls are
not counted as separate calls. Read more
Source§fn lock_delegate_dependency(code_hash: &[u8])
fn lock_delegate_dependency(code_hash: &[u8])
Lock a new delegate dependency to the contract. Read more
Source§fn unlock_delegate_dependency(code_hash: &[u8])
fn unlock_delegate_dependency(code_hash: &[u8])
Removes the delegate dependency from the contract. Read more
Source§fn instantiation_nonce() -> u64
fn instantiation_nonce() -> u64
Returns a nonce that is unique per contract instantiation. Read more
Source§fn reentrance_count() -> u32
fn reentrance_count() -> u32
👎Deprecated: Unstable function. Behaviour can change without further notice. Use only for testing.
Returns the number of times the currently executing contract exists on the call stack in
addition to the calling instance. Read more
Source§fn xcm_execute(msg: &[u8]) -> Result<(), ReturnErrorCode>
fn xcm_execute(msg: &[u8]) -> Result<(), ReturnErrorCode>
👎Deprecated: Unstable function. Behaviour can change without further notice. Use only for testing.
Execute an XCM program locally, using the contract’s address as the origin.
This is equivalent to dispatching
pallet_xcm::execute
through call_runtime, except that
the function is called directly instead of being dispatched. Read moreSource§fn xcm_send(
dest: &[u8],
msg: &[u8],
output: &mut [u8; 32],
) -> Result<(), ReturnErrorCode>
fn xcm_send( dest: &[u8], msg: &[u8], output: &mut [u8; 32], ) -> Result<(), ReturnErrorCode>
👎Deprecated: Unstable function. Behaviour can change without further notice. Use only for testing.
Send an XCM program from the contract to the specified destination.
This is equivalent to dispatching
pallet_xcm::send
through call_runtime
, except that
the function is called directly instead of being dispatched. Read moreAuto Trait Implementations§
impl Freeze for HostFnImpl
impl RefUnwindSafe for HostFnImpl
impl Send for HostFnImpl
impl Sync for HostFnImpl
impl Unpin for HostFnImpl
impl UnwindSafe for HostFnImpl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more