Skip to content

updated StorageMapAccess::get return Option<V>#676

Open
PoulavBhowmick03 wants to merge 1 commit into0xMiden:nextfrom
PoulavBhowmick03:sdk/StorageMapAccess
Open

updated StorageMapAccess::get return Option<V>#676
PoulavBhowmick03 wants to merge 1 commit into0xMiden:nextfrom
PoulavBhowmick03:sdk/StorageMapAccess

Conversation

@PoulavBhowmick03
Copy link

Fixes #673

@PoulavBhowmick03 PoulavBhowmick03 changed the title updated StorageMapAccess::get return Option<V> updated StorageMapAccess::get return Option<V> Sep 14, 2025
Copy link
Contributor

@greenhat greenhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Please check my comment.

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())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to test if get_map_item returns zero word and if so - return None. See the Why section in #673.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SDK: make StorageMapAccess::get return Option<V>

2 participants