Expand description
Operations on the off-chain testing environment.
Macros§
- pay_
with_ call - Prepend contract message call with value transfer. Used for tests in off-chain environment.
Structs§
- Call
Data - The raw ABI respecting input data to a call.
- Chain
Spec - The chain specification.
- Default
Accounts - The default accounts.
- Emitted
Event - Record for an emitted event.
Traits§
- Chain
Extension - Types implementing this trait can be used as chain extensions.
Functions§
- advance_
block - Advances the chain by a single block.
- assert_
contract_ termination - Tests if a contract terminates successfully after
self.env().terminate()
has been called. - callee
- Gets the currently set callee.
- count_
used_ storage_ cells - Returns the amount of storage cells used by the contract
addr
. - default_
accounts - Returns the default accounts for testing purposes:
Alice, Bob, Charlie, Django, Eve and Frank.
todo should be
default_addresses
- get_
account_ balance - Returns the balance of the account.
- get_
contract_ storage_ rw - Returns the total number of reads and writes of the contract’s storage.
- get_
return_ value - Retrieves the value stored by
return_value()
. - is_
contract - Returns a boolean to indicate whether an account is a contract
- recorded_
events - Returns the recorded emitted events in order.
- register_
chain_ extension - Registers a new chain extension.
- run_
test - Runs the given closure test function with the default configuration for the off-chain environment.
- set_
account_ balance - Sets the balance of the account to the given balance.
- set_
block_ number - Sets the block number for the next
advance_block
invocation. - set_
block_ timestamp - Sets the block timestamp for the next
advance_block
invocation. - set_
callee - Sets the callee for the next call.
- set_
caller - Sets a caller for the next call.
- set_
clear_ storage_ disabled - Set to true to disable clearing storage
- set_
contract - Sets an account as a contract
- set_
value_ transferred - Sets the value transferred from the caller to the callee as part of the call.
- transfer_
in - Transfers value from the caller account to the contract.
- upload_
code - Gets a pseudo code hash for a contract ref.