pub struct DefaultBlockchainRuntime { /* private fields */ }Expand description
Default implementation of blockchain runtime
Implementations§
Source§impl DefaultBlockchainRuntime
impl DefaultBlockchainRuntime
Sourcepub fn with_capabilities(
blockchain_id: String,
capabilities: RuntimeCapabilities,
) -> Self
pub fn with_capabilities( blockchain_id: String, capabilities: RuntimeCapabilities, ) -> Self
Create a new runtime with custom capabilities
Trait Implementations§
Source§impl BlockchainRuntime for DefaultBlockchainRuntime
impl BlockchainRuntime for DefaultBlockchainRuntime
Source§fn blockchain_id(&self) -> &str
fn blockchain_id(&self) -> &str
Get the blockchain identifier
Source§fn create_environment<'life0, 'async_trait>(
&'life0 self,
config: RuntimeConfig,
) -> Pin<Box<dyn Future<Output = Result<RuntimeEnvironment>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_environment<'life0, 'async_trait>(
&'life0 self,
config: RuntimeConfig,
) -> Pin<Box<dyn Future<Output = Result<RuntimeEnvironment>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a runtime environment
Source§fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_code_path: &'life2 Path,
_inputs: &'life3 ExecutionInputs,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_code_path: &'life2 Path,
_inputs: &'life3 ExecutionInputs,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Execute code in the runtime
Source§fn deploy_contract<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_bytecode: &'life2 [u8],
_constructor_args: &'life3 [u8],
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn deploy_contract<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_bytecode: &'life2 [u8],
_constructor_args: &'life3 [u8],
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Deploy a contract to the runtime
Source§fn call_function<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_contract_address: &'life2 str,
_function: &'life3 str,
_args: &'life4 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn call_function<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_contract_address: &'life2 str,
_function: &'life3 str,
_args: &'life4 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Call a contract function
Source§fn metrics_definition(&self) -> Vec<RuntimeMetricDefinition>
fn metrics_definition(&self) -> Vec<RuntimeMetricDefinition>
Get runtime metrics
Source§fn monitor<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_execution_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<RuntimeEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn monitor<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_execution_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<RuntimeEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Monitor runtime events
Source§fn destroy<'life0, 'async_trait>(
&'life0 self,
_env: RuntimeEnvironment,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn destroy<'life0, 'async_trait>(
&'life0 self,
_env: RuntimeEnvironment,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Destroy the environment
Source§fn is_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if runtime is available
Source§fn capabilities(&self) -> RuntimeCapabilities
fn capabilities(&self) -> RuntimeCapabilities
Get runtime capabilities
Source§fn execute_secure<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
env: &'life1 RuntimeEnvironment,
code_path: &'life2 Path,
inputs: &'life3 ExecutionInputs,
_security_config: &'life4 SecurityConfig,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn execute_secure<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
env: &'life1 RuntimeEnvironment,
code_path: &'life2 Path,
inputs: &'life3 ExecutionInputs,
_security_config: &'life4 SecurityConfig,
) -> Pin<Box<dyn Future<Output = Result<ExecutionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Execute code with security checks
Source§fn check_reentrancy<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_function_name: &'life2 str,
_caller: &'life3 str,
_call_stack: &'life4 [String],
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn check_reentrancy<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_function_name: &'life2 str,
_caller: &'life3 str,
_call_stack: &'life4 [String],
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Check for reentrancy attacks
Source§fn detect_overflow<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_operation: &'life2 str,
_operands: &'life3 [i64],
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn detect_overflow<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_operation: &'life2 str,
_operands: &'life3 [i64],
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Detect integer overflow
Source§fn verify_access_control<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_function_name: &'life2 str,
_caller: &'life3 str,
_required_role: Option<&'life4 str>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn verify_access_control<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_function_name: &'life2 str,
_caller: &'life3 str,
_required_role: Option<&'life4 str>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Verify access control
Source§fn enforce_resource_limits<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_gas_used: u64,
_memory_used: u64,
_call_depth: u32,
_external_calls: u32,
_security_config: &'life2 SecurityConfig,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecurityViolation>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn enforce_resource_limits<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_gas_used: u64,
_memory_used: u64,
_call_depth: u32,
_external_calls: u32,
_security_config: &'life2 SecurityConfig,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecurityViolation>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Enforce resource limits
Source§fn get_security_report<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_execution_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_security_report<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_env: &'life1 RuntimeEnvironment,
_execution_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get security report for execution
Auto Trait Implementations§
impl Freeze for DefaultBlockchainRuntime
impl RefUnwindSafe for DefaultBlockchainRuntime
impl Send for DefaultBlockchainRuntime
impl Sync for DefaultBlockchainRuntime
impl Unpin for DefaultBlockchainRuntime
impl UnwindSafe for DefaultBlockchainRuntime
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