Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make crate visible methods of OverlayedChanges public #2597

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions prdoc/pr_2597.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: Make crate visible methods of `OverlayedChanges` public.

doc:
- audience: Node Dev
description: |
Make some methods of `OverlayedChanges` namely `set_child_storage`, `clear_child_storage`, `clear_prefix`
and `clear_child_prefix` public which only had crate level visibility.

migrations:
db: []

runtime: []

crates:
- name: sp-state-machine

host_functions: []
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ impl<H: Hasher> OverlayedChanges<H> {
/// `None` can be used to delete a value specified by the given key.
///
/// Can be rolled back or committed when called inside a transaction.
pub(crate) fn set_child_storage(
pub fn set_child_storage(
&mut self,
child_info: &ChildInfo,
key: StorageKey,
Expand All @@ -373,7 +373,7 @@ impl<H: Hasher> OverlayedChanges<H> {
/// Clear child storage of given storage key.
///
/// Can be rolled back or committed when called inside a transaction.
pub(crate) fn clear_child_storage(&mut self, child_info: &ChildInfo) -> u32 {
pub fn clear_child_storage(&mut self, child_info: &ChildInfo) -> u32 {
self.mark_dirty();

let extrinsic_index = self.extrinsic_index();
Expand All @@ -391,7 +391,7 @@ impl<H: Hasher> OverlayedChanges<H> {
/// Removes all key-value pairs which keys share the given prefix.
///
/// Can be rolled back or committed when called inside a transaction.
pub(crate) fn clear_prefix(&mut self, prefix: &[u8]) -> u32 {
pub fn clear_prefix(&mut self, prefix: &[u8]) -> u32 {
self.mark_dirty();

self.top.clear_where(|key, _| key.starts_with(prefix), self.extrinsic_index())
Expand All @@ -400,7 +400,7 @@ impl<H: Hasher> OverlayedChanges<H> {
/// Removes all key-value pairs which keys share the given prefix.
///
/// Can be rolled back or committed when called inside a transaction
pub(crate) fn clear_child_prefix(&mut self, child_info: &ChildInfo, prefix: &[u8]) -> u32 {
pub fn clear_child_prefix(&mut self, child_info: &ChildInfo, prefix: &[u8]) -> u32 {
self.mark_dirty();

let extrinsic_index = self.extrinsic_index();
Expand Down