diff --git a/actions/createLUTproposal.ts b/actions/createLUTproposal.ts index 2e8d22ea..d5164148 100644 --- a/actions/createLUTproposal.ts +++ b/actions/createLUTproposal.ts @@ -28,7 +28,7 @@ import { deduplicateObjsFilter } from '@utils/instructionTools' import { sendSignAndConfirmTransactions } from '@utils/modifiedMangolana' import { InstructionDataWithHoldUpTime } from './createProposal' import { fetchProgramVersion } from '@hooks/queries/useProgramVersionQuery' -// import { chargeFee, PROPOSAL_FEE } from './createChargeFee' +import { chargeFee, PROPOSAL_FEE } from './createChargeFee' /** This is a modified version of createProposal that makes a lookup table, which is useful for especially large instructions */ // TODO make a more generic, less redundant solution @@ -106,7 +106,6 @@ export const createLUTProposal = async ( payer ) - // instructions.push(...chargeFee(wallet.publicKey!, PROPOSAL_FEE)) // TODO: Return signatoryRecordAddress from the SDK call const signatoryRecordAddress = await getSignatoryRecordAddress( programId, @@ -275,6 +274,15 @@ export const createLUTProposal = async ( .then((res) => res.value) if (lookupTableAccount === null) throw new Error() + txes.push({ + instructionsSet: [ + ...chargeFee(wallet.publicKey!, PROPOSAL_FEE).map((x) => ({ + transactionInstruction: x, + signers: [], + })), + ], + sequenceType: SequenceType.Sequential, + }) await sendTransactionsV3({ callbacks, connection, diff --git a/actions/createProposal.ts b/actions/createProposal.ts index b36b25a4..79b8a084 100644 --- a/actions/createProposal.ts +++ b/actions/createProposal.ts @@ -27,7 +27,8 @@ import { trySentryLog } from '@utils/logs' import { deduplicateObjsFilter } from '@utils/instructionTools' import { NftVoterClient } from '@utils/uiTypes/NftVoterClient' import { fetchProgramVersion } from '@hooks/queries/useProgramVersionQuery' -// import { chargeFee, PROPOSAL_FEE } from './createChargeFee' +import { chargeFee, PROPOSAL_FEE } from './createChargeFee' + export interface InstructionDataWithHoldUpTime { data: InstructionData | null holdUpTime: number | undefined @@ -142,8 +143,6 @@ export const createProposal = async ( payer ) - // instructions.push(...chargeFee(wallet.publicKey!, PROPOSAL_FEE)) - // TODO: Return signatoryRecordAddress from the SDK call const signatoryRecordAddress = await getSignatoryRecordAddress( programId, @@ -248,6 +247,15 @@ export const createProposal = async ( sequenceType: SequenceType.Sequential, } }) + txes.push({ + instructionsSet: [ + ...chargeFee(wallet.publicKey!, PROPOSAL_FEE).map((x) => ({ + transactionInstruction: x, + signers: [], + })), + ], + sequenceType: SequenceType.Sequential, + }) await sendTransactionsV3({ callbacks, @@ -290,6 +298,15 @@ export const createProposal = async ( ] // should add checking user has enough sol, refer castVote + instructionsChunks.push({ + instructionsSet: [ + ...chargeFee(wallet.publicKey!, PROPOSAL_FEE).map((x) => ({ + transactionInstruction: x, + signers: [], + })), + ], + sequenceType: SequenceType.Sequential, + }) await sendTransactionsV3({ connection, diff --git a/cli/helpers/createBase64Proposal.ts b/cli/helpers/createBase64Proposal.ts index 9f9f88b7..8282f16d 100644 --- a/cli/helpers/createBase64Proposal.ts +++ b/cli/helpers/createBase64Proposal.ts @@ -22,7 +22,7 @@ import { getVoterPDA, getVoterWeightPDA, } from 'VoteStakeRegistry/sdk/accounts' -// import { chargeFee, PROPOSAL_FEE } from 'actions/createChargeFee' +import { chargeFee, PROPOSAL_FEE } from 'actions/createChargeFee' export const createBase64Proposal = async ( connection: Connection, @@ -110,8 +110,6 @@ export const createBase64Proposal = async ( payer ) - // instructions.push(...chargeFee(wallet.publicKey!, PROPOSAL_FEE)) - const signatoryRecordAddress = await getSignatoryRecordAddress( governanceProgram, proposalAddress, @@ -152,13 +150,24 @@ export const createBase64Proposal = async ( await sendSignAndConfirmTransactions({ connection, wallet, - transactionInstructions: txChunks.map((txChunk) => ({ - instructionsSet: txChunk.map((tx) => ({ - signers: [], - transactionInstruction: tx, + transactionInstructions: [ + ...txChunks.map((txChunk) => ({ + instructionsSet: txChunk.map((tx) => ({ + signers: [], + transactionInstruction: tx, + })), + sequenceType: SequenceType.Sequential, })), - sequenceType: SequenceType.Sequential, - })), + { + instructionsSet: [ + ...chargeFee(wallet.publicKey!, PROPOSAL_FEE).map((x) => ({ + transactionInstruction: x, + signers: [], + })), + ], + sequenceType: SequenceType.Sequential, + }, + ], }) return proposalAddress }