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

Clean up and small refactors to the access module #1221

Merged
merged 15 commits into from
Nov 20, 2024
Merged

Conversation

ggonzalez94
Copy link
Collaborator

@ggonzalez94 ggonzalez94 commented Nov 18, 2024

  • Add comments where missing

  • Small refactors

  • Remove a check in Ownable that verifies that sender is the zero address

  • Add a check to Ownable initializer that the owner is not being set to the zero address

  • Tests

  • Added entry to CHANGELOG.md

packages/access/src/accesscontrol/accesscontrol.cairo Outdated Show resolved Hide resolved
packages/access/src/accesscontrol/accesscontrol.cairo Outdated Show resolved Hide resolved
packages/access/src/ownable/ownable.cairo Outdated Show resolved Hide resolved
packages/access/src/ownable/ownable.cairo Show resolved Hide resolved
packages/access/src/ownable/ownable.cairo Show resolved Hide resolved
packages/access/src/ownable/ownable.cairo Outdated Show resolved Hide resolved
@ggonzalez94
Copy link
Collaborator Author

Should we update the Changelog to reflect any of these changes? I think ony the change in the initializer is worth calling out maybe

@ggonzalez94 ggonzalez94 marked this pull request as ready for review November 18, 2024 17:43
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.12%. Comparing base (4c0e16f) to head (0e71f5a).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1221      +/-   ##
==========================================
+ Coverage   92.06%   92.12%   +0.06%     
==========================================
  Files          49       49              
  Lines        1399     1397       -2     
==========================================
- Hits         1288     1287       -1     
+ Misses        111      110       -1     
Files with missing lines Coverage Δ
...kages/access/src/accesscontrol/accesscontrol.cairo 73.33% <100.00%> (ø)
packages/access/src/ownable/ownable.cairo 81.25% <100.00%> (+0.39%) ⬆️
packages/security/src/initializable.cairo 100.00% <ø> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c0e16f...0e71f5a. Read the comment docs.

---- 🚨 Try these New Features:

Copy link
Collaborator

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I left a few minor doc suggestions

packages/access/src/ownable/ownable.cairo Outdated Show resolved Hide resolved
packages/access/src/ownable/ownable.cairo Show resolved Hide resolved
Copy link
Member

@ericnordelo ericnordelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! The only missing things I see:

  • Updating the doc site accordingly
  • In line 69: {RoleAdminChanged} should use backticks instead.

@ggonzalez94
Copy link
Collaborator Author

All comments have been addressed and changelog has been updated.

Copy link
Member

@ericnordelo ericnordelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Collaborator

@immrsd immrsd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, left a couple of comments

packages/access/src/tests/test_ownable.cairo Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@ggonzalez94 ggonzalez94 requested a review from immrsd November 19, 2024 16:34
Copy link
Collaborator

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a final suggestion. Otherwise, LGTM!

docs/modules/ROOT/pages/api/access.adoc Outdated Show resolved Hide resolved
@ggonzalez94 ggonzalez94 merged commit f502aeb into main Nov 20, 2024
8 checks passed
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.

4 participants