Make sure to use the optimized method instead of reading the storage. (#7445)

This commit is contained in:
Tomasz Drwięga
2020-10-28 13:48:15 +01:00
committed by GitHub
parent be1bc19be0
commit 2ffad62529
@@ -83,7 +83,7 @@ pub fn take_or_else<T: Decode + Sized, F: FnOnce() -> T>(key: &[u8], default_val
/// Check to see if `key` has an explicit entry in storage.
pub fn exists(key: &[u8]) -> bool {
sp_io::storage::read(key, &mut [0;0][..], 0).is_some()
sp_io::storage::exists(key)
}
/// Ensure `key` has no explicit entry in storage.