1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use {crate::state::*, anchor_lang::prelude::*};
#[derive(Accounts)]
#[instruction(
new_admin_authority: Pubkey,
)]
pub struct ConfigUpdateAdminAuthority<'info> {
#[account(
mut,
address = config.admin_authority,
)]
pub admin: Signer<'info>,
#[account(
mut,
seeds = [SEED_CONFIG],
bump = config.bump,
owner = crate::ID,
)]
pub config: Account<'info, Config>,
}
pub fn handler(
ctx: Context<ConfigUpdateAdminAuthority>,
new_admin_authority: Pubkey,
) -> ProgramResult {
let config = &mut ctx.accounts.config;
config.admin_authority = new_admin_authority;
Ok(())
}