Proposals (#32)

* Timing fixes to avoid burnout in the rpc layer

* New ids for demo

Co-authored-by: Dummy Tester 123 <dummytester123@hey.com>
This commit is contained in:
Jordan Prince 2021-03-25 08:47:43 -05:00 committed by GitHub
parent eb13626ca7
commit e35050ec15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 7 deletions

View File

@ -95,9 +95,9 @@ export const PROGRAM_IDS = [
name: 'devnet', name: 'devnet',
timelock: () => ({ timelock: () => ({
programAccountId: new PublicKey( programAccountId: new PublicKey(
'2psyhnxGBm8y4RMaLZ4BTk2DUf2FrcCDrKkuNXm91HrE', '2tNnNbgf2WR7TFs4nriuNrKkVyq5bTwv9JTtNhzATnYK',
), ),
programId: new PublicKey('2XuR8fYrf2XECGJPAW8jf2LQG52TeHcoxvtDTE3ujr2F'), programId: new PublicKey('CzdHe5RxnXKoRk4TrJRX8Q5BPRYqW8SPXpEkQth4drsv'),
}), }),
wormhole: () => ({ wormhole: () => ({
pubkey: new PublicKey('WormT3McKhFJ2RkiGpdw9GKvNCrB2aB54gb2uV9MfQC'), pubkey: new PublicKey('WormT3McKhFJ2RkiGpdw9GKvNCrB2aB54gb2uV9MfQC'),

View File

@ -104,7 +104,7 @@ function PlayStatusButton({
if (ineligibleToSee) { if (ineligibleToSee) {
const id = setInterval(() => { const id = setInterval(() => {
connection.getSlot().then(setCurrSlot); connection.getSlot().then(setCurrSlot);
}, 400); }, 5000);
return () => { return () => {
clearInterval(id); clearInterval(id);

View File

@ -7,7 +7,12 @@ import {
} from '@solana/web3.js'; } from '@solana/web3.js';
import { useMemo } from 'react'; import { useMemo } from 'react';
import { utils, ParsedAccount, useConnectionConfig, cache } from '@oyster/common'; import {
utils,
ParsedAccount,
useConnectionConfig,
cache,
} from '@oyster/common';
import { import {
CustomSingleSignerTimelockTransactionLayout, CustomSingleSignerTimelockTransactionLayout,
CustomSingleSignerTimelockTransactionParser, CustomSingleSignerTimelockTransactionParser,
@ -146,7 +151,7 @@ function useSetupProposalsCache({
return () => { return () => {
connection.removeProgramAccountChangeListener(subID); connection.removeProgramAccountChangeListener(subID);
}; };
}, [connection, PROGRAM_IDS.timelock.programAccountId]); }, [connection, PROGRAM_IDS.timelock.programAccountId.toBase58()]);
} }
export const useProposals = () => { export const useProposals = () => {
const context = useContext(ProposalsContext); const context = useContext(ProposalsContext);
@ -155,9 +160,9 @@ export const useProposals = () => {
export const useConfig = (id: string) => { export const useConfig = (id: string) => {
const context = useContext(ProposalsContext); const context = useContext(ProposalsContext);
if(!context?.configs) { if (!context?.configs) {
return; return;
} }
return context.configs[id]; return context.configs[id];
} };