Struct spl_governance::state::realm::RealmV2
source · pub struct RealmV2 {
pub account_type: GovernanceAccountType,
pub community_mint: Pubkey,
pub config: RealmConfig,
pub reserved: [u8; 6],
pub legacy1: u16,
pub authority: Option<Pubkey>,
pub name: String,
pub reserved_v2: [u8; 128],
}
Expand description
Governance Realm Account Account PDA seeds“ [‘governance’, name]
Fields§
§account_type: GovernanceAccountType
Governance account type
community_mint: Pubkey
Community mint
config: RealmConfig
Configuration of the Realm
reserved: [u8; 6]
Reserved space for future versions
legacy1: u16
Legacy field not used since program V3 any longer Note: If the field is going to be reused in future version it must be taken under consideration that for some Realms it might be already set to none zero because it was used as voting_proposal_count before
Realm authority. The authority must sign transactions which update the realm config The authority should be transferred to Realm Governance to make the Realm self governed through proposals
name: String
Governance Realm name
reserved_v2: [u8; 128]
Reserved space for versions v2 and onwards Note: V1 accounts must be resized before using this space
Implementations§
source§impl RealmV2
impl RealmV2
sourcepub fn assert_is_valid_governing_token_mint(
&self,
governing_token_mint: &Pubkey
) -> Result<(), ProgramError>
pub fn assert_is_valid_governing_token_mint( &self, governing_token_mint: &Pubkey ) -> Result<(), ProgramError>
Asserts the given mint is either Community or Council mint of the Realm
sourcepub fn get_proposal_governing_token_mint_for_vote(
&self,
vote_governing_token_mint: &Pubkey,
vote_kind: &VoteKind
) -> Result<Pubkey, ProgramError>
pub fn get_proposal_governing_token_mint_for_vote( &self, vote_governing_token_mint: &Pubkey, vote_kind: &VoteKind ) -> Result<Pubkey, ProgramError>
Returns the governing token mint which is used to vote on a proposal given the provided Vote kind and vote_governing_token_mint
Veto vote is cast on a proposal configured for the opposite voting population defined using governing_token_mint Council can veto Community vote and Community can veto Council assuming the veto for the voting population is enabled
For all votes other than Veto (Electorate votes) the vote_governing_token_mint is the same as Proposal governing_token_mint
sourcepub fn assert_is_valid_governing_token_mint_and_holding(
&self,
program_id: &Pubkey,
realm: &Pubkey,
governing_token_mint: &Pubkey,
governing_token_holding: &Pubkey
) -> Result<(), ProgramError>
pub fn assert_is_valid_governing_token_mint_and_holding( &self, program_id: &Pubkey, realm: &Pubkey, governing_token_mint: &Pubkey, governing_token_holding: &Pubkey ) -> Result<(), ProgramError>
Asserts the given governing token mint and holding accounts are valid for the realm
Assert the given create authority can create governance