Skip to content

Commit

Permalink
Replace #[account("...")] with #[account(constraint = "...")]
Browse files Browse the repository at this point in the history
Signed-off-by: Nikhil B N <[email protected]>
  • Loading branch information
NBNARADHYA committed Feb 14, 2022
1 parent 07eb693 commit 6d8bec7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lang/src/idl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub struct IdlSetBuffer<'info> {
//
// Note: we use the same account for the "write buffer", similar to the
// bpf upgradeable loader's mechanism.
#[account("internal")]
#[account(constraint = "internal")]
#[derive(Debug)]
pub struct IdlAccount {
// Address that can modify the IDL.
Expand Down
2 changes: 1 addition & 1 deletion tests/lockup/programs/lockup/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ pub struct WhitelistTransfer<'info> {
bump = vesting.nonce,
)]
vesting_signer: AccountInfo<'info>,
#[account("token_program.key == &token::ID")]
#[account(constraint = "token_program.key == &token::ID")]
token_program: AccountInfo<'info>,
#[account(mut)]
whitelisted_program_vault: AccountInfo<'info>,
Expand Down
6 changes: 3 additions & 3 deletions tests/lockup/programs/registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ pub struct Initialize<'info> {
registrar: Account<'info, Registrar>,
#[account(zero)]
reward_event_q: Account<'info, RewardQueue>,
#[account("pool_mint.decimals == 0")]
#[account(constraint = "pool_mint.decimals == 0")]
pool_mint: Account<'info, Mint>,
}

Expand Down Expand Up @@ -621,7 +621,7 @@ pub struct CreateMember<'info> {
balances_locked: BalanceSandboxAccounts<'info>,
member_signer: AccountInfo<'info>,
// Misc.
#[account("token_program.key == &token::ID")]
#[account(constraint = "token_program.key == &token::ID")]
token_program: AccountInfo<'info>,
}

Expand Down Expand Up @@ -952,7 +952,7 @@ pub struct ClaimReward<'info> {
pub struct ClaimRewardLocked<'info> {
cmn: ClaimRewardCommon<'info>,
registry: ProgramState<'info, Registry>,
#[account("lockup_program.key == &registry.lockup_program")]
#[account(constraint = "lockup_program.key == &registry.lockup_program")]
lockup_program: AccountInfo<'info>,
}

Expand Down

0 comments on commit 6d8bec7

Please sign in to comment.