-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae2d2fe
commit 882bc3c
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { autocratProgram, finalizeProposal } from "./main"; | ||
import * as anchor from "@coral-xyz/anchor"; | ||
import { MEMO_PROGRAM_ID } from "@solana/spl-memo"; | ||
|
||
const { PublicKey, Keypair, SystemProgram } = anchor.web3; | ||
const { BN, Program } = anchor; | ||
|
||
const PROPOSAL_NUMBER = 3; | ||
|
||
async function main() { | ||
const proposals = await autocratProgram.account.proposal.all(); | ||
const proposal = proposals.find((proposal) => proposal.account.number == PROPOSAL_NUMBER); | ||
|
||
await finalizeProposal(proposal.publicKey); | ||
} | ||
|
||
main(); |