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

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

Verification Context

Fields

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

Implementations

impl Context[src]

pub fn deploy_contract(&mut self, data: Bytes) -> OutPoint[src]

👎 Deprecated since 0.1.1:

Please use the deploy_cell function instead

pub fn deploy_cell(&mut self, data: Bytes) -> OutPoint[src]

Deploy a cell return the out-point of the cell

pub fn get_contract_out_point(&self, data_hash: &Byte32) -> Option<OutPoint>[src]

👎 Deprecated since 0.1.1:

Please use the get_cell_by_data_hash function instead

pub fn get_cell_by_data_hash(&self, data_hash: &Byte32) -> Option<OutPoint>[src]

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

pub fn create_cell(&mut self, cell: CellOutput, data: Bytes) -> OutPoint[src]

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
)
[src]

Create cell with specified out-point and cell data

pub fn insert_cell(
    &mut self,
    out_point: OutPoint,
    cell: CellOutput,
    data: Bytes
)
[src]

👎 Deprecated since 0.1.1:

Please use the create_cell_with_out_point function instead

pub fn get_cell(&self, out_point: &OutPoint) -> Option<(CellOutput, Bytes)>[src]

Get cell output and data by out-point

pub fn build_script(
    &mut self,
    out_point: &OutPoint,
    args: Bytes
) -> Option<Script>
[src]

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

pub fn complete_tx(&mut self, tx: TransactionView) -> TransactionView[src]

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

pub fn capture_debug(&self) -> bool[src]

pub fn set_capture_debug(&mut self, capture_debug: bool)[src]

Capture debug output, default value is false

pub fn captured_messages(&self) -> Vec<Message>[src]

return captured messages

pub fn verify_tx(
    &self,
    tx: &TransactionView,
    max_cycles: u64
) -> Result<Cycle, CKBError>
[src]

Verify the transaction in CKB-VM

Trait Implementations

impl CellDataProvider for Context[src]

impl Default for Context[src]

impl HeaderProvider for Context[src]

Auto Trait Implementations

impl RefUnwindSafe for Context

impl Send for Context

impl Sync for Context

impl Unpin for Context

impl UnwindSafe for Context

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsAny for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,