-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement config_delete_pointer and config_delete_profile
- Loading branch information
Showing
13 changed files
with
306 additions
and
12 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
anchor/programs/pubkey-protocol/src/instructions/config/config_delete_pointer.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use anchor_lang::prelude::*; | ||
|
||
use crate::errors::*; | ||
use crate::state::*; | ||
|
||
#[derive(Accounts)] | ||
#[instruction()] | ||
pub struct ConfigDeletePointer<'info> { | ||
#[account(mut)] | ||
pub config: Account<'info, Config>, | ||
#[account( | ||
mut, | ||
constraint = config.check_for_config_authority(&config_authority.key()) @ ProtocolError::UnAuthorizedCommunityAuthority | ||
)] | ||
pub config_authority: Signer<'info>, | ||
#[account( | ||
mut, | ||
close = config_authority, | ||
)] | ||
pub pointer: Account<'info, Pointer>, | ||
} | ||
|
||
pub fn config_delete_pointer(_ctx: Context<ConfigDeletePointer>) -> Result<()> { | ||
Ok(()) | ||
} |
25 changes: 25 additions & 0 deletions
25
anchor/programs/pubkey-protocol/src/instructions/config/config_delete_profile.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use anchor_lang::prelude::*; | ||
|
||
use crate::errors::*; | ||
use crate::state::*; | ||
|
||
#[derive(Accounts)] | ||
#[instruction()] | ||
pub struct ConfigDeleteProfile<'info> { | ||
#[account(mut)] | ||
pub config: Account<'info, Config>, | ||
#[account( | ||
mut, | ||
constraint = config.check_for_config_authority(&config_authority.key()) @ ProtocolError::UnAuthorizedCommunityAuthority | ||
)] | ||
pub config_authority: Signer<'info>, | ||
#[account( | ||
mut, | ||
close = config_authority, | ||
)] | ||
pub profile: Account<'info, Profile>, | ||
} | ||
|
||
pub fn config_delete_profile(_ctx: Context<ConfigDeleteProfile>) -> Result<()> { | ||
Ok(()) | ||
} |
4 changes: 4 additions & 0 deletions
4
anchor/programs/pubkey-protocol/src/instructions/config/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
pub mod config_delete_pointer; | ||
pub mod config_delete_profile; | ||
pub mod config_init; | ||
|
||
pub use config_delete_pointer::*; | ||
pub use config_delete_profile::*; | ||
pub use config_init::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.