Skip to content

Commit

Permalink
fix: upgrade abitypes by upgrading viem to its latest version. It fix…
Browse files Browse the repository at this point in the history
… the cached parse-abi output
  • Loading branch information
brunomenezes committed Dec 10, 2024
1 parent 324d1cd commit fd0edbb
Show file tree
Hide file tree
Showing 9 changed files with 140 additions and 35 deletions.
1 change: 0 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@tanstack/react-query": "^5.27.5",
"@vercel/analytics": "^1.2.2",
"@vercel/speed-insights": "^1.0.10",
"abitype": "^0.9",
"dexie": "^4.0.4",
"encoding": "^0.1",
"graphql": "^16",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/applications/applicationsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";

import { ActionIcon, Box, Group, Tooltip } from "@mantine/core";
import { Address as AddressType } from "abitype/dist/types/abi";
import Link from "next/link";
import { FC } from "react";
import {
Expand All @@ -10,6 +9,7 @@ import {
TbPlugConnectedX,
TbStack2,
} from "react-icons/tb";
import { Address as AddressType } from "viem";
import { ApplicationItemFragment } from "../../graphql/explorer/operations";
import { useConnectionConfig } from "../../providers/connectionConfig/hooks";
import Address from "../address";
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/applications/latestInputsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"use client";
import { Badge, Box, Button, Group, Loader, Table, Text } from "@mantine/core";
import type { Address as AddressType } from "abitype/dist/types/abi";
import prettyMilliseconds from "pretty-ms";
import { FC, useCallback, useState } from "react";
import Address from "../address";
import { InputItemFragment } from "../../graphql/explorer/operations";
import { TbArrowRight } from "react-icons/tb";
import type { Address as AddressType } from "viem";
import { InputItemFragment } from "../../graphql/explorer/operations";
import { methodResolver } from "../../lib/methodResolver";
import Address from "../address";

export interface Entry {
appId: AddressType;
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/latestEntries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
useMantineTheme,
} from "@mantine/core";
import { useMediaQuery } from "@mantine/hooks";
import type { Address as AddressType } from "abitype/dist/types/abi";
import Link from "next/link";
import type { FC } from "react";
import { IconType } from "react-icons";
import { TbApps, TbInbox } from "react-icons/tb";
import type { Address as AddressType } from "viem";
import {
useApplicationsConnectionQuery,
useInputsQuery,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/latestEntriesTable.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
import { Button, Loader, Table, Text } from "@mantine/core";
import type { Address as AddressType } from "abitype/dist/types/abi";
import prettyMilliseconds from "pretty-ms";
import { FC, useCallback, useState } from "react";
import type { Address as AddressType } from "viem";
import Address from "./address";

export interface Entry {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as mantineHooks from "@mantine/hooks";
import { notifications } from "@mantine/notifications";
import {
cleanup,
Expand All @@ -19,7 +20,6 @@ import withMantineTheme from "../../utils/WithMantineTheme";
import { encodedDataSamples } from "./encodedData.stubs";
import { JotaiTestProvider } from "./jotaiHelpers";
import { erc1155JSONABISpecStub } from "./specification.stubs";
import * as mantineHooks from "@mantine/hooks";

vi.mock("@mantine/hooks", async () => {
const actual = await vi.importActual<typeof mantineHooks>("@mantine/hooks");
Expand Down Expand Up @@ -687,7 +687,7 @@ describe("Specification Form View", () => {

expect(
screen.getByText(
`Unknown type. Type "bla" is not a valid ABI type. Version: abitype@1.0.0`,
`Unknown type. Type "bla" is not a valid ABI type. Version: abitype@1.0.7`,
),
).toBeInTheDocument();
});
Expand All @@ -712,7 +712,7 @@ describe("Specification Form View", () => {

expect(
screen.getByText(
`Invalid ABI parameter. "address" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html Details: uint address Version: abitype@1.0.0`,
`Invalid ABI parameter. "address" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html Details: uint address Version: abitype@1.0.7`,
),
).toBeInTheDocument();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"ramda": "0.30.1",
"ramda-adjunct": "^5.0.1",
"react-icons": "^4",
"viem": "^2",
"uuid": "^11.0.3",
"viem": "^2",
"wagmi": "^2"
},
"peerDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/test/GenericInputForm/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
import { AbiFunction, getAddress, stringToHex } from "viem";
import { afterAll, describe, it } from "vitest";
import { GenericInputForm } from "../../src/GenericInputForm";
import withMantineTheme from "../utils/WithMantineTheme";
import { AbiFunction, getAddress, stringToHex } from "viem";
import { abiParam, formSpecification, functionSignature } from "./mocks";

const Component = withMantineTheme(GenericInputForm);
Expand Down Expand Up @@ -819,7 +819,7 @@ describe("GenericInputForm", () => {
});
expect(
screen.getByText(
"Unknown signature. Details: invalid-value Version: abitype@1.0.0",
"Unknown signature. Details: invalid-value Version: abitype@1.0.7",
),
).toBeInTheDocument();

Expand Down Expand Up @@ -1022,7 +1022,7 @@ describe("GenericInputForm", () => {
});
expect(
screen.getByText(
"Invalid ABI parameter. Details: invalid-value Version: abitype@1.0.0",
"Invalid ABI parameter. Details: invalid-value Version: abitype@1.0.7",
),
).toBeInTheDocument();
fireEvent.change(abiParameterInput, {
Expand Down
Loading

0 comments on commit fd0edbb

Please sign in to comment.