Preimage::Error

Variant 481 v393

pallet_preimage::pallet::Error

The `Error` enum of this pallet.

About This Type

Error enum for the Error pallet.

Contains all error types that the Error pallet can return when a call fails.

Variants (8)

IndexNameFieldsDocs
0TooBignonePreimage is too large to store on-chain.
1AlreadyNotednonePreimage has already been noted on-chain.
2NotAuthorizednoneThe user is not authorized to perform this action.
3NotNotednoneThe preimage cannot be removed since it has not yet been noted.
4RequestednoneA preimage may not be removed when there are outstanding requests.
5NotRequestednoneThe preimage request cannot be removed since no outstanding requests exist.
6TooManynoneMore than `MAX_HASH_UPGRADE_BULK_COUNT` hashes were requested to be upgraded at once.
7TooFewnoneToo few hashes were requested to be upgraded (i.e. zero).

SCALE Encoding

Rule
1-byte variant index followed by variant-specific field data. 8 possible variants.
Size
variable (1+ bytes)

Examples

TooBig
0x00
00 Variant index 0 = TooBig
AlreadyNoted
0x01
01 Variant index 1 = AlreadyNoted
NotAuthorized
0x02
02 Variant index 2 = NotAuthorized

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode Preimage::Error — variant "TooBig"
const value = registry.createType("Preimage::Error", "TooBig");
console.log("Hex:", value.toHex());

Type Parameters

T

Referenced By (21)

and 1 more...

Also See

Type Information

Type ID
481
Kind
Variant
Path
pallet_preimage::pallet::Error
Runtime
v393