pub fn governance_get_instruction(
        &self,
        governance_name: &str,
        proposal_index: u32,
        instruction_index: u16,
    ) -> Result<Instruction, 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 instruction_address = get_proposal_instruction_address(
            &dao_program,
            &proposal_address,
            &0u16.to_le_bytes(),
            &instruction_index.to_le_bytes(),
        );

        let data = self.rpc_client.get_account_data(&instruction_address)?;
        let ins_data: InstructionData =
            try_from_slice_unchecked::<ProposalInstructionV2>(data.as_slice())
                .map_err(|e| FarmClientError::IOError(e.to_string()))?
                .instruction;
        Ok((&ins_data).into())
    }
// Returns stored instruction in the proposal
Returns stored instruction in the proposal
Returns stored instruction in the proposal
pub fn governance_get_instruction(
        &self,
        governance_name: &str,
        proposal_index: u32,
        instruction_index: u16,
    ) -> Result<Instruction, 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 instruction_address = get_proposal_instruction_address(
            &dao_program,
            &proposal_address,
            &0u16.to_le_bytes(),
            &instruction_index.to_le_bytes(),
        );
        let data = self.rpc_client.get_account_data(&instruction_address)?;
        let ins_data: InstructionData =
            try_from_slice_unchecked::<ProposalInstructionV2>(data.as_slice())
                .map_err(|e| FarmClientError::IOError(e.to_string()))?
                .instruction;
        Ok((&ins_data).into())
    }
pub fn governance_get_instruction ( & self , governance_name : & str , proposal_index : u32 , instruction_index : u16 , ) -> Result < Instruction , 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 instruction_address = get_proposal_instruction_address ( & dao_program , & proposal_address , & 0u16 . to_le_bytes ( ) , & instruction_index . to_le_bytes ( ) , ) ; let data = self . rpc_client . get_account_data ( & instruction_address ) ? ; let ins_data : InstructionData = try_from_slice_unchecked :: < ProposalInstructionV2 > ( data . as_slice ( ) ) . map_err ( | e | FarmClientError :: IOError ( e . to_string ( ) ) ) ? . instruction ; Ok ( ( & ins_data ) . into ( ) ) }
Returns stored instruction in the proposal
Returns stored instruction in the proposal
&self
governance_name
&str
proposal_index
u32
instruction_index
u16
&self
governance_name
&str
proposal_index
u32
instruction_index
u16