pub struct CellState {
pub cells: HashMap<AccountId, CellAccount>,
pub token_balances: HashMap<(AccountId, AccountId), u128>,
pub frozen_accounts: HashMap<(AccountId, AccountId), bool>,
}Fields§
§cells: HashMap<AccountId, CellAccount>§token_balances: HashMap<(AccountId, AccountId), u128>§frozen_accounts: HashMap<(AccountId, AccountId), bool>Implementations§
Source§impl CellState
impl CellState
pub fn new() -> Self
pub fn deploy_cell( &mut self, cell_id: AccountId, owner: AccountId, bytecode: Vec<u8>, initial_storage: HashMap<[u8; 32], [u8; 32]>, initial_balance: u128, timestamp: u64, declared_reads: Vec<[u8; 32]>, declared_writes: Vec<[u8; 32]>, commutative_keys: Vec<[u8; 32]>, storage_key_specs: Vec<StorageKeySpec>, oracle_schema_ids: Vec<[u8; 32]>, ) -> Result<(), String>
pub fn deploy_token( &mut self, cell_id: AccountId, owner: AccountId, config: TokenConfig, initial_balance: u128, timestamp: u64, ) -> Result<(), String>
pub fn accept_ownership( &mut self, cell_id: AccountId, caller: AccountId, ) -> Result<(), String>
pub fn make_immutable( &mut self, cell_id: AccountId, caller: AccountId, ) -> Result<(), String>
pub fn upgrade_cell( &mut self, cell_id: AccountId, caller: AccountId, new_bytecode: Vec<u8>, timestamp: u64, new_declared_reads: Vec<[u8; 32]>, new_declared_writes: Vec<[u8; 32]>, new_commutative_keys: Vec<[u8; 32]>, new_storage_key_specs: Vec<StorageKeySpec>, new_oracle_schema_ids: Vec<[u8; 32]>, ) -> Result<(), String>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CellState
impl<'de> Deserialize<'de> for CellState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CellState
impl RefUnwindSafe for CellState
impl Send for CellState
impl Sync for CellState
impl Unpin for CellState
impl UnsafeUnpin for CellState
impl UnwindSafe for CellState
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