mirror of https://github.com/certusone/oyster.git
chore: fix linter warnings
This commit is contained in:
parent
9d30c4b12e
commit
c8a7c726f0
|
@ -66,7 +66,7 @@ export default function MintSourceTokens({
|
||||||
else
|
else
|
||||||
sourceHolders[sourceHolders.length - 1].tokenAmount = parseInt(value);
|
sourceHolders[sourceHolders.length - 1].tokenAmount = parseInt(value);
|
||||||
});
|
});
|
||||||
console.log(sourceHolders);
|
//console.log(sourceHolders);
|
||||||
|
|
||||||
if (singleSourceHolder)
|
if (singleSourceHolder)
|
||||||
sourceHolders.push({
|
sourceHolders.push({
|
||||||
|
|
|
@ -30,7 +30,7 @@ export function VoterBubbleGraph(props: IVoterBubbleGraph) {
|
||||||
'...' +
|
'...' +
|
||||||
d.name.slice(d.name.length - 3, d.name.length),
|
d.name.slice(d.name.length - 3, d.name.length),
|
||||||
}));
|
}));
|
||||||
console.log('Data', limitedData);
|
//console.log('Data', limitedData);
|
||||||
const format = d3.format(',d');
|
const format = d3.format(',d');
|
||||||
const color = d3
|
const color = d3
|
||||||
.scaleOrdinal()
|
.scaleOrdinal()
|
||||||
|
@ -51,7 +51,7 @@ export function VoterBubbleGraph(props: IVoterBubbleGraph) {
|
||||||
if (ref) {
|
if (ref) {
|
||||||
ref.innerHTML = '';
|
ref.innerHTML = '';
|
||||||
const root = pack(limitedData);
|
const root = pack(limitedData);
|
||||||
console.log('Re-rendered');
|
// console.log('Re-rendered');
|
||||||
const newSvg = d3
|
const newSvg = d3
|
||||||
.select(ref)
|
.select(ref)
|
||||||
.append('svg')
|
.append('svg')
|
||||||
|
|
|
@ -61,6 +61,7 @@ export const VoterTable = (props: IVoterTable) => {
|
||||||
<a
|
<a
|
||||||
href={`https://explorer.solana.com/address/${key}?cluster=${subdomain}`}
|
href={`https://explorer.solana.com/address/${key}?cluster=${subdomain}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
{breakpoint.xxl && (
|
{breakpoint.xxl && (
|
||||||
<span>
|
<span>
|
||||||
|
|
|
@ -22,8 +22,6 @@ export function useVotingRecords(proposal: PublicKey) {
|
||||||
const { endpoint } = useConnectionConfig();
|
const { endpoint } = useConnectionConfig();
|
||||||
const connection = useConnection();
|
const connection = useConnection();
|
||||||
|
|
||||||
const { timelock } = utils.programIds();
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!proposal) {
|
if (!proposal) {
|
||||||
return;
|
return;
|
||||||
|
@ -33,6 +31,8 @@ export function useVotingRecords(proposal: PublicKey) {
|
||||||
const records = await getGovernanceVotingRecords(proposal, endpoint);
|
const records = await getGovernanceVotingRecords(proposal, endpoint);
|
||||||
setVotingRecords(records);
|
setVotingRecords(records);
|
||||||
|
|
||||||
|
const { timelock } = utils.programIds();
|
||||||
|
|
||||||
return connection.onProgramAccountChange(timelock.programId, info => {
|
return connection.onProgramAccountChange(timelock.programId, info => {
|
||||||
if (
|
if (
|
||||||
info.accountInfo.data.length === GovernanceVotingRecordLayout.span
|
info.accountInfo.data.length === GovernanceVotingRecordLayout.span
|
||||||
|
@ -57,7 +57,7 @@ export function useVotingRecords(proposal: PublicKey) {
|
||||||
return () => {
|
return () => {
|
||||||
sub.then(id => connection.removeProgramAccountChangeListener(id));
|
sub.then(id => connection.removeProgramAccountChangeListener(id));
|
||||||
};
|
};
|
||||||
}, [proposal]);
|
}, [proposal, connection, endpoint]);
|
||||||
|
|
||||||
return votingRecords;
|
return votingRecords;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
import {
|
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
|
||||||
PublicKey,
|
|
||||||
SYSVAR_RENT_PUBKEY,
|
|
||||||
TransactionInstruction,
|
|
||||||
} from '@solana/web3.js';
|
|
||||||
import { utils } from '@oyster/common';
|
import { utils } from '@oyster/common';
|
||||||
import * as BufferLayout from 'buffer-layout';
|
import * as BufferLayout from 'buffer-layout';
|
||||||
import { CONFIG_NAME_LENGTH, TimelockInstruction } from './timelock';
|
import { TimelockInstruction } from './timelock';
|
||||||
import BN from 'bn.js';
|
|
||||||
import * as Layout from '../utils/layout';
|
|
||||||
|
|
||||||
/// 0. `[]` Timelock config key. Needs to be set with pubkey set to PDA with seeds of the
|
/// 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.
|
/// program account key, governance mint key, council mint key, and timelock program account key.
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
import {
|
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
|
||||||
PublicKey,
|
|
||||||
SYSVAR_RENT_PUBKEY,
|
|
||||||
TransactionInstruction,
|
|
||||||
} from '@solana/web3.js';
|
|
||||||
import { utils } from '@oyster/common';
|
import { utils } from '@oyster/common';
|
||||||
import * as BufferLayout from 'buffer-layout';
|
import * as BufferLayout from 'buffer-layout';
|
||||||
import { CONFIG_NAME_LENGTH, TimelockInstruction } from './timelock';
|
import { CONFIG_NAME_LENGTH, TimelockInstruction } from './timelock';
|
||||||
|
|
|
@ -437,7 +437,7 @@ export const TimelockConfigParser = (
|
||||||
votingEntryRule: data.votingEntryRule,
|
votingEntryRule: data.votingEntryRule,
|
||||||
minimumSlotWaitingPeriod: data.minimumSlotWaitingPeriod,
|
minimumSlotWaitingPeriod: data.minimumSlotWaitingPeriod,
|
||||||
governanceMint: data.governanceMint,
|
governanceMint: data.governanceMint,
|
||||||
councilMint: data.councilMintOption == 1 ? data.councilMint : null,
|
councilMint: data.councilMintOption === 1 ? data.councilMint : null,
|
||||||
program: data.program,
|
program: data.program,
|
||||||
timeLimit: data.timeLimit,
|
timeLimit: data.timeLimit,
|
||||||
name: utils.fromUTF8Array(data.name).replaceAll('\u0000', ''),
|
name: utils.fromUTF8Array(data.name).replaceAll('\u0000', ''),
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { LABELS } from '../../constants';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
hooks,
|
hooks,
|
||||||
contexts,
|
|
||||||
useWallet,
|
useWallet,
|
||||||
useConnection,
|
useConnection,
|
||||||
deserializeMint,
|
deserializeMint,
|
||||||
|
|
|
@ -41,6 +41,7 @@ export const ProposalsView = () => {
|
||||||
badge: <TokenIcon mintAddress={mint} size={30} />,
|
badge: <TokenIcon mintAddress={mint} size={30} />,
|
||||||
status: state.info.status,
|
status: state.info.status,
|
||||||
state,
|
state,
|
||||||
|
key,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return newListData;
|
return newListData;
|
||||||
|
@ -87,7 +88,7 @@ export const ProposalsView = () => {
|
||||||
dataSource={listData}
|
dataSource={listData}
|
||||||
renderItem={item => (
|
renderItem={item => (
|
||||||
<List.Item
|
<List.Item
|
||||||
key={item.title}
|
key={item.key}
|
||||||
className="proposal-item"
|
className="proposal-item"
|
||||||
onClick={() => history.push(item.href)}
|
onClick={() => history.push(item.href)}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue