Enum pallet_contracts::pallet::Error
source · pub enum Error<T> {
Show 34 variants
InvalidSchedule,
InvalidCallFlags,
OutOfGas,
OutputBufferTooSmall,
TransferFailed,
MaxCallDepthReached,
ContractNotFound,
CodeTooLarge,
CodeNotFound,
CodeInfoNotFound,
OutOfBounds,
DecodingFailed,
ContractTrapped,
ValueTooLarge,
TerminatedWhileReentrant,
InputForwarded,
RandomSubjectTooLong,
TooManyTopics,
NoChainExtension,
DuplicateContract,
TerminatedInConstructor,
ReentranceDenied,
StorageDepositNotEnoughFunds,
StorageDepositLimitExhausted,
CodeInUse,
ContractReverted,
CodeRejected,
Indeterministic,
MigrationInProgress,
NoMigrationPerformed,
MaxDelegateDependenciesReached,
DelegateDependencyNotFound,
DelegateDependencyAlreadyExists,
CannotAddSelfAsDelegateDependency,
// some variants omitted
}
Expand description
The Error
enum of this pallet.
Variants§
InvalidSchedule
Invalid schedule supplied, e.g. with zero weight of a basic operation.
InvalidCallFlags
Invalid combination of flags supplied to seal_call
or seal_delegate_call
.
OutOfGas
The executed contract exhausted its gas limit.
OutputBufferTooSmall
The output buffer supplied to a contract API call was too small.
TransferFailed
Performing the requested transfer failed. Probably because there isn’t enough free balance in the sender’s account.
MaxCallDepthReached
Performing a call was denied because the calling depth reached the limit of what is specified in the schedule.
ContractNotFound
No contract was found at the specified address.
CodeTooLarge
The code supplied to instantiate_with_code
exceeds the limit specified in the
current schedule.
CodeNotFound
No code could be found at the supplied code hash.
CodeInfoNotFound
No code info could be found at the supplied code hash.
OutOfBounds
A buffer outside of sandbox memory was passed to a contract API function.
DecodingFailed
Input passed to a contract API function failed to decode as expected type.
ContractTrapped
Contract trapped during execution.
ValueTooLarge
The size defined in T::MaxValueSize
was exceeded.
TerminatedWhileReentrant
Termination of a contract is not allowed while the contract is already
on the call stack. Can be triggered by seal_terminate
.
InputForwarded
seal_call
forwarded this contracts input. It therefore is no longer available.
RandomSubjectTooLong
The subject passed to seal_random
exceeds the limit.
TooManyTopics
The amount of topics passed to seal_deposit_events
exceeds the limit.
NoChainExtension
The chain does not provide a chain extension. Calling the chain extension results in this error. Note that this usually shouldn’t happen as deploying such contracts is rejected.
DuplicateContract
A contract with the same AccountId already exists.
TerminatedInConstructor
A contract self destructed in its constructor.
This can be triggered by a call to seal_terminate
.
ReentranceDenied
A call tried to invoke a contract that is flagged as non-reentrant.
The only other cause is that a call from a contract into the runtime tried to call back
into pallet-contracts
. This would make the whole pallet reentrant with regard to
contract code execution which is not supported.
StorageDepositNotEnoughFunds
Origin doesn’t have enough balance to pay the required storage deposits.
StorageDepositLimitExhausted
More storage was created than allowed by the storage deposit limit.
CodeInUse
Code removal was denied because the code is still in use by at least one contract.
ContractReverted
The contract ran to completion but decided to revert its storage changes.
Please note that this error is only returned from extrinsics. When called directly
or via RPC an Ok
will be returned. In this case the caller needs to inspect the flags
to determine whether a reversion has taken place.
CodeRejected
The contract’s code was found to be invalid during validation.
The most likely cause of this is that an API was used which is not supported by the node. This happens if an older node is used with a new version of ink!. Try updating your node to the newest available version.
A more detailed error can be found on the node console if debug messages are enabled
by supplying -lruntime::contracts=debug
.
Indeterministic
An indetermistic code was used in a context where this is not permitted.
MigrationInProgress
A pending migration needs to complete before the extrinsic can be called.
NoMigrationPerformed
Migrate dispatch call was attempted but no migration was performed.
MaxDelegateDependenciesReached
The contract has reached its maximum number of delegate dependencies.
DelegateDependencyNotFound
The dependency was not found in the contract’s delegate dependencies.
DelegateDependencyAlreadyExists
The contract already depends on the given delegate dependency.
CannotAddSelfAsDelegateDependency
Can not add a delegate dependency to the code hash of the contract itself.
Trait Implementations§
source§impl<T> Decode for Error<T>
impl<T> Decode for Error<T>
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self> ) -> Result<DecodeFinished, Error>where I: Input,
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where I: Input,
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
source§impl<T> Encode for Error<T>
impl<T> Encode for Error<T>
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl<T> PalletError for Error<T>
impl<T> PalletError for Error<T>
source§const MAX_ENCODED_SIZE: usize = 1usize
const MAX_ENCODED_SIZE: usize = 1usize
source§impl<T> TypeInfo for Error<T>where
PhantomData<T>: TypeInfo + 'static,
T: 'static,
impl<T> TypeInfo for Error<T>where PhantomData<T>: TypeInfo + 'static, T: 'static,
impl<T> EncodeLike<Error<T>> for Error<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Error<T>where T: RefUnwindSafe,
impl<T> Send for Error<T>where T: Send,
impl<T> Sync for Error<T>where T: Sync,
impl<T> Unpin for Error<T>where T: Unpin,
impl<T> UnwindSafe for Error<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Self
and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere T: Decode,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> Hashable for Twhere
T: Codec,
impl<T> Hashable for Twhere T: Codec,
fn blake2_128(&self) -> [u8; 16]
fn blake2_256(&self) -> [u8; 32]
fn blake2_128_concat(&self) -> Vec<u8, Global> ⓘ
fn twox_128(&self) -> [u8; 16]
fn twox_256(&self) -> [u8; 32]
fn twox_64_concat(&self) -> Vec<u8, Global> ⓘ
fn identity(&self) -> Vec<u8, Global> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere T: Codec,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read more§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.