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',
timelock: () => ({
programAccountId: new PublicKey(
'2psyhnxGBm8y4RMaLZ4BTk2DUf2FrcCDrKkuNXm91HrE',
'2tNnNbgf2WR7TFs4nriuNrKkVyq5bTwv9JTtNhzATnYK',
),
programId: new PublicKey('2XuR8fYrf2XECGJPAW8jf2LQG52TeHcoxvtDTE3ujr2F'),
programId: new PublicKey('CzdHe5RxnXKoRk4TrJRX8Q5BPRYqW8SPXpEkQth4drsv'),
}),
wormhole: () => ({
pubkey: new PublicKey('WormT3McKhFJ2RkiGpdw9GKvNCrB2aB54gb2uV9MfQC'),

View File

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

View File

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