multiversx_sc_scenario::whitebox_legacy

Struct BlockchainStateWrapper

Source
pub struct BlockchainStateWrapper { /* private fields */ }

Implementations§

Source§

impl BlockchainStateWrapper

Source

pub fn new() -> Self

Source

pub fn write_mandos_output(self, file_name: &str)

Source

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

Source

pub fn check_esdt_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>, )

Source§

impl BlockchainStateWrapper

Source

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

Source

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

Source

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 = DebugApi> + CallableContract + 'static, ContractObjBuilder: 'static + Copy + Fn() -> CB,

Source

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 = DebugApi> + CallableContract + 'static, ContractObjBuilder: 'static + Copy + Fn() -> CB,

Source

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

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_egld_balance(&mut self, address: &Address, balance: &BigUint)

Source

pub fn set_esdt_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( &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_esdt_local_roles( &mut self, address: &Address, token_id: &[u8], roles: &[EsdtLocalRole], )

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: &[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: &[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_mandos_sc_call( &mut self, sc_call: ScCallMandos, opt_expect: Option<TxExpectMandos>, )

Source

pub fn add_mandos_sc_query( &mut self, sc_query: ScQueryMandos, opt_expect: Option<TxExpectMandos>, )

Source

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

Source

pub fn add_mandos_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>, egld_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_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, ) -> TxResult
where CB: ContractBase<Api = DebugApi> + CallableContract + 'static, ContractObjBuilder: 'static + Copy + Fn() -> CB, TxFn: FnOnce(CB),

Source

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

Source

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

Source

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

Source§

impl BlockchainStateWrapper

Source

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

Source

pub fn get_esdt_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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> ReconstructableFrom<T> for T

Source§

fn reconstruct_from(from: T, _builder: &ReconstructorContext) -> T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

Source§

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

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

Source§

fn vzip(self) -> V