-
Notifications
You must be signed in to change notification settings - Fork 2.6k
chainHead_storage: Iterate over keys #14628
Conversation
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
result: StorageResultType::Value(hex_string(&storage_data.0)), | ||
}) | ||
}) | ||
QueryResult::Ok(opt.map(|storage_data| StorageResult::<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I personally would just use Ok
instead of QueryResult::Ok
, but I guess that is just personal preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(It might be that QueryResult::Ok
is used here to convey the type information that comes along with QueryResult
:))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lookk clean to me; good work!
Random question; is there a reason for picking 10 as the number of storage items to send back before needing a "continue"?
Thanks a lot for the review!
I thought of it as a hard limit to ensure we don't iterate over the whole DB until we implement the |
bot rebase |
Rebased |
bot rebase |
Branch is already up-to-date |
This PR adds support to iterate over (key, value) and (key, hash) pairs.
At the moment, substrate will iterate over at most 10 keys producing at most 10 pairs.
This PR lays the ground for iteration and support for pagination will be added in:
A new tests checks
Closes #14548.
// @paritytech/subxt-team