pub fn assert_can_cancel(&self) -> Result<(), ProgramError> {
        match self.state {
            ProposalState::Draft | ProposalState::SigningOff | ProposalState::Voting => Ok(()),
            ProposalState::Executing
            | ProposalState::Completed
            | ProposalState::Cancelled
            | ProposalState::Succeeded
            | ProposalState::Defeated => {
                Err(GovernanceError::InvalidStateCannotCancelProposal.into())
            }
        }
    }
/// Checks if Proposal can be canceled in the given state
Checks if Proposal can be canceled in the given state
Checks if Proposal can be canceled in the given state
pub fn assert_can_cancel(&self) -> Result<(), ProgramError> {
        match self.state {
            ProposalState::Draft | ProposalState::SigningOff | ProposalState::Voting => Ok(()),
            ProposalState::Executing
            | ProposalState::Completed
            | ProposalState::Cancelled
            | ProposalState::Succeeded
            | ProposalState::Defeated => {
                Err(GovernanceError::InvalidStateCannotCancelProposal.into())
            }
        }
    }
pub fn assert_can_cancel ( & self ) -> Result < ( ) , ProgramError > { match self . state { ProposalState :: Draft | ProposalState :: SigningOff | ProposalState :: Voting => Ok ( ( ) ) , ProposalState :: Executing | ProposalState :: Completed | ProposalState :: Cancelled | ProposalState :: Succeeded | ProposalState :: Defeated => { Err ( GovernanceError :: InvalidStateCannotCancelProposal . into ( ) ) } } }
Checks if Proposal can be canceled in the given state
Checks if Proposal can be canceled in the given state
&self
&self