[−][src]Struct ckb_testtool::context::Context
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]
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]
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]
&mut self,
out_point: OutPoint,
cell: CellOutput,
data: Bytes
)
Create cell with specified out-point and cell data
pub fn insert_cell(
&mut self,
out_point: OutPoint,
cell: CellOutput,
data: Bytes
)
[src]
&mut self,
out_point: OutPoint,
cell: CellOutput,
data: Bytes
)
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]
&mut self,
out_point: &OutPoint,
args: Bytes
) -> Option<Script>
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]
&self,
tx: &TransactionView,
max_cycles: u64
) -> Result<Cycle, CKBError>
Verify the transaction in CKB-VM
Trait Implementations
impl CellDataProvider for Context
[src]
fn load_cell_data(&self, cell: &CellMeta) -> Option<(Bytes, Byte32)>
[src]
fn get_cell_data(&self, out_point: &OutPoint) -> Option<(Bytes, Byte32)>
[src]
impl Default for Context
[src]
impl HeaderProvider for Context
[src]
fn get_header(&self, block_hash: &Byte32) -> Option<HeaderView>
[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]
T: 'static + ?Sized,
impl<T> AsAny for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,