21
21
// NOTE: could replace unhashed by having only one kind of storage (top trie being the child info
22
22
// of null length parent storage key).
23
23
24
- pub use crate :: sp_io:: { ClearPrefixResult , KillStorageResult } ;
24
+ pub use crate :: sp_io:: { KillStorageResult , MultiRemovalResults } ;
25
25
use crate :: sp_std:: prelude:: * ;
26
26
use codec:: { Codec , Decode , Encode } ;
27
27
pub use sp_core:: storage:: { ChildInfo , ChildType , StateVersion } ;
@@ -166,8 +166,8 @@ pub fn kill_storage(child_info: &ChildInfo, limit: Option<u32>) -> KillStorageRe
166
166
/// cursor need not be passed in an a `None` may be passed instead. This exception may be useful
167
167
/// then making this call solely from a block-hook such as `on_initialize`.
168
168
///
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.
171
171
///
172
172
/// NOTE: After the initial call for any given child storage, it is important that no keys further
173
173
/// keys are inserted. If so, then they may or may not be deleted by subsequent calls.
@@ -180,7 +180,7 @@ pub fn clear_storage(
180
180
child_info : & ChildInfo ,
181
181
maybe_limit : Option < u32 > ,
182
182
_maybe_cursor : Option < & [ u8 ] > ,
183
- ) -> ClearPrefixResult {
183
+ ) -> MultiRemovalResults {
184
184
// TODO: Once the network has upgraded to include the new host functions, this code can be
185
185
// enabled.
186
186
// sp_io::default_child_storage::storage_kill(prefix, maybe_limit, maybe_cursor)
@@ -189,11 +189,11 @@ pub fn clear_storage(
189
189
sp_io:: default_child_storage:: storage_kill ( child_info. storage_key ( ) , maybe_limit) ,
190
190
} ;
191
191
use sp_io:: KillStorageResult :: * ;
192
- let ( maybe_cursor, db ) = match r {
192
+ let ( maybe_cursor, backend ) = match r {
193
193
AllRemoved ( db) => ( None , db) ,
194
194
SomeRemaining ( db) => ( Some ( child_info. storage_key ( ) . to_vec ( ) ) , db) ,
195
195
} ;
196
- ClearPrefixResult { maybe_cursor, db , total : db , loops : db }
196
+ MultiRemovalResults { maybe_cursor, backend , unique : backend , loops : backend }
197
197
}
198
198
199
199
/// Ensure `key` has no explicit entry in storage.
0 commit comments