From dc5c83f794c234633d62e19c2b5f12738c5e6b6d Mon Sep 17 00:00:00 2001 From: Noah Prince Date: Mon, 5 May 2025 12:40:47 -0700 Subject: [PATCH 1/2] Fix start ts on create proposal --- scripts/bulk-create-proposal.ts | 7 ++++++- scripts/create-proposal.ts | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/bulk-create-proposal.ts b/scripts/bulk-create-proposal.ts index 6462d446..da435bf3 100644 --- a/scripts/bulk-create-proposal.ts +++ b/scripts/bulk-create-proposal.ts @@ -23,6 +23,7 @@ import { } from "@helium/hpl-crons-sdk"; import { init as initHsd, daoKey } from "@helium/helium-sub-daos-sdk"; import { HNT_MINT } from "@helium/spl-utils"; +import { BN } from "@coral-xyz/anchor"; interface Choice { uri: string; @@ -144,7 +145,11 @@ export async function run(args: any = process.argv) { const { instruction: setState } = await stateProgram.methods // @ts-ignore .updateStateV0({ - newState: { voting: {} }, + newState: { + voting: { + startTs: new BN(Date.now() / 1000).toNumber() + } + }, }) .accountsPartial({ proposal, diff --git a/scripts/create-proposal.ts b/scripts/create-proposal.ts index db480174..d3373719 100644 --- a/scripts/create-proposal.ts +++ b/scripts/create-proposal.ts @@ -129,7 +129,11 @@ export async function run(args: any = process.argv) { const { instruction: setState } = await stateProgram.methods // @ts-ignore .updateStateV0({ - newState: { voting: {} }, + newState: { + voting: { + startTs: new anchor.BN(Date.now() / 1000).toNumber() + } + }, }) .accountsStrict({ proposal: proposal!, From e58c58bcc6b0afa5900521605b4d08a1065fce7a Mon Sep 17 00:00:00 2001 From: Noah Prince Date: Mon, 5 May 2025 12:42:30 -0700 Subject: [PATCH 2/2] Rm toNumber --- scripts/bulk-create-proposal.ts | 2 +- scripts/create-proposal.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/bulk-create-proposal.ts b/scripts/bulk-create-proposal.ts index da435bf3..578724aa 100644 --- a/scripts/bulk-create-proposal.ts +++ b/scripts/bulk-create-proposal.ts @@ -147,7 +147,7 @@ export async function run(args: any = process.argv) { .updateStateV0({ newState: { voting: { - startTs: new BN(Date.now() / 1000).toNumber() + startTs: new BN(Date.now() / 1000) } }, }) diff --git a/scripts/create-proposal.ts b/scripts/create-proposal.ts index d3373719..5da6cef7 100644 --- a/scripts/create-proposal.ts +++ b/scripts/create-proposal.ts @@ -131,7 +131,7 @@ export async function run(args: any = process.argv) { .updateStateV0({ newState: { voting: { - startTs: new anchor.BN(Date.now() / 1000).toNumber() + startTs: new anchor.BN(Date.now() / 1000) } }, })