pub struct BlockchainMock {
    pub accounts: HashMap<Address, AccountData>,
    pub builtin_functions: Rc<BuiltinFunctionMap>,
    pub addr_to_pretty_string_map: HashMap<Address, String>,
    pub new_addresses: HashMap<(Address, u64), Address>,
    pub previous_block_info: BlockInfo,
    pub current_block_info: BlockInfo,
    pub contract_map: ContractMap,
    pub current_dir: PathBuf,
    pub scenario_trace: Scenario,
}

Fields§

§accounts: HashMap<Address, AccountData>§builtin_functions: Rc<BuiltinFunctionMap>§addr_to_pretty_string_map: HashMap<Address, String>§new_addresses: HashMap<(Address, u64), Address>§previous_block_info: BlockInfo§current_block_info: BlockInfo§contract_map: ContractMap§current_dir: PathBuf§scenario_trace: Scenario

Implementations§

Adds a SC call step, as specified in the sc_call_step argument, then executes it.

Adds a SC call step, executes it and retrieves the transaction result (“out” field).

The transaction is expected to complete successfully.

It takes the contract_call argument separately from the SC call step, so we can benefit from type inference in the result.

Adds a SC deploy step, as specified in the sc_deploy_step argument, then executes it.

Adds a SC deploy step, executes it and retrieves the transaction result (“out” field).

The transaction is expected to complete successfully.

It takes the contract_call argument separately from the SC call step, so we can benefit from type inference in the result.

Adds a SC query step, as specified in the sc_query_step argument, then executes it.

Adds a SC query step, but sets the contract call data and returns the result.

It also sets in the trace the expected result to be the actual returned result.

It is the duty of the test developer to check that the result is actually correct after the call.

Performs a SC query to a contract, leaves no scenario trace behind.

Meant to be used for the test to investigate the state of the contract.

Use mandos_sc_query to embed the SC query in the resulting scenario.

Links a contract path in a test to a contract implementation.

Links a contract path in a test to a multi-contract output.

This simulates the effects of building such a contract with only part of the endpoints.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Adds a SC call step, as specified in the sc_call_step argument, then executes it.

Adds a SC query step, as specified in the sc_query_step argument, then executes it.

Adds a SC deploy step, as specified in the sc_deploy_step argument, then executes it.

Adds a SC call step, then executes it.
Adds a simple transfer step, then executes it.
Adds a validator reward step, then executes it.
Adds a check state step, then executes it.
Adds a dump state step, then executes it.
👎Deprecated since 0.39.0: Renamed, use set_state_step instead.
👎Deprecated since 0.39.0: Renamed, use sc_call_step instead.
👎Deprecated since 0.39.0: Renamed, use sc_query_step instead.
👎Deprecated since 0.39.0: Renamed, use sc_deploy_step instead.
👎Deprecated since 0.39.0: Renamed, use transfer_step instead.
👎Deprecated since 0.39.0: Renamed, use validator_reward_step instead.
👎Deprecated since 0.39.0: Renamed, use check_state_step instead.
👎Deprecated since 0.39.0: Renamed, use dump_state_step instead.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.