Skip to content

Commit

Permalink
Memoize fetching solc
Browse files Browse the repository at this point in the history
  • Loading branch information
gnidan committed Jul 7, 2024
1 parent 5bc7c56 commit f90fb4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/pointers/src/integration.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { jest, expect, describe, it, beforeEach } from "@jest/globals";
import { jest, expect, describe, it } from "@jest/globals";

import { observeTrace } from "../test/index.js";
import { observeTraceTests } from "./test-cases.js";
Expand Down
5 changes: 3 additions & 2 deletions packages/pointers/test/solc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { fetchSolc } from "web-solc";

import { Data } from "../src/data.js";

const solc = fetchSolc("^0.8.25");
const compile = async (input: any) => await (await solc).compile(input);

/**
* Organizes the sources being compiled by their path identifier, as well
* as includes information about which contract's bytecode is desired
Expand Down Expand Up @@ -44,9 +47,7 @@ export async function compileCreateBytecode({
}
};

const { compile, stopWorker } = await fetchSolc("^0.8.25");
const output = await compile(input);
stopWorker();

const { errors = [] } = output;
if (errors.length > 0) {
Expand Down

0 comments on commit f90fb4a

Please sign in to comment.