Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
c4446f62
Commit
c4446f62
authored
3 years ago
by
Amar Singh
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix rust docs for remove storage prefix and take storage item (#9544)
parent
f7bcbdd2
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/frame/support/src/storage/migration.rs
+2
-2
2 additions, 2 deletions
substrate/frame/support/src/storage/migration.rs
with
2 additions
and
2 deletions
substrate/frame/support/src/storage/migration.rs
+
2
−
2
View file @
c4446f62
...
...
@@ -249,7 +249,7 @@ pub fn put_storage_value<T: Encode>(module: &[u8], item: &[u8], hash: &[u8], val
frame_support
::
storage
::
unhashed
::
put
(
&
key
,
&
value
);
}
///
Get a particular value in
storage by the `module`, the map's `item` name and the key `hash`.
///
Remove all items under a
storage
prefix
by the `module`, the map's `item` name and the key `hash`.
pub
fn
remove_storage_prefix
(
module
:
&
[
u8
],
item
:
&
[
u8
],
hash
:
&
[
u8
])
{
let
mut
key
=
vec!
[
0u8
;
32
+
hash
.len
()];
key
[
0
..
16
]
.copy_from_slice
(
&
Twox128
::
hash
(
module
));
...
...
@@ -258,7 +258,7 @@ pub fn remove_storage_prefix(module: &[u8], item: &[u8], hash: &[u8]) {
frame_support
::
storage
::
unhashed
::
kill_prefix
(
&
key
,
None
);
}
///
Get
a particular
value
in storage by the `module`, the map's `item` name and the key `hash`.
///
Take
a particular
item
in storage by the `module`, the map's `item` name and the key `hash`.
pub
fn
take_storage_item
<
K
:
Encode
+
Sized
,
T
:
Decode
+
Sized
,
H
:
StorageHasher
>
(
module
:
&
[
u8
],
item
:
&
[
u8
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment