-
Notifications
You must be signed in to change notification settings - Fork 54
feat(examples): Add "Time locked account" account abstraction example #8602
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(examples): Add "Time locked account" account abstraction example #8602
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 6 Skipped Deployments
|
4675a96 to
ca3aa5c
Compare
examples/move/account_template/tests/account_template_tests.move
Outdated
Show resolved
Hide resolved
examples/move/account_template/tests/account_template_tests.move
Outdated
Show resolved
Hide resolved
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.
I personally would prefer to create a dedicated PR for account_template, because it is an independent feature from the time_locked example.
|
@TheMrAI I see that the |
73999ed to
7020334
Compare
58d3a8a to
d6190de
Compare
borrow_uid remains until restructuring
The utility functions for building an account fulfill a completely different purpose from an actual account implementation. For this reason it makes sense to separate them as it makes it very clear what functionality may be problematic from a design perspective as well.
It muddies the interface, especially in terms of access control. Utility functions aren't concerned with access control, but all account functions should ensure that all access is correct. While in this case it doesn't change much, in more granular access controls it might become important if a clean pattern is established.
We named the module according to the name of the dynamic field struct. This is necessary to avoid name collisions within the testing framework while trying to compose multiple packages. package_A::name package_B::name package_C including both will collide, no matter if an alias or fully qualified names are used. In package_C one cannot override the address of pakcage_A or package_B either, so there is no convenient way to resolve collision.
These tests as the module are partial code duplications, but we don't want to refactor IOTAccount every time some new pattern should emerge. With this following refactor only has to remove the relevant code and tests from IOTAccount and transition to using these functions.
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.
I left a few comments, but overall it looks good to me!
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.
LGTM!
4c61aa5
into
vm-lang/aa-auth/8116-feature-branch
Description of change
Implement "Time locked account" example for abstract accounts.
This example explores the possibility of utilizing the authentication logic.
Each authenticator type can have a number of "reserved" dynamic fields and provide basic functions for attaching, detaching, rotating, checking and borrowing that type.
Properly using these functions is the responsibility of the implementer, but given the language restrictions this is a very flexible pattern.
Links to any relevant issues
fixes #8534
How the change has been tested