Enum HostFnImpl

Source
pub enum HostFnImpl {}
Expand description

Implements HostFn for each supported target architecture.

Trait Implementations§

Source§

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>

👎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>

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>

👎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>

👎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>

Call (possibly transferring some amount of funds) into the specified account. Read more
Source§

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>

Execute code in the context (storage, caller, value) of the current contract. Read more
Source§

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])

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 more
Source§

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>

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>

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>

👎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])

Clear the value at the given key in the contract storage. Read more
Source§

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>

👎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>

Retrieve the value under the given key from storage. Read more
Source§

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>

👎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>

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>

👎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>

Emit a custom debug message. Read more
Source§

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>

Checks whether there is a value stored under the given key. Read more
Source§

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]) -> !

👎Deprecated: Deprecated, use newer version instead
Remove the calling account and transfer remaining balance. Read more
Source§

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

Call into the chain extension provided by the chain if any. Read more
Source§

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]) -> !

Cease contract execution and save a data buffer as a result of the execution. Read more
Source§

fn call_runtime(call: &[u8]) -> Result<(), ReturnErrorCode>

Call some dispatchable of the runtime. Read more
Source§

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])

Stores the current block number of the current contract into the supplied buffer. Read more
Source§

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])

Stores the free balance of the current account into the supplied buffer. Read more
Source§

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])

Stores the value transferred along with this call/instantiate into the supplied buffer. The data is encoded as T::Balance. Read more
Source§

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])

Stores the minimum balance (a.k.a. existential deposit) into the supplied buffer. The data is encoded as T::Balance. Read more
Source§

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])

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], )

👎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 more
Source§

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])

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])

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])

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>

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>

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>

Verify a sr25519 signature Read more
Source§

fn is_contract(account_id: &[u8]) -> bool

Checks whether a specified address belongs to a contract. Read more
Source§

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>

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>

Retrieve the code hash for a specified contract address. Read more
Source§

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

👎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])

Lock a new delegate dependency to the contract. Read more
Source§

fn unlock_delegate_dependency(code_hash: &[u8])

Removes the delegate dependency from the contract. Read more
Source§

fn instantiation_nonce() -> u64

Returns a nonce that is unique per contract instantiation. Read more
Source§

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>

👎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 more
Source§

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 more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> JsonSchemaMaybe for T