Struct spl_governance::state::legacy::TokenOwnerRecordV1
source · [−]#[repr(C)]pub struct TokenOwnerRecordV1 {
pub account_type: GovernanceAccountType,
pub realm: Pubkey,
pub governing_token_mint: Pubkey,
pub governing_token_owner: Pubkey,
pub governing_token_deposit_amount: u64,
pub unrelinquished_votes_count: u32,
pub total_votes_count: u32,
pub outstanding_proposal_count: u8,
pub reserved: [u8; 7],
pub governance_delegate: Option<Pubkey>,
}
Expand description
Governance Token Owner Record Account PDA seeds: [‘governance’, realm, token_mint, token_owner ]
Fields
account_type: GovernanceAccountType
Governance account type
realm: Pubkey
The Realm the TokenOwnerRecord belongs to
governing_token_mint: Pubkey
Governing Token Mint the TokenOwnerRecord holds deposit for
governing_token_owner: Pubkey
The owner (either single or multisig) of the deposited governing SPL Tokens This is who can authorize a withdrawal of the tokens
governing_token_deposit_amount: u64
The amount of governing tokens deposited into the Realm This amount is the voter weight used when voting on proposals
unrelinquished_votes_count: u32
The number of votes cast by TokenOwner but not relinquished yet Every time a vote is cast this number is increased and it’s always decreased when relinquishing a vote regardless of the vote state
total_votes_count: u32
The total number of votes cast by the TokenOwner If TokenOwner withdraws vote while voting is still in progress total_votes_count is decreased and the vote doesn’t count towards the total
outstanding_proposal_count: u8
The number of outstanding proposals the TokenOwner currently owns The count is increased when TokenOwner creates a proposal and decreased once it’s either voted on (Succeeded or Defeated) or Cancelled By default it’s restricted to 1 outstanding Proposal per token owner
reserved: [u8; 7]
Reserved space for future versions
governance_delegate: Option<Pubkey>
A single account that is allowed to operate governance with the deposited governing tokens It can be delegated to by the governing_token_owner or current governance_delegate
Trait Implementations
impl BorshDeserialize for TokenOwnerRecordV1 where
GovernanceAccountType: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
u32: BorshDeserialize,
u32: BorshDeserialize,
u8: BorshDeserialize,
[u8; 7]: BorshDeserialize,
Option<Pubkey>: BorshDeserialize,
impl BorshDeserialize for TokenOwnerRecordV1 where
GovernanceAccountType: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
u32: BorshDeserialize,
u32: BorshDeserialize,
u8: BorshDeserialize,
[u8; 7]: BorshDeserialize,
Option<Pubkey>: BorshDeserialize,
impl BorshSchema for TokenOwnerRecordV1 where
GovernanceAccountType: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
u64: BorshSchema,
u32: BorshSchema,
u32: BorshSchema,
u8: BorshSchema,
[u8; 7]: BorshSchema,
Option<Pubkey>: BorshSchema,
impl BorshSchema for TokenOwnerRecordV1 where
GovernanceAccountType: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
u64: BorshSchema,
u32: BorshSchema,
u32: BorshSchema,
u8: BorshSchema,
[u8; 7]: BorshSchema,
Option<Pubkey>: BorshSchema,
Get the name of the type without brackets.
Recursively, using DFS, add type definitions required for this type. For primitive types this is an empty map. Type definition explains how to serialize/deserialize a type. Read more
fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
Helper method to add a single type definition to the map.
Is initialized
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for TokenOwnerRecordV1
impl Send for TokenOwnerRecordV1
impl Sync for TokenOwnerRecordV1
impl Unpin for TokenOwnerRecordV1
impl UnwindSafe for TokenOwnerRecordV1
Blanket Implementations
pub default fn example() -> T
Mutably borrows from an owned value. Read more