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

feat: Add constraint = attribute to #[light_accounts] macro #1217

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

vadorovsky
Copy link
Contributor

Similarly to Anchor's constraint = attribute, it can be used to ensure constraints for the given accounts. The constraint can use both regular and compressed accounts.

The most common use-case for it is ensuring the equality of public keys across regular and compressed accounts for security checks.

DNS example is updated to use it for ensuring that compressed NameRecord accounts can be modified only by original signers, with constraint = record.owner == signer.key().

Similarly to Anchor's `constraint =` attribute, it can be used to ensure
constraints for the given accounts. The constraint can use both regular
and compressed accounts.

The most common use-case for it is ensuring the equality of public keys
across regular and compressed accounts for security checks.

DNS example is updated to use it for ensuring that compressed
`NameRecord` accounts can be modified only by original signers, with
`constraint = record.owner == signer.key()`.
@ananas-block ananas-block merged commit d839539 into main Sep 13, 2024
8 checks passed
@ananas-block ananas-block deleted the vadorovsky/sdk-constraint branch September 13, 2024 13:05
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.

2 participants