diff --git a/packages/proposals/src/components/Proposal/MintSourceTokens.tsx b/packages/proposals/src/components/Proposal/MintSourceTokens.tsx index 6824ec5..a24794a 100644 --- a/packages/proposals/src/components/Proposal/MintSourceTokens.tsx +++ b/packages/proposals/src/components/Proposal/MintSourceTokens.tsx @@ -66,7 +66,7 @@ export default function MintSourceTokens({ else sourceHolders[sourceHolders.length - 1].tokenAmount = parseInt(value); }); - console.log(sourceHolders); + //console.log(sourceHolders); if (singleSourceHolder) sourceHolders.push({ diff --git a/packages/proposals/src/components/Proposal/VoterBubbleGraph.tsx b/packages/proposals/src/components/Proposal/VoterBubbleGraph.tsx index ead3c78..2d7fee0 100644 --- a/packages/proposals/src/components/Proposal/VoterBubbleGraph.tsx +++ b/packages/proposals/src/components/Proposal/VoterBubbleGraph.tsx @@ -30,7 +30,7 @@ export function VoterBubbleGraph(props: IVoterBubbleGraph) { '...' + d.name.slice(d.name.length - 3, d.name.length), })); - console.log('Data', limitedData); + //console.log('Data', limitedData); const format = d3.format(',d'); const color = d3 .scaleOrdinal() @@ -51,7 +51,7 @@ export function VoterBubbleGraph(props: IVoterBubbleGraph) { if (ref) { ref.innerHTML = ''; const root = pack(limitedData); - console.log('Re-rendered'); + // console.log('Re-rendered'); const newSvg = d3 .select(ref) .append('svg') diff --git a/packages/proposals/src/components/Proposal/VoterTable.tsx b/packages/proposals/src/components/Proposal/VoterTable.tsx index 269e5d7..15506e2 100644 --- a/packages/proposals/src/components/Proposal/VoterTable.tsx +++ b/packages/proposals/src/components/Proposal/VoterTable.tsx @@ -61,6 +61,7 @@ export const VoterTable = (props: IVoterTable) => { {breakpoint.xxl && ( diff --git a/packages/proposals/src/hooks/useVotingRecords.ts b/packages/proposals/src/hooks/useVotingRecords.ts index 6581a2d..a9b814d 100644 --- a/packages/proposals/src/hooks/useVotingRecords.ts +++ b/packages/proposals/src/hooks/useVotingRecords.ts @@ -22,8 +22,6 @@ export function useVotingRecords(proposal: PublicKey) { const { endpoint } = useConnectionConfig(); const connection = useConnection(); - const { timelock } = utils.programIds(); - useEffect(() => { if (!proposal) { return; @@ -33,6 +31,8 @@ export function useVotingRecords(proposal: PublicKey) { const records = await getGovernanceVotingRecords(proposal, endpoint); setVotingRecords(records); + const { timelock } = utils.programIds(); + return connection.onProgramAccountChange(timelock.programId, info => { if ( info.accountInfo.data.length === GovernanceVotingRecordLayout.span @@ -57,7 +57,7 @@ export function useVotingRecords(proposal: PublicKey) { return () => { sub.then(id => connection.removeProgramAccountChangeListener(id)); }; - }, [proposal]); + }, [proposal, connection, endpoint]); return votingRecords; } diff --git a/packages/proposals/src/models/createEmptyTimelockConfig.ts b/packages/proposals/src/models/createEmptyTimelockConfig.ts index 5a88700..29d594a 100644 --- a/packages/proposals/src/models/createEmptyTimelockConfig.ts +++ b/packages/proposals/src/models/createEmptyTimelockConfig.ts @@ -1,13 +1,7 @@ -import { - PublicKey, - SYSVAR_RENT_PUBKEY, - TransactionInstruction, -} from '@solana/web3.js'; +import { PublicKey, TransactionInstruction } from '@solana/web3.js'; import { utils } from '@oyster/common'; import * as BufferLayout from 'buffer-layout'; -import { CONFIG_NAME_LENGTH, TimelockInstruction } from './timelock'; -import BN from 'bn.js'; -import * as Layout from '../utils/layout'; +import { TimelockInstruction } from './timelock'; /// 0. `[]` Timelock config key. Needs to be set with pubkey set to PDA with seeds of the /// program account key, governance mint key, council mint key, and timelock program account key. diff --git a/packages/proposals/src/models/initTimelockConfig.ts b/packages/proposals/src/models/initTimelockConfig.ts index dd32108..eead19f 100644 --- a/packages/proposals/src/models/initTimelockConfig.ts +++ b/packages/proposals/src/models/initTimelockConfig.ts @@ -1,8 +1,4 @@ -import { - PublicKey, - SYSVAR_RENT_PUBKEY, - TransactionInstruction, -} from '@solana/web3.js'; +import { PublicKey, TransactionInstruction } from '@solana/web3.js'; import { utils } from '@oyster/common'; import * as BufferLayout from 'buffer-layout'; import { CONFIG_NAME_LENGTH, TimelockInstruction } from './timelock'; diff --git a/packages/proposals/src/models/timelock.ts b/packages/proposals/src/models/timelock.ts index 2182633..19996fe 100644 --- a/packages/proposals/src/models/timelock.ts +++ b/packages/proposals/src/models/timelock.ts @@ -437,7 +437,7 @@ export const TimelockConfigParser = ( votingEntryRule: data.votingEntryRule, minimumSlotWaitingPeriod: data.minimumSlotWaitingPeriod, governanceMint: data.governanceMint, - councilMint: data.councilMintOption == 1 ? data.councilMint : null, + councilMint: data.councilMintOption === 1 ? data.councilMint : null, program: data.program, timeLimit: data.timeLimit, name: utils.fromUTF8Array(data.name).replaceAll('\u0000', ''), diff --git a/packages/proposals/src/views/governance/index.tsx b/packages/proposals/src/views/governance/index.tsx index d3f0bc8..fecaee1 100644 --- a/packages/proposals/src/views/governance/index.tsx +++ b/packages/proposals/src/views/governance/index.tsx @@ -4,7 +4,6 @@ import { LABELS } from '../../constants'; import { hooks, - contexts, useWallet, useConnection, deserializeMint, diff --git a/packages/proposals/src/views/proposals/index.tsx b/packages/proposals/src/views/proposals/index.tsx index d79343e..7e8b22f 100644 --- a/packages/proposals/src/views/proposals/index.tsx +++ b/packages/proposals/src/views/proposals/index.tsx @@ -41,6 +41,7 @@ export const ProposalsView = () => { badge: , status: state.info.status, state, + key, }); }); return newListData; @@ -87,7 +88,7 @@ export const ProposalsView = () => { dataSource={listData} renderItem={item => ( history.push(item.href)} >