Trait SystemCallEvm
pub trait SystemCallEvm: ExecuteEvm {
// Required method
fn system_call_one_with_caller(
&mut self,
caller: Address,
system_contract_address: Address,
data: Bytes,
) -> Result<Self::ExecutionResult, Self::Error>;
// Provided methods
fn system_call_one(
&mut self,
system_contract_address: Address,
data: Bytes,
) -> Result<Self::ExecutionResult, Self::Error> { ... }
fn system_call(
&mut self,
system_contract_address: Address,
data: Bytes,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error> { ... }
fn system_call_with_caller(
&mut self,
caller: Address,
system_contract_address: Address,
data: Bytes,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error> { ... }
fn transact_system_call_with_caller(
&mut self,
caller: Address,
system_contract_address: Address,
data: Bytes,
) -> Result<Self::ExecutionResult, Self::Error> { ... }
fn transact_system_call(
&mut self,
system_contract_address: Address,
data: Bytes,
) -> Result<Self::ExecutionResult, Self::Error> { ... }
fn transact_system_call_finalize(
&mut self,
system_contract_address: Address,
data: Bytes,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error> { ... }
fn transact_system_call_with_caller_finalize(
&mut self,
caller: Address,
system_contract_address: Address,
data: Bytes,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error> { ... }
}
Expand description
API for executing the system calls. System calls dont deduct the caller or reward the beneficiary. They are used before and after block execution to insert or obtain blockchain state.
It act similar to transact
function and sets default Tx with data and system contract as a target.
§Note
Only one function needs implementation SystemCallEvm::system_call_one_with_caller
, other functions
are derived from it.
Required Methods§
fn system_call_one_with_caller(
&mut self,
caller: Address,
system_contract_address: Address,
data: Bytes,
) -> Result<Self::ExecutionResult, Self::Error>
fn system_call_one_with_caller( &mut self, caller: Address, system_contract_address: Address, data: Bytes, ) -> Result<Self::ExecutionResult, Self::Error>
System call is a special transaction call that is used to call a system contract.
Transaction fields are reset and set in SystemCallTx
and data and target are set to
given values.
Block values are taken into account and will determent how system call will be executed.
Provided Methods§
fn system_call_one(
&mut self,
system_contract_address: Address,
data: Bytes,
) -> Result<Self::ExecutionResult, Self::Error>
fn system_call_one( &mut self, system_contract_address: Address, data: Bytes, ) -> Result<Self::ExecutionResult, Self::Error>
System call is a special transaction call that is used to call a system contract.
Transaction fields are reset and set in SystemCallTx
and data and target are set to
given values.
Block values are taken into account and will determent how system call will be executed.
fn system_call(
&mut self,
system_contract_address: Address,
data: Bytes,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
fn system_call( &mut self, system_contract_address: Address, data: Bytes, ) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
Internally calls SystemCallEvm::system_call_with_caller
.
fn system_call_with_caller(
&mut self,
caller: Address,
system_contract_address: Address,
data: Bytes,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
fn system_call_with_caller( &mut self, caller: Address, system_contract_address: Address, data: Bytes, ) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
Internally calls SystemCallEvm::system_call_one
and ExecuteEvm::finalize
functions to obtain the changed state.
fn transact_system_call_with_caller(
&mut self,
caller: Address,
system_contract_address: Address,
data: Bytes,
) -> Result<Self::ExecutionResult, Self::Error>
👎Deprecated since 0.1.0: Use system_call_one_with_caller
instead
fn transact_system_call_with_caller( &mut self, caller: Address, system_contract_address: Address, data: Bytes, ) -> Result<Self::ExecutionResult, Self::Error>
system_call_one_with_caller
insteadSystem call is a special transaction call that is used to call a system contract.
Transaction fields are reset and set in SystemCallTx
and data and target are set to
given values.
Block values are taken into account and will determent how system call will be executed.
fn transact_system_call(
&mut self,
system_contract_address: Address,
data: Bytes,
) -> Result<Self::ExecutionResult, Self::Error>
👎Deprecated since 0.1.0: Use system_call_one
instead
fn transact_system_call( &mut self, system_contract_address: Address, data: Bytes, ) -> Result<Self::ExecutionResult, Self::Error>
system_call_one
insteadCalls SystemCallEvm::system_call_one
with SYSTEM_ADDRESS
as a caller.
fn transact_system_call_finalize(
&mut self,
system_contract_address: Address,
data: Bytes,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
👎Deprecated since 0.1.0: Use system_call
instead
fn transact_system_call_finalize( &mut self, system_contract_address: Address, data: Bytes, ) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
system_call
insteadTransact the system call and finalize.
Internally calls combo of transact_system_call
and finalize
functions.
fn transact_system_call_with_caller_finalize(
&mut self,
caller: Address,
system_contract_address: Address,
data: Bytes,
) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
👎Deprecated since 0.1.0: Use system_call_with_caller
instead
fn transact_system_call_with_caller_finalize( &mut self, caller: Address, system_contract_address: Address, data: Bytes, ) -> Result<ExecResultAndState<Self::ExecutionResult, Self::State>, Self::Error>
system_call_with_caller
insteadCalls SystemCallEvm::system_call_one
and finalize
functions.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.