Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kvinwang committed Oct 12, 2022
1 parent 600eef1 commit 2334c14
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions crates/pink/pink-extension/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use pink_extension_macro as pink;
use alloc::string::String;
use scale::{Decode, Encode};

use crate::{Hash, AccountId, Balance};
use crate::{AccountId, Balance, Hash};

/// Errors that can occur upon calling the system contract.
#[derive(Debug, PartialEq, Eq, Encode, Decode)]
Expand All @@ -27,31 +27,37 @@ pub trait System {
#[ink(message, selector = 0x87c98a8d)]
fn version(&self) -> (u16, u16);
/// Grant an address the administrator role.
///
/// The caller must be the owner of the cluster.
#[ink(message)]
fn grant_admin(&mut self, contract_id: AccountId) -> Result<()>;

/// Set a contract as a driver for `name`.
///
/// The caller must be the owner of the cluster or an administrator.
#[ink(message)]
fn set_driver(&mut self, name: String, contract_id: AccountId) -> Result<()>;

/// Set a contract as a driver for `name`.
///
/// The caller must be the owner of the cluster or an administrator.
#[ink(message)]
fn get_driver(&self, name: String) -> Option<AccountId>;

/// Deploy a sidevm instance attached to a given contract.
///
/// The caller must be an administrator.
#[ink(message)]
fn deploy_sidevm_to(&self, contract_id: AccountId, code_hash: Hash) -> Result<()>;

/// Stop a sidevm instance attached to a given contract.
///
/// The caller must be an administrator.
#[ink(message)]
fn stop_sidevm_at(&self, contract_id: AccountId) -> Result<()>;

/// Set block hook, such as OnBlockEnd, for given contract
///
/// The caller must be an administrator.
#[ink(message)]
fn set_hook(
Expand All @@ -62,6 +68,7 @@ pub trait System {
) -> Result<()>;

/// Set weight of the contract for query requests and sidevm scheduling.
///
/// Higher weight would let the contract to get more resource.
#[ink(message)]
fn set_contract_weight(&self, contract_id: AccountId, weight: u32) -> Result<()>;
Expand All @@ -82,6 +89,6 @@ pub trait SidevmOperation {
pub trait ContractDeposit {
/// Change deposit of a contract. A driver should set the contract weight according to the
/// new deposit.
#[ink(message, selector=0xa24bcb44)]
#[ink(message, selector = 0xa24bcb44)]
fn change_deposit(&mut self, contract_id: AccountId, deposit: Balance) -> Result<()>;
}

0 comments on commit 2334c14

Please sign in to comment.