Struct ckb_testtool::context::Context [−][src]
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
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 insert_header(&mut self, header: HeaderView)[src]
Insert a block header into context
pub fn link_cell_with_block(
&mut self,
out_point: OutPoint,
block_hash: Byte32,
tx_index: usize
)[src]
&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
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>[src]
fn get_cell_data(&self, out_point: &OutPoint) -> Option<Bytes>[src]
fn get_cell_data_hash(&self, out_point: &OutPoint) -> Option<Byte32>[src]
pub fn load_cell_data_hash(&self, cell: &CellMeta) -> Option<Byte32>
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[src]
impl Send for Context[src]
impl Sync for Context[src]
impl Unpin for Context[src]
impl UnwindSafe for Context[src]
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,
pub 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]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub 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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,