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  - Addresses of the default accounts.
 - Emitted
Event  - Record for an emitted event.
 
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 
H160addresses of default accounts, for testing purposes: Alice, Bob, Charlie, Django, Eve and Frank. - get_
contract_ balance  - Returns the balance of a contract.
 - 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.
 - run_
test  - Runs the given closure test function with the default configuration for the off-chain environment.
 - set_
block_ number  - Sets the block number for the next 
advance_blockinvocation. - set_
block_ timestamp  - Sets the block timestamp for the next 
advance_blockinvocation. - 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_
contract_ balance  - Sets the balance of a contract to the given balance.
 - 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.