Trait pink::system::SidevmOperationForDoc
source · pub trait SidevmOperationForDoc {
// Required methods
fn deploy(&self, code_hash: Hash) -> Result<(), DriverError>;
fn can_deploy(&self, contract_id: AccountId) -> bool;
fn deploy_to_workers(
&mut self,
code_hash: Hash,
code_size: u32,
workers: Vec<WorkerId>,
max_memory_pages: u32,
blocks_to_live: u32
) -> Result<(), DriverError>;
fn calc_price(
&self,
code_size: u32,
max_memory_pages: u32,
n_workers: u32
) -> Result<Balance, DriverError>;
fn update_deadline(&mut self, deadline: u32) -> Result<(), DriverError>;
fn deadline_of(&self, account: AccountId) -> Option<u32>;
}
Expand description
This is the clean version doc of SidevmOperation
Driver to manage sidevm deployments.
Required Methods§
sourcefn deploy(&self, code_hash: Hash) -> Result<(), DriverError>
fn deploy(&self, code_hash: Hash) -> Result<(), DriverError>
Invoked by a contract to deploy a sidevm instance that attached to itself.
sourcefn can_deploy(&self, contract_id: AccountId) -> bool
fn can_deploy(&self, contract_id: AccountId) -> bool
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
) -> Result<(), DriverError>
fn deploy_to_workers( &mut self, code_hash: Hash, code_size: u32, workers: Vec<WorkerId>, max_memory_pages: u32, blocks_to_live: u32 ) -> Result<(), DriverError>
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.