Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit c857fd8

Browse files
authored
Governance: Remove assert_can_flag_transaction_error (#6366)
chore: Remove assert_can_flag_transaction_error
1 parent 95dd495 commit c857fd8

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

governance/program/src/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ pub enum GovernanceError {
269269
#[error("Governance PDA must sign")]
270270
GovernancePdaMustSign, // 561
271271

272-
/// Transaction already flagged with error
273-
#[error("Transaction already flagged with error")]
274-
TransactionAlreadyFlaggedWithError, // 562
272+
/// Previously TransactionAlreadyFlaggedWithError
273+
#[error("Legacy2")]
274+
Legacy2, // 562
275275

276276
/// Invalid Realm for Governance
277277
#[error("Invalid Realm for Governance")]

governance/program/src/state/enums.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ pub enum TransactionExecutionStatus {
214214
Success,
215215

216216
/// Transaction execution failed
217+
/// Note: The field is not used any longer
217218
Error,
218219
}
219220

governance/program/src/state/proposal.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use {
1010
state::{
1111
enums::{
1212
GovernanceAccountType, InstructionExecutionFlags, MintMaxVoterWeightSource,
13-
ProposalState, TransactionExecutionStatus, VoteThreshold, VoteTipping,
13+
ProposalState, VoteThreshold, VoteTipping,
1414
},
1515
governance::GovernanceConfig,
1616
legacy::ProposalV1,
@@ -880,23 +880,6 @@ impl ProposalV2 {
880880
Ok(())
881881
}
882882

883-
/// Checks if the instruction can be flagged with error for the Proposal in
884-
/// the given state
885-
pub fn assert_can_flag_transaction_error(
886-
&self,
887-
proposal_transaction_data: &ProposalTransactionV2,
888-
current_unix_timestamp: UnixTimestamp,
889-
) -> Result<(), ProgramError> {
890-
// Instruction can be flagged for error only when it's eligible for execution
891-
self.assert_can_execute_transaction(proposal_transaction_data, current_unix_timestamp)?;
892-
893-
if proposal_transaction_data.execution_status == TransactionExecutionStatus::Error {
894-
return Err(GovernanceError::TransactionAlreadyFlaggedWithError.into());
895-
}
896-
897-
Ok(())
898-
}
899-
900883
/// Checks if Proposal with off-chain/manual actions can be transitioned to
901884
/// Completed
902885
pub fn assert_can_complete(&self) -> Result<(), ProgramError> {

0 commit comments

Comments
 (0)