diff --git a/packages/config-service/src/commands/printEnvs.ts b/packages/config-service/src/commands/printEnvs.ts index 2764b21f7..fb392098f 100644 --- a/packages/config-service/src/commands/printEnvs.ts +++ b/packages/config-service/src/commands/printEnvs.ts @@ -2,7 +2,7 @@ * * Hedera JSON RPC Relay * - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2024 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/packages/config-service/src/services/globalConfig.ts b/packages/config-service/src/services/globalConfig.ts index 52b2f07db..a15955482 100644 --- a/packages/config-service/src/services/globalConfig.ts +++ b/packages/config-service/src/services/globalConfig.ts @@ -2,7 +2,7 @@ * * Hedera JSON RPC Relay * - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2024 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,22 @@ * */ +type TypeStrToType = Tstr extends 'string' + ? string + : Tstr extends 'boolean' + ? boolean + : Tstr extends 'number' + ? number + : Tstr extends 'array' + ? unknown[] + : never; + +type GetTypeStrOfKey = K extends keyof typeof _CONFIG + ? typeof _CONFIG[K]['type'] + : never; + +export type TypeOfKey = TypeStrToType>; + export interface ConfigProperty { envName: string; type: string; @@ -751,6 +767,40 @@ const _CONFIG = { export type ConfigKey = keyof typeof _CONFIG; +export class ConfigService { + private static config: typeof _CONFIG = _CONFIG; + + public static get(name: K): TypeOfKey | undefined { + const configItem = this.config[name]; + if (!configItem) { + return undefined; + } + + const value = process.env[configItem.envName]; + + if (value === undefined) { + return configItem.defaultValue as TypeOfKey; + } + + switch (configItem.type) { + case 'boolean': + return (value.toLowerCase() === 'true') as TypeOfKey; + case 'number': + return Number(value) as TypeOfKey; + case 'string': + return value as TypeOfKey; + case 'array': + try { + return JSON.parse(value) as TypeOfKey; + } catch { + return undefined; + } + default: + return undefined; + } + } +} + export class GlobalConfig { public static readonly ENTRIES: Record = _CONFIG; } diff --git a/packages/config-service/src/services/index.ts b/packages/config-service/src/services/index.ts index 40f3ad374..77c5dce26 100644 --- a/packages/config-service/src/services/index.ts +++ b/packages/config-service/src/services/index.ts @@ -2,7 +2,7 @@ * * Hedera JSON RPC Relay * - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2024 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import findConfig from 'find-config'; import pino from 'pino'; import { LoggerService } from './loggerService'; import { ValidationService } from './validationService'; -import { ConfigKey } from './globalConfig'; +import type { ConfigKey } from './globalConfig'; const mainLogger = pino({ name: 'hedera-json-rpc-relay', diff --git a/packages/config-service/src/services/validationService.ts b/packages/config-service/src/services/validationService.ts index 041976383..738fc3639 100644 --- a/packages/config-service/src/services/validationService.ts +++ b/packages/config-service/src/services/validationService.ts @@ -2,7 +2,7 @@ * * Hedera JSON RPC Relay * - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2024 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/packages/config-service/tests/configServiceTestHelper.ts b/packages/config-service/tests/configServiceTestHelper.ts index 288734f10..1344cb30f 100644 --- a/packages/config-service/tests/configServiceTestHelper.ts +++ b/packages/config-service/tests/configServiceTestHelper.ts @@ -2,7 +2,7 @@ * * Hedera JSON RPC Relay * - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2024 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/packages/config-service/tests/src/services/configService.spec.ts b/packages/config-service/tests/src/services/configService.spec.ts index eb57a32c3..48d4fb0ed 100644 --- a/packages/config-service/tests/src/services/configService.spec.ts +++ b/packages/config-service/tests/src/services/configService.spec.ts @@ -2,7 +2,7 @@ * * Hedera JSON RPC Relay * - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2024 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/packages/config-service/tests/src/services/loggerService.spec.ts b/packages/config-service/tests/src/services/loggerService.spec.ts index 02c55549c..428e75979 100644 --- a/packages/config-service/tests/src/services/loggerService.spec.ts +++ b/packages/config-service/tests/src/services/loggerService.spec.ts @@ -2,7 +2,7 @@ * * Hedera JSON RPC Relay * - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2024 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ import crypto from 'crypto'; import { ConfigService } from '../../../src/services'; import { LoggerService } from '../../../src/services/loggerService'; import { GlobalConfig } from '../../../dist/services/globalConfig'; -import { ConfigKey } from '../../../src/services/globalConfig'; chai.use(chaiAsPromised); diff --git a/packages/config-service/tests/src/services/validationService.spec.ts b/packages/config-service/tests/src/services/validationService.spec.ts index b5c8ca476..9fd5671ae 100644 --- a/packages/config-service/tests/src/services/validationService.spec.ts +++ b/packages/config-service/tests/src/services/validationService.spec.ts @@ -2,7 +2,7 @@ * * Hedera JSON RPC Relay * - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2024 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts b/packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts index 8d7ddf255..957e3be9a 100644 --- a/packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts +++ b/packages/relay/tests/lib/config/hbarSpendingPlanConfigService.spec.ts @@ -47,7 +47,6 @@ import { verifyResult, withOverriddenEnvsInMochaTest, } from '../../helpers'; -import { ConfigKey } from '../../../../config-service/src/services/globalConfig'; chai.use(chaiAsPromised); diff --git a/packages/relay/tests/lib/eth/eth-config.ts b/packages/relay/tests/lib/eth/eth-config.ts index 673f30f9e..647e304c7 100644 --- a/packages/relay/tests/lib/eth/eth-config.ts +++ b/packages/relay/tests/lib/eth/eth-config.ts @@ -32,7 +32,6 @@ import { mockData, toHex, } from '../../helpers'; -import { ConfigKey } from '../../../../config-service/src/services/globalConfig'; export const BLOCK_TRANSACTION_COUNT = 77; export const GAS_USED_1 = 200000; diff --git a/packages/relay/tests/lib/eth/eth-helpers.ts b/packages/relay/tests/lib/eth/eth-helpers.ts index f31c989f5..58295adc8 100644 --- a/packages/relay/tests/lib/eth/eth-helpers.ts +++ b/packages/relay/tests/lib/eth/eth-helpers.ts @@ -34,7 +34,6 @@ import { EthImpl } from '../../../src/lib/eth'; import { CacheService } from '../../../src/lib/services/cacheService/cacheService'; import HAPIService from '../../../src/lib/services/hapiService/hapiService'; import { HbarLimitService } from '../../../src/lib/services/hbarLimitService'; -import { ConfigKey } from '../../../../config-service/src/services/globalConfig'; export function contractResultsByNumberByIndexURL(number: number, index: number): string { return `contracts/results?block.number=${number}&transaction.index=${index}&limit=100&order=asc`; diff --git a/packages/relay/tests/lib/eth/eth_common.spec.ts b/packages/relay/tests/lib/eth/eth_common.spec.ts index c7bc8137b..8a2dda285 100644 --- a/packages/relay/tests/lib/eth/eth_common.spec.ts +++ b/packages/relay/tests/lib/eth/eth_common.spec.ts @@ -26,7 +26,6 @@ import { Registry } from 'prom-client'; import { RelayImpl } from '../../../src'; import { RequestDetails } from '../../../src/lib/types'; -import { ConfigKey } from '../../../../config-service/src/services/globalConfig'; use(chaiAsPromised); diff --git a/packages/relay/tests/lib/eth/eth_sendRawTransaction.spec.ts b/packages/relay/tests/lib/eth/eth_sendRawTransaction.spec.ts index b0cccdbf3..fa90b6371 100644 --- a/packages/relay/tests/lib/eth/eth_sendRawTransaction.spec.ts +++ b/packages/relay/tests/lib/eth/eth_sendRawTransaction.spec.ts @@ -57,7 +57,6 @@ import { } from '../../helpers'; import { ACCOUNT_ADDRESS_1, DEFAULT_NETWORK_FEES, MAX_GAS_LIMIT_HEX, NO_TRANSACTIONS } from './eth-config'; import { generateEthTestEnv } from './eth-helpers'; -import { ConfigKey } from '../../../../config-service/src/services/globalConfig'; use(chaiAsPromised); diff --git a/packages/relay/tests/lib/ethGetBlockBy.spec.ts b/packages/relay/tests/lib/ethGetBlockBy.spec.ts index d7f4f0254..f3e9e7d2b 100644 --- a/packages/relay/tests/lib/ethGetBlockBy.spec.ts +++ b/packages/relay/tests/lib/ethGetBlockBy.spec.ts @@ -39,7 +39,6 @@ import HAPIService from '../../src/lib/services/hapiService/hapiService'; import { HbarLimitService } from '../../src/lib/services/hbarLimitService'; import { RequestDetails } from '../../src/lib/types'; import { defaultDetailedContractResults, overrideEnvsInMochaDescribe, useInMemoryRedisServer } from '../helpers'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; use(chaiAsPromised); @@ -129,7 +128,7 @@ describe('eth_getBlockBy', async function () { // @ts-ignore mirrorNodeInstance = new MirrorNodeClient( - (ConfigService.get('MIRROR_NODE_URL')) ?? '', + ConfigService.get('MIRROR_NODE_URL') ?? '', logger.child({ name: `mirror-node` }), registry, cacheService, diff --git a/packages/relay/tests/lib/hapiService.spec.ts b/packages/relay/tests/lib/hapiService.spec.ts index 222768f86..0db52b3dc 100644 --- a/packages/relay/tests/lib/hapiService.spec.ts +++ b/packages/relay/tests/lib/hapiService.spec.ts @@ -35,7 +35,6 @@ import HAPIService from '../../src/lib/services/hapiService/hapiService'; import { HbarLimitService } from '../../src/lib/services/hbarLimitService'; import { RequestDetails } from '../../src/lib/types'; import { overrideEnvsInMochaDescribe, withOverriddenEnvsInMochaTest } from '../helpers'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; const registry = new Registry(); const logger = pino(); diff --git a/packages/relay/tests/lib/mirrorNodeClient.spec.ts b/packages/relay/tests/lib/mirrorNodeClient.spec.ts index a95794b00..d08d899e6 100644 --- a/packages/relay/tests/lib/mirrorNodeClient.spec.ts +++ b/packages/relay/tests/lib/mirrorNodeClient.spec.ts @@ -35,7 +35,6 @@ const registry = new Registry(); import { MirrorNodeTransactionRecord, RequestDetails } from '../../src/lib/types'; import { SDKClientError } from '../../src/lib/errors/SDKClientError'; import { BigNumber } from 'bignumber.js'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; const logger = pino(); const noTransactions = '?transactions=false'; diff --git a/packages/relay/tests/lib/net.spec.ts b/packages/relay/tests/lib/net.spec.ts index 1b36af1cf..0458480de 100644 --- a/packages/relay/tests/lib/net.spec.ts +++ b/packages/relay/tests/lib/net.spec.ts @@ -25,7 +25,6 @@ import { Registry } from 'prom-client'; import { RelayImpl } from '../../src/lib/relay'; import constants from '../../src/lib/constants'; import { withOverriddenEnvsInMochaTest } from '../helpers'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; const logger = pino(); let Relay; diff --git a/packages/relay/tests/lib/openrpc.spec.ts b/packages/relay/tests/lib/openrpc.spec.ts index fcd270d07..0ed459e71 100644 --- a/packages/relay/tests/lib/openrpc.spec.ts +++ b/packages/relay/tests/lib/openrpc.spec.ts @@ -76,7 +76,7 @@ import { signedTransactionHash, } from '../helpers'; import { CONTRACT_RESULT_MOCK, NOT_FOUND_RES } from './eth/eth-config'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; + const logger = pino(); const registry = new Registry(); const Relay = new RelayImpl(logger, registry); diff --git a/packages/relay/tests/lib/poller.spec.ts b/packages/relay/tests/lib/poller.spec.ts index 250cebded..75333a38f 100644 --- a/packages/relay/tests/lib/poller.spec.ts +++ b/packages/relay/tests/lib/poller.spec.ts @@ -26,7 +26,6 @@ import sinon from 'sinon'; import { EthImpl } from '../../src/lib/eth'; import { Poller } from '../../src/lib/poller'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; const logger = pino({ level: 'trace' }); diff --git a/packages/relay/tests/lib/precheck.spec.ts b/packages/relay/tests/lib/precheck.spec.ts index 4ffd9cc1e..46a70bc3a 100644 --- a/packages/relay/tests/lib/precheck.spec.ts +++ b/packages/relay/tests/lib/precheck.spec.ts @@ -44,7 +44,6 @@ import { ONE_TINYBAR_IN_WEI_HEX } from './eth/eth-config'; const registry = new Registry(); import { RequestDetails } from '../../src/lib/types'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; const logger = pino(); const limitOrderPostFix = '?order=desc&limit=1'; diff --git a/packages/relay/tests/lib/sdkClient.spec.ts b/packages/relay/tests/lib/sdkClient.spec.ts index 7b0d8f62c..b406d4942 100644 --- a/packages/relay/tests/lib/sdkClient.spec.ts +++ b/packages/relay/tests/lib/sdkClient.spec.ts @@ -65,7 +65,6 @@ import { random20BytesAddress, withOverriddenEnvsInMochaTest, } from '../helpers'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; const registry = new Registry(); const logger = pino(); diff --git a/packages/relay/tests/lib/services/debugService/debug.spec.ts b/packages/relay/tests/lib/services/debugService/debug.spec.ts index 6a6d82298..5e3a339f9 100644 --- a/packages/relay/tests/lib/services/debugService/debug.spec.ts +++ b/packages/relay/tests/lib/services/debugService/debug.spec.ts @@ -36,7 +36,6 @@ import { CommonService } from '../../../../src/lib/services/ethService'; import { RequestDetails } from '../../../../src/lib/types'; import RelayAssertions from '../../../assertions'; import { getQueryParams, withOverriddenEnvsInMochaTest } from '../../../helpers'; -import { ConfigKey } from '../../../../../config-service/src/services/globalConfig'; chai.use(chaiAsPromised); diff --git a/packages/relay/tests/lib/services/eth/filter.spec.ts b/packages/relay/tests/lib/services/eth/filter.spec.ts index a41bf3aaf..e56b6a6c0 100644 --- a/packages/relay/tests/lib/services/eth/filter.spec.ts +++ b/packages/relay/tests/lib/services/eth/filter.spec.ts @@ -40,7 +40,6 @@ import { toHex, withOverriddenEnvsInMochaTest, } from '../../../helpers'; -import { ConfigKey } from '../../../../../config-service/src/services/globalConfig'; const logger = pino(); const registry = new Registry(); diff --git a/packages/relay/tests/lib/services/hbarLimitService/hbarLimitService.spec.ts b/packages/relay/tests/lib/services/hbarLimitService/hbarLimitService.spec.ts index b8997a5ea..7d475e8d1 100644 --- a/packages/relay/tests/lib/services/hbarLimitService/hbarLimitService.spec.ts +++ b/packages/relay/tests/lib/services/hbarLimitService/hbarLimitService.spec.ts @@ -44,7 +44,6 @@ import { SubscriptionTier } from '../../../../src/lib/db/types/hbarLimiter/subsc import { CacheService } from '../../../../src/lib/services/cacheService/cacheService'; import { HbarLimitService } from '../../../../src/lib/services/hbarLimitService'; import { RequestDetails } from '../../../../src/lib/types'; -import { ConfigKey } from '../../../../../config-service/src/services/globalConfig'; chai.use(chaiAsPromised); diff --git a/packages/relay/tests/lib/services/metricService/metricService.spec.ts b/packages/relay/tests/lib/services/metricService/metricService.spec.ts index eadc77eae..fb22cf052 100644 --- a/packages/relay/tests/lib/services/metricService/metricService.spec.ts +++ b/packages/relay/tests/lib/services/metricService/metricService.spec.ts @@ -43,7 +43,6 @@ import { overrideEnvsInMochaDescribe, withOverriddenEnvsInMochaTest, } from '../../../helpers'; -import { ConfigKey } from '../../../../../config-service/src/services/globalConfig'; const registry = new Registry(); const logger = pino(); diff --git a/packages/relay/tests/lib/utils.spec.ts b/packages/relay/tests/lib/utils.spec.ts index 784bc180a..27b934784 100644 --- a/packages/relay/tests/lib/utils.spec.ts +++ b/packages/relay/tests/lib/utils.spec.ts @@ -22,7 +22,6 @@ import { ConfigService } from '@hashgraph/json-rpc-config-service/dist/services' import { expect } from 'chai'; import createHash from 'keccak'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; import { ASCIIToHex, prepend0x } from '../../src/formatters'; import constants from '../../src/lib/constants'; import { Utils } from '../../src/utils'; diff --git a/packages/relay/tests/lib/web3.spec.ts b/packages/relay/tests/lib/web3.spec.ts index 4e9f3b8bc..6d746d874 100644 --- a/packages/relay/tests/lib/web3.spec.ts +++ b/packages/relay/tests/lib/web3.spec.ts @@ -23,7 +23,6 @@ import { expect } from 'chai'; import pino from 'pino'; import { Registry } from 'prom-client'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; import { RelayImpl } from '../../src'; import { withOverriddenEnvsInMochaTest } from '../helpers'; diff --git a/packages/server/tests/acceptance/conformityTests.spec.ts b/packages/server/tests/acceptance/conformityTests.spec.ts index ccd8cc681..46bb0d497 100644 --- a/packages/server/tests/acceptance/conformityTests.spec.ts +++ b/packages/server/tests/acceptance/conformityTests.spec.ts @@ -32,7 +32,6 @@ import LogsContract from '../contracts/Logs.json'; import CallerContract from '../contracts/Caller.json'; import { ConfigService } from '@hashgraph/json-rpc-config-service/dist/services'; import { parseOpenRPCDocument } from '@open-rpc/schema-utils-js'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; const directoryPath = path.resolve(__dirname, '../../../../node_modules/execution-apis/tests'); diff --git a/packages/server/tests/acceptance/hbarLimiter.spec.ts b/packages/server/tests/acceptance/hbarLimiter.spec.ts index 2d97bb7ef..2824a63f0 100644 --- a/packages/server/tests/acceptance/hbarLimiter.spec.ts +++ b/packages/server/tests/acceptance/hbarLimiter.spec.ts @@ -52,7 +52,6 @@ import testConstants from '../helpers/constants'; // Local resources import { Utils } from '../helpers/utils'; import { AliasAccount } from '../types/AliasAccount'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; config({ path: resolve(__dirname, '../localAcceptance.env') }); const DOT_ENV = dotenv.parse(fs.readFileSync(resolve(__dirname, '../localAcceptance.env'))); diff --git a/packages/server/tests/acceptance/index.spec.ts b/packages/server/tests/acceptance/index.spec.ts index 61cf3b768..659617df0 100644 --- a/packages/server/tests/acceptance/index.spec.ts +++ b/packages/server/tests/acceptance/index.spec.ts @@ -45,7 +45,6 @@ import ServicesClient from '../clients/servicesClient'; // Utils and types import { Utils } from '../helpers/utils'; import { AliasAccount } from '../types/AliasAccount'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; chai.use(chaiAsPromised); dotenv.config({ path: path.resolve(__dirname, '../../../../.env') }); diff --git a/packages/server/tests/acceptance/rateLimiter.spec.ts b/packages/server/tests/acceptance/rateLimiter.spec.ts index c818ef2e3..a1154e927 100644 --- a/packages/server/tests/acceptance/rateLimiter.spec.ts +++ b/packages/server/tests/acceptance/rateLimiter.spec.ts @@ -26,7 +26,6 @@ import relayConstants from '@hashgraph/json-rpc-relay/dist/lib/constants'; import testConstants from '../../tests/helpers/constants'; import RelayClient from '../clients/relayClient'; import Assertions from '../helpers/assertions'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; describe('@ratelimiter Rate Limiters Acceptance Tests', function () { this.timeout(480 * 1000); // 480 seconds diff --git a/packages/server/tests/acceptance/rpc_batch1.spec.ts b/packages/server/tests/acceptance/rpc_batch1.spec.ts index 08eda1784..3d8c6f6a4 100644 --- a/packages/server/tests/acceptance/rpc_batch1.spec.ts +++ b/packages/server/tests/acceptance/rpc_batch1.spec.ts @@ -50,7 +50,6 @@ import parentContractJson from '../contracts/Parent.json'; import Assertions from '../helpers/assertions'; import { Utils } from '../helpers/utils'; import { AliasAccount } from '../types/AliasAccount'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; const Address = RelayCalls; diff --git a/packages/server/tests/acceptance/rpc_batch2.spec.ts b/packages/server/tests/acceptance/rpc_batch2.spec.ts index 5252ede1a..b64b13139 100644 --- a/packages/server/tests/acceptance/rpc_batch2.spec.ts +++ b/packages/server/tests/acceptance/rpc_batch2.spec.ts @@ -46,7 +46,6 @@ import TokenCreateJson from '../contracts/TokenCreateContract.json'; import Assertions from '../helpers/assertions'; import { Utils } from '../helpers/utils'; import { AliasAccount } from '../types/AliasAccount'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; describe('@api-batch-2 RPC Server Acceptance Tests', function () { this.timeout(240 * 1000); // 240 seconds diff --git a/packages/server/tests/acceptance/rpc_batch3.spec.ts b/packages/server/tests/acceptance/rpc_batch3.spec.ts index 53f9ee3df..6528df9e0 100644 --- a/packages/server/tests/acceptance/rpc_batch3.spec.ts +++ b/packages/server/tests/acceptance/rpc_batch3.spec.ts @@ -56,7 +56,6 @@ import Assertions from '../helpers/assertions'; import RelayCalls from '../helpers/constants'; import { Utils } from '../helpers/utils'; import { AliasAccount } from '../types/AliasAccount'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; chai.use(chaiExclude); diff --git a/packages/server/tests/acceptance/serverConfig.spec.ts b/packages/server/tests/acceptance/serverConfig.spec.ts index 06c213df7..d80a75585 100644 --- a/packages/server/tests/acceptance/serverConfig.spec.ts +++ b/packages/server/tests/acceptance/serverConfig.spec.ts @@ -21,7 +21,6 @@ import { ConfigService } from '@hashgraph/json-rpc-config-service/dist/services' import { expect } from 'chai'; import { Utils } from '../helpers/utils'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; describe('@server-config Server Configuration Options Coverage', function () { describe('Koa Server Timeout', () => { diff --git a/packages/server/tests/integration/server.spec.ts b/packages/server/tests/integration/server.spec.ts index d488a47f8..47577126a 100644 --- a/packages/server/tests/integration/server.spec.ts +++ b/packages/server/tests/integration/server.spec.ts @@ -43,7 +43,6 @@ import * as Constants from '../../src/validator/constants'; import RelayCalls from '../../tests/helpers/constants'; import Assertions from '../helpers/assertions'; import { Utils } from '../helpers/utils'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; const MISSING_PARAM_ERROR = 'Missing value for required parameter'; diff --git a/packages/ws-server/tests/acceptance/batchRequest.spec.ts b/packages/ws-server/tests/acceptance/batchRequest.spec.ts index ecae0bfbd..0a55083ae 100644 --- a/packages/ws-server/tests/acceptance/batchRequest.spec.ts +++ b/packages/ws-server/tests/acceptance/batchRequest.spec.ts @@ -25,7 +25,6 @@ import { expect } from 'chai'; import { ethers, WebSocketProvider } from 'ethers'; import { WsTestConstant, WsTestHelper } from '../helper'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; describe('@web-socket-batch-request Batch Requests', async function () { const METHOD_NAME = 'batch_request'; diff --git a/packages/ws-server/tests/acceptance/getTransactionByHash.spec.ts b/packages/ws-server/tests/acceptance/getTransactionByHash.spec.ts index 9ec3266ca..c787afbe1 100644 --- a/packages/ws-server/tests/acceptance/getTransactionByHash.spec.ts +++ b/packages/ws-server/tests/acceptance/getTransactionByHash.spec.ts @@ -31,7 +31,6 @@ import { expect } from 'chai'; import { ethers, WebSocketProvider } from 'ethers'; import { WsTestConstant, WsTestHelper } from '../helper'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; describe('@web-socket-batch-2 eth_getTransactionByHash', async function () { const METHOD_NAME = 'eth_getTransactionByHash'; diff --git a/packages/ws-server/tests/acceptance/getTransactionCount.spec.ts b/packages/ws-server/tests/acceptance/getTransactionCount.spec.ts index c9750f0bb..840757206 100644 --- a/packages/ws-server/tests/acceptance/getTransactionCount.spec.ts +++ b/packages/ws-server/tests/acceptance/getTransactionCount.spec.ts @@ -30,7 +30,6 @@ import { expect } from 'chai'; import { ethers, WebSocketProvider } from 'ethers'; import { WsTestConstant, WsTestHelper } from '../helper'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; describe('@release @web-socket-batch-2 eth_getTransactionCount', async function () { const METHOD_NAME = 'eth_getTransactionCount'; diff --git a/packages/ws-server/tests/acceptance/getTransactionReceipt.spec.ts b/packages/ws-server/tests/acceptance/getTransactionReceipt.spec.ts index dd5127817..edae3d066 100644 --- a/packages/ws-server/tests/acceptance/getTransactionReceipt.spec.ts +++ b/packages/ws-server/tests/acceptance/getTransactionReceipt.spec.ts @@ -31,7 +31,6 @@ import { expect } from 'chai'; import { ethers, WebSocketProvider } from 'ethers'; import { WsTestConstant, WsTestHelper } from '../helper'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; describe('@web-socket-batch-2 eth_getTransactionReceipt', async function () { const METHOD_NAME = 'eth_getTransactionReceipt'; diff --git a/packages/ws-server/tests/acceptance/index.spec.ts b/packages/ws-server/tests/acceptance/index.spec.ts index 820a6f43c..88d477fbc 100644 --- a/packages/ws-server/tests/acceptance/index.spec.ts +++ b/packages/ws-server/tests/acceptance/index.spec.ts @@ -37,7 +37,6 @@ import dotenv from 'dotenv'; import fs from 'fs'; import path from 'path'; import pino from 'pino'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; chai.use(chaiAsPromised); diff --git a/packages/ws-server/tests/acceptance/rateLimiter.spec.ts b/packages/ws-server/tests/acceptance/rateLimiter.spec.ts index 931ec7ced..0c2cd11e3 100644 --- a/packages/ws-server/tests/acceptance/rateLimiter.spec.ts +++ b/packages/ws-server/tests/acceptance/rateLimiter.spec.ts @@ -27,7 +27,6 @@ import { expect } from 'chai'; import { ConfigServiceTestHelper } from '../../../config-service/tests/configServiceTestHelper'; import { WsTestHelper } from '../helper'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; describe('@web-socket-ratelimiter Rate Limit Tests', async function () { const rateLimitTier2 = Number(ConfigService.get('TIER_2_RATE_LIMIT') || relayConstants.DEFAULT_RATE_LIMIT.TIER_2); diff --git a/packages/ws-server/tests/acceptance/sendRawTransaction.spec.ts b/packages/ws-server/tests/acceptance/sendRawTransaction.spec.ts index fdfa32bed..85a107c16 100644 --- a/packages/ws-server/tests/acceptance/sendRawTransaction.spec.ts +++ b/packages/ws-server/tests/acceptance/sendRawTransaction.spec.ts @@ -33,7 +33,6 @@ import { expect } from 'chai'; import { ethers, WebSocketProvider } from 'ethers'; import { WsTestConstant, WsTestHelper } from '../helper'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; describe('@web-socket-batch-2 eth_sendRawTransaction', async function () { const METHOD_NAME = 'eth_sendRawTransaction'; diff --git a/packages/ws-server/tests/acceptance/subscribe.spec.ts b/packages/ws-server/tests/acceptance/subscribe.spec.ts index bcdb5e552..4395a06af 100644 --- a/packages/ws-server/tests/acceptance/subscribe.spec.ts +++ b/packages/ws-server/tests/acceptance/subscribe.spec.ts @@ -34,7 +34,6 @@ import { ethers } from 'ethers'; import WebSocket from 'ws'; import { WsTestHelper } from '../helper'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; chai.use(solidity); diff --git a/packages/ws-server/tests/acceptance/subscribeNewHeads.spec.ts b/packages/ws-server/tests/acceptance/subscribeNewHeads.spec.ts index 7bef0648a..5c207aaa0 100644 --- a/packages/ws-server/tests/acceptance/subscribeNewHeads.spec.ts +++ b/packages/ws-server/tests/acceptance/subscribeNewHeads.spec.ts @@ -32,7 +32,6 @@ import { ethers } from 'ethers'; import WebSocket from 'ws'; import { WsTestHelper } from '../helper'; -import { ConfigKey } from '../../../config-service/src/services/globalConfig'; chai.use(solidity); diff --git a/tools/brownie-example/LICENSE b/tools/brownie-example/LICENSE index 26837975d..56eb59cd2 100644 --- a/tools/brownie-example/LICENSE +++ b/tools/brownie-example/LICENSE @@ -1,7 +1,6 @@ Hedera Brownie Example -Copyright (C) 2022-2024 Hedera Hashgraph, LLC - +Copyright (C) 2024 Hedera Hashgraph, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at