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
sourceimpl 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,
sourceimpl 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,
sourcefn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
sourcefn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
fn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
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
sourcefn 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.
fn schema_container() -> BorshSchemaContainer
sourceimpl BorshSerialize for TokenOwnerRecordV1 where
GovernanceAccountType: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u64: BorshSerialize,
u32: BorshSerialize,
u32: BorshSerialize,
u8: BorshSerialize,
[u8; 7]: BorshSerialize,
Option<Pubkey>: BorshSerialize,
impl BorshSerialize for TokenOwnerRecordV1 where
GovernanceAccountType: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u64: BorshSerialize,
u32: BorshSerialize,
u32: BorshSerialize,
u8: BorshSerialize,
[u8; 7]: BorshSerialize,
Option<Pubkey>: BorshSerialize,
sourceimpl Clone for TokenOwnerRecordV1
impl Clone for TokenOwnerRecordV1
sourcefn clone(&self) -> TokenOwnerRecordV1
fn clone(&self) -> TokenOwnerRecordV1
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TokenOwnerRecordV1
impl Debug for TokenOwnerRecordV1
sourceimpl IsInitialized for TokenOwnerRecordV1
impl IsInitialized for TokenOwnerRecordV1
sourcefn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
Is initialized
sourceimpl PartialEq<TokenOwnerRecordV1> for TokenOwnerRecordV1
impl PartialEq<TokenOwnerRecordV1> for TokenOwnerRecordV1
sourcefn eq(&self, other: &TokenOwnerRecordV1) -> bool
fn eq(&self, other: &TokenOwnerRecordV1) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &TokenOwnerRecordV1) -> bool
fn ne(&self, other: &TokenOwnerRecordV1) -> bool
This method tests for !=
.
impl StructuralPartialEq for TokenOwnerRecordV1
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
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more