Enum ckb_script::ScriptError
source · [−]pub enum ScriptError {
InvalidCodeHash,
ExceededMaximumCycles(Cycle),
CyclesOverflow(Cycle, Cycle),
MultipleMatches,
ValidationFailure(String, i8),
EncounteredKnownBugs(String, usize),
InvalidScriptHashType(String),
InvalidVmVersion(u8),
VMInternalError(String),
}
Expand description
Script execution error.
Variants
InvalidCodeHash
The field code_hash in script is invalid
ExceededMaximumCycles(Cycle)
The script consumes too much cycles
CyclesOverflow(Cycle, Cycle)
Internal error cycles overflow
MultipleMatches
script.type_hash
hits multiple cells with different data
ValidationFailure(String, i8)
Non-zero exit code returns by script
EncounteredKnownBugs(String, usize)
Known bugs are detected in transaction script outputs
InvalidScriptHashType(String)
InvalidScriptHashType
InvalidVmVersion(u8)
InvalidVmVersion
VMInternalError(String)
Known bugs are detected in transaction script outputs
Implementations
sourceimpl ScriptError
impl ScriptError
sourcepub fn validation_failure(script: &Script, exit_code: i8) -> ScriptError
pub fn validation_failure(script: &Script, exit_code: i8) -> ScriptError
Creates a script error originated the script and its exit code.
sourcepub fn source(self, script_group: &ScriptGroup) -> TransactionScriptError
pub fn source(self, script_group: &ScriptGroup) -> TransactionScriptError
Creates a script error originated from the script group.
sourcepub fn input_lock_script(self, index: usize) -> TransactionScriptError
pub fn input_lock_script(self, index: usize) -> TransactionScriptError
Creates a script error originated from the lock script of the input cell at the specific index.
sourcepub fn input_type_script(self, index: usize) -> TransactionScriptError
pub fn input_type_script(self, index: usize) -> TransactionScriptError
Creates a script error originated from the type script of the input cell at the specific index.
sourcepub fn output_type_script(self, index: usize) -> TransactionScriptError
pub fn output_type_script(self, index: usize) -> TransactionScriptError
Creates a script error originated from the type script of the output cell at the specific index.
sourcepub fn unknown_source(self) -> TransactionScriptError
pub fn unknown_source(self) -> TransactionScriptError
Creates a script error with unknown source, usually a internal error
Trait Implementations
sourceimpl Clone for ScriptError
impl Clone for ScriptError
sourcefn clone(&self) -> ScriptError
fn clone(&self) -> ScriptError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ScriptError
impl Debug for ScriptError
sourceimpl Display for ScriptError
impl Display for ScriptError
sourceimpl Error for ScriptError
impl Error for ScriptError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl PartialEq<ScriptError> for ScriptError
impl PartialEq<ScriptError> for ScriptError
sourcefn eq(&self, other: &ScriptError) -> bool
fn eq(&self, other: &ScriptError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ScriptError) -> bool
fn ne(&self, other: &ScriptError) -> bool
This method tests for !=
.
impl Eq for ScriptError
impl StructuralEq for ScriptError
impl StructuralPartialEq for ScriptError
Auto Trait Implementations
impl RefUnwindSafe for ScriptError
impl Send for ScriptError
impl Sync for ScriptError
impl Unpin for ScriptError
impl UnwindSafe for ScriptError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more