Skip to content

Commit

Permalink
Update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Jun 26, 2022
1 parent 14265d5 commit ac3a7c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 8 additions & 2 deletions packages/lodestar/test/e2e/keymanager/keymanager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,10 @@ describe("keymanager delete and import test", async function () {
afterEachCallbacks.push(() => keystoresDir.removeCallback());
afterEachCallbacks.push(() => tokenDir.removeCallback());

const keymanagerApi = new KeymanagerApi(validators[0], keystoresDir.name);
const keymanagerApi = new KeymanagerApi(validators[0], {
importedKeystoresDirpath: keystoresDir.name,
importedRemoteKeysDirpath: keystoresDir.name,
});

return {config, validators, secretKeys, logger, keymanagerApi, tokenDir: tokenDir.name};
}
Expand Down Expand Up @@ -398,7 +401,10 @@ function createKeymanager(
config: IBeaconConfig,
logger: WinstonLogger
): KeymanagerServer {
const keymanagerApi = new KeymanagerApi(vc, importKeystoresPath);
const keymanagerApi = new KeymanagerApi(vc, {
importedKeystoresDirpath: importKeystoresPath,
importedRemoteKeysDirpath: `${importKeystoresPath}_remotekeys`,
});

return new KeymanagerServer(
{host: "127.0.0.1", port, cors: "*", isAuthEnabled: false, tokenDir: logFilesDir},
Expand Down
3 changes: 1 addition & 2 deletions packages/lodestar/test/utils/node/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
SignerLocal,
} from "@chainsafe/lodestar-validator";
import type {SecretKey} from "@chainsafe/bls/types";
import {KEY_IMPORTED_PREFIX} from "@chainsafe/lodestar-keymanager-server";
import {BeaconNode} from "../../../src/node/index.js";
import {testLogger, TestLoggerOpts} from "../logger.js";
import {getLocalSecretKeys} from "../../../../cli/src/cmds/validator/keys.js";
Expand Down Expand Up @@ -43,7 +42,7 @@ export async function getAndInitValidatorsWithKeystore({
};
}> {
const keystoreDir = tmp.dirSync({unsafeCleanup: true});
const keystoreFile = path.join(`${keystoreDir.name}`, `${KEY_IMPORTED_PREFIX}_${keystorePubKey}.json`);
const keystoreFile = path.join(`${keystoreDir.name}`, `${keystorePubKey}.json`);

fs.writeFileSync(keystoreFile, keystoreContent, {encoding: "utf8", flag: "wx"});

Expand Down

0 comments on commit ac3a7c3

Please sign in to comment.