Type Alias frequency_runtime::StatefulStorage
source · pub type StatefulStorage = Pallet<Runtime>;
Aliased Type§
struct StatefulStorage(/* private fields */);
Implementations
source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
sourcepub fn apply_item_actions(
origin: <T as Config>::RuntimeOrigin,
state_owner_msa_id: u64,
schema_id: u16,
target_hash: u32,
actions: BoundedVec<ItemAction<<T as Config>::MaxItemizedBlobSizeBytes>, <T as Config>::MaxItemizedActionsCount>
) -> Result<(), DispatchError>
pub fn apply_item_actions( origin: <T as Config>::RuntimeOrigin, state_owner_msa_id: u64, schema_id: u16, target_hash: u32, actions: BoundedVec<ItemAction<<T as Config>::MaxItemizedBlobSizeBytes>, <T as Config>::MaxItemizedActionsCount> ) -> Result<(), DispatchError>
Applies the Add or Delete Actions on the requested Itemized page. This is treated as a transaction so either all actions succeed or none will be executed.
Note: if called by the state owner, call may succeed even on SignatureRequired
schemas.
The fact that the entire (signed) transaction is submitted by the owner’s keypair is
considered equivalent to supplying a separate signature. Note in that case that a delegate
submitting this extrinsic on behalf of a user would fail.
Events
sourcepub fn upsert_page(
origin: <T as Config>::RuntimeOrigin,
state_owner_msa_id: u64,
schema_id: u16,
page_id: u16,
target_hash: u32,
payload: BoundedVec<u8, <T as Config>::MaxPaginatedPageSizeBytes>
) -> Result<(), DispatchError>
pub fn upsert_page( origin: <T as Config>::RuntimeOrigin, state_owner_msa_id: u64, schema_id: u16, page_id: u16, target_hash: u32, payload: BoundedVec<u8, <T as Config>::MaxPaginatedPageSizeBytes> ) -> Result<(), DispatchError>
Creates or updates an Paginated storage with new payload
Note: if called by the state owner, call may succeed even on SignatureRequired
schemas.
The fact that the entire (signed) transaction is submitted by the owner’s keypair is
considered equivalent to supplying a separate signature. Note in that case that a delegate
submitting this extrinsic on behalf of a user would fail.
Events
sourcepub fn delete_page(
origin: <T as Config>::RuntimeOrigin,
state_owner_msa_id: u64,
schema_id: u16,
page_id: u16,
target_hash: u32
) -> Result<(), DispatchError>
pub fn delete_page( origin: <T as Config>::RuntimeOrigin, state_owner_msa_id: u64, schema_id: u16, page_id: u16, target_hash: u32 ) -> Result<(), DispatchError>
Deletes a Paginated storage
Note: if called by the state owner, call may succeed even on SignatureRequired
schemas.
The fact that the entire (signed) transaction is submitted by the owner’s keypair is
considered equivalent to supplying a separate signature. Note in that case that a delegate
submitting this extrinsic on behalf of a user would fail.
Events
sourcepub fn apply_item_actions_with_signature(
origin: <T as Config>::RuntimeOrigin,
delegator_key: <T as Config>::AccountId,
proof: MultiSignature,
payload: ItemizedSignaturePayload<T>
) -> Result<(), DispatchError>
👎Deprecated: please use apply_item_actions_with_signature_v2
instead
pub fn apply_item_actions_with_signature( origin: <T as Config>::RuntimeOrigin, delegator_key: <T as Config>::AccountId, proof: MultiSignature, payload: ItemizedSignaturePayload<T> ) -> Result<(), DispatchError>
apply_item_actions_with_signature_v2
insteadApplies the Add or Delete Actions on the requested Itemized page that requires signature since the signature of delegator is checked there is no need for delegation validation This is treated as a transaction so either all actions succeed or none will be executed.
Events
sourcepub fn upsert_page_with_signature(
origin: <T as Config>::RuntimeOrigin,
delegator_key: <T as Config>::AccountId,
proof: MultiSignature,
payload: PaginatedUpsertSignaturePayload<T>
) -> Result<(), DispatchError>
👎Deprecated: please use upsert_page_with_signature_v2
instead
pub fn upsert_page_with_signature( origin: <T as Config>::RuntimeOrigin, delegator_key: <T as Config>::AccountId, proof: MultiSignature, payload: PaginatedUpsertSignaturePayload<T> ) -> Result<(), DispatchError>
upsert_page_with_signature_v2
insteadCreates or updates an Paginated storage with new payload that requires signature since the signature of delegator is checked there is no need for delegation validation
Events
sourcepub fn delete_page_with_signature(
origin: <T as Config>::RuntimeOrigin,
delegator_key: <T as Config>::AccountId,
proof: MultiSignature,
payload: PaginatedDeleteSignaturePayload<T>
) -> Result<(), DispatchError>
👎Deprecated: please use delete_page_with_signature_v2
instead
pub fn delete_page_with_signature( origin: <T as Config>::RuntimeOrigin, delegator_key: <T as Config>::AccountId, proof: MultiSignature, payload: PaginatedDeleteSignaturePayload<T> ) -> Result<(), DispatchError>
delete_page_with_signature_v2
insteadDeletes a Paginated storage that requires signature since the signature of delegator is checked there is no need for delegation validation
Events
sourcepub fn apply_item_actions_with_signature_v2(
origin: <T as Config>::RuntimeOrigin,
delegator_key: <T as Config>::AccountId,
proof: MultiSignature,
payload: ItemizedSignaturePayloadV2<T>
) -> Result<(), DispatchError>
pub fn apply_item_actions_with_signature_v2( origin: <T as Config>::RuntimeOrigin, delegator_key: <T as Config>::AccountId, proof: MultiSignature, payload: ItemizedSignaturePayloadV2<T> ) -> Result<(), DispatchError>
Applies the Add or Delete Actions on the requested Itemized page that requires signature since the signature of delegator is checked there is no need for delegation validation This is treated as a transaction so either all actions succeed or none will be executed.
Events
sourcepub fn upsert_page_with_signature_v2(
origin: <T as Config>::RuntimeOrigin,
delegator_key: <T as Config>::AccountId,
proof: MultiSignature,
payload: PaginatedUpsertSignaturePayloadV2<T>
) -> Result<(), DispatchError>
pub fn upsert_page_with_signature_v2( origin: <T as Config>::RuntimeOrigin, delegator_key: <T as Config>::AccountId, proof: MultiSignature, payload: PaginatedUpsertSignaturePayloadV2<T> ) -> Result<(), DispatchError>
Creates or updates an Paginated storage with new payload that requires signature since the signature of delegator is checked there is no need for delegation validation
Events
sourcepub fn delete_page_with_signature_v2(
origin: <T as Config>::RuntimeOrigin,
delegator_key: <T as Config>::AccountId,
proof: MultiSignature,
payload: PaginatedDeleteSignaturePayloadV2<T>
) -> Result<(), DispatchError>
pub fn delete_page_with_signature_v2( origin: <T as Config>::RuntimeOrigin, delegator_key: <T as Config>::AccountId, proof: MultiSignature, payload: PaginatedDeleteSignaturePayloadV2<T> ) -> Result<(), DispatchError>
Deletes a Paginated storage that requires signature since the signature of delegator is checked there is no need for delegation validation
Events
source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
sourcepub fn sum_add_actions_bytes(
actions: &BoundedVec<ItemAction<<T as Config>::MaxItemizedBlobSizeBytes>, <T as Config>::MaxItemizedActionsCount>
) -> u32
pub fn sum_add_actions_bytes( actions: &BoundedVec<ItemAction<<T as Config>::MaxItemizedBlobSizeBytes>, <T as Config>::MaxItemizedActionsCount> ) -> u32
Sums the total bytes of each item actions
sourcepub fn get_paginated_storage(
msa_id: u64,
schema_id: u16
) -> Result<Vec<PaginatedStorageResponse>, DispatchError>
pub fn get_paginated_storage( msa_id: u64, schema_id: u16 ) -> Result<Vec<PaginatedStorageResponse>, DispatchError>
This function returns all the paginated storage associated with msa_id
and schema_id
Warning: since this function iterates over all the potential keys it should never called from runtime.
sourcepub fn get_itemized_storage(
msa_id: u64,
schema_id: u16
) -> Result<ItemizedStoragePageResponse, DispatchError>
pub fn get_itemized_storage( msa_id: u64, schema_id: u16 ) -> Result<ItemizedStoragePageResponse, DispatchError>
This function returns all the itemized storage associated with msa_id
and schema_id
sourcepub fn check_payload_expiration(
current_block: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
payload_expire_block: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number
) -> Result<(), DispatchError>
pub fn check_payload_expiration( current_block: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, payload_expire_block: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number ) -> Result<(), DispatchError>
This function checks to ensure payload_expire_block
is in a valid range
Errors
sourcepub fn check_signature(
signature: &MultiSignature,
signer: &<T as Config>::AccountId,
payload: Vec<u8>
) -> Result<(), DispatchError>
pub fn check_signature( signature: &MultiSignature, signer: &<T as Config>::AccountId, payload: Vec<u8> ) -> Result<(), DispatchError>
Verify the signature
was signed by signer
on payload
by a wallet
Note the wrap_binary_data
follows the Polkadot wallet pattern of wrapping with <Byte>
tags.
Errors
sourcepub fn get_paginated_page_for(
msa_id: u64,
schema_id: u16,
page_id: u16
) -> Result<Option<Page<<T as Config>::MaxPaginatedPageSizeBytes>>, DispatchError>
pub fn get_paginated_page_for( msa_id: u64, schema_id: u16, page_id: u16 ) -> Result<Option<Page<<T as Config>::MaxPaginatedPageSizeBytes>>, DispatchError>
Gets a paginated storage for desired parameters
sourcepub fn get_itemized_page_for(
msa_id: u64,
schema_id: u16
) -> Result<Option<Page<<T as Config>::MaxItemizedPageSizeBytes>>, DispatchError>
pub fn get_itemized_page_for( msa_id: u64, schema_id: u16 ) -> Result<Option<Page<<T as Config>::MaxItemizedPageSizeBytes>>, DispatchError>
Gets an itemized storage for desired parameters
Trait Implementations
source§impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
source§impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
source§fn on_initialize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number
) -> Weight
fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number ) -> Weight
Hooks::on_initialize
].source§impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
source§impl<T> IntegrityTest for Pallet<T>where
T: Config,
impl<T> IntegrityTest for Pallet<T>where
T: Config,
source§fn integrity_test()
fn integrity_test()
Hooks::integrity_test
].source§impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
source§fn on_finalize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number
)
fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number )
Hooks::on_finalize
].source§impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
source§fn module_name() -> &'static str
fn module_name() -> &'static str
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
source§impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
source§fn offchain_worker(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number
)
fn offchain_worker( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number )
source§impl<T> PartialEq for Pallet<T>
impl<T> PartialEq for Pallet<T>
impl<T> Eq for Pallet<T>
source§impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
fn storage_info() -> Vec<StorageInfo>
source§impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hooks::on_runtime_upgrade
].source§impl<T> GetStorageVersion for Pallet<T>where
T: Config,
impl<T> GetStorageVersion for Pallet<T>where
T: Config,
§type InCodeStorageVersion = StorageVersion
type InCodeStorageVersion = StorageVersion
source§fn in_code_storage_version(
) -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
fn in_code_storage_version( ) -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
storage_version
attribute, or
[NoStorageVersionSet
] if the attribute is missing.source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
in_code_storage_version
and will be removed after March 2024.Self::current_storage_version
] instead. Read moresource§impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey>
indicating the storage keys that
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.source§impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
source§fn on_initialize(
_current: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number
) -> Weight
fn on_initialize( _current: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number ) -> Weight
§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
]). Read more§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read more