Skip to content

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

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

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

Conversation

@PoulavBhowmick03
Copy link
Copy Markdown

Fixes #673

@PoulavBhowmick03 PoulavBhowmick03 changed the title updated StorageMapAccess::get return Option<V> updated StorageMapAccess::get return Option<V> Sep 14, 2025
Copy link
Copy Markdown
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
Copy Markdown
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.

@bitwalker
Copy link
Copy Markdown
Collaborator

Closing as stale

@bitwalker bitwalker closed this Mar 27, 2026
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>

3 participants