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
Please use the deploy_cell function instead
Deploy a cell return the out-point of the cell
Insert a block header into context
pub fn link_cell_with_block(
&mut self,
out_point: OutPoint,
block_hash: Byte32,
tx_index: usize
)
pub fn link_cell_with_block(
&mut self,
out_point: OutPoint,
block_hash: Byte32,
tx_index: usize
)
Link a cell with a block to make the load_header_by_cell syscalls works
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
pub fn create_cell_with_out_point(
&mut self,
out_point: OutPoint,
cell: CellOutput,
data: Bytes
)
pub fn create_cell_with_out_point(
&mut self,
out_point: OutPoint,
cell: CellOutput,
data: Bytes
)
Create cell with specified out-point and cell data
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
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
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