pub enum ScriptError {
ScriptNotFound(Byte32),
ExceededMaximumCycles(u64),
CyclesOverflow(u64, u64),
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(u64)
The script consumes too much cycles
CyclesOverflow(u64, u64)
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
impl Eq for ScriptError
impl StructuralPartialEq for ScriptError
Auto Trait Implementations§
impl !Freeze for ScriptError
impl RefUnwindSafe for ScriptError
impl Send for ScriptError
impl Sync for ScriptError
impl Unpin for ScriptError
impl UnwindSafe for ScriptError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more