pub struct BlockchainStateWrapper { /* private fields */ }

Implementations§

source§

impl BlockchainStateWrapper

source

pub fn new() -> Self

source

pub fn get_mut_state(&mut self) -> &mut Rc<BlockchainMock>

source

pub fn write_denali_output(self, file_name: &str)

source

pub fn check_moax_balance(&self, address: &Address, expected_balance: &BigUint)

source

pub fn check_dct_balance( &self, address: &Address, token_id: &[u8], expected_balance: &BigUint )

source

pub fn check_nft_balance<T>( &self, address: &Address, token_id: &[u8], nonce: u64, expected_balance: &BigUint, opt_expected_attributes: Option<&T> )
where T: TopEncode + TopDecode + PartialEq + Debug,

source§

impl BlockchainStateWrapper

source

pub fn create_user_account(&mut self, moax_balance: &BigUint) -> Address

source

pub fn create_user_account_fixed_address( &mut self, address: &Address, moax_balance: &BigUint )

source

pub fn create_sc_account<CB, ContractObjBuilder>( &mut self, moax_balance: &BigUint, owner: Option<&Address>, obj_builder: ContractObjBuilder, contract_wasm_path: &str ) -> ContractObjWrapper<CB, ContractObjBuilder>
where CB: ContractBase<Api = DebugApi> + CallableContract + 'static, ContractObjBuilder: 'static + Copy + Fn() -> CB,

source

pub fn create_sc_account_fixed_address<CB, ContractObjBuilder>( &mut self, address: &Address, moax_balance: &BigUint, owner: Option<&Address>, obj_builder: ContractObjBuilder, contract_wasm_path: &str ) -> ContractObjWrapper<CB, ContractObjBuilder>
where CB: ContractBase<Api = DebugApi> + CallableContract + 'static, ContractObjBuilder: 'static + Copy + Fn() -> CB,

source

pub fn create_account_raw( &mut self, address: &Address, moax_balance: &BigUint, owner: Option<&Address>, sc_identifier: Option<Vec<u8>>, sc_denali_path_expr: Option<Vec<u8>> )

source

pub fn prepare_deploy_from_sc<CB, ContractObjBuilder>( &mut self, deployer: &Address, obj_builder: ContractObjBuilder ) -> ContractObjWrapper<CB, ContractObjBuilder>
where CB: ContractBase<Api = DebugApi> + CallableContract + 'static, ContractObjBuilder: 'static + Copy + Fn() -> CB,

source

pub fn upgrade_wrapper<OldCB, OldContractObjBuilder, NewCB, NewContractObjBuilder>( &self, old_wrapper: ContractObjWrapper<OldCB, OldContractObjBuilder>, new_builder: NewContractObjBuilder ) -> ContractObjWrapper<NewCB, NewContractObjBuilder>
where OldCB: ContractBase<Api = DebugApi> + CallableContract + 'static, OldContractObjBuilder: 'static + Copy + Fn() -> OldCB, NewCB: ContractBase<Api = DebugApi> + CallableContract + 'static, NewContractObjBuilder: 'static + Copy + Fn() -> NewCB,

source

pub fn set_moax_balance(&mut self, address: &Address, balance: &BigUint)

source

pub fn set_dct_balance( &mut self, address: &Address, token_id: &[u8], balance: &BigUint )

source

pub fn set_nft_balance<T: TopEncode>( &mut self, address: &Address, token_id: &[u8], nonce: u64, balance: &BigUint, attributes: &T )

source

pub fn set_developer_rewards<T: TopEncode>( &mut self, address: &Address, developer_rewards: BigUint )

source

pub fn set_nft_balance_all_properties<T: TopEncode>( &mut self, address: &Address, token_id: &[u8], nonce: u64, balance: &BigUint, attributes: &T, royalties: u64, creator: Option<&Address>, name: Option<&[u8]>, hash: Option<&[u8]>, uris: &[Vec<u8>] )

source

pub fn set_dct_local_roles( &mut self, address: &Address, token_id: &[u8], roles: &[DctLocalRole] )

source

pub fn set_block_epoch(&mut self, block_epoch: u64)

source

pub fn set_block_nonce(&mut self, block_nonce: u64)

source

pub fn set_block_random_seed(&mut self, block_random_seed: Box<[u8; 48]>)

source

pub fn set_block_round(&mut self, block_round: u64)

source

pub fn set_block_timestamp(&mut self, block_timestamp: u64)

source

pub fn set_prev_block_epoch(&mut self, block_epoch: u64)

source

pub fn set_prev_block_nonce(&mut self, block_nonce: u64)

source

pub fn set_prev_block_random_seed(&mut self, block_random_seed: Box<[u8; 48]>)

source

pub fn set_prev_block_round(&mut self, block_round: u64)

source

pub fn set_prev_block_timestamp(&mut self, block_timestamp: u64)

source

pub fn add_denali_sc_call( &mut self, sc_call: ScCallDenali, opt_expect: Option<TxExpectDenali> )

source

pub fn add_denali_sc_query( &mut self, sc_query: ScQueryDenali, opt_expect: Option<TxExpectDenali> )

source

pub fn add_denali_set_account(&mut self, address: &Address)

source

pub fn add_denali_check_account(&mut self, address: &Address)

source§

impl BlockchainStateWrapper

source

pub fn execute_tx<CB, ContractObjBuilder, TxFn>( &mut self, caller: &Address, sc_wrapper: &ContractObjWrapper<CB, ContractObjBuilder>, moax_payment: &BigUint, tx_fn: TxFn ) -> TxResult
where CB: ContractBase<Api = DebugApi> + CallableContract + 'static, ContractObjBuilder: 'static + Copy + Fn() -> CB, TxFn: FnOnce(CB),

source

pub fn execute_dct_transfer<CB, ContractObjBuilder, TxFn>( &mut self, caller: &Address, sc_wrapper: &ContractObjWrapper<CB, ContractObjBuilder>, token_id: &[u8], dct_nonce: u64, dct_amount: &BigUint, tx_fn: TxFn ) -> TxResult
where CB: ContractBase<Api = DebugApi> + CallableContract + 'static, ContractObjBuilder: 'static + Copy + Fn() -> CB, TxFn: FnOnce(CB),

source

pub fn execute_dct_multi_transfer<CB, ContractObjBuilder, TxFn: FnOnce(CB)>( &mut self, caller: &Address, sc_wrapper: &ContractObjWrapper<CB, ContractObjBuilder>, dct_transfers: &[TxTokenTransfer], tx_fn: TxFn ) -> TxResult
where CB: ContractBase<Api = DebugApi> + CallableContract + 'static, ContractObjBuilder: 'static + Copy + Fn() -> CB,

source

pub fn execute_query<CB, ContractObjBuilder, TxFn: FnOnce(CB)>( &mut self, sc_wrapper: &ContractObjWrapper<CB, ContractObjBuilder>, query_fn: TxFn ) -> TxResult
where CB: ContractBase<Api = DebugApi> + CallableContract + 'static, ContractObjBuilder: 'static + Copy + Fn() -> CB,

source

pub fn execute_in_managed_environment<T, Func: FnOnce() -> T>( &self, f: Func ) -> T

source§

impl BlockchainStateWrapper

source

pub fn get_moax_balance(&self, address: &Address) -> BigUint

source

pub fn get_dct_balance( &self, address: &Address, token_id: &[u8], token_nonce: u64 ) -> BigUint

source

pub fn get_nft_attributes<T: TopDecode>( &self, address: &Address, token_id: &[u8], token_nonce: u64 ) -> Option<T>

source

pub fn dump_state(&self)

source

pub fn dump_state_for_account_hex_attributes(&self, address: &Address)

Prints the state for the account, with any token attributes as hex

source

pub fn dump_state_for_account<AttributesType: 'static + TopDecode + Debug>( &self, address: &Address )

Prints the state for the account, with token attributes decoded as the provided type, if possible

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> InterpretableFrom<T> for T

source§

fn interpret_from(from: T, _context: &InterpreterContext) -> T

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> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V