pub struct BlockchainMock {
    pub accounts: HashMap<Address, AccountData>,
    pub builtin_functions: Rc<BuiltinFunctionMap>,
    pub addr_to_mandos_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 mandos_trace: Scenario,
}

Fields§

§accounts: HashMap<Address, AccountData>§builtin_functions: Rc<BuiltinFunctionMap>§addr_to_mandos_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§mandos_trace: Scenario

Implementations§

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

Adds a mandos 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 mandos SC deploy step, as specified in the sc_deploy_step argument, then executes it.

Adds a mandos 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 mandos SC query step, as specified in the sc_query_step argument, then executes it.

Adds a mandos 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 mandos 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 mandos.

Tells the tests where the crate lies relative to the workspace. This ensures that the paths are set correctly, including in debug mode.

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

👎Deprecated since 0.37.0: Got renamed to register_contract, but not completely removed, in order to ease test migration. Please replace with register_contract.

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

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.