DefaultBlockchainRuntime

Struct DefaultBlockchainRuntime 

Source
pub struct DefaultBlockchainRuntime { /* private fields */ }
Expand description

Default implementation of blockchain runtime

Implementations§

Source§

impl DefaultBlockchainRuntime

Source

pub fn new(blockchain_id: String) -> Self

Create a new default blockchain runtime

Source

pub fn with_capabilities( blockchain_id: String, capabilities: RuntimeCapabilities, ) -> Self

Create a new runtime with custom capabilities

Trait Implementations§

Source§

impl BlockchainRuntime for DefaultBlockchainRuntime

Source§

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,

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,

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,

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,

Call a contract function
Source§

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,

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,

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,

Check if runtime is available
Source§

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,

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,

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,

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,

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,

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,

Get security report for execution

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.