pub struct MaxVoterWeightRecord {
pub account_discriminator: [u8; 8],
pub realm: Pubkey,
pub governing_token_mint: Pubkey,
pub max_voter_weight: u64,
pub max_voter_weight_expiry: Option<Slot>,
pub reserved: [u8; 8],
}
Expand description
MaxVoterWeightRecord account The account is used as an api interface to provide max voting power to the governance program from external addin contracts
Fields
account_discriminator: [u8; 8]
VoterWeightRecord discriminator sha256(“account:MaxVoterWeightRecord”)[..8] Note: The discriminator size must match the addin implementing program discriminator size to ensure it’s stored in the private space of the account data and it’s unique
realm: Pubkey
The Realm the MaxVoterWeightRecord belongs to
governing_token_mint: Pubkey
Governing Token Mint the MaxVoterWeightRecord is associated with Note: The addin can take deposits of any tokens and is not restricted to the community or council tokens only
max_voter_weight: u64
Max voter weight The max voter weight provided by the addin for the given realm and governing_token_mint
max_voter_weight_expiry: Option<Slot>
The slot when the max voting weight expires It should be set to None if the weight never expires If the max vote weight decays with time, for example for time locked based weights, then the expiry must be set As a pattern Revise instruction to update the max weight should be invoked before governance instruction within the same transaction and the expiry set to the current slot to provide up to date weight
reserved: [u8; 8]
Reserved space for future versions
Implementations
sourceimpl MaxVoterWeightRecord
impl MaxVoterWeightRecord
sourcepub const ACCOUNT_DISCRIMINATOR: [u8; 8]
pub const ACCOUNT_DISCRIMINATOR: [u8; 8]
sha256(“account:MaxVoterWeightRecord”)[..8]
Trait Implementations
sourceimpl AccountMaxSize for MaxVoterWeightRecord
impl AccountMaxSize for MaxVoterWeightRecord
sourcefn get_max_size(&self) -> Option<usize>
fn get_max_size(&self) -> Option<usize>
Returns max account size or None if max size is not known and actual instance size should be used
sourceimpl BorshDeserialize for MaxVoterWeightRecord where
[u8; 8]: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
Option<Slot>: BorshDeserialize,
[u8; 8]: BorshDeserialize,
impl BorshDeserialize for MaxVoterWeightRecord where
[u8; 8]: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
Option<Slot>: BorshDeserialize,
[u8; 8]: BorshDeserialize,
sourceimpl BorshSchema for MaxVoterWeightRecord where
[u8; 8]: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
u64: BorshSchema,
Option<Slot>: BorshSchema,
[u8; 8]: BorshSchema,
impl BorshSchema for MaxVoterWeightRecord where
[u8; 8]: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
u64: BorshSchema,
Option<Slot>: BorshSchema,
[u8; 8]: 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 MaxVoterWeightRecord where
[u8; 8]: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u64: BorshSerialize,
Option<Slot>: BorshSerialize,
[u8; 8]: BorshSerialize,
impl BorshSerialize for MaxVoterWeightRecord where
[u8; 8]: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u64: BorshSerialize,
Option<Slot>: BorshSerialize,
[u8; 8]: BorshSerialize,
sourceimpl Clone for MaxVoterWeightRecord
impl Clone for MaxVoterWeightRecord
sourcefn clone(&self) -> MaxVoterWeightRecord
fn clone(&self) -> MaxVoterWeightRecord
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 MaxVoterWeightRecord
impl Debug for MaxVoterWeightRecord
sourceimpl IsInitialized for MaxVoterWeightRecord
impl IsInitialized for MaxVoterWeightRecord
sourcefn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
Is initialized
sourceimpl PartialEq<MaxVoterWeightRecord> for MaxVoterWeightRecord
impl PartialEq<MaxVoterWeightRecord> for MaxVoterWeightRecord
sourcefn eq(&self, other: &MaxVoterWeightRecord) -> bool
fn eq(&self, other: &MaxVoterWeightRecord) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &MaxVoterWeightRecord) -> bool
fn ne(&self, other: &MaxVoterWeightRecord) -> bool
This method tests for !=
.
impl StructuralPartialEq for MaxVoterWeightRecord
Auto Trait Implementations
impl RefUnwindSafe for MaxVoterWeightRecord
impl Send for MaxVoterWeightRecord
impl Sync for MaxVoterWeightRecord
impl Unpin for MaxVoterWeightRecord
impl UnwindSafe for MaxVoterWeightRecord
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