From f3270bdfa19b8cb4200144d85f0cd3797d112b01 Mon Sep 17 00:00:00 2001 From: Noah Prince <83885631+ChewingGlass@users.noreply.github.com> Date: Fri, 19 Jan 2024 16:24:38 -0500 Subject: [PATCH] Bugfix create multiple proposals (#104) --- scripts/bootstrap.ts | 3 ++- scripts/bulk-create-proposal.ts | 5 +++-- scripts/create-proposal.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/bootstrap.ts b/scripts/bootstrap.ts index cd7356c..19305ec 100644 --- a/scripts/bootstrap.ts +++ b/scripts/bootstrap.ts @@ -167,6 +167,7 @@ export async function run(args: any = process.argv) { ); console.log(`Created org ${organization.toBase58()}`); } else { + const organizationAcc = await orgProgram.account.organizationV0.fetch(organization) const instruction = await orgProgram.methods .updateOrganizationV0({ defaultProposalConfig: proposalConfig, @@ -174,7 +175,7 @@ export async function run(args: any = process.argv) { uri: null, authority, }) - .accounts({ organization, authority }) + .accounts({ organization, authority: organizationAcc.authority }) .instruction(); await sendInstructionsOrSquads({ diff --git a/scripts/bulk-create-proposal.ts b/scripts/bulk-create-proposal.ts index 591d587..2c89c9e 100644 --- a/scripts/bulk-create-proposal.ts +++ b/scripts/bulk-create-proposal.ts @@ -1,5 +1,5 @@ import * as anchor from "@coral-xyz/anchor"; -import { init as initOrg, organizationKey } from "@helium/organization-sdk"; +import { init as initOrg, organizationKey, proposalKey } from "@helium/organization-sdk"; import os from "os"; import yargs from "yargs/yargs"; import { init as initState } from "@helium/state-controller-sdk"; @@ -18,7 +18,7 @@ interface Proposal { maxChoicesPerVoter: number; choices: Choice[]; proposalConfig?: string; - tags: string[] + tags: string[]; } export async function run(args: any = process.argv) { @@ -98,6 +98,7 @@ export async function run(args: any = process.argv) { owner: authority, authority, payer: authority, + proposal: proposalKey(organizationK, i)[0], }) .prepare(); diff --git a/scripts/create-proposal.ts b/scripts/create-proposal.ts index 23c0b64..05ae92d 100644 --- a/scripts/create-proposal.ts +++ b/scripts/create-proposal.ts @@ -124,7 +124,7 @@ export async function run(args: any = process.argv) { instruction, setState, ], - executeTransaction: true, + executeTransaction: false, squads, multisig: argv.multisig ? new PublicKey(argv.multisig) : undefined, authorityIndex: argv.authorityIndex,