Skip to content

Commit

Permalink
Fix prettier errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley authored and evan-gray committed Apr 26, 2023
1 parent fc10575 commit 9a4c1e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
28 changes: 12 additions & 16 deletions dashboard/src/components/Accountant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ import {
useReactTable,
} from '@tanstack/react-table';
import { useMemo, useState } from 'react';
import {CloudGovernorInfo} from '../hooks/useCloudGovernorInfo';
import { CloudGovernorInfo } from '../hooks/useCloudGovernorInfo';
import useGetAccountantAccounts, { Account } from '../hooks/useGetAccountantAccounts';
import useGetAccountantPendingTransfers, {
PendingTransfer,
} from '../hooks/useGetAccountantPendingTransfers';
import chainIdToName from '../utils/chainIdToName';
import { GUARDIAN_SET_3 } from '../utils/consts';
import Table from './Table';
import { ethers } from "ethers";
import { ethers } from 'ethers';

type PendingTransferForAcct = PendingTransfer & {isEnqueuedInGov: boolean}
type PendingTransferForAcct = PendingTransfer & { isEnqueuedInGov: boolean };

function getNumSignatures(signatures: string) {
let bitfield = Number(signatures);
Expand Down Expand Up @@ -162,11 +162,7 @@ const pendingTransferColumns = [
}),
];

function EnqueuedInGovChecker({
isEnqueuedInGov,
}: {
isEnqueuedInGov: boolean;
}) {
function EnqueuedInGovChecker({ isEnqueuedInGov }: { isEnqueuedInGov: boolean }) {
return <span role="img">{isEnqueuedInGov ? '✅' : '❌'}</span>;
}

Expand All @@ -191,11 +187,7 @@ const accountsColumns = [
}),
];

function Accountant({
governorInfo,
}: {
governorInfo: CloudGovernorInfo;
}) {
function Accountant({ governorInfo }: { governorInfo: CloudGovernorInfo }) {
const pendingTransferInfo = useGetAccountantPendingTransfers();
const accountsInfo = useGetAccountantAccounts();

Expand All @@ -205,10 +197,14 @@ function Accountant({
pt.isEnqueuedInGov = false;
for (const vaa of governorInfo.enqueuedVAAs) {
let ea = vaa.emitterAddress;
if (ea.startsWith("0x")) {
ea = ethers.utils.hexlify(ea, { allowMissingPrefix: true }).substring(2).padStart(64, "0");
if (ea.startsWith('0x')) {
ea = ethers.utils.hexlify(ea, { allowMissingPrefix: true }).substring(2).padStart(64, '0');
}
if (vaa.emitterChain === pt.key.emitter_chain && ea === pt.key.emitter_address && vaa.sequence === pt.key.sequence.toString()) {
if (
vaa.emitterChain === pt.key.emitter_chain &&
ea === pt.key.emitter_address &&
vaa.sequence === pt.key.sequence.toString()
) {
pt.isEnqueuedInGov = true;
break;
}
Expand Down
6 changes: 1 addition & 5 deletions dashboard/src/components/MainnetGovernor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,7 @@ const tokenColumns = [

type ChainIdToEnqueuedCount = { [chainId: number]: number };

function MainnetGovernor({
governorInfo,
}: {
governorInfo: CloudGovernorInfo;
}) {
function MainnetGovernor({ governorInfo }: { governorInfo: CloudGovernorInfo }) {
const tokenSymbols = useSymbolInfo(governorInfo.tokens);
// TODO: governorInfo.tokens triggers updates to displayTokens, not tokenSymbols
// Should fix this
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/hooks/useCloudGovernorInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const useCloudGovernorInfo = (): CloudGovernorInfo => {
useEffect(() => {
setGovernorInfo(createEmptyInfo());
if (currentNetwork.name !== 'Mainnet') {
return
return;
}
let cancelled = false;
(async () => {
Expand Down

0 comments on commit 9a4c1e2

Please sign in to comment.