Skip to content

Commit

Permalink
Fixed [P1-L-05] Unvalidated "delegate_voter.registrar"
Browse files Browse the repository at this point in the history
by adding has_one = registrar constraint to the delegate_voter
  • Loading branch information
kstepanovdev committed Sep 27, 2024
1 parent 24b39ba commit c89749b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub struct ChangeDelegate<'info> {
pub voter: AccountLoader<'info, Voter>,
pub voter_authority: Signer<'info>,

#[account(has_one = registrar)]
pub delegate_voter: AccountLoader<'info, Voter>,

/// CHECK: Mining Account that belongs to Rewards Program and some delegate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub struct CreateDepositEntry<'info> {
)]
pub vault: Box<Account<'info, TokenAccount>>,
pub voter_authority: Signer<'info>,
#[account(has_one = registrar)]
pub delegate_voter: AccountLoader<'info, Voter>,

#[account(mut)]
Expand Down

0 comments on commit c89749b

Please sign in to comment.