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
use borsh::{BorshDeserialize, BorshSchema, BorshSerialize};
use solana_program::pubkey::Pubkey;
use spl_governance_tools::account::AccountMaxSize;
#[derive(Clone, Debug, PartialEq, BorshDeserialize, BorshSerialize, BorshSchema)]
pub struct NativeTreasury {}
impl AccountMaxSize for NativeTreasury {
fn get_max_size(&self) -> Option<usize> {
Some(0)
}
}
pub fn get_native_treasury_address_seeds(governance: &Pubkey) -> [&[u8]; 2] {
[b"native-treasury", governance.as_ref()]
}
pub fn get_native_treasury_address(program_id: &Pubkey, governance: &Pubkey) -> Pubkey {
Pubkey::find_program_address(&get_native_treasury_address_seeds(governance), program_id).0
}