Closed ametel01 closed 1 year ago
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
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 (given_...
)
Sorry I wasn't clear but the test you renamed was the one with good naming :)
Rename other tests following the same pattern (
given_...
)
done
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