From c1401b4a6ee28a563bd65e16482b4c9259fb8646 Mon Sep 17 00:00:00 2001 From: Theo Date: Thu, 5 Oct 2023 12:58:54 -0700 Subject: [PATCH] Fix imports & add command to pin Tornado IPFS cids with daemon --- .gitignore | 4 +++- package.json | 3 ++- src/downloader.ts | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) 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!`);