Skip to content

Commit

Permalink
lint-fix, added .madgerc and configured it to dont count typed import…
Browse files Browse the repository at this point in the history
…s as circular dependencies

Signed-off-by: instamenta <[email protected]>
  • Loading branch information
instamenta committed Dec 12, 2024
1 parent 1a29c82 commit dac6d6d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
7 changes: 7 additions & 0 deletions .madgerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"detectiveOptions": {
"ts": {
"skipTypeImports": true
}
}
}
4 changes: 2 additions & 2 deletions src/commands/node/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import path from 'path';
import fs from 'fs';
import {validatePath} from '../../core/helpers.js';
import {Flags as flags} from '../flags.js';
import {type NodeAlias, type NodeAliases, type PodName} from '../../types/aliases.js';
import {type NetworkNodeServices} from '../../core/network_node_services.js';
import type {NodeAlias, NodeAliases, PodName} from '../../types/aliases.js';
import type {NetworkNodeServices} from '../../core/network_node_services.js';

export const PREPARE_UPGRADE_CONFIGS_NAME = 'prepareUpgradeConfig';
export const DOWNLOAD_GENERATED_FILES_CONFIGS_NAME = 'downloadGeneratedFilesConfig';
Expand Down
28 changes: 14 additions & 14 deletions src/core/profile_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class ProfileManager {
profile: any,
nodeAliases: NodeAliases,
yamlRoot: object,
genesisNetworkData: GenesisNetworkDataConstructor,
genesisNetworkData?: GenesisNetworkDataConstructor,
): object {
if (!profile) throw new MissingArgumentError('profile is required');

Expand Down Expand Up @@ -310,7 +310,7 @@ export class ProfileManager {
* @param genesisNetworkData
* @returns return the full path to the values file
*/
prepareValuesForSoloChart(profileName: string, genesisNetworkData: GenesisNetworkDataConstructor) {
prepareValuesForSoloChart(profileName: string, genesisNetworkData?: GenesisNetworkDataConstructor) {
if (!profileName) throw new MissingArgumentError('profileName is required');
const profile = this.getProfile(profileName);

Expand Down Expand Up @@ -485,7 +485,7 @@ export class ProfileManager {
releaseTag: string,
appName = constants.HEDERA_APP_NAME,
chainId = constants.HEDERA_CHAIN_ID,
genesisNetworkData: GenesisNetworkDataConstructor,
genesisNetworkData?: GenesisNetworkDataConstructor,
) {
if (!nodeAccountMap || nodeAccountMap.size === 0)
throw new MissingArgumentError('nodeAccountMap the map of node IDs to account IDs is required');
Expand All @@ -511,21 +511,21 @@ export class ProfileManager {
for (const nodeAlias of nodeAccountMap.keys()) {
const internalIP = Templates.renderFullyQualifiedNetworkPodName(namespace, nodeAlias);
const externalIP = Templates.renderFullyQualifiedNetworkSvcName(namespace, nodeAlias);
const account = nodeAccountMap.get(nodeAlias);

const nodeDataWrapper = genesisNetworkData.nodes[nodeAlias];

nodeDataWrapper.weight = nodeStakeAmount;
if (genesisNetworkData) {
const nodeDataWrapper = genesisNetworkData.nodes[nodeAlias];

// Add gossip endpoints
nodeDataWrapper.addGossipEndpoint(externalIP, externalPort);
nodeDataWrapper.addGossipEndpoint(internalIP, internalPort);
nodeDataWrapper.weight = nodeStakeAmount;
nodeDataWrapper.accountId = account;

// Add service endpoints
nodeDataWrapper.addServiceEndpoint(internalIP, internalPort);
// Add gossip endpoints
nodeDataWrapper.addGossipEndpoint(externalIP, externalPort);
nodeDataWrapper.addGossipEndpoint(internalIP, internalPort);

const account = nodeAccountMap.get(nodeAlias);

nodeDataWrapper.accountId = account;
// Add service endpoints
nodeDataWrapper.addServiceEndpoint(internalIP, internalPort);
}

if (releaseVersion.minor >= 40) {
configLines.push(
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "./tsconfig-google.json",
"compilerOptions": {
"isolatedModules": true,
"target": "ES2022",
"lib": [
"ES2022",
Expand Down

0 comments on commit dac6d6d

Please sign in to comment.