Trait drt_chain_vm::tx_execution::BuiltinFunction
source · pub trait BuiltinFunction {
// Required methods
fn name(&self) -> &str;
fn execute<F>(
&self,
tx_input: TxInput,
tx_cache: TxCache,
vm: &BlockchainVMRef,
lambda: F,
) -> (TxResult, BlockchainUpdate)
where F: FnOnce();
// Provided method
fn extract_dcdt_transfers(
&self,
tx_input: &TxInput,
) -> BuiltinFunctionDcdtTransferInfo { ... }
}
Required Methods§
sourcefn name(&self) -> &str
fn name(&self) -> &str
Function name corresponding the builtin function implementation.
Currently not used.
sourcefn execute<F>(
&self,
tx_input: TxInput,
tx_cache: TxCache,
vm: &BlockchainVMRef,
lambda: F,
) -> (TxResult, BlockchainUpdate)where
F: FnOnce(),
fn execute<F>(
&self,
tx_input: TxInput,
tx_cache: TxCache,
vm: &BlockchainVMRef,
lambda: F,
) -> (TxResult, BlockchainUpdate)where
F: FnOnce(),
Executes builtin function for the givn TxInput
and with access to the underlying contracts states via the TxCache
.
A few builtin functions (the ones transferring DCDT) can also call the VM after they finish, so they are given the extra reference to the VM and a lambda closure to execute on the VM
Provided Methods§
sourcefn extract_dcdt_transfers(
&self,
tx_input: &TxInput,
) -> BuiltinFunctionDcdtTransferInfo
fn extract_dcdt_transfers( &self, tx_input: &TxInput, ) -> BuiltinFunctionDcdtTransferInfo
Extracts data relating DCDT transfers handled by the builtin function, if applicable.
Object Safety§
This trait is not object safe.