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 #[instruction] attribute #1220

Merged
merged 1 commit into from
Sep 16, 2024
Merged

Conversation

vadorovsky
Copy link
Contributor

@vadorovsky vadorovsky commented Sep 14, 2024

Allow to reference the instruction parameters in seed = and constraint = parametes inside light_account attribute by exposing them through #[instruction] attribute. It works the same way as in Anchor.

Code example:

#[instruction(name: String)]
pub struct MyInstruction {
    #[light_account(init, seeds = [b"my-seed", name.as_bytes()])]
    pub my_cpda: MyCpdaType,

    [...]
}

@vadorovsky vadorovsky force-pushed the vadorovsky/sdk-instruction branch 2 times, most recently from 4a1856b to 026d748 Compare September 16, 2024 08:36
@vadorovsky vadorovsky marked this pull request as ready for review September 16, 2024 08:38
@vadorovsky vadorovsky force-pushed the vadorovsky/sdk-instruction branch from 026d748 to bf9d765 Compare September 16, 2024 08:42
Allow to reference the instruction parameters in `seed =` and
`constraint =` parametes inside `light_account` attribute by exposing
them through `#[instruction]` attribute. It works the same way as
in Anchor.

Code example:

    ```rust
    #[instruction]
    pub struct MyInstruction {
        #[light_account(init, seeds = [b"my-seed", name.as_bytes()])]
        pub my_cpda: MyCpdaType,

        [...]
    }
    ```
@vadorovsky vadorovsky force-pushed the vadorovsky/sdk-instruction branch from bf9d765 to 873068a Compare September 16, 2024 09:12
@ananas-block ananas-block merged commit a6d3b56 into main Sep 16, 2024
8 checks passed
@ananas-block ananas-block deleted the vadorovsky/sdk-instruction branch September 16, 2024 10:03
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