2121// NOTE: could replace unhashed by having only one kind of storage (top trie being the child info
2222// of null length parent storage key).
2323
24- pub use crate :: sp_io:: { ClearPrefixResult , KillStorageResult } ;
24+ pub use crate :: sp_io:: { KillStorageResult , MultiRemovalResults } ;
2525use crate :: sp_std:: prelude:: * ;
2626use codec:: { Codec , Decode , Encode } ;
2727pub use sp_core:: storage:: { ChildInfo , ChildType , StateVersion } ;
@@ -166,8 +166,8 @@ pub fn kill_storage(child_info: &ChildInfo, limit: Option<u32>) -> KillStorageRe
166166/// cursor need not be passed in an a `None` may be passed instead. This exception may be useful
167167/// then making this call solely from a block-hook such as `on_initialize`.
168168///
169- /// Returns [`ClearPrefixResult`] to inform about the result. Once the resultant `maybe_cursor`
170- /// field is `None`, then no further items remain to be deleted.
169+ /// Returns [`MultiRemovalResults`](sp_io::MultiRemovalResults) to inform about the result. Once the
170+ /// resultant `maybe_cursor` field is `None`, then no further items remain to be deleted.
171171///
172172/// NOTE: After the initial call for any given child storage, it is important that no keys further
173173/// keys are inserted. If so, then they may or may not be deleted by subsequent calls.
@@ -180,7 +180,7 @@ pub fn clear_storage(
180180 child_info : & ChildInfo ,
181181 maybe_limit : Option < u32 > ,
182182 _maybe_cursor : Option < & [ u8 ] > ,
183- ) -> ClearPrefixResult {
183+ ) -> MultiRemovalResults {
184184 // TODO: Once the network has upgraded to include the new host functions, this code can be
185185 // enabled.
186186 // sp_io::default_child_storage::storage_kill(prefix, maybe_limit, maybe_cursor)
@@ -189,11 +189,11 @@ pub fn clear_storage(
189189 sp_io:: default_child_storage:: storage_kill ( child_info. storage_key ( ) , maybe_limit) ,
190190 } ;
191191 use sp_io:: KillStorageResult :: * ;
192- let ( maybe_cursor, db ) = match r {
192+ let ( maybe_cursor, backend ) = match r {
193193 AllRemoved ( db) => ( None , db) ,
194194 SomeRemaining ( db) => ( Some ( child_info. storage_key ( ) . to_vec ( ) ) , db) ,
195195 } ;
196- ClearPrefixResult { maybe_cursor, db , total : db , loops : db }
196+ MultiRemovalResults { maybe_cursor, backend , unique : backend , loops : backend }
197197}
198198
199199/// Ensure `key` has no explicit entry in storage.
0 commit comments