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

fix: return error for non-existent states + unit tests #101

Merged
merged 7 commits into from
Oct 29, 2024

Conversation

Farhad-Shabani
Copy link
Member

@Farhad-Shabani Farhad-Shabani commented Oct 28, 2024

Closes: #100

Part of: #79

Description

In this PR, all reader methods have been reviewed to ensure they handle non-existent states by returning an error. However, in a few specific cases, such as when minting a token and needing to check if it has been previously created (exists), we return an optional value due to the internal logic dependency on that state.
Additionally, unit tests were added to cover cases where a state does not exist on storage calls.

@Farhad-Shabani Farhad-Shabani changed the title fix: return error for non-existent states instead of zero/empty values fix: return error for non-existent states + unit tests Oct 28, 2024
@Farhad-Shabani Farhad-Shabani merged commit 2d28d67 into main Oct 29, 2024
6 checks passed
@Farhad-Shabani Farhad-Shabani deleted the farhad/handle-non-existance-on-storage-calls branch October 29, 2024 02:04
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.

Returning zero values in storage queries could pose vulnerability by masking non-existent states
1 participant