/ packages / frontend / src / utils / mod_test.ts
mod_test.ts
 1  import { assertEquals } from "@std/assert";
 2  import { createPublicClient, http, zeroAddress } from "viem";
 3  import { hardhat } from "viem/chains";
 4  import { abi } from "@massmarket/contracts";
 5  const { eddiesAddress } = abi;
 6  
 7  import * as Utils from "./mod.ts";
 8  
 9  Deno.test("getTokenInformation", async () => {
10    const publicClient = createPublicClient({
11      chain: hardhat,
12      transport: http(),
13    });
14    const eth = await Utils.getTokenInformation(
15      publicClient,
16      zeroAddress,
17    );
18    assertEquals(eth[0], "ETH");
19    assertEquals(eth[1], 18);
20    const edd = await Utils.getTokenInformation(
21      publicClient,
22      eddiesAddress,
23    );
24    assertEquals(edd[0], "EDD");
25    assertEquals(edd[1], 2);
26  });