Skip to content

feat: add PDA size derivation in anchor#38

Open
unive3sal wants to merge 1 commit intosolana-foundation:mainfrom
unive3sal:anchor
Open

feat: add PDA size derivation in anchor#38
unive3sal wants to merge 1 commit intosolana-foundation:mainfrom
unive3sal:anchor

Conversation

@unive3sal
Copy link
Copy Markdown
Contributor

Hi,

Would you please kindly review this change?

I raise this PR because I met this problem during my development. Here is the commit for your reference:
PinkPlants/pactum@9acef99#diff-525ff2c25561ab1bb4a21349fa32321ac40f9b40dd6f2fc5a36cd9e6a37046b6


### Account Size

Use `#[derive(InitSpace)]` to derive PDA data size instead of calculate it manually.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use `#[derive(InitSpace)]` to derive PDA data size instead of calculate it manually.
Use `#[derive(InitSpace)]` to derive PDA data size instead of calculating it manually.

@unive3sal
Copy link
Copy Markdown
Contributor Author

I've updated according to your comments

@unive3sal unive3sal requested a review from MicaiahReid March 20, 2026 07:18
Copy link
Copy Markdown
Contributor

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking better, almost there! Thank you @unive3sal!

@unive3sal
Copy link
Copy Markdown
Contributor Author

Hi @MicaiahReid Thanks for your comments. I've updated the commit.

Copy link
Copy Markdown
Contributor

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @unive3sal!

use InitSpace macro to derive PDA account size
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