Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Update account seed management in badge and issuer modules #19

Merged
merged 1 commit into from
May 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions programs/gpl_core/src/instructions/badge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct CreateBadge<'info> {
)]
pub badge: Account<'info, Badge>,
#[account(
seeds = [Issuer::SEED_PREFIX.as_bytes(), issuer.key().as_ref()],
seeds = [Issuer::SEED_PREFIX.as_bytes(), authority.key().as_ref()],
abishekk92 marked this conversation as resolved.
Show resolved Hide resolved
bump,
has_one = authority
)]
Expand Down Expand Up @@ -76,7 +76,7 @@ pub struct UpdateBadge<'info> {
)]
pub badge: Account<'info, Badge>,
#[account(
seeds = [Issuer::SEED_PREFIX.as_bytes(), issuer.key().as_ref()],
seeds = [Issuer::SEED_PREFIX.as_bytes(), signer.key().as_ref()],
bump,
)]
pub issuer: Account<'info, Issuer>,
Expand Down Expand Up @@ -104,7 +104,7 @@ pub fn update_badge_handler(ctx: Context<UpdateBadge>, metadata_uri: String) ->
pub struct BurnBadge<'info> {
#[account(
mut,
seeds = [Badge::SEED_PREFIX.as_bytes(), issuer.key().as_ref()],
seeds = [Badge::SEED_PREFIX.as_bytes(), issuer.key().as_ref(), holder.key().as_ref()],
abishekk92 marked this conversation as resolved.
Show resolved Hide resolved
bump,
has_one = issuer,
has_one = holder,
Expand All @@ -122,7 +122,7 @@ pub struct BurnBadge<'info> {
pub holder: Account<'info, Profile>,

#[account(
seeds = [Issuer::SEED_PREFIX.as_bytes(), issuer.key().as_ref()],
seeds = [Issuer::SEED_PREFIX.as_bytes(), signer.key().as_ref()],
bump,
)]
pub issuer: Account<'info, Issuer>,
Expand Down Expand Up @@ -253,7 +253,7 @@ pub fn create_issuer_handler(ctx: Context<CreateIssuer>) -> Result<()> {
pub struct DeleteIssuer<'info> {
#[account(
mut,
seeds = [Issuer::SEED_PREFIX.as_bytes(), issuer.key().as_ref()],
seeds = [Issuer::SEED_PREFIX.as_bytes(), authority.key().as_ref()],
bump,
has_one = authority,
close = authority
Expand Down