Skip to content

Conversation

@Reinis-FRP
Copy link
Contributor

@Reinis-FRP Reinis-FRP commented Oct 16, 2024

This proposes to standardize formatting of Solana program imports grouping them in 3 blocks separated by newline:

  • standard library imports
  • external imports
  • current crate imports
    Also avoids replicated use statements and has nested grouping when imports share the same root.

Fixes: https://linear.app/uma/issue/ACX-2911/instructionsadminrs-standardize-imports-across-all-files

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
pub struct Initialize<'info> {
#[account(init, // Use init, not init_if_needed to prevent re-initialization.
payer = signer,
space = DISCRIMINATOR_SIZE + State::INIT_SPACE, // TODO: check that INIT_SPACE is used everywhere
Copy link
Contributor Author

Choose a reason for hiding this comment

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

checked this, no changes needed, so removed the comment just to avoid separate PR for that.

use anchor_spl::associated_token::AssociatedToken;
use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface};

// TODO: check that the discriminator size is used everywhere
Copy link
Contributor Author

Choose a reason for hiding this comment

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

checked this, no changes needed, so removed the comment just to avoid separate PR for that.

@linear
Copy link

linear bot commented Oct 16, 2024

@Reinis-FRP Reinis-FRP requested review from chrismaree and md0x October 16, 2024 12:30
@Reinis-FRP Reinis-FRP merged commit 2ddf687 into master Oct 18, 2024
9 checks passed
@Reinis-FRP Reinis-FRP deleted the reinis-frp/svm-imports branch October 18, 2024 09:10
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.

3 participants