-
Notifications
You must be signed in to change notification settings - Fork 73
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
Feat: Completed Implementation of role_store
contract.
#443
Feat: Completed Implementation of role_store
contract.
#443
Conversation
67336b7
to
a953dba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, could you just rename some test to follow our test naming rules
Like in the first test -> given_normal_conditions_when_revoke_role_then_works
67ce18c
to
5364865
Compare
renamed tests |
Sorry I wasn't clear but the test you renamed was the one with good naming :) Rename other tests following the same pattern ( |
5364865
to
a1903bb
Compare
done |
4ea089a
to
a65328e
Compare
Summary
Implemented
role_store
and added corresponding tests.Labels
Issue Resolved
Resolves: #432
New Behavior
The new implementation mimics the behavior of the Solidity version but avoids using arrays in storage. Instead,
role_members_count
androles_count
track the total number of writes rather than the actual instance count. This is because deleting a<key, value>
pair sets thevalue
tozero()
rather than removing it. To manage storage efficiently, the algorithm checks existing keys from 0 to the current storage count during insertion. If azero()
value is found, that key is reused; otherwise, a new key-value pair is created and the key count is incremented.Breaking Changes
None.
Additional Info
N/A