Enum HostError

Source
pub enum HostError {
Show 33 variants BadUtf16, BadUtf8, GasExceeded, GasLimitExceeded, BalanceExceeded, EmptyMethodName, GuestPanic { panic_msg: String, }, IntegerOverflow, InvalidPromiseIndex { promise_idx: u64, }, CannotAppendActionToJointPromise, CannotReturnJointPromise, InvalidPromiseResultIndex { result_idx: u64, }, InvalidRegisterId { register_id: u64, }, IteratorWasInvalidated { iterator_index: u64, }, MemoryAccessViolation, InvalidReceiptIndex { receipt_index: u64, }, InvalidIteratorIndex { iterator_index: u64, }, InvalidAccountId, InvalidMethodName, InvalidPublicKey, ProhibitedInView { method_name: String, }, NumberOfLogsExceeded { limit: u64, }, KeyLengthExceeded { length: u64, limit: u64, }, ValueLengthExceeded { length: u64, limit: u64, }, TotalLogLengthExceeded { length: u64, limit: u64, }, NumberPromisesExceeded { limit: u64, number_of_promises: u64, }, NumberInputDataDependenciesExceeded { limit: u64, number_of_input_data_dependencies: u64, }, ReturnedValueLengthExceeded { length: u64, limit: u64, }, ContractSizeExceeded { limit: u64, size: u64, }, Deprecated { method_name: String, }, EcRecoverError { msg: String, }, AltBn128InvalidInput { msg: String, }, Ed25519VerifyInvalidInput { msg: String, },
}
Expand description

HostError

JSON schema
{
 "oneOf": [
   {
     "description": "String encoding is bad UTF-16 sequence",
     "type": "string",
     "enum": [
       "BadUTF16"
     ]
   },
   {
     "description": "String encoding is bad UTF-8 sequence",
     "type": "string",
     "enum": [
       "BadUTF8"
     ]
   },
   {
     "description": "Exceeded the prepaid gas",
     "type": "string",
     "enum": [
       "GasExceeded"
     ]
   },
   {
     "description": "Exceeded the maximum amount of gas allowed to burn per contract",
     "type": "string",
     "enum": [
       "GasLimitExceeded"
     ]
   },
   {
     "description": "Exceeded the account balance",
     "type": "string",
     "enum": [
       "BalanceExceeded"
     ]
   },
   {
     "description": "Tried to call an empty method name",
     "type": "string",
     "enum": [
       "EmptyMethodName"
     ]
   },
   {
     "description": "Smart contract panicked",
     "type": "object",
     "required": [
       "GuestPanic"
     ],
     "properties": {
       "GuestPanic": {
         "type": "object",
         "required": [
           "panic_msg"
         ],
         "properties": {
           "panic_msg": {
             "type": "string"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "IntegerOverflow happened during a contract execution",
     "type": "string",
     "enum": [
       "IntegerOverflow"
     ]
   },
   {
     "description": "`promise_idx` does not correspond to existing promises",
     "type": "object",
     "required": [
       "InvalidPromiseIndex"
     ],
     "properties": {
       "InvalidPromiseIndex": {
         "type": "object",
         "required": [
           "promise_idx"
         ],
         "properties": {
           "promise_idx": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Actions can only be appended to non-joint promise.",
     "type": "string",
     "enum": [
       "CannotAppendActionToJointPromise"
     ]
   },
   {
     "description": "Returning joint promise is currently prohibited",
     "type": "string",
     "enum": [
       "CannotReturnJointPromise"
     ]
   },
   {
     "description": "Accessed invalid promise result index",
     "type": "object",
     "required": [
       "InvalidPromiseResultIndex"
     ],
     "properties": {
       "InvalidPromiseResultIndex": {
         "type": "object",
         "required": [
           "result_idx"
         ],
         "properties": {
           "result_idx": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Accessed invalid register id",
     "type": "object",
     "required": [
       "InvalidRegisterId"
     ],
     "properties": {
       "InvalidRegisterId": {
         "type": "object",
         "required": [
           "register_id"
         ],
         "properties": {
           "register_id": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Iterator `iterator_index` was invalidated after its creation by performing a mutable operation on trie",
     "type": "object",
     "required": [
       "IteratorWasInvalidated"
     ],
     "properties": {
       "IteratorWasInvalidated": {
         "type": "object",
         "required": [
           "iterator_index"
         ],
         "properties": {
           "iterator_index": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Accessed memory outside the bounds",
     "type": "string",
     "enum": [
       "MemoryAccessViolation"
     ]
   },
   {
     "description": "VM Logic returned an invalid receipt index",
     "type": "object",
     "required": [
       "InvalidReceiptIndex"
     ],
     "properties": {
       "InvalidReceiptIndex": {
         "type": "object",
         "required": [
           "receipt_index"
         ],
         "properties": {
           "receipt_index": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Iterator index `iterator_index` does not exist",
     "type": "object",
     "required": [
       "InvalidIteratorIndex"
     ],
     "properties": {
       "InvalidIteratorIndex": {
         "type": "object",
         "required": [
           "iterator_index"
         ],
         "properties": {
           "iterator_index": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "VM Logic returned an invalid account id",
     "type": "string",
     "enum": [
       "InvalidAccountId"
     ]
   },
   {
     "description": "VM Logic returned an invalid method name",
     "type": "string",
     "enum": [
       "InvalidMethodName"
     ]
   },
   {
     "description": "VM Logic provided an invalid public key",
     "type": "string",
     "enum": [
       "InvalidPublicKey"
     ]
   },
   {
     "description": "`method_name` is not allowed in view calls",
     "type": "object",
     "required": [
       "ProhibitedInView"
     ],
     "properties": {
       "ProhibitedInView": {
         "type": "object",
         "required": [
           "method_name"
         ],
         "properties": {
           "method_name": {
             "type": "string"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "The total number of logs will exceed the limit.",
     "type": "object",
     "required": [
       "NumberOfLogsExceeded"
     ],
     "properties": {
       "NumberOfLogsExceeded": {
         "type": "object",
         "required": [
           "limit"
         ],
         "properties": {
           "limit": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "The storage key length exceeded the limit.",
     "type": "object",
     "required": [
       "KeyLengthExceeded"
     ],
     "properties": {
       "KeyLengthExceeded": {
         "type": "object",
         "required": [
           "length",
           "limit"
         ],
         "properties": {
           "length": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           },
           "limit": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "The storage value length exceeded the limit.",
     "type": "object",
     "required": [
       "ValueLengthExceeded"
     ],
     "properties": {
       "ValueLengthExceeded": {
         "type": "object",
         "required": [
           "length",
           "limit"
         ],
         "properties": {
           "length": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           },
           "limit": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "The total log length exceeded the limit.",
     "type": "object",
     "required": [
       "TotalLogLengthExceeded"
     ],
     "properties": {
       "TotalLogLengthExceeded": {
         "type": "object",
         "required": [
           "length",
           "limit"
         ],
         "properties": {
           "length": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           },
           "limit": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "The maximum number of promises within a FunctionCall exceeded the limit.",
     "type": "object",
     "required": [
       "NumberPromisesExceeded"
     ],
     "properties": {
       "NumberPromisesExceeded": {
         "type": "object",
         "required": [
           "limit",
           "number_of_promises"
         ],
         "properties": {
           "limit": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           },
           "number_of_promises": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "The maximum number of input data dependencies exceeded the limit.",
     "type": "object",
     "required": [
       "NumberInputDataDependenciesExceeded"
     ],
     "properties": {
       "NumberInputDataDependenciesExceeded": {
         "type": "object",
         "required": [
           "limit",
           "number_of_input_data_dependencies"
         ],
         "properties": {
           "limit": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           },
           "number_of_input_data_dependencies": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "The returned value length exceeded the limit.",
     "type": "object",
     "required": [
       "ReturnedValueLengthExceeded"
     ],
     "properties": {
       "ReturnedValueLengthExceeded": {
         "type": "object",
         "required": [
           "length",
           "limit"
         ],
         "properties": {
           "length": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           },
           "limit": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "The contract size for DeployContract action exceeded the limit.",
     "type": "object",
     "required": [
       "ContractSizeExceeded"
     ],
     "properties": {
       "ContractSizeExceeded": {
         "type": "object",
         "required": [
           "limit",
           "size"
         ],
         "properties": {
           "limit": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           },
           "size": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "The host function was deprecated.",
     "type": "object",
     "required": [
       "Deprecated"
     ],
     "properties": {
       "Deprecated": {
         "type": "object",
         "required": [
           "method_name"
         ],
         "properties": {
           "method_name": {
             "type": "string"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "General errors for ECDSA recover.",
     "type": "object",
     "required": [
       "ECRecoverError"
     ],
     "properties": {
       "ECRecoverError": {
         "type": "object",
         "required": [
           "msg"
         ],
         "properties": {
           "msg": {
             "type": "string"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Invalid input to alt_bn128 family of functions (e.g., point which isn't\non the curve).",
     "type": "object",
     "required": [
       "AltBn128InvalidInput"
     ],
     "properties": {
       "AltBn128InvalidInput": {
         "type": "object",
         "required": [
           "msg"
         ],
         "properties": {
           "msg": {
             "type": "string"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Invalid input to ed25519 signature verification function (e.g. signature cannot be\nderived from bytes).",
     "type": "object",
     "required": [
       "Ed25519VerifyInvalidInput"
     ],
     "properties": {
       "Ed25519VerifyInvalidInput": {
         "type": "object",
         "required": [
           "msg"
         ],
         "properties": {
           "msg": {
             "type": "string"
           }
         }
       }
     },
     "additionalProperties": false
   }
 ]
}

Variants§

§

BadUtf16

String encoding is bad UTF-16 sequence

§

BadUtf8

String encoding is bad UTF-8 sequence

§

GasExceeded

Exceeded the prepaid gas

§

GasLimitExceeded

Exceeded the maximum amount of gas allowed to burn per contract

§

BalanceExceeded

Exceeded the account balance

§

EmptyMethodName

Tried to call an empty method name

§

GuestPanic

Smart contract panicked

Fields

§panic_msg: String
§

IntegerOverflow

IntegerOverflow happened during a contract execution

§

InvalidPromiseIndex

promise_idx does not correspond to existing promises

Fields

§promise_idx: u64
§

CannotAppendActionToJointPromise

Actions can only be appended to non-joint promise.

§

CannotReturnJointPromise

Returning joint promise is currently prohibited

§

InvalidPromiseResultIndex

Accessed invalid promise result index

Fields

§result_idx: u64
§

InvalidRegisterId

Accessed invalid register id

Fields

§register_id: u64
§

IteratorWasInvalidated

Iterator iterator_index was invalidated after its creation by performing a mutable operation on trie

Fields

§iterator_index: u64
§

MemoryAccessViolation

Accessed memory outside the bounds

§

InvalidReceiptIndex

VM Logic returned an invalid receipt index

Fields

§receipt_index: u64
§

InvalidIteratorIndex

Iterator index iterator_index does not exist

Fields

§iterator_index: u64
§

InvalidAccountId

VM Logic returned an invalid account id

§

InvalidMethodName

VM Logic returned an invalid method name

§

InvalidPublicKey

VM Logic provided an invalid public key

§

ProhibitedInView

method_name is not allowed in view calls

Fields

§method_name: String
§

NumberOfLogsExceeded

The total number of logs will exceed the limit.

Fields

§limit: u64
§

KeyLengthExceeded

The storage key length exceeded the limit.

Fields

§length: u64
§limit: u64
§

ValueLengthExceeded

The storage value length exceeded the limit.

Fields

§length: u64
§limit: u64
§

TotalLogLengthExceeded

The total log length exceeded the limit.

Fields

§length: u64
§limit: u64
§

NumberPromisesExceeded

The maximum number of promises within a FunctionCall exceeded the limit.

Fields

§limit: u64
§number_of_promises: u64
§

NumberInputDataDependenciesExceeded

The maximum number of input data dependencies exceeded the limit.

Fields

§limit: u64
§number_of_input_data_dependencies: u64
§

ReturnedValueLengthExceeded

The returned value length exceeded the limit.

Fields

§length: u64
§limit: u64
§

ContractSizeExceeded

The contract size for DeployContract action exceeded the limit.

Fields

§limit: u64
§size: u64
§

Deprecated

The host function was deprecated.

Fields

§method_name: String
§

EcRecoverError

General errors for ECDSA recover.

Fields

§

AltBn128InvalidInput

Invalid input to alt_bn128 family of functions (e.g., point which isn’t on the curve).

Fields

§

Ed25519VerifyInvalidInput

Invalid input to ed25519 signature verification function (e.g. signature cannot be derived from bytes).

Fields

Trait Implementations§

Source§

impl Clone for HostError

Source§

fn clone(&self) -> HostError

Returns a duplicate 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 Debug for HostError

Source§

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

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

impl<'de> Deserialize<'de> for HostError

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&HostError> for HostError

Source§

fn from(value: &HostError) -> Self

Converts to this type from the input type.
Source§

impl From<HostError> for FunctionCallError

Source§

fn from(value: HostError) -> Self

Converts to this type from the input type.
Source§

impl Serialize for HostError

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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 T
where 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,