Struct ckb_script::TransactionScriptsVerifier [−][src]
pub struct TransactionScriptsVerifier<'a, DL> { /* fields omitted */ }
Expand description
This struct leverages CKB VM to verify transaction inputs.
FlatBufferBuilder owned Vec<u8>
that grows as needed, in the
future, we might refactor this to share buffer to achieve zero-copy
Implementations
impl<'a, DL: CellDataProvider + HeaderProvider> TransactionScriptsVerifier<'a, DL>
[src]
impl<'a, DL: CellDataProvider + HeaderProvider> TransactionScriptsVerifier<'a, DL>
[src]pub fn new(
rtx: &'a ResolvedTransaction,
data_loader: &'a DL
) -> TransactionScriptsVerifier<'a, DL>
[src]
pub fn new(
rtx: &'a ResolvedTransaction,
data_loader: &'a DL
) -> TransactionScriptsVerifier<'a, DL>
[src]Creates a script verifier for the transaction.
Params
rtx
- transaction which cell out points have been resolved.data_loader
- used to load cell data.
pub fn set_debug_printer<F: Fn(&Byte32, &str) + 'static>(&mut self, func: F)
[src]
pub fn set_debug_printer<F: Fn(&Byte32, &str) + 'static>(&mut self, func: F)
[src]Sets a callback to handle the debug syscall.
Script can print a message using the debug syscall.
The callback receives two parameters:
hash: &Byte32
: this is the script hash of currently running script group.message: &str
: message passed to the debug syscall.
pub fn extract_script(&self, script: &'a Script) -> Result<Bytes, ScriptError>
[src]
pub fn extract_script(&self, script: &'a Script) -> Result<Bytes, ScriptError>
[src]Extracts actual script binary either in dep cells.
pub fn verify_single(
&self,
script_group_type: ScriptGroupType,
script_hash: &Byte32,
max_cycles: Cycle
) -> Result<Cycle, ScriptError>
[src]
pub fn verify_single(
&self,
script_group_type: ScriptGroupType,
script_hash: &Byte32,
max_cycles: Cycle
) -> Result<Cycle, ScriptError>
[src]Runs a single script in current transaction, while this is not useful for CKB itself, it can be very helpful when building a CKB debugger.
pub fn find_script_group(
&self,
script_group_type: ScriptGroupType,
script_hash: &Byte32
) -> Option<&ScriptGroup>
[src]
pub fn find_script_group(
&self,
script_group_type: ScriptGroupType,
script_hash: &Byte32
) -> Option<&ScriptGroup>
[src]Finds the script group from cell deps.
pub fn cost_model(&self) -> Box<InstructionCycleFunc>
[src]
pub fn cost_model(&self) -> Box<InstructionCycleFunc>
[src]Gets the cost model.
Cost model is used to evaluate consumed cycles.
pub fn generate_syscalls(
&'a self,
script_group: &'a ScriptGroup
) -> Vec<Box<dyn Syscalls<Box<AsmCoreMachine>> + 'a>>
[src]
pub fn generate_syscalls(
&'a self,
script_group: &'a ScriptGroup
) -> Vec<Box<dyn Syscalls<Box<AsmCoreMachine>> + 'a>>
[src]Prepares syscalls.
Auto Trait Implementations
impl<'a, DL> !RefUnwindSafe for TransactionScriptsVerifier<'a, DL>
impl<'a, DL> !Send for TransactionScriptsVerifier<'a, DL>
impl<'a, DL> !Sync for TransactionScriptsVerifier<'a, DL>
impl<'a, DL> Unpin for TransactionScriptsVerifier<'a, DL>
impl<'a, DL> !UnwindSafe for TransactionScriptsVerifier<'a, DL>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,