pub struct BlockchainStateWrapper { /* private fields */ }Implementations§
source§impl BlockchainStateWrapper
impl BlockchainStateWrapper
pub fn new() -> Self
pub fn get_mut_state(&mut self) -> &mut Rc<BlockchainMock>
pub fn write_denali_output(self, file_name: &str)
pub fn check_moax_balance(&self, address: &Address, expected_balance: &BigUint)
pub fn check_dct_balance( &self, address: &Address, token_id: &[u8], expected_balance: &BigUint )
pub fn check_nft_balance<T>( &self, address: &Address, token_id: &[u8], nonce: u64, expected_balance: &BigUint, opt_expected_attributes: Option<&T> )
source§impl BlockchainStateWrapper
impl BlockchainStateWrapper
pub fn create_user_account(&mut self, moax_balance: &BigUint) -> Address
pub fn create_user_account_fixed_address( &mut self, address: &Address, moax_balance: &BigUint )
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,
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,
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>> )
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,
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,
pub fn set_moax_balance(&mut self, address: &Address, balance: &BigUint)
pub fn set_dct_balance( &mut self, address: &Address, token_id: &[u8], balance: &BigUint )
pub fn set_nft_balance<T: TopEncode>( &mut self, address: &Address, token_id: &[u8], nonce: u64, balance: &BigUint, attributes: &T )
pub fn set_developer_rewards<T: TopEncode>( &mut self, address: &Address, developer_rewards: BigUint )
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>] )
pub fn set_dct_local_roles( &mut self, address: &Address, token_id: &[u8], roles: &[DctLocalRole] )
pub fn set_block_epoch(&mut self, block_epoch: u64)
pub fn set_block_nonce(&mut self, block_nonce: u64)
pub fn set_block_random_seed(&mut self, block_random_seed: Box<[u8; 48]>)
pub fn set_block_round(&mut self, block_round: u64)
pub fn set_block_timestamp(&mut self, block_timestamp: u64)
pub fn set_prev_block_epoch(&mut self, block_epoch: u64)
pub fn set_prev_block_nonce(&mut self, block_nonce: u64)
pub fn set_prev_block_random_seed(&mut self, block_random_seed: Box<[u8; 48]>)
pub fn set_prev_block_round(&mut self, block_round: u64)
pub fn set_prev_block_timestamp(&mut self, block_timestamp: u64)
pub fn add_denali_sc_call( &mut self, sc_call: ScCallDenali, opt_expect: Option<TxExpectDenali> )
pub fn add_denali_sc_query( &mut self, sc_query: ScQueryDenali, opt_expect: Option<TxExpectDenali> )
pub fn add_denali_set_account(&mut self, address: &Address)
pub fn add_denali_check_account(&mut self, address: &Address)
source§impl BlockchainStateWrapper
impl BlockchainStateWrapper
pub fn execute_tx<CB, ContractObjBuilder, TxFn>(
&mut self,
caller: &Address,
sc_wrapper: &ContractObjWrapper<CB, ContractObjBuilder>,
moax_payment: &BigUint,
tx_fn: TxFn
) -> TxResultwhere
CB: ContractBase<Api = DebugApi> + CallableContract + 'static,
ContractObjBuilder: 'static + Copy + Fn() -> CB,
TxFn: FnOnce(CB),
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
) -> TxResultwhere
CB: ContractBase<Api = DebugApi> + CallableContract + 'static,
ContractObjBuilder: 'static + Copy + Fn() -> CB,
TxFn: FnOnce(CB),
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
) -> TxResultwhere
CB: ContractBase<Api = DebugApi> + CallableContract + 'static,
ContractObjBuilder: 'static + Copy + Fn() -> CB,
pub fn execute_query<CB, ContractObjBuilder, TxFn: FnOnce(CB)>(
&mut self,
sc_wrapper: &ContractObjWrapper<CB, ContractObjBuilder>,
query_fn: TxFn
) -> TxResultwhere
CB: ContractBase<Api = DebugApi> + CallableContract + 'static,
ContractObjBuilder: 'static + Copy + Fn() -> CB,
pub fn execute_in_managed_environment<T, Func: FnOnce() -> T>( &self, f: Func ) -> T
source§impl BlockchainStateWrapper
impl BlockchainStateWrapper
pub fn get_moax_balance(&self, address: &Address) -> BigUint
pub fn get_dct_balance( &self, address: &Address, token_id: &[u8], token_nonce: u64 ) -> BigUint
pub fn get_nft_attributes<T: TopDecode>( &self, address: &Address, token_id: &[u8], token_nonce: u64 ) -> Option<T>
pub fn dump_state(&self)
sourcepub fn dump_state_for_account_hex_attributes(&self, address: &Address)
pub fn dump_state_for_account_hex_attributes(&self, address: &Address)
Prints the state for the account, with any token attributes as hex
sourcepub fn dump_state_for_account<AttributesType: 'static + TopDecode + Debug>(
&self,
address: &Address
)
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§
impl !CodecFromSelf for BlockchainStateWrapper
impl !RefUnwindSafe for BlockchainStateWrapper
impl !Send for BlockchainStateWrapper
impl !Sync for BlockchainStateWrapper
impl Unpin for BlockchainStateWrapper
impl !UnwindSafe for BlockchainStateWrapper
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