Skip to content

Commit

Permalink
fix: e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkeil committed Apr 17, 2024
1 parent cc59be9 commit f71acd7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/light-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class Lightclient {

private runStatus: RunStatus = {code: RunStatusCode.stopped};

constructor({config, logger, genesisData, bootstrap, transport, blsImplementation}: LightclientInitArgs) {
private constructor({config, logger, genesisData, bootstrap, transport, blsImplementation}: LightclientInitArgs) {
this.genesisTime = genesisData.genesisTime;
this.genesisValidatorsRoot =
typeof genesisData.genesisValidatorsRoot === "string"
Expand Down Expand Up @@ -154,8 +154,9 @@ export class Lightclient {
checkpointRoot: phase0.Checkpoint["root"];
}
): Promise<Lightclient> {
const {transport, checkpointRoot} = args;
const {transport, checkpointRoot, blsImplementation} = args;

await initBls(blsImplementation);
// Fetch bootstrap state with proof at the trusted block root
const {data: bootstrap} = await transport.getBootstrap(toHexString(checkpointRoot));

Expand Down Expand Up @@ -185,7 +186,7 @@ export class Lightclient {
// Do not block the event loop
void this.runLoop();

return initBls(this.blsImplementation).then(() => startPromise);
return startPromise;
}

stop(): void {
Expand Down
6 changes: 6 additions & 0 deletions vitest.base.e2e.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import path from "node:path";
import {defineConfig, mergeConfig} from "vitest/config";
import vitestConfig from "./vitest.base.unit.config.js";

Expand All @@ -15,5 +16,10 @@ export default mergeConfig(
},
},
},
resolve: {
alias: {
"@chainsafe/blst": path.join(__dirname, "scripts/vitest/polyfills/emptyModule.js"),
},
},
})
);

0 comments on commit f71acd7

Please sign in to comment.