#[non_exhaustive]
pub enum Error {
Show 29 variants RootNotFound(Digest), InvalidProtocolVersion(ProtocolVersion), Genesis(Box<GenesisError>), WasmPreprocessing(PreprocessingError), WasmSerialization(SerializationError), Exec(Error), Storage(Error), Authorization, InsufficientPayment, GasConversionOverflow, Deploy, Finalization, Bytesrepr(String), Mint(String), InvalidKeyVariant, ProtocolUpgrade(ProtocolUpgradeError), InvalidDeployItemVariant(String), CommitError(CommitError), MissingSystemContractRegistry, MissingSystemContractHash(String), MissingChecksumRegistry, RuntimeStackOverflow, FailedToGetWithdrawKeys, FailedToGetStoredWithdraws, FailedToGetWithdrawPurses, FailedToRetrieveUnbondingDelay, FailedToRetrieveEraId, MissingTrieNodeChildren(Vec<Digest>), FailedToRetrieveAccumulationPurse,
}
Expand description

Engine state errors.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

RootNotFound(Digest)

Specified state root hash is not found.

§

InvalidProtocolVersion(ProtocolVersion)

Protocol version used in the deploy is invalid.

§

Genesis(Box<GenesisError>)

Genesis error.

§

WasmPreprocessing(PreprocessingError)

WASM preprocessing error.

§

WasmSerialization(SerializationError)

WASM serialization error.

§

Exec(Error)

Contract execution error.

§

Storage(Error)

Storage error.

§

Authorization

Authorization error.

§

InsufficientPayment

Payment code provided insufficient funds for execution.

§

GasConversionOverflow

Motes to gas conversion resulted in an overflow.

§

Deploy

General deploy error.

§

Finalization

Executing a payment finalization code resulted in an error.

§

Bytesrepr(String)

Serialization/deserialization error.

§

Mint(String)

Mint error.

§

InvalidKeyVariant

Invalid key variant.

§

ProtocolUpgrade(ProtocolUpgradeError)

Protocol upgrade error.

§

InvalidDeployItemVariant(String)

Invalid deploy item variant.

§

CommitError(CommitError)

Commit error.

§

MissingSystemContractRegistry

Missing system contract registry.

§

MissingSystemContractHash(String)

Missing system contract hash.

§

MissingChecksumRegistry

Missing checksum registry.

§

RuntimeStackOverflow

An attempt to push to the runtime stack while already at the maximum height.

§

FailedToGetWithdrawKeys

Failed to get the set of Key::Withdraw from global state.

§

FailedToGetStoredWithdraws

Failed to get the purses stored under Key::Withdraw

§

FailedToGetWithdrawPurses

Failed to convert the StoredValue into WithdrawPurse.

§

FailedToRetrieveUnbondingDelay

Failed to retrieve the unbonding delay from the auction state.

§

FailedToRetrieveEraId

Failed to retrieve the current EraId from the auction state.

§

MissingTrieNodeChildren(Vec<Digest>)

Failed to put a trie node into global state because some of its children were missing.

§

FailedToRetrieveAccumulationPurse

Failed to retrieve accumulation purse from handle payment system contract.

Implementations§

source§

impl Error

source

pub fn reverter(api_error: impl Into<ApiError>) -> Error

Creates an Error instance of an Error::Exec variant with an API error-compatible object.

This method should be used only by native code that has to mimic logic of a WASM executed code.

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Error

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl DataSize for Error

source§

const IS_DYNAMIC: bool = true

If true, the type has a heap size that can vary at runtime, depending on the actual value.
source§

const STATIC_HEAP_SIZE: usize = 0usize

The amount of space a value of the type always occupies. If IS_DYNAMIC is false, this is the total amount of heap memory occupied by the value. Otherwise this is a lower bound.
source§

fn estimate_heap_size(&self) -> usize

Estimates the size of heap memory taken up by this value. Read more
source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Box<GenesisError>> for Error

source§

fn from(genesis_error: Box<GenesisError>) -> Self

Converts to this type from the input type.
source§

impl From<CommitError> for Error

source§

fn from(source: CommitError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for GetEraValidatorsError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for StepError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<PreprocessingError> for Error

source§

fn from(source: PreprocessingError) -> Self

Converts to this type from the input type.
source§

impl From<ProtocolUpgradeError> for Error

source§

fn from(source: ProtocolUpgradeError) -> Self

Converts to this type from the input type.
source§

impl From<RuntimeStackOverflow> for Error

source§

fn from(_: RuntimeStackOverflow) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: SerializationError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for Twhere T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more