Use exists host function (#10531)

This commit is contained in:
Alexander Theißen
2021-12-21 18:36:46 +01:00
committed by GitHub
parent 9c9ea8da85
commit 62ee43d822
+1 -2
View File
@@ -112,8 +112,7 @@ pub fn take_or_else<T: Codec + Sized, F: FnOnce() -> T>(
pub fn exists(child_info: &ChildInfo, key: &[u8]) -> bool {
match child_info.child_type() {
ChildType::ParentKeyId =>
sp_io::default_child_storage::read(child_info.storage_key(), key, &mut [0; 0][..], 0)
.is_some(),
sp_io::default_child_storage::exists(child_info.storage_key(), key),
}
}