Trait pink::system::SidevmOperation
source · pub trait SidevmOperation: ContractEnv {
type deployOutput: ImpliesReturn<Result<(), DriverError>>;
type canDeployOutput: ImpliesReturn<bool>;
type deployToWorkersOutput: ImpliesReturn<Result<(), DriverError>>;
type calcPriceOutput: ImpliesReturn<Result<Balance, DriverError>>;
type updateDeadlineOutput: ImpliesReturn<Result<(), DriverError>>;
type deadlineOfOutput: ImpliesReturn<Option<u32>>;
// Required methods
fn deploy(&self, code_hash: Hash) -> Self::deployOutput;
fn can_deploy(&self, contract_id: AccountId) -> Self::canDeployOutput;
fn deploy_to_workers(
&mut self,
code_hash: Hash,
code_size: u32,
workers: Vec<WorkerId>,
max_memory_pages: u32,
blocks_to_live: u32
) -> Self::deployToWorkersOutput;
fn calc_price(
&self,
code_size: u32,
max_memory_pages: u32,
n_workers: u32
) -> Self::calcPriceOutput;
fn update_deadline(&mut self, deadline: u32) -> Self::updateDeadlineOutput;
fn deadline_of(&self, account: AccountId) -> Self::deadlineOfOutput;
}
Expand description
The doc is messed up by the ink macro. See SidevmOperationForDoc
for a clean version
Driver to manage sidevm deployments.
Required Associated Types§
sourcetype deployOutput: ImpliesReturn<Result<(), DriverError>>
type deployOutput: ImpliesReturn<Result<(), DriverError>>
Output type of the respective trait message.
sourcetype canDeployOutput: ImpliesReturn<bool>
type canDeployOutput: ImpliesReturn<bool>
Output type of the respective trait message.
sourcetype deployToWorkersOutput: ImpliesReturn<Result<(), DriverError>>
type deployToWorkersOutput: ImpliesReturn<Result<(), DriverError>>
Output type of the respective trait message.
sourcetype calcPriceOutput: ImpliesReturn<Result<Balance, DriverError>>
type calcPriceOutput: ImpliesReturn<Result<Balance, DriverError>>
Output type of the respective trait message.
sourcetype updateDeadlineOutput: ImpliesReturn<Result<(), DriverError>>
type updateDeadlineOutput: ImpliesReturn<Result<(), DriverError>>
Output type of the respective trait message.
sourcetype deadlineOfOutput: ImpliesReturn<Option<u32>>
type deadlineOfOutput: ImpliesReturn<Option<u32>>
Output type of the respective trait message.
Required Methods§
sourcefn deploy(&self, code_hash: Hash) -> Self::deployOutput
fn deploy(&self, code_hash: Hash) -> Self::deployOutput
Invoked by a contract to deploy a sidevm instance that attached to itself.
sourcefn can_deploy(&self, contract_id: AccountId) -> Self::canDeployOutput
fn can_deploy(&self, contract_id: AccountId) -> Self::canDeployOutput
Check if given address has the permission to deploy a sidevm.
sourcefn deploy_to_workers(
&mut self,
code_hash: Hash,
code_size: u32,
workers: Vec<WorkerId>,
max_memory_pages: u32,
blocks_to_live: u32
) -> Self::deployToWorkersOutput
fn deploy_to_workers( &mut self, code_hash: Hash, code_size: u32, workers: Vec<WorkerId>, max_memory_pages: u32, blocks_to_live: u32 ) -> Self::deployToWorkersOutput
Deploys a paid side VM instance to a set of worker nodes with the specified configurations.
§Parameters
code_hash
: The hash of the code to be deployed.code_size
: Size of the code.workers
: A vector of worker IDs to which the code will be deployed.max_memory_pages
: Maximum memory pages allowed for the side VM.blocks_to_live
: How many blocks the deployment will live.
§Returns
Ok(())
if the deployment was commited.- Various
Err
variants for different types of failures.
sourcefn calc_price(
&self,
code_size: u32,
max_memory_pages: u32,
n_workers: u32
) -> Self::calcPriceOutput
fn calc_price( &self, code_size: u32, max_memory_pages: u32, n_workers: u32 ) -> Self::calcPriceOutput
sourcefn update_deadline(&mut self, deadline: u32) -> Self::updateDeadlineOutput
fn update_deadline(&mut self, deadline: u32) -> Self::updateDeadlineOutput
sourcefn deadline_of(&self, account: AccountId) -> Self::deadlineOfOutput
fn deadline_of(&self, account: AccountId) -> Self::deadlineOfOutput
Implementations on Foreign Types§
source§impl<E> SidevmOperation for TraitDefinitionRegistry<E>where
E: Environment,
impl<E> SidevmOperation for TraitDefinitionRegistry<E>where
E: Environment,
source§fn deploy(&self, __ink_binding_0: Hash) -> Self::deployOutput
fn deploy(&self, __ink_binding_0: Hash) -> Self::deployOutput
Invoked by a contract to deploy a sidevm instance that attached to itself.
source§fn can_deploy(&self, __ink_binding_0: AccountId) -> Self::canDeployOutput
fn can_deploy(&self, __ink_binding_0: AccountId) -> Self::canDeployOutput
Check if given address has the permission to deploy a sidevm.
source§fn deploy_to_workers(
&mut self,
__ink_binding_0: Hash,
__ink_binding_1: u32,
__ink_binding_2: Vec<WorkerId>,
__ink_binding_3: u32,
__ink_binding_4: u32
) -> Self::deployToWorkersOutput
fn deploy_to_workers( &mut self, __ink_binding_0: Hash, __ink_binding_1: u32, __ink_binding_2: Vec<WorkerId>, __ink_binding_3: u32, __ink_binding_4: u32 ) -> Self::deployToWorkersOutput
Deploys a paid side VM instance to a set of worker nodes with the specified configurations.
§Parameters
code_hash
: The hash of the code to be deployed.code_size
: Size of the code.workers
: A vector of worker IDs to which the code will be deployed.max_memory_pages
: Maximum memory pages allowed for the side VM.blocks_to_live
: How many blocks the deployment will live.
§Returns
Ok(())
if the deployment was commited.- Various
Err
variants for different types of failures.