Enum ckb_script::ScriptError
source · pub enum ScriptError {
ScriptNotFound(Byte32),
ExceededMaximumCycles(Cycle),
CyclesOverflow(Cycle, Cycle),
MultipleMatches,
ValidationFailure(String, i8),
EncounteredKnownBugs(String, usize),
InvalidScriptHashType(String),
InvalidVmVersion(u8),
VMInternalError(Error),
Other(String),
}
Expand description
Script execution error.
Variants§
ScriptNotFound(Byte32)
The field code_hash in script can’t be resolved
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(Error)
Errors thrown by ckb-vm
Other(String)
Other errors raised in script execution process
Implementations§
source§impl 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§
source§impl Clone for ScriptError
impl Clone for ScriptError
source§fn clone(&self) -> ScriptError
fn clone(&self) -> ScriptError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ScriptError
impl Debug for ScriptError
source§impl Display for ScriptError
impl Display for ScriptError
source§impl Error for ScriptError
impl Error for ScriptError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl PartialEq for ScriptError
impl PartialEq for ScriptError
source§fn eq(&self, other: &ScriptError) -> bool
fn eq(&self, other: &ScriptError) -> bool
self
and other
values to be equal, and is used
by ==
.