Enum near_primitives::errors::ActionErrorKind

source ·
pub enum ActionErrorKind {
Show 23 variants AccountAlreadyExists { account_id: AccountId, }, AccountDoesNotExist { account_id: AccountId, }, CreateAccountOnlyByRegistrar { account_id: AccountId, registrar_account_id: AccountId, predecessor_id: AccountId, }, CreateAccountNotAllowed { account_id: AccountId, predecessor_id: AccountId, }, ActorNoPermission { account_id: AccountId, actor_id: AccountId, }, DeleteKeyDoesNotExist { account_id: AccountId, public_key: Box<PublicKey>, }, AddKeyAlreadyExists { account_id: AccountId, public_key: Box<PublicKey>, }, DeleteAccountStaking { account_id: AccountId, }, LackBalanceForState { account_id: AccountId, amount: Balance, }, TriesToUnstake { account_id: AccountId, }, TriesToStake { account_id: AccountId, stake: Balance, locked: Balance, balance: Balance, }, InsufficientStake { account_id: AccountId, stake: Balance, minimum_stake: Balance, }, FunctionCallError(FunctionCallError), NewReceiptValidationError(ReceiptValidationError), OnlyImplicitAccountCreationAllowed { account_id: AccountId, }, DeleteAccountWithLargeState { account_id: AccountId, }, DelegateActionInvalidSignature, DelegateActionSenderDoesNotMatchTxReceiver { sender_id: AccountId, receiver_id: AccountId, }, DelegateActionExpired, DelegateActionAccessKeyError(InvalidAccessKeyError), DelegateActionInvalidNonce { delegate_nonce: Nonce, ak_nonce: Nonce, }, DelegateActionNonceTooLarge { delegate_nonce: Nonce, upper_bound: Nonce, }, NonRefundableTransferToExistingAccount { account_id: AccountId, },
}

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
§registrar_account_id: AccountId
§predecessor_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: Box<PublicKey>
§

AddKeyAlreadyExists

The public key is already used for an existing access key

Fields

§account_id: AccountId
§public_key: Box<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: Balance

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
§stake: Balance
§locked: Balance
§balance: Balance
§

InsufficientStake

Fields

§account_id: AccountId
§stake: Balance
§minimum_stake: Balance
§

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

§sender_id: AccountId
§receiver_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

§delegate_nonce: Nonce
§ak_nonce: Nonce
§

DelegateActionNonceTooLarge

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

Fields

§delegate_nonce: Nonce
§upper_bound: Nonce
§

NonRefundableTransferToExistingAccount

Non-refundable storage transfer to an existing account is not allowed according to NEP-491.

Fields

§account_id: AccountId

Trait Implementations§

source§

impl BorshDeserialize for ActionErrorKind

source§

fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>

source§

fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
source§

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

source§

impl BorshSerialize for ActionErrorKind

source§

fn serialize<__W: Write>(&self, writer: &mut __W) -> Result<(), Error>

source§

impl Clone for ActionErrorKind

source§

fn clone(&self) -> ActionErrorKind

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

source§

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

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

impl EnumExt for ActionErrorKind

source§

fn deserialize_variant<__R: Read>( reader: &mut __R, variant_tag: u8, ) -> Result<Self, Error>

Deserialises given variant of an enum from the reader. Read more
source§

impl From<ActionErrorKind> for ActionError

source§

fn from(e: ActionErrorKind) -> ActionError

Converts to this type from the input type.
source§

impl PartialEq for ActionErrorKind

source§

fn eq(&self, other: &ActionErrorKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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
source§

impl Eq for ActionErrorKind

source§

impl StructuralPartialEq for ActionErrorKind

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
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> ToString for T
where 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 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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

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
source§

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