Skip to content

Commit

Permalink
fix test types
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomendezroyo committed Aug 12, 2024
1 parent 0cee03e commit 5baf6f2
Showing 1 changed file with 15 additions and 25 deletions.
40 changes: 15 additions & 25 deletions packages/daemons/test/unit/ethMultiClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ import sinon from "sinon";
import rewiremock from "rewiremock/webpack";
// imports for typings
import {
EthClientTarget,
UserSettings,
InstalledPackageData,
Eth2ClientTarget,
EthClientRemote,
EthClientInstallStatus,
ExecutionClientMainnet,
ConsensusClientMainnet,
} from "@dappnode/types";
import { mockDnp, mockContainer, dappnodeInstaller } from "../testUtils.js";

Expand All @@ -22,10 +19,9 @@ interface State {

describe.skip("daemons > ethMultiClient > runWatcher", () => {
it("Simulate a client change process", async () => {
let currentExecClient: ExecutionClientMainnet | undefined | null =
let currentExecClient: string | null | undefined =
"besu.public.dappnode.eth";
let currentConsClient: ConsensusClientMainnet | undefined | null =
"prysm.dnp.dappnode.eth";
let currentConsClient: string | null | undefined = "prysm.dnp.dappnode.eth";
let currentRemote: EthClientRemote | null = EthClientRemote.on;
const newTarget: Eth2ClientTarget = {
execClient: "geth.dnp.dappnode.eth",
Expand All @@ -49,14 +45,14 @@ describe.skip("daemons > ethMultiClient > runWatcher", () => {
// Also, it will be enforced by rewiremock in case of error
const db = {
executionClientMainnet: {
get: (): ExecutionClientMainnet | undefined | null => currentExecClient,
set: async (execClient: ExecutionClientMainnet | undefined | null) => {
get: (): string | null | undefined => currentExecClient,
set: async (execClient: string | null | undefined) => {
currentExecClient = execClient;
},
},
consensusClientMainnet: {
get: (): ConsensusClientMainnet | undefined | null => currentConsClient,
set: async (consClient: ConsensusClientMainnet | undefined | null) => {
get: (): string | null | undefined => currentConsClient,
set: async (consClient: string | null | undefined) => {
currentConsClient = consClient;
},
},
Expand All @@ -68,27 +64,21 @@ describe.skip("daemons > ethMultiClient > runWatcher", () => {
},
ethExecClientInstallStatus: {
getAll: () => ({}),
get: (keyArg: ExecutionClientMainnet) => state.status[keyArg],
set: (
keyArg: ExecutionClientMainnet,
status: EthClientInstallStatus
) => {
get: (keyArg: string) => state.status[keyArg],
set: (keyArg: string, status: EthClientInstallStatus) => {
state.status[keyArg] = status;
},
remove: (keyArg: ExecutionClientMainnet) => {
remove: (keyArg: string) => {
keyArg;
},
},
ethConsClientInstallStatus: {
getAll: () => ({}),
get: (keyArg: ConsensusClientMainnet) => state.status[keyArg],
set: (
keyArg: ConsensusClientMainnet,
status: EthClientInstallStatus
) => {
get: (keyArg: string) => state.status[keyArg],
set: (keyArg: string, status: EthClientInstallStatus) => {
state.status[keyArg] = status;
},
remove: (keyArg: ConsensusClientMainnet) => {
remove: (keyArg: string) => {
keyArg;
},
},
Expand All @@ -100,15 +90,15 @@ describe.skip("daemons > ethMultiClient > runWatcher", () => {
},
ethClientUserSettings: {
getAll: () => ({}),
get: (keyArg: EthClientTarget): UserSettings => {
get: (keyArg: Eth2ClientTarget): UserSettings => {
keyArg;
return {};
},
set: (keyArg: EthClientTarget, userSettings: UserSettings) => {
set: (keyArg: Eth2ClientTarget, userSettings: UserSettings) => {
keyArg;
userSettings;
},
remove: (keyArg: EthClientTarget) => {
remove: (keyArg: Eth2ClientTarget) => {
keyArg;
},
},
Expand Down

0 comments on commit 5baf6f2

Please sign in to comment.