Remove obsolete setSecretAndCreateIdentities

This commit is contained in:
Simon Warta 2020-02-10 12:45:54 +01:00
parent 6075d2900c
commit 3f8ab89877
3 changed files with 9 additions and 9 deletions

View File

@ -2,7 +2,7 @@ import { ChainId } from "@iov/bcp";
import { Bip39, Random } from "@iov/crypto";
import * as constants from "../constants";
import { setSecretAndCreateIdentities } from "../profile";
import { createUserProfile } from "../profile";
export async function generate(args: ReadonlyArray<string>): Promise<void> {
if (args.length < 1) {
@ -17,5 +17,5 @@ export async function generate(args: ReadonlyArray<string>): Promise<void> {
console.info(`FAUCET_MNEMONIC="${mnemonic}"`);
// Log the addresses
await setSecretAndCreateIdentities(mnemonic, chainId);
await createUserProfile(mnemonic, chainId, constants.concurrency, true);
}

View File

@ -8,7 +8,7 @@ import * as constants from "../../constants";
import { logAccountsState } from "../../debugging";
import { Faucet } from "../../faucet";
import { availableTokensFromHolder } from "../../multichainhelpers";
import { setSecretAndCreateIdentities } from "../../profile";
import { createUserProfile } from "../../profile";
import { HttpError } from "./httperror";
import { RequestParser } from "./requestparser";
@ -32,7 +32,12 @@ export async function start(args: ReadonlyArray<string>): Promise<void> {
// Profile
if (!constants.mnemonic) throw new Error("The FAUCET_MNEMONIC environment variable is not set");
const profile = await setSecretAndCreateIdentities(constants.mnemonic, connection.chainId());
const [profile] = await createUserProfile(
constants.mnemonic,
connection.chainId(),
constants.concurrency,
true,
);
// Faucet
const faucet = new Faucet(constants.tokenConfig, connection, connector.codec, profile, true);

View File

@ -2,7 +2,6 @@ import { ChainId, Identity } from "@iov/bcp";
import { HdPaths, Secp256k1HdWallet, UserProfile } from "@iov/keycontrol";
import { identityToAddress } from "./addresses";
import * as constants from "./constants";
import { debugPath } from "./hdpaths";
export async function createUserProfile(
@ -29,7 +28,3 @@ export async function createUserProfile(
}
return [profile, identities];
}
export async function setSecretAndCreateIdentities(mnemonic: string, chainId: ChainId): Promise<UserProfile> {
return (await createUserProfile(mnemonic, chainId, constants.concurrency, true))[0];
}