pub struct BlockchainStateWrapper { /* private fields */ }
Implementations§
Source§impl BlockchainStateWrapper
impl BlockchainStateWrapper
pub fn new() -> BlockchainStateWrapper
pub fn write_mandos_output(self, file_name: &str)
pub fn check_egld_balance(&self, address: &Address, expected_balance: &BigUint)
pub fn check_esdt_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, egld_balance: &BigUint) -> Address
pub fn create_user_account_fixed_address( &mut self, address: &Address, egld_balance: &BigUint, )
pub fn create_sc_account<CB, ContractObjBuilder>(
&mut self,
egld_balance: &BigUint,
owner: Option<&Address>,
obj_builder: ContractObjBuilder,
contract_wasm_path: &str,
) -> ContractObjWrapper<CB, ContractObjBuilder>where
CB: ContractBase<Api = VMHooksApi<DebugApiBackend>> + CallableContract + 'static,
ContractObjBuilder: 'static + Copy + Fn() -> CB,
pub fn create_sc_account_fixed_address<CB, ContractObjBuilder>(
&mut self,
address: &Address,
egld_balance: &BigUint,
owner: Option<&Address>,
obj_builder: ContractObjBuilder,
contract_wasm_path: &str,
) -> ContractObjWrapper<CB, ContractObjBuilder>where
CB: ContractBase<Api = VMHooksApi<DebugApiBackend>> + CallableContract + 'static,
ContractObjBuilder: 'static + Copy + Fn() -> CB,
pub fn create_account_raw( &mut self, address: &Address, egld_balance: &BigUint, _owner: Option<&Address>, _sc_identifier: Option<Vec<u8>>, _sc_mandos_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 = VMHooksApi<DebugApiBackend>> + 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 = VMHooksApi<DebugApiBackend>> + CallableContract + 'static,
OldContractObjBuilder: 'static + Copy + Fn() -> OldCB,
NewCB: ContractBase<Api = VMHooksApi<DebugApiBackend>> + CallableContract + 'static,
NewContractObjBuilder: 'static + Copy + Fn() -> NewCB,
pub fn set_egld_balance(&mut self, address: &Address, balance: &BigUint)
pub fn set_esdt_balance( &mut self, address: &Address, token_id: &[u8], balance: &BigUint, )
pub fn set_nft_balance<T>(
&mut self,
address: &Address,
token_id: &[u8],
nonce: u64,
balance: &BigUint,
attributes: &T,
)where
T: TopEncode,
pub fn set_developer_rewards( &mut self, address: &Address, developer_rewards: BigUint, )
pub fn set_nft_balance_all_properties<T>(
&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>],
)where
T: TopEncode,
pub fn set_esdt_local_roles( &mut self, address: &Address, token_id: &[u8], roles: &[EsdtLocalRole], )
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: &[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: &[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_mandos_sc_call( &mut self, sc_call: ScCallMandos, opt_expect: Option<TxExpectMandos>, )
pub fn add_mandos_sc_query( &mut self, sc_query: ScQueryMandos, opt_expect: Option<TxExpectMandos>, )
pub fn add_mandos_set_account(&mut self, address: &Address)
pub fn add_mandos_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>,
egld_payment: &BigUint,
tx_fn: TxFn,
) -> TxResultwhere
CB: ContractBase<Api = VMHooksApi<DebugApiBackend>> + CallableContract + 'static,
ContractObjBuilder: 'static + Copy + Fn() -> CB,
TxFn: FnOnce(CB),
pub fn execute_esdt_transfer<CB, ContractObjBuilder, TxFn>(
&mut self,
caller: &Address,
sc_wrapper: &ContractObjWrapper<CB, ContractObjBuilder>,
token_id: &[u8],
esdt_nonce: u64,
esdt_amount: &BigUint,
tx_fn: TxFn,
) -> TxResultwhere
CB: ContractBase<Api = VMHooksApi<DebugApiBackend>> + CallableContract + 'static,
ContractObjBuilder: 'static + Copy + Fn() -> CB,
TxFn: FnOnce(CB),
pub fn execute_esdt_multi_transfer<CB, ContractObjBuilder, TxFn>(
&mut self,
caller: &Address,
sc_wrapper: &ContractObjWrapper<CB, ContractObjBuilder>,
esdt_transfers: &[TxTokenTransfer],
tx_fn: TxFn,
) -> TxResultwhere
CB: ContractBase<Api = VMHooksApi<DebugApiBackend>> + CallableContract + 'static,
ContractObjBuilder: 'static + Copy + Fn() -> CB,
TxFn: FnOnce(CB),
pub fn execute_query<CB, ContractObjBuilder, TxFn>(
&mut self,
sc_wrapper: &ContractObjWrapper<CB, ContractObjBuilder>,
query_fn: TxFn,
) -> TxResultwhere
CB: ContractBase<Api = VMHooksApi<DebugApiBackend>> + CallableContract + 'static,
ContractObjBuilder: 'static + Copy + Fn() -> CB,
TxFn: FnOnce(CB),
pub fn execute_in_managed_environment<T, F>(&self, f: F) -> Twhere
F: FnOnce() -> T,
Source§impl BlockchainStateWrapper
impl BlockchainStateWrapper
pub fn get_egld_balance(&self, address: &Address) -> BigUint
pub fn get_esdt_balance( &self, address: &Address, token_id: &[u8], token_nonce: u64, ) -> BigUint
pub fn get_nft_attributes<T>(
&self,
address: &Address,
token_id: &[u8],
token_nonce: u64,
) -> Option<T>where
T: TopDecode,
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>(&self, address: &Address)
pub fn dump_state_for_account<AttributesType>(&self, address: &Address)
Prints the state for the account, with token attributes decoded as the provided type, if possible
Auto Trait Implementations§
impl Freeze 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more