pub struct Proposal {
pub multisig: Pubkey,
pub transaction_index: u64,
pub status: ProposalStatus,
pub bump: u8,
pub approved: Vec<Pubkey>,
pub rejected: Vec<Pubkey>,
pub cancelled: Vec<Pubkey>,
}Expand description
Stores the data required for tracking the status of a multisig proposal.
Each Proposal has a 1:1 association with a transaction account, e.g. a VaultTransaction or a ConfigTransaction;
the latter can be executed only after the Proposal has been approved and its time lock is released.
Fields§
§multisig: PubkeyThe multisig this belongs to.
transaction_index: u64Index of the multisig transaction this proposal is associated with.
status: ProposalStatusThe status of the transaction.
bump: u8PDA bump.
approved: Vec<Pubkey>Keys that have approved/signed.
rejected: Vec<Pubkey>Keys that have rejected.
cancelled: Vec<Pubkey>Keys that have cancelled (Approved only).
Implementations§
Source§impl Proposal
impl Proposal
pub fn size(members_len: usize) -> usize
Sourcepub fn approve(&mut self, member: Pubkey, threshold: usize) -> Result<(), Error>
pub fn approve(&mut self, member: Pubkey, threshold: usize) -> Result<(), Error>
Register an approval vote.
Sourcepub fn reject(&mut self, member: Pubkey, cutoff: usize) -> Result<(), Error>
pub fn reject(&mut self, member: Pubkey, cutoff: usize) -> Result<(), Error>
Register a rejection vote.
Sourcepub fn cancel(&mut self, member: Pubkey, threshold: usize) -> Result<(), Error>
pub fn cancel(&mut self, member: Pubkey, threshold: usize) -> Result<(), Error>
Registers a cancellation vote.
Sourcepub fn realloc_if_needed<'a>(
proposal: AccountInfo<'a>,
members_length: usize,
rent_payer: Option<AccountInfo<'a>>,
system_program: Option<AccountInfo<'a>>,
) -> Result<bool, Error>
pub fn realloc_if_needed<'a>( proposal: AccountInfo<'a>, members_length: usize, rent_payer: Option<AccountInfo<'a>>, system_program: Option<AccountInfo<'a>>, ) -> Result<bool, Error>
Check if the proposal account space needs to be reallocated to accommodate cancelled vec.
Proposal size is crated at creation, and thus may not accomodate enough space for all members to cancel if more are added or changed
Returns true if the account was reallocated.
Trait Implementations§
Source§impl AccountDeserialize for Proposal
impl AccountDeserialize for Proposal
Source§fn try_deserialize(buf: &mut &[u8]) -> Result<Proposal, Error>
fn try_deserialize(buf: &mut &[u8]) -> Result<Proposal, Error>
Mint account into a token
Account.Source§impl AccountSerialize for Proposal
impl AccountSerialize for Proposal
Source§impl BorshDeserialize for Proposal
impl BorshDeserialize for Proposal
fn deserialize_reader<R>(reader: &mut R) -> Result<Proposal, Error>where
R: Read,
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for Proposalwhere
Pubkey: BorshSerialize,
u64: BorshSerialize,
ProposalStatus: BorshSerialize,
u8: BorshSerialize,
Vec<Pubkey>: BorshSerialize,
impl BorshSerialize for Proposalwhere
Pubkey: BorshSerialize,
u64: BorshSerialize,
ProposalStatus: BorshSerialize,
u8: BorshSerialize,
Vec<Pubkey>: BorshSerialize,
Source§impl Discriminator for Proposal
impl Discriminator for Proposal
Source§const DISCRIMINATOR: &'static [u8]
const DISCRIMINATOR: &'static [u8]
Auto Trait Implementations§
impl Freeze for Proposal
impl RefUnwindSafe for Proposal
impl Send for Proposal
impl Sync for Proposal
impl Unpin for Proposal
impl UnsafeUnpin for Proposal
impl UnwindSafe for Proposal
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more