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

Commit 95dd495

Browse files
authored
Governance: Remove FlagTransactionError instruction (#6365)
chore: Remove FlagTransactionError instruction
1 parent ee9dd75 commit 95dd495

File tree

5 files changed

+7
-584
lines changed

5 files changed

+7
-584
lines changed

governance/program/src/instruction.rs

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -412,19 +412,9 @@ pub enum GovernanceInstruction {
412412
config: GovernanceConfig,
413413
},
414414

415-
/// Flags a transaction and its parent Proposal with error status
416-
/// It can be used by Proposal owner in case the transaction is permanently
417-
/// broken and can't be executed.
418-
/// Note: This instruction is a workaround because currently it's not
419-
/// possible to catch errors from CPI calls and the Governance program has
420-
/// no way to know when instruction failed and flag it automatically.
421-
///
422-
/// 0. `[writable]` Proposal account
423-
/// 1. `[]` TokenOwnerRecord account of the Proposal owner
424-
/// 2. `[signer]` Governance Authority (Token Owner or Governance
425-
/// Delegate)
426-
/// 3. `[writable]` ProposalTransaction account to flag
427-
FlagTransactionError,
415+
/// Legacy FlagTransactionError instruction
416+
/// Exists for backwards-compatibility
417+
Legacy5,
428418

429419
/// Sets new Realm authority
430420
///
@@ -1291,31 +1281,6 @@ pub fn set_governance_config(
12911281
}
12921282
}
12931283

1294-
/// Creates FlagTransactionError instruction
1295-
pub fn flag_transaction_error(
1296-
program_id: &Pubkey,
1297-
// Accounts
1298-
proposal: &Pubkey,
1299-
token_owner_record: &Pubkey,
1300-
governance_authority: &Pubkey,
1301-
proposal_transaction: &Pubkey,
1302-
) -> Instruction {
1303-
let accounts = vec![
1304-
AccountMeta::new(*proposal, false),
1305-
AccountMeta::new_readonly(*token_owner_record, false),
1306-
AccountMeta::new_readonly(*governance_authority, true),
1307-
AccountMeta::new(*proposal_transaction, false),
1308-
];
1309-
1310-
let instruction = GovernanceInstruction::FlagTransactionError {};
1311-
1312-
Instruction {
1313-
program_id: *program_id,
1314-
accounts,
1315-
data: borsh::to_vec(&instruction).unwrap(),
1316-
}
1317-
}
1318-
13191284
/// Creates SetRealmAuthority instruction
13201285
pub fn set_realm_authority(
13211286
program_id: &Pubkey,

governance/program/src/processor/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mod process_create_token_owner_record;
1515
mod process_deposit_governing_tokens;
1616
mod process_execute_transaction;
1717
mod process_finalize_vote;
18-
mod process_flag_transaction_error;
18+
1919
mod process_insert_transaction;
2020
mod process_refund_proposal_deposit;
2121
mod process_relinquish_token_owner_record_locks;
@@ -48,7 +48,6 @@ use {
4848
process_deposit_governing_tokens::*,
4949
process_execute_transaction::*,
5050
process_finalize_vote::*,
51-
process_flag_transaction_error::*,
5251
process_insert_transaction::*,
5352
process_refund_proposal_deposit::*,
5453
process_relinquish_token_owner_record_locks::*,
@@ -145,7 +144,8 @@ pub fn process_instruction(
145144
GovernanceInstruction::Legacy1
146145
| GovernanceInstruction::Legacy2
147146
| GovernanceInstruction::Legacy3
148-
| GovernanceInstruction::Legacy4 => {
147+
| GovernanceInstruction::Legacy4
148+
| GovernanceInstruction::Legacy5 => {
149149
Err(GovernanceError::InstructionDeprecated.into()) // No-op
150150
}
151151
GovernanceInstruction::SignOffProposal {} => {
@@ -184,9 +184,6 @@ pub fn process_instruction(
184184
process_set_governance_config(program_id, accounts, config)
185185
}
186186

187-
GovernanceInstruction::FlagTransactionError {} => {
188-
process_flag_transaction_error(program_id, accounts)
189-
}
190187
GovernanceInstruction::SetRealmAuthority { action } => {
191188
process_set_realm_authority(program_id, accounts, action)
192189
}

governance/program/src/processor/process_flag_transaction_error.rs

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)