Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add existence helpers to cw-storage-plus #261

Closed
ethanfrey opened this issue Apr 8, 2021 · 0 comments · Fixed by #322
Closed

Add existence helpers to cw-storage-plus #261

ethanfrey opened this issue Apr 8, 2021 · 0 comments · Fixed by #322
Milestone

Comments

@ethanfrey
Copy link
Member

Inspired by #251 (comment)

We should add a quick existence operator to Map / IndexedMap that doesn't parse the data. This could be used like load:

let exists: bool = TOKENS.has(deps.storage, &token_id);

We should also expose this on the Path helper (which would be how the above is implemented`

TOKENS.key(k).exists(deps.storage);

Note that neither must return errors (like remove) as neither parses data

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 a pull request may close this issue.

1 participant