Skip to content

Commit

Permalink
fix: BN bugs with proposal creation
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasDeco committed Aug 30, 2024
1 parent 30c76c6 commit 29104c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions lib/client/indexer/proposals.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PublicKey } from "@solana/web3.js";
import { Keypair, PublicKey } from "@solana/web3.js";
import {
Proposal,
DaoAggregate,
Expand All @@ -16,7 +16,10 @@ import {
GovernanceParticipant,
ProposalRanking,
ProposalRequestConfig,
ProposalDaoConfiguration
ProposalDaoConfiguration,
ProposalInstruction,
VaultAccountWithKey,
VaultAccount
} from "@/types";
import { FutarchyProposalsClient } from "@/client";
import { FutarchyRPCProposalsClient } from "@/client/rpc";
Expand All @@ -35,6 +38,7 @@ import { Observable } from "rxjs";
import { Client as GQLWebSocketClient } from "graphql-ws";
import dayjs from "dayjs";
import { createSlug } from "@/utils";
import { SUPPORTED_EMOJIS } from "@/constants";

export class FutarchyIndexerProposalsClient implements FutarchyProposalsClient {
private protocolMap: Map<string, FutarchyProtocol>;
Expand Down Expand Up @@ -844,14 +848,15 @@ export class FutarchyIndexerProposalsClient implements FutarchyProposalsClient {
.add(new BN(slotsPerProposal))
.toNumber(),
pass_threshold_bps: dao.daoAccount.passThresholdBps,
duration_in_slots: dao.daoAccount.slotsPerProposal,
duration_in_slots: dao.daoAccount.slotsPerProposal?.toNumber(),
min_base_futarchic_liquidity:
dao.daoAccount.minBaseFutarchicLiquidity,
dao.daoAccount.minBaseFutarchicLiquidity?.toNumber(),
min_quote_futarchic_liquidity:
dao.daoAccount.minQuoteFutarchicLiquidity,
twap_initial_observation: dao.daoAccount.twapInitialObservation,
dao.daoAccount.minQuoteFutarchicLiquidity?.toNumber(),
twap_initial_observation:
dao.daoAccount.twapInitialObservation?.toNumber(),
twap_max_observation_change_per_update:
dao.daoAccount.twapMaxObservationChangePerUpdate
dao.daoAccount.twapMaxObservationChangePerUpdate?.toNumber()
}
},
proposal_acct: true // Fields you want to return after insertion
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metadaoproject/futarchy-sdk",
"version": "4.0.0-alpha.49",
"version": "4.0.0-alpha.50",
"type": "module",
"main": "dist",
"scripts": {
Expand Down

0 comments on commit 29104c0

Please sign in to comment.