pub struct Proposal {Show 15 fields
pub governor: Pubkey,
pub index: u64,
pub bump: u8,
pub proposer: Pubkey,
pub quorum_votes: u64,
pub for_votes: u64,
pub against_votes: u64,
pub abstain_votes: u64,
pub canceled_at: i64,
pub created_at: i64,
pub activated_at: i64,
pub voting_ends_at: i64,
pub queued_at: i64,
pub queued_transaction: Pubkey,
pub instructions: Vec<ProposalInstruction>,
}Expand description
A Proposal is a pending transaction that may or may not be executed by the DAO.
Fields
governor: PubkeyThe public key of the governor.
index: u64The unique ID of the proposal, auto-incremented.
bump: u8Bump seed
proposer: PubkeyThe public key of the proposer.
quorum_votes: u64The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
for_votes: u64Current number of votes in favor of this proposal
against_votes: u64Current number of votes in opposition to this proposal
abstain_votes: u64Current number of votes for abstaining for this proposal
canceled_at: i64The timestamp when the proposal was canceled.
created_at: i64The timestamp when the proposal was created.
activated_at: i64The timestamp in which the proposal was activated. This is when voting begins.
voting_ends_at: i64The timestamp when voting ends. This only applies to active proposals.
queued_at: i64The timestamp in which the proposal was queued, i.e. approved for execution on the Smart Wallet.
queued_transaction: PubkeyIf the transaction was queued, this is the associated Goki Smart Wallet transaction.
instructions: Vec<ProposalInstruction>The instructions associated with the proposal.
Implementations
sourceimpl Proposal
impl Proposal
sourcepub fn get_state(&self) -> Result<ProposalState>
pub fn get_state(&self) -> Result<ProposalState>
Gets the state.
sourcepub fn meets_quorum(&self, quorum_votes: u64) -> Option<bool>
pub fn meets_quorum(&self, quorum_votes: u64) -> Option<bool>
Checks if the proposal meets quorum; that is, enough votes were made on the proposal.
sourcepub fn state(&self, current_time: i64) -> Option<ProposalState>
pub fn state(&self, current_time: i64) -> Option<ProposalState>
The state of the proposal. See ProposalState for more details. Adapted from https://github.com/compound-finance/compound-protocol/blob/4a8648ec0364d24c4ecfc7d6cae254f55030d65f/contracts/Governance/GovernorBravoDelegate.sol#L205
sourcepub fn to_smart_wallet_instructions(&self) -> Vec<TXInstruction>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn to_smart_wallet_instructions(&self) -> Vec<TXInstruction>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Converts this proposal to Smart Wallet smart_wallet::TXInstructions.
Trait Implementations
sourceimpl AccountDeserialize for Proposal
impl AccountDeserialize for Proposal
sourcefn try_deserialize(buf: &mut &[u8]) -> Result<Self, ProgramError>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self, ProgramError>
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program were to implement this trait,
it should be impossible to deserialize a Mint account into a token
Account. Read more
sourceimpl AccountSerialize for Proposal
impl AccountSerialize for Proposal
sourceimpl BorshDeserialize for Proposal where
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
u8: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
Pubkey: BorshDeserialize,
Vec<ProposalInstruction>: BorshDeserialize,
impl BorshDeserialize for Proposal where
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
u8: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
Pubkey: BorshDeserialize,
Vec<ProposalInstruction>: BorshDeserialize,
sourceimpl BorshSerialize for Proposal where
Pubkey: BorshSerialize,
u64: BorshSerialize,
u8: BorshSerialize,
Pubkey: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
Pubkey: BorshSerialize,
Vec<ProposalInstruction>: BorshSerialize,
impl BorshSerialize for Proposal where
Pubkey: BorshSerialize,
u64: BorshSerialize,
u8: BorshSerialize,
Pubkey: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
Pubkey: BorshSerialize,
Vec<ProposalInstruction>: BorshSerialize,
sourceimpl Discriminator for Proposal
impl Discriminator for Proposal
fn discriminator() -> [u8; 8]
Auto Trait Implementations
impl RefUnwindSafe for Proposal
impl Send for Proposal
impl Sync for Proposal
impl Unpin for Proposal
impl UnwindSafe for Proposal
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
pub default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more