Skip to content
This repository has been archived by the owner on Feb 9, 2025. It is now read-only.

remove explicit withAddSignatory when creating proposal #2112

Merged
merged 2 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions actions/createLUTproposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import {
TokenOwnerRecord,
VoteType,
withCreateProposal,
getSignatoryRecordAddress,
withInsertTransaction,
withSignOffProposal,
withAddSignatory,
RpcContext,
} from '@solana/spl-governance'
import {
Expand Down Expand Up @@ -94,24 +92,12 @@ export const createLUTProposal = async (
payer,
plugin?.voterWeightPk
)

await withAddSignatory(
instructions,
programId,
programVersion,
proposalAddress,
tokenOwnerRecord.pubkey,
governanceAuthority,
signatory,
payer
)

// TODO: Return signatoryRecordAddress from the SDK call
/*
const signatoryRecordAddress = await getSignatoryRecordAddress(
programId,
proposalAddress,
signatory
)
) */

const insertInstructions: TransactionInstruction[] = []

Expand Down Expand Up @@ -159,8 +145,8 @@ export const createLUTProposal = async (
governance,
proposalAddress,
signatory,
signatoryRecordAddress,
undefined
undefined, //signatoryRecordAddress,
tokenOwnerRecord.pubkey
)
}

Expand Down
27 changes: 3 additions & 24 deletions actions/createProposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import {
TokenOwnerRecord,
VoteType,
withCreateProposal,
getSignatoryRecordAddress,
RpcContext,
withInsertTransaction,
InstructionData,
withSignOffProposal,
withAddSignatory,
MultiChoiceType,
} from '@solana/spl-governance'
import {
Expand Down Expand Up @@ -76,7 +74,6 @@ export const createProposal = async (
const instructions: TransactionInstruction[] = []
const createNftTicketsIxs: TransactionInstruction[] = []
const governanceAuthority = walletPubkey
const signatory = walletPubkey
const payer = walletPubkey
const prerequisiteInstructions: TransactionInstruction[] = []
const prerequisiteInstructionsSigners: (Keypair | null)[] = []
Expand Down Expand Up @@ -131,24 +128,6 @@ export const createProposal = async (
plugin?.voterWeightPk
)

await withAddSignatory(
instructions,
programId,
programVersion,
proposalAddress,
tokenOwnerRecord.pubkey,
governanceAuthority,
signatory,
payer
)

// TODO: Return signatoryRecordAddress from the SDK call
const signatoryRecordAddress = await getSignatoryRecordAddress(
programId,
proposalAddress,
signatory
)

const insertInstructions: TransactionInstruction[] = []

const chunkBys = instructionsData
Expand Down Expand Up @@ -194,9 +173,9 @@ export const createProposal = async (
realm.pubkey,
governance,
proposalAddress,
signatory,
signatoryRecordAddress,
undefined
walletPubkey,
undefined,
tokenOwnerRecord.pubkey
)
}

Expand Down
21 changes: 4 additions & 17 deletions cli/helpers/createBase64Proposal.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import {
getGovernanceProgramVersion,
getInstructionDataFromBase64,
getSignatoryRecordAddress,
ProgramAccount,
SYSTEM_PROGRAM_ID,
TokenOwnerRecord,
VoteType,
WalletSigner,
withAddSignatory,
withCreateProposal,
withInsertTransaction,
withSignOffProposal,
Expand Down Expand Up @@ -101,23 +99,12 @@ export const createBase64Proposal = async (
payer,
voterWeightPluginPk
)

await withAddSignatory(
instructions,
governanceProgram,
programVersion,
proposalAddress,
tokenOwnerRecord.pubkey,
governanceAuthority,
signatory,
payer
)

/*
const signatoryRecordAddress = await getSignatoryRecordAddress(
governanceProgram,
proposalAddress,
signatory
)
) */
const insertInstructions: TransactionInstruction[] = []
for (const i in base64Instructions) {
const instruction = getInstructionDataFromBase64(base64Instructions[i])
Expand All @@ -144,8 +131,8 @@ export const createBase64Proposal = async (
governance,
proposalAddress,
signatory,
signatoryRecordAddress,
undefined
undefined, //signatoryRecordAddress,
tokenOwnerRecord.pubkey
)

const txChunks = chunk([...instructions, ...insertInstructions], 2)
Expand Down
Loading