@@ -149,7 +149,7 @@ pub enum GovernanceInstruction {
149
149
/// 0. `[]` Realm account the created Proposal belongs to
150
150
/// 1. `[writable]` Proposal account. PDA seeds ['governance',governance, governing_token_mint, proposal_index]
151
151
/// 2. `[writable]` Governance account
152
- /// 3. `[]` TokenOwnerRecord account for Proposal owner
152
+ /// 3. `[writable ]` TokenOwnerRecord account of the Proposal owner
153
153
/// 4. `[signer]` Governance Authority (Token Owner or Governance Delegate)
154
154
/// 5. `[signer]` Payer
155
155
/// 6. `[]` System program
@@ -172,7 +172,7 @@ pub enum GovernanceInstruction {
172
172
/// Adds a signatory to the Proposal which means this Proposal can't leave Draft state until yet another Signatory signs
173
173
///
174
174
/// 0. `[writable]` Proposal account
175
- /// 1. `[]` TokenOwnerRecord account for Proposal owner
175
+ /// 1. `[]` TokenOwnerRecord account of the Proposal owner
176
176
/// 2. `[signer]` Governance Authority (Token Owner or Governance Delegate)
177
177
/// 3. `[writable]` Signatory Record Account
178
178
/// 4. `[signer]` Payer
@@ -187,7 +187,7 @@ pub enum GovernanceInstruction {
187
187
/// Removes a Signatory from the Proposal
188
188
///
189
189
/// 0. `[writable]` Proposal account
190
- /// 1. `[]` TokenOwnerRecord account for Proposal owner
190
+ /// 1. `[]` TokenOwnerRecord account of the Proposal owner
191
191
/// 2. `[signer]` Governance Authority (Token Owner or Governance Delegate)
192
192
/// 3. `[writable]` Signatory Record Account
193
193
/// 4. `[writable]` Beneficiary Account which would receive lamports from the disposed Signatory Record Account
@@ -203,7 +203,7 @@ pub enum GovernanceInstruction {
203
203
204
204
/// 0. `[]` Governance account
205
205
/// 1. `[writable]` Proposal account
206
- /// 2. `[]` TokenOwnerRecord account for Proposal owner
206
+ /// 2. `[]` TokenOwnerRecord account of the Proposal owner
207
207
/// 3. `[signer]` Governance Authority (Token Owner or Governance Delegate)
208
208
/// 4. `[writable]` ProposalInstruction account. PDA seeds: ['governance',proposal,index]
209
209
/// 5. `[signer]` Payer
@@ -225,7 +225,7 @@ pub enum GovernanceInstruction {
225
225
/// Removes instruction from the Proposal
226
226
///
227
227
/// 0. `[writable]` Proposal account
228
- /// 1. `[]` TokenOwnerRecord account for Proposal owner
228
+ /// 1. `[]` TokenOwnerRecord account of the Proposal owner
229
229
/// 2. `[signer]` Governance Authority (Token Owner or Governance Delegate)
230
230
/// 3. `[writable]` ProposalInstruction account
231
231
/// 4. `[writable]` Beneficiary Account which would receive lamports from the disposed ProposalInstruction account
@@ -234,7 +234,7 @@ pub enum GovernanceInstruction {
234
234
/// Cancels Proposal by changing its state to Canceled
235
235
///
236
236
/// 0. `[writable]` Proposal account
237
- /// 1. `[]` TokenOwnerRecord account for Proposal owner
237
+ /// 1. `[writable ]` TokenOwnerRecord account of the Proposal owner
238
238
/// 2 `[signer]` Governance Authority (Token Owner or Governance Delegate)
239
239
/// 3. `[]` Clock sysvar
240
240
CancelProposal ,
@@ -255,7 +255,8 @@ pub enum GovernanceInstruction {
255
255
/// 0. `[]` Realm account
256
256
/// 1. `[]` Governance account
257
257
/// 2. `[writable]` Proposal account
258
- /// 3. `[writable]` Token Owner Record account. PDA seeds: ['governance',realm, governing_token_mint, governing_token_owner]
258
+ /// 4. `[writable]` TokenOwnerRecord of the Proposal owner
259
+ /// 3. `[writable]` TokenOwnerRecord of the voter. PDA seeds: ['governance',realm, governing_token_mint, governing_token_owner]
259
260
/// 4. `[signer]` Governance Authority (Token Owner or Governance Delegate)
260
261
/// 5. `[writable]` Proposal VoteRecord account. PDA seeds: ['governance',proposal,governing_token_owner_record]
261
262
/// 6. `[]` Governing Token Mint
@@ -274,8 +275,9 @@ pub enum GovernanceInstruction {
274
275
/// 0. `[]` Realm account
275
276
/// 1. `[]` Governance account
276
277
/// 2. `[writable]` Proposal account
277
- /// 3. `[]` Governing Token Mint
278
- /// 4. `[]` Clock sysvar
278
+ /// 3. `[writable]` TokenOwnerRecord of the Proposal owner
279
+ /// 4. `[]` Governing Token Mint
280
+ /// 5. `[]` Clock sysvar
279
281
FinalizeVote { } ,
280
282
281
283
/// Relinquish Vote removes voter weight from a Proposal and removes it from voter's active votes
@@ -368,7 +370,7 @@ pub enum GovernanceInstruction {
368
370
/// and the Governance program has no way to know when instruction failed and flag it automatically
369
371
///
370
372
/// 0. `[writable]` Proposal account
371
- /// 1. `[]` TokenOwnerRecord account for Proposal owner
373
+ /// 1. `[]` TokenOwnerRecord account of the Proposal owner
372
374
/// 2. `[signer]` Governance Authority (Token Owner or Governance Delegate)
373
375
/// 3. `[writable]` ProposalInstruction account to flag
374
376
/// 4. `[]` Clock sysvar
@@ -735,7 +737,7 @@ pub fn create_proposal(
735
737
program_id : & Pubkey ,
736
738
// Accounts
737
739
governance : & Pubkey ,
738
- governing_token_owner_record : & Pubkey ,
740
+ proposal_owner_record : & Pubkey ,
739
741
governance_authority : & Pubkey ,
740
742
payer : & Pubkey ,
741
743
// Args
@@ -756,7 +758,7 @@ pub fn create_proposal(
756
758
AccountMeta :: new_readonly( * realm, false ) ,
757
759
AccountMeta :: new( proposal_address, false ) ,
758
760
AccountMeta :: new( * governance, false ) ,
759
- AccountMeta :: new_readonly ( * governing_token_owner_record , false ) ,
761
+ AccountMeta :: new ( * proposal_owner_record , false ) ,
760
762
AccountMeta :: new_readonly( * governance_authority, true ) ,
761
763
AccountMeta :: new_readonly( * payer, true ) ,
762
764
AccountMeta :: new_readonly( system_program:: id( ) , false ) ,
@@ -875,20 +877,23 @@ pub fn cast_vote(
875
877
realm : & Pubkey ,
876
878
governance : & Pubkey ,
877
879
proposal : & Pubkey ,
878
- token_owner_record : & Pubkey ,
880
+ proposal_owner_record : & Pubkey ,
881
+ voter_token_owner_record : & Pubkey ,
879
882
governance_authority : & Pubkey ,
880
883
governing_token_mint : & Pubkey ,
881
884
payer : & Pubkey ,
882
885
// Args
883
886
vote : Vote ,
884
887
) -> Instruction {
885
- let vote_record_address = get_vote_record_address ( program_id, proposal, token_owner_record) ;
888
+ let vote_record_address =
889
+ get_vote_record_address ( program_id, proposal, voter_token_owner_record) ;
886
890
887
891
let accounts = vec ! [
888
892
AccountMeta :: new_readonly( * realm, false ) ,
889
893
AccountMeta :: new_readonly( * governance, false ) ,
890
894
AccountMeta :: new( * proposal, false ) ,
891
- AccountMeta :: new( * token_owner_record, false ) ,
895
+ AccountMeta :: new( * proposal_owner_record, false ) ,
896
+ AccountMeta :: new( * voter_token_owner_record, false ) ,
892
897
AccountMeta :: new_readonly( * governance_authority, true ) ,
893
898
AccountMeta :: new( vote_record_address, false ) ,
894
899
AccountMeta :: new_readonly( * governing_token_mint, false ) ,
@@ -914,12 +919,14 @@ pub fn finalize_vote(
914
919
realm : & Pubkey ,
915
920
governance : & Pubkey ,
916
921
proposal : & Pubkey ,
922
+ proposal_owner_record : & Pubkey ,
917
923
governing_token_mint : & Pubkey ,
918
924
) -> Instruction {
919
925
let accounts = vec ! [
920
926
AccountMeta :: new_readonly( * realm, false ) ,
921
927
AccountMeta :: new_readonly( * governance, false ) ,
922
928
AccountMeta :: new( * proposal, false ) ,
929
+ AccountMeta :: new( * proposal_owner_record, false ) ,
923
930
AccountMeta :: new_readonly( * governing_token_mint, false ) ,
924
931
AccountMeta :: new_readonly( sysvar:: clock:: id( ) , false ) ,
925
932
] ;
@@ -973,12 +980,12 @@ pub fn cancel_proposal(
973
980
program_id : & Pubkey ,
974
981
// Accounts
975
982
proposal : & Pubkey ,
976
- token_owner_record : & Pubkey ,
983
+ proposal_owner_record : & Pubkey ,
977
984
governance_authority : & Pubkey ,
978
985
) -> Instruction {
979
986
let accounts = vec ! [
980
987
AccountMeta :: new( * proposal, false ) ,
981
- AccountMeta :: new_readonly ( * token_owner_record , false ) ,
988
+ AccountMeta :: new ( * proposal_owner_record , false ) ,
982
989
AccountMeta :: new_readonly( * governance_authority, true ) ,
983
990
AccountMeta :: new_readonly( sysvar:: clock:: id( ) , false ) ,
984
991
] ;
0 commit comments