Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sdk/base/src/types/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl<V: Into<Word> + From<Word>> ValueAccess<V> for Value {

pub trait StorageMapAccess<K, V> {
/// Returns a map item value for `key` from the account storage.
fn get(&self, key: &K) -> V;
fn get(&self, key: &K) -> Option<V>;
/// Sets a map item `value` for `key` in the account storage and returns (old_root, old_value)
fn set(&self, key: K, value: V) -> (StorageCommitmentRoot, V);
}
Expand All @@ -44,8 +44,8 @@ impl<K: Into<Word> + AsRef<Word>, V: From<Word> + Into<Word>> StorageMapAccess<K
{
/// Returns a map item value from the account storage.
#[inline(always)]
fn get(&self, key: &K) -> V {
storage::get_map_item(self.slot, key.as_ref()).into()
fn get(&self, key: &K) -> Option<V> {
Some(storage::get_map_item(self.slot, key.as_ref()).into())
}

/// Sets a map item `value` in the account storage and returns (old_root, old_value)
Expand Down