pub fn governance_get_proposal_state(
        &self,
        governance_name: &str,
        proposal_index: u32,
    ) -> Result<ProposalV2, FarmClientError> {
        let dao_program = self.get_program_id(DAO_PROGRAM_NAME)?;
        let dao_token = self.get_token(DAO_TOKEN_NAME)?;
        let governance = self.governance_get_address(governance_name)?;
        let proposal_address = get_proposal_address(
            &dao_program,
            &governance,
            &dao_token.mint,
            &proposal_index.to_le_bytes(),
        );

        let proposal_data = self.rpc_client.get_account_data(&proposal_address)?;
        let proposal_state: ProposalV2 = try_from_slice_unchecked(&proposal_data)
            .map_err(|e| FarmClientError::IOError(e.to_string()))?;

        Ok(proposal_state)
    }
/// Returns the state of the proposal
Returns the state of the proposal
Returns the state of the proposal
pub fn governance_get_proposal_state(
        &self,
        governance_name: &str,
        proposal_index: u32,
    ) -> Result<ProposalV2, FarmClientError> {
        let dao_program = self.get_program_id(DAO_PROGRAM_NAME)?;
        let dao_token = self.get_token(DAO_TOKEN_NAME)?;
        let governance = self.governance_get_address(governance_name)?;
        let proposal_address = get_proposal_address(
            &dao_program,
            &governance,
            &dao_token.mint,
            &proposal_index.to_le_bytes(),
        );
        let proposal_data = self.rpc_client.get_account_data(&proposal_address)?;
        let proposal_state: ProposalV2 = try_from_slice_unchecked(&proposal_data)
            .map_err(|e| FarmClientError::IOError(e.to_string()))?;
        Ok(proposal_state)
    }
pub fn governance_get_proposal_state ( & self , governance_name : & str , proposal_index : u32 , ) -> Result < ProposalV2 , FarmClientError > { let dao_program = self . get_program_id ( DAO_PROGRAM_NAME ) ? ; let dao_token = self . get_token ( DAO_TOKEN_NAME ) ? ; let governance = self . governance_get_address ( governance_name ) ? ; let proposal_address = get_proposal_address ( & dao_program , & governance , & dao_token . mint , & proposal_index . to_le_bytes ( ) , ) ; let proposal_data = self . rpc_client . get_account_data ( & proposal_address ) ? ; let proposal_state : ProposalV2 = try_from_slice_unchecked ( & proposal_data ) . map_err ( | e | FarmClientError :: IOError ( e . to_string ( ) ) ) ? ; Ok ( proposal_state ) }
Returns the state of the proposal
Returns the state of the proposal
&self
governance_name
&str
proposal_index
u32
&self
governance_name
&str
proposal_index
u32