Skip to content

Commit

Permalink
Bugfix create multiple proposals (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass authored Jan 19, 2024
1 parent df6e92f commit f3270bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion scripts/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,15 @@ 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,
proposalProgram: null,
uri: null,
authority,
})
.accounts({ organization, authority })
.accounts({ organization, authority: organizationAcc.authority })
.instruction();

await sendInstructionsOrSquads({
Expand Down
5 changes: 3 additions & 2 deletions scripts/bulk-create-proposal.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -18,7 +18,7 @@ interface Proposal {
maxChoicesPerVoter: number;
choices: Choice[];
proposalConfig?: string;
tags: string[]
tags: string[];
}

export async function run(args: any = process.argv) {
Expand Down Expand Up @@ -98,6 +98,7 @@ export async function run(args: any = process.argv) {
owner: authority,
authority,
payer: authority,
proposal: proposalKey(organizationK, i)[0],
})
.prepare();

Expand Down
2 changes: 1 addition & 1 deletion scripts/create-proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f3270bd

Please sign in to comment.