diff --git a/packages/brain/src/index.ts b/packages/brain/src/index.ts index 5bb24d82..27b6fca7 100644 --- a/packages/brain/src/index.ts +++ b/packages/brain/src/index.ts @@ -44,13 +44,13 @@ export const signerApi = new Web3SignerApi({ baseUrl: signerUrl, authToken: token, host, -}); -export const beaconchaApi = new BeaconchaApi({ baseUrl: beaconchaUrl }); +}, network); +export const beaconchaApi = new BeaconchaApi({ baseUrl: beaconchaUrl }, network); export const validatorApi = new ValidatorApi({ baseUrl: validatorUrl, authToken: token, tlsCert, -}); +}, network); export const beaconchainApi = new Beaconchain( { baseUrl: beaconchainUrl }, network diff --git a/packages/brain/src/modules/apiClients/beaconcha/index.ts b/packages/brain/src/modules/apiClients/beaconcha/index.ts index e52c38ff..a28a2888 100644 --- a/packages/brain/src/modules/apiClients/beaconcha/index.ts +++ b/packages/brain/src/modules/apiClients/beaconcha/index.ts @@ -44,7 +44,7 @@ export class BeaconchaApi extends StandardApi { const endpoint = `/api/v1/validator/${pubkeys.join(",")}`; try { - return (await this.request("GET", endpoint)) as BeaconchaGetResponse; + return (await this.request({ method: "GET", endpoint })) as BeaconchaGetResponse; } catch (e) { e.message += "Error on getting indexes for validator public keys"; throw e; diff --git a/packages/brain/src/modules/apiClients/beaconchain/index.ts b/packages/brain/src/modules/apiClients/beaconchain/index.ts index 2a09d3ca..571cc572 100644 --- a/packages/brain/src/modules/apiClients/beaconchain/index.ts +++ b/packages/brain/src/modules/apiClients/beaconchain/index.ts @@ -15,7 +15,7 @@ export class Beaconchain extends StandardApi { private beaconchainEndpoint = "/eth/v1/beacon"; constructor(apiParams: ApiParams, network: Network) { - super(apiParams); + super(apiParams, network); this.SLOTS_PER_EPOCH = network === "gnosis" ? 16 : 32; } @@ -30,11 +30,11 @@ export class Beaconchain extends StandardApi { postVoluntaryExitsRequest: BeaconchainPoolVoluntaryExitsPostRequest; }): Promise { try { - await this.request( - "POST", - path.join(this.beaconchainEndpoint, "pool", "voluntary_exits"), - JSON.stringify(postVoluntaryExitsRequest) - ); + await this.request({ + method: "POST", + endpoint: path.join(this.beaconchainEndpoint, "pool", "voluntary_exits"), + body: JSON.stringify(postVoluntaryExitsRequest) + }); } catch (e) { e.message += `Error posting (POST) voluntary exits to beaconchain. `; throw e; @@ -47,10 +47,10 @@ export class Beaconchain extends StandardApi { */ public async getGenesis(): Promise { try { - return (await this.request( - "GET", - path.join(this.beaconchainEndpoint, "genesis") - )) as BeaconchainGenesisGetResponse; + return (await this.request({ + method: "GET", + endpoint: path.join(this.beaconchainEndpoint, "genesis") + })) as BeaconchainGenesisGetResponse; } catch (e) { e.message += `Error getting (GET) genesis from beaconchain. `; throw e; @@ -68,10 +68,10 @@ export class Beaconchain extends StandardApi { state_id: string; }): Promise { try { - return (await this.request( - "GET", - path.join(this.beaconchainEndpoint, "states", state_id, "fork") - )) as BeaconchainForkFromStateGetResponse; + return (await this.request({ + method: "GET", + endpoint: path.join(this.beaconchainEndpoint, "states", state_id, "fork") + })) as BeaconchainForkFromStateGetResponse; } catch (e) { e.message += `Error getting (GET) fork from beaconchain. `; throw e; @@ -92,16 +92,16 @@ export class Beaconchain extends StandardApi { pubkey: string; }): Promise { try { - return (await this.request( - "GET", - path.join( + return (await this.request({ + method: "GET", + endpoint: path.join( this.beaconchainEndpoint, "states", state, "validators", pubkey ) - )) as BeaconchainValidatorFromStateGetResponse; + })) as BeaconchainValidatorFromStateGetResponse; } catch (e) { e.message += `Error getting (GET) validator from beaconchain. `; throw e; @@ -128,10 +128,10 @@ export class Beaconchain extends StandardApi { block_id: string; }): Promise { try { - return (await this.request( - "GET", - path.join(this.beaconchainEndpoint, "headers", block_id) - )) as BeaconchainBlockHeaderGetResponse; + return (await this.request({ + method: "GET", + endpoint: path.join(this.beaconchainEndpoint, "headers", block_id) + })) as BeaconchainBlockHeaderGetResponse; } catch (e) { e.message += `Error getting (GET) block header from beaconchain. `; throw e; diff --git a/packages/brain/src/modules/apiClients/index.ts b/packages/brain/src/modules/apiClients/index.ts index c3d022c8..6387da11 100644 --- a/packages/brain/src/modules/apiClients/index.ts +++ b/packages/brain/src/modules/apiClients/index.ts @@ -4,6 +4,7 @@ import { ApiParams, AllowedMethods, ErrnoException, + Network, } from "@stakingbrain/common"; import { ApiError } from "./error.js"; import logger from "../logger/index.js"; @@ -11,10 +12,13 @@ import logger from "../logger/index.js"; export class StandardApi { private useTls = false; private requestOptions: https.RequestOptions; + protected network: Network; - constructor(apiParams: ApiParams) { + constructor(apiParams: ApiParams, network: Network) { const urlOptions = new URL(apiParams.baseUrl + (apiParams.apiPath || "")); + this.network = network; + this.requestOptions = { hostname: urlOptions.hostname, port: urlOptions.port, @@ -46,13 +50,19 @@ export class StandardApi { return `${protocol}//${hostname}:${port || 80}`; } - protected async request( + protected async request({ + method, + endpoint, + body, + setOrigin = false + }: { method: AllowedMethods, endpoint: string, // eslint-disable-next-line @typescript-eslint/no-explicit-any - body?: any + body?: any, + setOrigin?: boolean // eslint-disable-next-line @typescript-eslint/no-explicit-any - ): Promise { + }): Promise { let req: http.ClientRequest; this.requestOptions.method = method; this.requestOptions.path = endpoint; @@ -62,6 +72,11 @@ export class StandardApi { req = https.request(this.requestOptions); } else req = http.request(this.requestOptions); + if (setOrigin) + req.setHeader("Origin", this.network === "mainnet" + ? "http://brain.web3signer.dappnode" + : `http://brain.web3signer-${this.network}.dappnode`); + if (body) { req.setHeader("Content-Length", Buffer.byteLength(body)); req.write(body); diff --git a/packages/brain/src/modules/apiClients/validator/index.ts b/packages/brain/src/modules/apiClients/validator/index.ts index 7c5a046a..10ae25e7 100644 --- a/packages/brain/src/modules/apiClients/validator/index.ts +++ b/packages/brain/src/modules/apiClients/validator/index.ts @@ -31,14 +31,14 @@ export class ValidatorApi extends StandardApi { publicKey: string ): Promise { try { - return (await this.request( - "GET", - path.join( + return (await this.request({ + method: "GET", + endpoint: path.join( this.feeRecipientEndpoint, prefix0xPubkey(publicKey), "feerecipient" ) - )) as ValidatorGetFeeResponse; + })) as ValidatorGetFeeResponse; } catch (e) { e.message += `Error getting (GET) fee recipient for pubkey ${publicKey} from validator. `; throw e; @@ -54,15 +54,15 @@ export class ValidatorApi extends StandardApi { publicKey: string ): Promise { try { - await this.request( - "POST", - path.join( + await this.request({ + method: "POST", + endpoint: path.join( this.feeRecipientEndpoint, prefix0xPubkey(publicKey), "feerecipient" ), - JSON.stringify({ ethaddress: newFeeRecipient }) - ); + body: JSON.stringify({ ethaddress: newFeeRecipient }) + }); } catch (e) { e.message += `Error setting (POST) fee recipient for pubkey ${publicKey} to ${newFeeRecipient} on validator. `; throw e; @@ -75,14 +75,14 @@ export class ValidatorApi extends StandardApi { */ public async deleteFeeRecipient(publicKey: string): Promise { try { - await this.request( - "DELETE", - path.join( + await this.request({ + method: "DELETE", + endpoint: path.join( this.feeRecipientEndpoint, prefix0xPubkey(publicKey), "feerecipient" ) - ); + }); } catch (e) { e.message += `Error deleting (DELETE) fee recipient for pubkey ${publicKey} from validator. `; throw e; @@ -95,10 +95,10 @@ export class ValidatorApi extends StandardApi { */ public async getRemoteKeys(): Promise { try { - return (await this.request( - "GET", - this.remoteKeymanagerEndpoint - )) as ValidatorGetRemoteKeysResponse; + return (await this.request({ + method: "GET", + endpoint: this.remoteKeymanagerEndpoint + })) as ValidatorGetRemoteKeysResponse; } catch (e) { e.message += `Error getting (GET) remote keys from validator. `; throw e; @@ -116,11 +116,11 @@ export class ValidatorApi extends StandardApi { remoteKeys.remote_keys = remoteKeys.remote_keys.map((k) => { return { pubkey: prefix0xPubkey(k.pubkey), url: k.url }; }); - return (await this.request( - "POST", - this.remoteKeymanagerEndpoint, - JSON.stringify(remoteKeys) - )) as ValidatorPostRemoteKeysResponse; + return (await this.request({ + method: "POST", + endpoint: this.remoteKeymanagerEndpoint, + body: JSON.stringify(remoteKeys) + })) as ValidatorPostRemoteKeysResponse; } catch (e) { e.message += `Error posting (POST) remote keys to validator. `; throw e; @@ -137,11 +137,11 @@ export class ValidatorApi extends StandardApi { try { // Make sure all pubkeys are prefixed with 0x pubkeys.pubkeys = pubkeys.pubkeys.map((k) => prefix0xPubkey(k)); - return (await this.request( - "DELETE", - this.remoteKeymanagerEndpoint, - JSON.stringify(pubkeys) - )) as ValidatorDeleteRemoteKeysResponse; + return (await this.request({ + method: "DELETE", + endpoint: this.remoteKeymanagerEndpoint, + body: JSON.stringify(pubkeys) + })) as ValidatorDeleteRemoteKeysResponse; } catch (e) { e.message += `Error deleting (DELETE) remote keys from validator. `; throw e; diff --git a/packages/brain/src/modules/apiClients/web3signer/index.ts b/packages/brain/src/modules/apiClients/web3signer/index.ts index ccc86130..5aafd358 100644 --- a/packages/brain/src/modules/apiClients/web3signer/index.ts +++ b/packages/brain/src/modules/apiClients/web3signer/index.ts @@ -46,11 +46,12 @@ export class Web3SignerApi extends StandardApi { pubkey: string; }): Promise { try { - return await this.request( - "POST", - path.join(this.signEndpoint, pubkey), - JSON.stringify(signerVoluntaryExitRequest) - ); + return await this.request({ + method: "POST", + endpoint: path.join(this.signEndpoint, pubkey), + body: JSON.stringify(signerVoluntaryExitRequest), + setOrigin: true, + }); } catch (e) { e.message += `Error signing (POST) voluntary exit for validator index ${signerVoluntaryExitRequest.voluntary_exit.validator_index}. `; throw e; @@ -66,11 +67,12 @@ export class Web3SignerApi extends StandardApi { ): Promise { try { // IMPORTANT: do not edit the keystore data, it must be exactly as it was received from the remote signer - return (await this.request( - "POST", - this.localKeymanagerEndpoint, - JSON.stringify(postRequest) - )) as Web3signerPostResponse; + return (await this.request({ + method: "POST", + endpoint: this.localKeymanagerEndpoint, + body: JSON.stringify(postRequest), + setOrigin: true, + })) as Web3signerPostResponse; } catch (e) { e.message += `Error importing (POST) keystores to remote signer. `; throw e; @@ -92,11 +94,12 @@ export class Web3SignerApi extends StandardApi { const data = JSON.stringify({ pubkeys: deleteRequest.pubkeys, }); - return (await this.request( - "DELETE", - this.localKeymanagerEndpoint, - data - )) as Web3signerDeleteResponse; + return (await this.request({ + method: "DELETE", + endpoint: this.localKeymanagerEndpoint, + body: data, + setOrigin: true, + })) as Web3signerDeleteResponse; } catch (e) { e.message += `Error deleting (DELETE) keystores from remote signer. `; throw e; @@ -109,10 +112,11 @@ export class Web3SignerApi extends StandardApi { */ public async getKeystores(): Promise { try { - return (await this.request( - "GET", - this.localKeymanagerEndpoint - )) as Web3signerGetResponse; + return (await this.request({ + method: "GET", + endpoint: this.localKeymanagerEndpoint, + setOrigin: true, + })) as Web3signerGetResponse; } catch (e) { e.message += `Error getting (GET) keystores from remote signer. `; throw e; @@ -125,10 +129,11 @@ export class Web3SignerApi extends StandardApi { */ public async getStatus(): Promise { try { - return (await this.request( - "GET", - this.serverStatusEndpoint - )) as Web3signerHealthcheckResponse; + return (await this.request({ + method: "GET", + endpoint: this.serverStatusEndpoint, + setOrigin: true, + })) as Web3signerHealthcheckResponse; } catch (e) { e.message += `Error getting (GET) server status. Is Web3Signer running? `; throw e; diff --git a/packages/brain/src/modules/apiServers/launchpad/index.ts b/packages/brain/src/modules/apiServers/launchpad/index.ts index 95f72267..d7b2b694 100644 --- a/packages/brain/src/modules/apiServers/launchpad/index.ts +++ b/packages/brain/src/modules/apiServers/launchpad/index.ts @@ -1,4 +1,5 @@ import express from "express"; +import cors from "cors"; import { tags as availableTags, Tag } from "@stakingbrain/common"; import logger from "../../logger/index.js"; import http from "node:http"; @@ -9,6 +10,16 @@ export function startLaunchpadApi(): http.Server { const app = express(); const server = new http.Server(app); app.use(express.json()); + app.use( + cors({ + origin: [ + "http://rocketpool-testnet.public.dappnode", // TODO: deprecate after holesky published + "http://rocketpool.dappnode", // Mainnet + "http://stader-testnet.dappnode", // Testnet + "http://stader.dappnode", // Mainnet + ], + }) + ); app.post("/eth/v1/keystores", async (req, res) => { const { keystores, passwords, slashingProtection, tags, feeRecipients } = req.body; diff --git a/packages/brain/tests/unit/modules/apiClients/cron.unit.test.ts b/packages/brain/tests/unit/modules/apiClients/cron.unit.test.ts index 716040a7..6f1a2697 100644 --- a/packages/brain/tests/unit/modules/apiClients/cron.unit.test.ts +++ b/packages/brain/tests/unit/modules/apiClients/cron.unit.test.ts @@ -7,7 +7,7 @@ import { BrainDataBase } from "../../../../src/modules/db/index.js"; import fs from "fs"; import path from "path"; import { Cron } from "../../../../src/modules/cron/index.js"; -import { PubkeyDetails } from "@stakingbrain/common"; +import { Network, PubkeyDetails } from "@stakingbrain/common"; describe.skip("Cron: Prater", () => { const defaultFeeRecipient = "0x0000000000000000000000000000000000000000"; @@ -26,7 +26,7 @@ describe.skip("Cron: Prater", () => { const keystorePass = "stakingbrain"; const stakerSpecs = { - network: "prater", + network: "prater" as Network, consensusClients: [ /*{ name: "Prysm", @@ -81,7 +81,7 @@ describe.skip("Cron: Prater", () => { validatorApi = new ValidatorApi({ baseUrl: `http://${consensusIp}:3500`, authToken: consensusClient.token, - }); + }, stakerSpecs.network); const signerIp = execSync( `docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${signerContainerName}` @@ -91,7 +91,7 @@ describe.skip("Cron: Prater", () => { signerApi = new Web3SignerApi({ baseUrl: `http://${signerIp}:9000`, host, - }); + }, stakerSpecs.network); if (fs.existsSync(testDbName)) fs.unlinkSync(testDbName); brainDb = new BrainDataBase(testDbName); diff --git a/packages/brain/tests/unit/modules/apiClients/fetchValidatorIndex.unit.test.ts b/packages/brain/tests/unit/modules/apiClients/fetchValidatorIndex.unit.test.ts index 72fd1d6e..b5a822bc 100644 --- a/packages/brain/tests/unit/modules/apiClients/fetchValidatorIndex.unit.test.ts +++ b/packages/brain/tests/unit/modules/apiClients/fetchValidatorIndex.unit.test.ts @@ -1,32 +1,40 @@ import { expect } from "chai"; -import { ApiParams } from "@stakingbrain/common"; +import { ApiParams, Network } from "@stakingbrain/common"; import { BeaconchaApi } from "../../../../src/modules/apiClients/beaconcha/index.js"; -describe.skip("Test for fetching validator indexes in every available network", () => { - it("should return data corresponding to every validator PK", async () => { - const networks = ["mainnet", "prater", "gnosis", "lukso", "holesky"]; +describe.only("Test for fetching validator indexes in every available network", () => { + const networks: Network[] = ["mainnet", "prater", "gnosis", "lukso", "holesky"]; - for (const network of networks) { - console.log("NETWORK: ", network); + networks.forEach((network) => { + it(`should return data corresponding to every validator PK for ${network}`, async () => { + const apiParams = beaconchaApiParamsMap.get(network); + if (!apiParams) { + throw new Error(`API parameters for ${network} are not defined`); + } - const beaconchaApi = new BeaconchaApi( - beaconchaApiParamsMap.get(network)! - ); + const beaconchaApi = new BeaconchaApi(apiParams, network); + const testParams = networkTestMap.get(network); + if (!testParams) { + throw new Error(`Test parameters for ${network} are not defined`); + } const allValidatorsInfo = await beaconchaApi.fetchAllValidatorsInfo({ - pubkeys: [ - networkTestMap.get(network)!.pubkeys[0], - networkTestMap.get(network)!.pubkeys[1], - ], + pubkeys: testParams.pubkeys, }); - expect(allValidatorsInfo[0].data[0].validatorindex).to.equal( - networkTestMap.get(network)!.indexes[0] - ); - expect(allValidatorsInfo[0].data[1].validatorindex).to.equal( - networkTestMap.get(network)!.indexes[1] - ); - } + // Assuming allValidatorsInfo[0].data contains an array of validators + const validators = allValidatorsInfo[0].data; + + // This loop assumes that the API returns validators in the same order as requested. + // If this assumption is not valid, additional logic is needed to match returned validators to expected values. + testParams.pubkeys.forEach((pubkey, index) => { + const validator = validators.find(v => v.pubkey === pubkey); + if (!validator) { + throw new Error(`Validator with pubkey ${pubkey} not found for ${network}`); + } + expect(validator.validatorindex).to.equal(testParams.indexes[index]); + }); + }); }); }); @@ -93,7 +101,6 @@ const beaconchaApiParamsMap = new Map([ "mainnet", { baseUrl: "https://beaconcha.in", - host: "brain.web3signer.dappnode", apiPath: "/api/v1/", }, ], @@ -101,7 +108,6 @@ const beaconchaApiParamsMap = new Map([ "prater", { baseUrl: "https://prater.beaconcha.in", - host: "brain.web3signer-prater.dappnode", apiPath: "/api/v1/", }, ], @@ -109,7 +115,6 @@ const beaconchaApiParamsMap = new Map([ "gnosis", { baseUrl: "https://gnosischa.in", - host: "brain.web3signer-gnosis.dappnode", apiPath: "/api/v1/", }, ], @@ -117,7 +122,6 @@ const beaconchaApiParamsMap = new Map([ "lukso", { baseUrl: "https://explorer.consensus.mainnet.lukso.network", - host: "brain.web3signer-lukso.dappnode", apiPath: "/api/v1/", }, ], @@ -125,7 +129,6 @@ const beaconchaApiParamsMap = new Map([ "holesky", { baseUrl: "https://holesky.beaconcha.in", - host: "brain.web3signer-holesky.dappnode", apiPath: "/api/v1/", }, ], diff --git a/packages/brain/tests/unit/modules/apiClients/validatorApi.unit.test.ts b/packages/brain/tests/unit/modules/apiClients/validatorApi.unit.test.ts index ab967b7b..f00de4b3 100644 --- a/packages/brain/tests/unit/modules/apiClients/validatorApi.unit.test.ts +++ b/packages/brain/tests/unit/modules/apiClients/validatorApi.unit.test.ts @@ -2,6 +2,7 @@ import { expect } from "chai"; import { before } from "mocha"; import { ValidatorApi } from "../../../../src/modules/apiClients/validator/index.js"; import { execSync } from "node:child_process"; +import { Network } from "@stakingbrain/common"; describe.skip("Validator API: Prater", () => { const defaultFeeRecipient = "0x0000000000000000000000000000000000000000"; @@ -13,7 +14,7 @@ describe.skip("Validator API: Prater", () => { "0xa1735a0dd72205dae313c36d7d17f5b06685944c8886ddac530e5aedbe1fca0c8003e7e274ec1b4ddd08b884f5b9a830", ]; const stakerSpecs = { - network: "prater", + network: "prater" as Network, consensusClients: [ { name: "Prysm", @@ -57,7 +58,7 @@ describe.skip("Validator API: Prater", () => { validatorApi = new ValidatorApi({ baseUrl: `http://${consensusIp}:3500`, authToken: consensusClient.token, - }); + }, stakerSpecs.network); }); it("Should post validators", async () => { diff --git a/packages/brain/tests/unit/modules/apiClients/web3signerApi.unit.test.ts b/packages/brain/tests/unit/modules/apiClients/web3signerApi.unit.test.ts index 662c4041..ebaf052d 100644 --- a/packages/brain/tests/unit/modules/apiClients/web3signerApi.unit.test.ts +++ b/packages/brain/tests/unit/modules/apiClients/web3signerApi.unit.test.ts @@ -30,7 +30,7 @@ describe.skip("Signer API: Prater", () => { signerApi = new Web3SignerApi({ baseUrl: `http://${signerIp}:9000`, host, - }); + }, "prater"); }); it("Should post validators", async () => { diff --git a/packages/brain/tests/unit/modules/db/index.unit.test.ts b/packages/brain/tests/unit/modules/db/index.unit.test.ts index 99a60597..ce310b05 100644 --- a/packages/brain/tests/unit/modules/db/index.unit.test.ts +++ b/packages/brain/tests/unit/modules/db/index.unit.test.ts @@ -28,40 +28,40 @@ describe("DataBase", () => { it.skip("Should do migration if database file not found", async () => { const expectedDb = { "0x821a80380122281580ba8a56cd21956933d43c62fdc8f5b4ec31b2c620e8534e80b6b816c9a2cc8d25568dc4ebcfd47a": - { - tag: "solo", - feeRecipient: "0x0000000000000000000000000000000000000000", - feeRecipientValidator: "0x0000000000000000000000000000000000000000", - automaticImport: true, - }, + { + tag: "solo", + feeRecipient: "0x0000000000000000000000000000000000000000", + feeRecipientValidator: "0x0000000000000000000000000000000000000000", + automaticImport: true, + }, "0x86d25af52627204ab822a20ac70da6767952841edbcb0b83c84a395205313661de5f7f76efa475a46f45fa89d95c1dd7": - { - tag: "solo", - feeRecipient: "0x0000000000000000000000000000000000000000", - feeRecipientValidator: "0x0000000000000000000000000000000000000000", - automaticImport: true, - }, + { + tag: "solo", + feeRecipient: "0x0000000000000000000000000000000000000000", + feeRecipientValidator: "0x0000000000000000000000000000000000000000", + automaticImport: true, + }, "0x8f2b698583d69c7a78b4482871282602adb7fb47a1aab66c63feb48e7b9245dad77b82346e0201328d66a8b4d483b716": - { - tag: "solo", - feeRecipient: "0x0000000000000000000000000000000000000000", - feeRecipientValidator: "0x0000000000000000000000000000000000000000", - automaticImport: true, - }, + { + tag: "solo", + feeRecipient: "0x0000000000000000000000000000000000000000", + feeRecipientValidator: "0x0000000000000000000000000000000000000000", + automaticImport: true, + }, "0xa1735a0dd72205dae313c36d7d17f5b06685944c8886ddac530e5aedbe1fca0c8003e7e274ec1b4ddd08b884f5b9a830": - { - tag: "solo", - feeRecipient: "0x0000000000000000000000000000000000000000", - feeRecipientValidator: "0x0000000000000000000000000000000000000000", - automaticImport: true, - }, + { + tag: "solo", + feeRecipient: "0x0000000000000000000000000000000000000000", + feeRecipientValidator: "0x0000000000000000000000000000000000000000", + automaticImport: true, + }, "0xa2cc280ce811bb680cba309103e23dc3c9902f2a08541c6737e8adfe8198e796023b959fc8aadfad39499b56ec3dd184": - { - tag: "solo", - feeRecipient: "0x0000000000000000000000000000000000000000", - feeRecipientValidator: "0x0000000000000000000000000000000000000000", - automaticImport: true, - }, + { + tag: "solo", + feeRecipient: "0x0000000000000000000000000000000000000000", + feeRecipientValidator: "0x0000000000000000000000000000000000000000", + automaticImport: true, + }, }; // get container IPs const signerIp = execSync( @@ -77,11 +77,11 @@ describe("DataBase", () => { const signerApi = new Web3SignerApi({ baseUrl: `http://${signerIp}:9000`, host: `web3signer.web3signer-prater.dappnode`, - }); + }, "prater"); const validatorApi = new ValidatorApi({ baseUrl: `http://${consensusIp}:3500`, authToken: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.MxwOozSH-TLbW_XKepjyYDHm2IT8Ki0tD3AHuajfNMg`, - }); + }, "prater"); // import to web3signer const keystoresPath = path.resolve(process.cwd(), "keystores"); const keystoresPaths = fs @@ -154,22 +154,22 @@ describe("DataBase", () => { /** * Should create a new database if it doesn't exist */ - it("Should create a new database if it doesn't exist", () => {}); + it("Should create a new database if it doesn't exist", () => { }); /** * Should throw an error if the pubkeys to be added are invalid */ - it("Should throw an error if the pubkeys to be added are invalid", () => {}); + it("Should throw an error if the pubkeys to be added are invalid", () => { }); /** * Should throw an error if the pubkeys to be added and the existing pubkeys exceed the maximum database size */ - it("Should throw an error if the pubkeys to be added and the existing pubkeys exceed the maximum database size", () => {}); + it("Should throw an error if the pubkeys to be added and the existing pubkeys exceed the maximum database size", () => { }); /** * Should add the pubkeys to the database */ - it("Should add the pubkeys to the database", () => {}); + it("Should add the pubkeys to the database", () => { }); }); after(() => {