Struct ckb_testtool::context::Context[][src]

pub struct Context {
    pub cells: HashMap<OutPoint, (CellOutput, Bytes)>,
    pub transaction_infos: HashMap<OutPoint, TransactionInfo>,
    pub headers: HashMap<Byte32, HeaderView>,
    pub epoches: HashMap<Byte32, EpochExt>,
    pub cells_by_data_hash: HashMap<Byte32, OutPoint>,
    // some fields omitted
}
Expand description

Verification Context

Fields

cells: HashMap<OutPoint, (CellOutput, Bytes)>transaction_infos: HashMap<OutPoint, TransactionInfo>headers: HashMap<Byte32, HeaderView>epoches: HashMap<Byte32, EpochExt>cells_by_data_hash: HashMap<Byte32, OutPoint>

Implementations

👎 Deprecated since 0.1.1:

Please use the deploy_cell function instead

Deploy a cell return the out-point of the cell

Insert a block header into context

Link a cell with a block to make the load_header_by_cell syscalls works

👎 Deprecated since 0.1.1:

Please use the get_cell_by_data_hash function instead

Get the out-point of a cell by data_hash the cell must has deployed to this context

Create a cell with data return the out-point

Create cell with specified out-point and cell data

👎 Deprecated since 0.1.1:

Please use the create_cell_with_out_point function instead

Get cell output and data by out-point

Build script with out_point and args return none if the out-point is not exist

Complete cell deps for a transaction this function searches context cells; generate cell dep for referenced scripts.

Capture debug output, default value is false

return captured messages

Verify the transaction in CKB-VM

Trait Implementations

load cell_data from memory, fallback to storage access

fetch cell_data from storage

fetch cell_data_hash from storage

load cell_data_hash from memory, fallback to storage access

Returns the “default value” for a type. Read more

TODO(doc): @quake

Return timestamp and block_number of the corresponding block_hash, and hash of parent block

Return past block median time, including the timestamp of the given one

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

TODO(doc): @quake

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

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.