Fix exists bug.

This commit is contained in:
Gav
2018-01-28 17:11:29 +01:00
parent bfd599e5de
commit 3491e1609e
3 changed files with 1 additions and 1 deletions
@@ -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.