Skip to content

Commit

Permalink
Add missing accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass committed Oct 12, 2023
1 parent e11a324 commit df2d7ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions scripts/bulk-create-proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export async function run(args: any = process.argv) {
proposalConfig: proposalData.proposalConfig
? new PublicKey(proposalData.proposalConfig)
: organization.defaultProposalConfig,
proposalProgram: organization.proposalProgram,
})
.prepare();

Expand Down
15 changes: 13 additions & 2 deletions scripts/create-proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ export async function run(args: any = process.argv) {
const wallet = new anchor.Wallet(walletKP);
const orgProgram = await initOrg(provider);
const stateProgram = await initState(provider);
const organizationK = organizationKey(argv.orgName)[0];
const organization = await orgProgram.account.organizationV0.fetch(
organizationK
);

const squads = Squads.endpoint(process.env.ANCHOR_PROVIDER_URL, wallet, {
commitmentOrConfig: "finalized",
Expand All @@ -94,7 +98,7 @@ export async function run(args: any = process.argv) {
tags: ["test", "tags"],
})
.accounts({
organization: organizationKey(argv.orgName)[0],
organization: organizationK,
owner: authority,
})
.prepare();
Expand All @@ -103,7 +107,14 @@ export async function run(args: any = process.argv) {
.updateStateV0({
newState: { voting: {} },
})
.accounts({ proposal, owner: authority })
.accounts({
proposal,
owner: authority,
proposalConfig: argv.proposalConfig
? new PublicKey(argv.proposalConfig)
: organization.defaultProposalConfig,
proposalProgram: organization.proposalProgram,
})
.prepare();

await sendInstructionsOrSquads({
Expand Down

0 comments on commit df2d7ae

Please sign in to comment.