Temporarily disabling fs access (#527)

* Temporarily disabling fs access

* Going back to double quotes
This commit is contained in:
Dave Hrycyszyn
2021-03-15 13:37:01 +00:00
committed by GitHub
parent a854118f19
commit 1d9bced599
+20 -17
View File
@@ -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.