Class: Solace::SquadsSmartAccounts::Instructions::ActivateProposalInstruction
- Inherits:
-
Object
- Object
- Solace::SquadsSmartAccounts::Instructions::ActivateProposalInstruction
- Defined in:
- lib/solace/squads_smart_accounts/instructions/activate_proposal_instruction.rb
Overview
Encodes the ‘activateProposal` instruction for the Squads Smart Account program.
Moves a proposal from Draft to Active so it can be voted on. Only needed for proposals created with ‘draft: true`; proposals created with `draft: false` start Active. The signer must be a smart-account member with the Initiate permission.
Accounts (in order):
0. settings — readonly, non-signer
1. signer — writable, signer (must have the Initiate permission)
2. proposal — writable, non-signer
NOTE: unlike the other proposal-lifecycle instructions, activateProposal takes NO trailing ‘program` account (confirmed against the deployed program’s activate_proposal.rs) — the program is only the invoked program.
Constant Summary collapse
- DISCRIMINATOR =
8-byte Anchor discriminator: SHA256(“global:activate_proposal”)
[90, 186, 203, 234, 70, 185, 191, 21].freeze
Class Method Summary collapse
-
.build(settings_index:, signer_index:, proposal_index:, program_index:) ⇒ Solace::Instruction
Builds a Instruction for activateProposal.
-
.data ⇒ Array<Integer>
Encodes the instruction data — the discriminator only; activateProposal takes no arguments.
Class Method Details
.build(settings_index:, signer_index:, proposal_index:, program_index:) ⇒ Solace::Instruction
Builds a Instruction for activateProposal.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/solace/squads_smart_accounts/instructions/activate_proposal_instruction.rb', line 32 def self.build( settings_index:, signer_index:, proposal_index:, program_index: ) Solace::Instruction.new.tap do |ix| ix.program_index = program_index ix.accounts = [ settings_index, signer_index, proposal_index ] ix.data = data end end |
.data ⇒ Array<Integer>
Encodes the instruction data — the discriminator only; activateProposal takes no arguments.
54 55 56 |
# File 'lib/solace/squads_smart_accounts/instructions/activate_proposal_instruction.rb', line 54 def self.data DISCRIMINATOR end |