Skip to content

Commit

Permalink
remove config
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis committed Aug 13, 2024
1 parent bb97506 commit 294e7a5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/explorer/src/app/(home)/EditableTableCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SchemaAbiType } from "@latticexyz/schema-type/internal";
import { useQueryClient } from "@tanstack/react-query";
import { waitForTransactionReceipt } from "@wagmi/core";
import { Checkbox } from "../../components/ui/Checkbox";
import { ACCOUNT_PRIVATE_KEYS, CONFIG } from "../../consts";
import { ACCOUNT_PRIVATE_KEYS } from "../../consts";
import { useWorldAddress } from "../../hooks/useWorldAddress";
import { camelCase } from "../../lib/utils";
import { useStore } from "../../store";
Expand Down Expand Up @@ -70,7 +70,7 @@ export function EditableTableCell({

const transactionReceipt = await waitForTransactionReceipt(wagmiConfig, {
hash: txHash,
pollingInterval: CONFIG.TRANSACTION_RECEIPT_POLL_INTERVAL,
pollingInterval: 100,
});

toast.success(`Transaction successful with hash: ${txHash}`, {
Expand Down
6 changes: 3 additions & 3 deletions packages/explorer/src/app/(home)/TablesViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
TableHeader,
TableRow,
} from "../../components/ui/Table";
import { CONFIG, NON_EDITABLE_TABLES } from "../../consts";
import { NON_EDITABLE_TABLES } from "../../consts";
import { EditableTableCell } from "./EditableTableCell";
import { bufferToBigInt } from "./utils/bufferToBigInt";

Expand Down Expand Up @@ -75,7 +75,7 @@ export function TablesViewer({ table: selectedTable }: Props) {
});
},
enabled: Boolean(selectedTable),
refetchInterval: CONFIG.TABLES_VIEWER_REFETCH_INTERVAL,
refetchInterval: 1000,
});

const { data: mudTableConfig } = useQuery({
Expand Down Expand Up @@ -161,7 +161,7 @@ export function TablesViewer({ table: selectedTable }: Props) {
columns,
initialState: {
pagination: {
pageSize: CONFIG.TABLE_PAGE_SIZE,
pageSize: 50,
},
},
onSortingChange: setSorting,
Expand Down
4 changes: 2 additions & 2 deletions packages/explorer/src/components/AccountSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Address, formatEther } from "viem";
import { useBalance } from "wagmi";
import { ACCOUNTS, CONFIG } from "../consts";
import { ACCOUNTS } from "../consts";
import { useStore } from "../store";
import {
Select,
Expand All @@ -21,7 +21,7 @@ function AccountSelectItem({
const balance = useBalance({
address,
query: {
refetchInterval: CONFIG.BALANCES_REFETCH_INTERVAL,
refetchInterval: 15000,
},
});
const balanceValue = balance.data?.value;
Expand Down
7 changes: 0 additions & 7 deletions packages/explorer/src/consts.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import { Hex } from "viem";
import { privateKeyToAccount } from "viem/accounts";

export const CONFIG = {
TABLES_VIEWER_REFETCH_INTERVAL: 1_000,
BALANCES_REFETCH_INTERVAL: 15_000,
TRANSACTION_RECEIPT_POLL_INTERVAL: 100,
TABLE_PAGE_SIZE: 50,
};

export const NON_EDITABLE_TABLES = ["__chainState", "__mudStoreTables"];

export const PRIVATE_KEYS: Hex[] = [
Expand Down

0 comments on commit 294e7a5

Please sign in to comment.