Fix exists bug.

This commit is contained in:
Gav committed 2018-01-28 17:11:29 +01:00
1 parent bfd599e5de
commit 3491e1609e
3 files changed
+1 -1

No files matched your search

@@ -87,7 +87,7 @@ pub fn take_or_else<T: Slicable + Sized, F: FnOnce() -> T>(key: &[u8], default_v
/// Check to see if `key` has an explicit entry in storage.
pub fn exists(key: &[u8]) -> bool {
let mut x = [0u8; 1];
runtime_std::read_storage(&twox_128(key)[..], &mut x[..], 0) == 1
runtime_std::read_storage(&twox_128(key)[..], &mut x[..], 0) >= 1
}
/// Ensure `key` has no explicit entry in storage.