diff --git a/.gitignore b/.gitignore index d3b4885..5d90983 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,6 @@ package-lock.json .vscode build -repos \ No newline at end of file +repos + +test.ts \ No newline at end of file diff --git a/package.json b/package.json index 6e3724b..0a4d98d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "type": "module", "scripts": { "start": "ts-node --esm src/index.ts", - "test": "echo \"Error: no test specified\" && exit 1" + "pin": "ts-node --esm scripts/pinIPFS.ts", + "test": "ts-node --esm test.ts" }, "repository": { "type": "git", diff --git a/src/downloader.ts b/src/downloader.ts index 609b3ea..c83ac17 100644 --- a/src/downloader.ts +++ b/src/downloader.ts @@ -1,6 +1,6 @@ import { ethers } from "ethers"; import { cidV0ToV1Base32 } from "@ensdomains/content-hash"; -import { simpleGit, SimpleGit, CleanOptions } from "simple-git"; +import { simpleGit, SimpleGit } from "simple-git"; import "dotenv/config"; import path from "path"; @@ -10,7 +10,7 @@ import { Domains, IPFSCids, RepoName } from "./types.ts"; const provider = new ethers.JsonRpcProvider(process.env.RPC_URL || "https://rpc.mevblocker.io"); const git: SimpleGit = simpleGit(); -async function getENSDomainContenthash(domain: string): Promise { +export async function getENSDomainContenthash(domain: string): Promise { const resolver = await provider.getResolver(domain); if (!resolver) throw new Error(`Resolver for domain ${domain} not found!`);