From 1d9bced599ef416cf0970bcbe5f593aba30b6816 Mon Sep 17 00:00:00 2001 From: Dave Hrycyszyn Date: Mon, 15 Mar 2021 13:37:01 +0000 Subject: [PATCH] Temporarily disabling fs access (#527) * Temporarily disabling fs access * Going back to double quotes --- clients/validator/src/index.ts | 37 ++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/clients/validator/src/index.ts b/clients/validator/src/index.ts index 13c9a05327..0e45e01ac6 100644 --- a/clients/validator/src/index.ts +++ b/clients/validator/src/index.ts @@ -1,12 +1,12 @@ -import NetClient, {INetClient} from "./net-client"; -import {MixNode, MixNodeBond} from "./types"; -import * as fs from "fs"; -import {Bip39, Random} from "@cosmjs/crypto"; -import {DirectSecp256k1HdWallet} from "@cosmjs/proto-signing"; +import NetClient, { INetClient } from "./net-client"; +import { MixNode, MixNodeBond } from "./types"; +// import * as fs from "fs"; +import { Bip39, Random } from "@cosmjs/crypto"; +import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import MixnodesCache from "./caches/mixnodes"; -import {Coin, coins} from "@cosmjs/launchpad"; -import {BroadcastTxResponse} from "@cosmjs/stargate/types" -import {ExecuteResult, InstantiateOptions, InstantiateResult, UploadMeta, UploadResult} from "@cosmjs/cosmwasm"; +import { Coin, coins } from "@cosmjs/launchpad"; +import { BroadcastTxResponse } from "@cosmjs/stargate/types" +import { ExecuteResult, InstantiateOptions, InstantiateResult, UploadMeta, UploadResult } from "@cosmjs/cosmwasm"; export { coins }; export default class ValidatorClient { @@ -34,20 +34,23 @@ export default class ValidatorClient { } /** + * TODO: re-enable this once we move back to client-side wallets running on people's machines + * instead of the web wallet. + * * Loads a named mnemonic from the system's keystore. * * @param keyPath the name of the key in the keystore * @returns the mnemonic as a string */ - static loadMnemonic(keyPath: string): string { - try { - const mnemonic = fs.readFileSync(keyPath, "utf8"); - return mnemonic.trim(); - } catch (err) { - console.log(err); - return "fight with type system later"; - } - } + // static loadMnemonic(keyPath: string): string { + // try { + // const mnemonic = fs.readFileSync(keyPath, "utf8"); + // return mnemonic.trim(); + // } catch (err) { + // console.log(err); + // return "fight with type system later"; + // } + // } /** * Generates a random mnemonic, useful for creating new accounts.