Skip to content

Commit

Permalink
dont use string but AccountId for the genesis-network.json constructor
Browse files Browse the repository at this point in the history
Signed-off-by: instamenta <[email protected]>
  • Loading branch information
instamenta committed Dec 16, 2024
1 parent f4c3cc7 commit 2887510
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {GenesisNetworkNodeStructure, ServiceEndpoint, ToObject} from '../..
export class GenesisNetworkNodeDataWrapper
implements GenesisNetworkNodeStructure, ToObject<{node: GenesisNetworkNodeStructure}>
{
public accountId: AccountId | string;
public accountId: AccountId;
public gossipEndpoint: ServiceEndpoint[] = [];
public serviceEndpoint: ServiceEndpoint[] = [];
public gossipCaCertificate: string;
Expand Down Expand Up @@ -50,6 +50,7 @@ export class GenesisNetworkNodeDataWrapper
this.gossipEndpoint.push({domainName, port});
}

// @ts-ignore
public toObject() {
return {
node: {
Expand Down
3 changes: 2 additions & 1 deletion src/core/profile_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import * as constants from './constants.js';
import {type ConfigManager} from './config_manager.js';
import * as helpers from './helpers.js';
import {getNodeAccountMap} from './helpers.js';
import {AccountId} from '@hashgraph/sdk';
import type {SemVer} from 'semver';
import type {SoloLogger} from './logging.js';
import type {AnyObject, DirPath, NodeAlias, NodeAliases, Path} from '../types/aliases.js';
Expand Down Expand Up @@ -519,7 +520,7 @@ export class ProfileManager {
const nodeDataWrapper = genesisNetworkData.nodes[nodeAlias];

nodeDataWrapper.weight = nodeStakeAmount;
nodeDataWrapper.accountId = account;
nodeDataWrapper.accountId = AccountId.fromString(account);

//? Add gossip endpoints
nodeDataWrapper.addGossipEndpoint(externalIP, externalPort);
Expand Down

0 comments on commit 2887510

Please sign in to comment.