Skip to content

Commit 3361081

Browse files
committed
renamed models to follow snake_case convention
Signed-off-by: instamenta <[email protected]>
1 parent d6ae342 commit 3361081

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/commands/network.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {ConsensusNodeComponent} from '../core/config/remote/components/consensus
3838
import {ConsensusNodeStates} from '../core/config/remote/enumerations.js';
3939
import {EnvoyProxyComponent} from '../core/config/remote/components/envoy_proxy_component.js';
4040
import {HaProxyComponent} from '../core/config/remote/components/ha_proxy_component.js';
41-
import {GenesisNetworkDataConstructor} from '../core/models/genesisNetworkDataConstructor.js';
41+
import {GenesisNetworkDataConstructor} from '../core/genesis_network_models/genesis_network_data_constructor.js';
4242

4343
export interface NetworkDeployConfigClass {
4444
applicationEnv: string;

src/core/models/genesisNetworkDataConstructor.ts renamed to src/core/genesis_network_models/genesis_network_data_constructor.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import * as constants from '../constants.js';
2323

2424
import type {KeyManager} from '../key_manager.js';
2525
import type {ToJSON} from '../../types/index.js';
26-
import type {NodeAlias, NodeAliases} from '../../types/aliases.js';
26+
import type {JsonString, NodeAlias, NodeAliases} from '../../types/aliases.js';
2727

2828
/**
2929
* Used to construct the nodes data and convert them to JSON
@@ -36,13 +36,13 @@ export class GenesisNetworkDataConstructor implements ToJSON {
3636
private readonly keyManager: KeyManager,
3737
private readonly keysDir: string,
3838
) {
39-
this.nodeAliases.forEach(nodeAlias => {
39+
for (const nodeAlias of nodeAliases) {
4040
const nodeId = Templates.nodeIdFromNodeAlias(nodeAlias);
41+
const adminPrivateKey = PrivateKey.fromStringED25519(constants.GENESIS_KEY);
42+
const adminPubKey = adminPrivateKey.publicKey.toStringRaw();
4143

42-
const adminKey = PrivateKey.fromStringED25519(constants.GENESIS_KEY);
43-
44-
this.nodes[nodeAlias] = new GenesisNetworkNodeDataWrapper(nodeId, adminKey.publicKey.toStringRaw(), nodeAlias);
45-
});
44+
this.nodes[nodeAlias] = new GenesisNetworkNodeDataWrapper(nodeId, adminPubKey, nodeAlias);
45+
}
4646
}
4747

4848
public static async initialize(
@@ -80,7 +80,7 @@ export class GenesisNetworkDataConstructor implements ToJSON {
8080
);
8181
}
8282

83-
public toJSON() {
83+
public toJSON(): JsonString {
8484
return JSON.stringify({
8585
nodeMetadata: Object.values(this.nodes).map(node => node.toObject()),
8686
});

src/core/profile_manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {getNodeAccountMap} from './helpers.js';
3131
import type {SemVer} from 'semver';
3232
import type {SoloLogger} from './logging.js';
3333
import type {AnyObject, DirPath, NodeAlias, NodeAliases, Path} from '../types/aliases.js';
34-
import type {GenesisNetworkDataConstructor} from './models/genesisNetworkDataConstructor.js';
34+
import type {GenesisNetworkDataConstructor} from './genesis_network_models/genesis_network_data_constructor.js';
3535
import type {Optional} from '../types/index.js';
3636

3737
const consensusSidecars = [

0 commit comments

Comments
 (0)