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

_setRootStates Stores ACL and DRP State as references #434

Closed
trungnotchung opened this issue Feb 5, 2025 · 0 comments · Fixed by #437
Closed

_setRootStates Stores ACL and DRP State as references #434

trungnotchung opened this issue Feb 5, 2025 · 0 comments · Fixed by #437
Assignees
Labels
bug Something isn't working

Comments

@trungnotchung
Copy link
Member

_setRootStates assigns aclState and drpState as references instead of deep copies:

this.aclStates.set(HashGraph.rootHash, { state: aclState });
this.drpStates.set(HashGraph.rootHash, { state: drpState });

Since aclState and drpState reference acl and drp, updates to these objects also modify the root vertex state, causing unintended changes.

@trungnotchung trungnotchung added the bug Something isn't working label Feb 5, 2025
@trungnotchung trungnotchung self-assigned this Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant