Enum ActionErrorKind

Source
pub enum ActionErrorKind {
Show 23 variants AccountAlreadyExists { account_id: AccountId, }, AccountDoesNotExist { account_id: AccountId, }, CreateAccountOnlyByRegistrar { account_id: AccountId, predecessor_id: AccountId, registrar_account_id: AccountId, }, CreateAccountNotAllowed { account_id: AccountId, predecessor_id: AccountId, }, ActorNoPermission { account_id: AccountId, actor_id: AccountId, }, DeleteKeyDoesNotExist { account_id: AccountId, public_key: PublicKey, }, AddKeyAlreadyExists { account_id: AccountId, public_key: PublicKey, }, DeleteAccountStaking { account_id: AccountId, }, LackBalanceForState { account_id: AccountId, amount: String, }, TriesToUnstake { account_id: AccountId, }, TriesToStake { account_id: AccountId, balance: String, locked: String, stake: String, }, InsufficientStake { account_id: AccountId, minimum_stake: String, stake: String, }, FunctionCallError(FunctionCallError), NewReceiptValidationError(ReceiptValidationError), OnlyImplicitAccountCreationAllowed { account_id: AccountId, }, DeleteAccountWithLargeState { account_id: AccountId, }, DelegateActionInvalidSignature, DelegateActionSenderDoesNotMatchTxReceiver { receiver_id: AccountId, sender_id: AccountId, }, DelegateActionExpired, DelegateActionAccessKeyError(InvalidAccessKeyError), DelegateActionInvalidNonce { ak_nonce: u64, delegate_nonce: u64, }, DelegateActionNonceTooLarge { delegate_nonce: u64, upper_bound: u64, }, GlobalContractDoesNotExist { identifier: GlobalContractIdentifier, },
}
Expand description

ActionErrorKind

JSON schema
{
 "oneOf": [
   {
     "description": "Happens when CreateAccount action tries to create an account with account_id which is already exists in the storage",
     "type": "object",
     "required": [
       "AccountAlreadyExists"
     ],
     "properties": {
       "AccountAlreadyExists": {
         "type": "object",
         "required": [
           "account_id"
         ],
         "properties": {
           "account_id": {
             "$ref": "#/components/schemas/AccountId"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Happens when TX receiver_id doesn't exist (but action is not Action::CreateAccount)",
     "type": "object",
     "required": [
       "AccountDoesNotExist"
     ],
     "properties": {
       "AccountDoesNotExist": {
         "type": "object",
         "required": [
           "account_id"
         ],
         "properties": {
           "account_id": {
             "$ref": "#/components/schemas/AccountId"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "A top-level account ID can only be created by registrar.",
     "type": "object",
     "required": [
       "CreateAccountOnlyByRegistrar"
     ],
     "properties": {
       "CreateAccountOnlyByRegistrar": {
         "type": "object",
         "required": [
           "account_id",
           "predecessor_id",
           "registrar_account_id"
         ],
         "properties": {
           "account_id": {
             "$ref": "#/components/schemas/AccountId"
           },
           "predecessor_id": {
             "$ref": "#/components/schemas/AccountId"
           },
           "registrar_account_id": {
             "$ref": "#/components/schemas/AccountId"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "A newly created account must be under a namespace of the creator account",
     "type": "object",
     "required": [
       "CreateAccountNotAllowed"
     ],
     "properties": {
       "CreateAccountNotAllowed": {
         "type": "object",
         "required": [
           "account_id",
           "predecessor_id"
         ],
         "properties": {
           "account_id": {
             "$ref": "#/components/schemas/AccountId"
           },
           "predecessor_id": {
             "$ref": "#/components/schemas/AccountId"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Administrative actions like `DeployContract`, `Stake`, `AddKey`, `DeleteKey`. can be proceed only if sender=receiver\nor the first TX action is a `CreateAccount` action",
     "type": "object",
     "required": [
       "ActorNoPermission"
     ],
     "properties": {
       "ActorNoPermission": {
         "type": "object",
         "required": [
           "account_id",
           "actor_id"
         ],
         "properties": {
           "account_id": {
             "$ref": "#/components/schemas/AccountId"
           },
           "actor_id": {
             "$ref": "#/components/schemas/AccountId"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Account tries to remove an access key that doesn't exist",
     "type": "object",
     "required": [
       "DeleteKeyDoesNotExist"
     ],
     "properties": {
       "DeleteKeyDoesNotExist": {
         "type": "object",
         "required": [
           "account_id",
           "public_key"
         ],
         "properties": {
           "account_id": {
             "$ref": "#/components/schemas/AccountId"
           },
           "public_key": {
             "$ref": "#/components/schemas/PublicKey"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "The public key is already used for an existing access key",
     "type": "object",
     "required": [
       "AddKeyAlreadyExists"
     ],
     "properties": {
       "AddKeyAlreadyExists": {
         "type": "object",
         "required": [
           "account_id",
           "public_key"
         ],
         "properties": {
           "account_id": {
             "$ref": "#/components/schemas/AccountId"
           },
           "public_key": {
             "$ref": "#/components/schemas/PublicKey"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Account is staking and can not be deleted",
     "type": "object",
     "required": [
       "DeleteAccountStaking"
     ],
     "properties": {
       "DeleteAccountStaking": {
         "type": "object",
         "required": [
           "account_id"
         ],
         "properties": {
           "account_id": {
             "$ref": "#/components/schemas/AccountId"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "ActionReceipt can't be completed, because the remaining balance will not be enough to cover storage.",
     "type": "object",
     "required": [
       "LackBalanceForState"
     ],
     "properties": {
       "LackBalanceForState": {
         "type": "object",
         "required": [
           "account_id",
           "amount"
         ],
         "properties": {
           "account_id": {
             "description": "An account which needs balance",
             "allOf": [
               {
                 "$ref": "#/components/schemas/AccountId"
               }
             ]
           },
           "amount": {
             "description": "Balance required to complete an action.",
             "type": "string"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Account is not yet staked, but tries to unstake",
     "type": "object",
     "required": [
       "TriesToUnstake"
     ],
     "properties": {
       "TriesToUnstake": {
         "type": "object",
         "required": [
           "account_id"
         ],
         "properties": {
           "account_id": {
             "$ref": "#/components/schemas/AccountId"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "The account doesn't have enough balance to increase the stake.",
     "type": "object",
     "required": [
       "TriesToStake"
     ],
     "properties": {
       "TriesToStake": {
         "type": "object",
         "required": [
           "account_id",
           "balance",
           "locked",
           "stake"
         ],
         "properties": {
           "account_id": {
             "$ref": "#/components/schemas/AccountId"
           },
           "balance": {
             "type": "string"
           },
           "locked": {
             "type": "string"
           },
           "stake": {
             "type": "string"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "type": "object",
     "required": [
       "InsufficientStake"
     ],
     "properties": {
       "InsufficientStake": {
         "type": "object",
         "required": [
           "account_id",
           "minimum_stake",
           "stake"
         ],
         "properties": {
           "account_id": {
             "$ref": "#/components/schemas/AccountId"
           },
           "minimum_stake": {
             "type": "string"
           },
           "stake": {
             "type": "string"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "An error occurred during a `FunctionCall` Action, parameter is debug message.",
     "type": "object",
     "required": [
       "FunctionCallError"
     ],
     "properties": {
       "FunctionCallError": {
         "$ref": "#/components/schemas/FunctionCallError"
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Error occurs when a new `ActionReceipt` created by the `FunctionCall` action fails\nreceipt validation.",
     "type": "object",
     "required": [
       "NewReceiptValidationError"
     ],
     "properties": {
       "NewReceiptValidationError": {
         "$ref": "#/components/schemas/ReceiptValidationError"
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Error occurs when a `CreateAccount` action is called on a NEAR-implicit or ETH-implicit account.\nSee NEAR-implicit account creation NEP: <https://github.com/nearprotocol/NEPs/pull/71>.\nAlso, see ETH-implicit account creation NEP: <https://github.com/near/NEPs/issues/518>.\n\nTODO(#8598): This error is named very poorly. A better name would be\n`OnlyNamedAccountCreationAllowed`.",
     "type": "object",
     "required": [
       "OnlyImplicitAccountCreationAllowed"
     ],
     "properties": {
       "OnlyImplicitAccountCreationAllowed": {
         "type": "object",
         "required": [
           "account_id"
         ],
         "properties": {
           "account_id": {
             "$ref": "#/components/schemas/AccountId"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Delete account whose state is large is temporarily banned.",
     "type": "object",
     "required": [
       "DeleteAccountWithLargeState"
     ],
     "properties": {
       "DeleteAccountWithLargeState": {
         "type": "object",
         "required": [
           "account_id"
         ],
         "properties": {
           "account_id": {
             "$ref": "#/components/schemas/AccountId"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Signature does not match the provided actions and given signer public key.",
     "type": "string",
     "enum": [
       "DelegateActionInvalidSignature"
     ]
   },
   {
     "description": "Receiver of the transaction doesn't match Sender of the delegate action",
     "type": "object",
     "required": [
       "DelegateActionSenderDoesNotMatchTxReceiver"
     ],
     "properties": {
       "DelegateActionSenderDoesNotMatchTxReceiver": {
         "type": "object",
         "required": [
           "receiver_id",
           "sender_id"
         ],
         "properties": {
           "receiver_id": {
             "$ref": "#/components/schemas/AccountId"
           },
           "sender_id": {
             "$ref": "#/components/schemas/AccountId"
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "Delegate action has expired. `max_block_height` is less than actual block height.",
     "type": "string",
     "enum": [
       "DelegateActionExpired"
     ]
   },
   {
     "description": "The given public key doesn't exist for Sender account",
     "type": "object",
     "required": [
       "DelegateActionAccessKeyError"
     ],
     "properties": {
       "DelegateActionAccessKeyError": {
         "$ref": "#/components/schemas/InvalidAccessKeyError"
       }
     },
     "additionalProperties": false
   },
   {
     "description": "DelegateAction nonce must be greater sender[public_key].nonce",
     "type": "object",
     "required": [
       "DelegateActionInvalidNonce"
     ],
     "properties": {
       "DelegateActionInvalidNonce": {
         "type": "object",
         "required": [
           "ak_nonce",
           "delegate_nonce"
         ],
         "properties": {
           "ak_nonce": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           },
           "delegate_nonce": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "description": "DelegateAction nonce is larger than the upper bound given by the block height",
     "type": "object",
     "required": [
       "DelegateActionNonceTooLarge"
     ],
     "properties": {
       "DelegateActionNonceTooLarge": {
         "type": "object",
         "required": [
           "delegate_nonce",
           "upper_bound"
         ],
         "properties": {
           "delegate_nonce": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           },
           "upper_bound": {
             "type": "integer",
             "format": "uint64",
             "minimum": 0.0
           }
         }
       }
     },
     "additionalProperties": false
   },
   {
     "type": "object",
     "required": [
       "GlobalContractDoesNotExist"
     ],
     "properties": {
       "GlobalContractDoesNotExist": {
         "type": "object",
         "required": [
           "identifier"
         ],
         "properties": {
           "identifier": {
             "$ref": "#/components/schemas/GlobalContractIdentifier"
           }
         }
       }
     },
     "additionalProperties": false
   }
 ]
}

Variants§

§

AccountAlreadyExists

Happens when CreateAccount action tries to create an account with account_id which is already exists in the storage

Fields

§account_id: AccountId
§

AccountDoesNotExist

Happens when TX receiver_id doesn’t exist (but action is not Action::CreateAccount)

Fields

§account_id: AccountId
§

CreateAccountOnlyByRegistrar

A top-level account ID can only be created by registrar.

Fields

§account_id: AccountId
§predecessor_id: AccountId
§registrar_account_id: AccountId
§

CreateAccountNotAllowed

A newly created account must be under a namespace of the creator account

Fields

§account_id: AccountId
§predecessor_id: AccountId
§

ActorNoPermission

Administrative actions like DeployContract, Stake, AddKey, DeleteKey. can be proceed only if sender=receiver or the first TX action is a CreateAccount action

Fields

§account_id: AccountId
§actor_id: AccountId
§

DeleteKeyDoesNotExist

Account tries to remove an access key that doesn’t exist

Fields

§account_id: AccountId
§public_key: PublicKey
§

AddKeyAlreadyExists

The public key is already used for an existing access key

Fields

§account_id: AccountId
§public_key: PublicKey
§

DeleteAccountStaking

Account is staking and can not be deleted

Fields

§account_id: AccountId
§

LackBalanceForState

ActionReceipt can’t be completed, because the remaining balance will not be enough to cover storage.

Fields

§account_id: AccountId

An account which needs balance

§amount: String

Balance required to complete an action.

§

TriesToUnstake

Account is not yet staked, but tries to unstake

Fields

§account_id: AccountId
§

TriesToStake

The account doesn’t have enough balance to increase the stake.

Fields

§account_id: AccountId
§balance: String
§locked: String
§stake: String
§

InsufficientStake

Fields

§account_id: AccountId
§minimum_stake: String
§stake: String
§

FunctionCallError(FunctionCallError)

An error occurred during a FunctionCall Action, parameter is debug message.

§

NewReceiptValidationError(ReceiptValidationError)

Error occurs when a new ActionReceipt created by the FunctionCall action fails receipt validation.

§

OnlyImplicitAccountCreationAllowed

Error occurs when a CreateAccount action is called on a NEAR-implicit or ETH-implicit account. See NEAR-implicit account creation NEP: https://github.com/nearprotocol/NEPs/pull/71. Also, see ETH-implicit account creation NEP: https://github.com/near/NEPs/issues/518.

TODO(#8598): This error is named very poorly. A better name would be OnlyNamedAccountCreationAllowed.

Fields

§account_id: AccountId
§

DeleteAccountWithLargeState

Delete account whose state is large is temporarily banned.

Fields

§account_id: AccountId
§

DelegateActionInvalidSignature

Signature does not match the provided actions and given signer public key.

§

DelegateActionSenderDoesNotMatchTxReceiver

Receiver of the transaction doesn’t match Sender of the delegate action

Fields

§receiver_id: AccountId
§sender_id: AccountId
§

DelegateActionExpired

Delegate action has expired. max_block_height is less than actual block height.

§

DelegateActionAccessKeyError(InvalidAccessKeyError)

The given public key doesn’t exist for Sender account

§

DelegateActionInvalidNonce

DelegateAction nonce must be greater sender[public_key].nonce

Fields

§ak_nonce: u64
§delegate_nonce: u64
§

DelegateActionNonceTooLarge

DelegateAction nonce is larger than the upper bound given by the block height

Fields

§delegate_nonce: u64
§upper_bound: u64
§

GlobalContractDoesNotExist

Fields

Trait Implementations§

Source§

impl Clone for ActionErrorKind

Source§

fn clone(&self) -> ActionErrorKind

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 ActionErrorKind

Source§

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

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

impl<'de> Deserialize<'de> for ActionErrorKind

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<&ActionErrorKind> for ActionErrorKind

Source§

fn from(value: &ActionErrorKind) -> Self

Converts to this type from the input type.
Source§

impl From<FunctionCallError> for ActionErrorKind

Source§

fn from(value: FunctionCallError) -> Self

Converts to this type from the input type.
Source§

impl From<InvalidAccessKeyError> for ActionErrorKind

Source§

fn from(value: InvalidAccessKeyError) -> Self

Converts to this type from the input type.
Source§

impl From<ReceiptValidationError> for ActionErrorKind

Source§

fn from(value: ReceiptValidationError) -> Self

Converts to this type from the input type.
Source§

impl Serialize for ActionErrorKind

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,