Near-One / near-plugins

Implementation of common patterns used for NEAR smart contracts.
Creative Commons Zero v1.0 Universal
27 stars 12 forks source link

chore: make Acl role limit explicit #69

Closed mooori closed 1 year ago

mooori commented 1 year ago

Currently, if the enum that represents Acl roles has too many variants, compilation fails with an overflow error due to this type definition:

https://github.com/aurora-is-near/near-plugins/blob/dbec4424c5bbfad5fedbfcbe877ed16bacfa18f3/near-plugins-derive/src/access_control_role.rs#L194-L198

This might be hard to understand for developers using the plugin. The changes in this PR produce a more helpful error in case there are too many enum variants. In addition, an upcoming PR will rely on that limit, so better to have it explicitly defined.

mooori commented 1 year ago

CI failure is due to the PR being based on a external repo. Closing this in favor of #70, which is identical except that it’s based on a branch of this repo.