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
IntegerOverflow
IntegerOverflow happened during a contract execution
InvalidPromiseIndex
promise_idx
does not correspond to existing promises
CannotAppendActionToJointPromise
Actions can only be appended to non-joint promise.
CannotReturnJointPromise
Returning joint promise is currently prohibited
InvalidPromiseResultIndex
Accessed invalid promise result index
InvalidRegisterId
Accessed invalid register id
IteratorWasInvalidated
Iterator iterator_index
was invalidated after its creation by performing a mutable operation on trie
MemoryAccessViolation
Accessed memory outside the bounds
InvalidReceiptIndex
VM Logic returned an invalid receipt index
InvalidIteratorIndex
Iterator index iterator_index
does not exist
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
NumberOfLogsExceeded
The total number of logs will exceed the limit.
KeyLengthExceeded
The storage key length exceeded the limit.
ValueLengthExceeded
The storage value length exceeded the limit.
TotalLogLengthExceeded
The total log length exceeded the limit.
NumberPromisesExceeded
The maximum number of promises within a FunctionCall exceeded the limit.
NumberInputDataDependenciesExceeded
The maximum number of input data dependencies exceeded the limit.
ReturnedValueLengthExceeded
The returned value length exceeded the limit.
ContractSizeExceeded
The contract size for DeployContract action exceeded the limit.
Deprecated
The host function was deprecated.
EcRecoverError
General errors for ECDSA recover.
AltBn128InvalidInput
Invalid input to alt_bn128 family of functions (e.g., point which isn’t on the curve).
Ed25519VerifyInvalidInput
Invalid input to ed25519 signature verification function (e.g. signature cannot be derived from bytes).