Skip to content

Commit 1e30538

Browse files
committed
fix type of the grpc cert hash to be digested to base64 and conditional logic to not break tests
Signed-off-by: instamenta <[email protected]>
1 parent 0b2326b commit 1e30538

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/core/genesis_network_models/genesis_network_data_constructor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export class GenesisNetworkDataConstructor implements ToJSON {
7575
const tlsCertDer = new Uint8Array(x509.PemConverter.decode(certPem)[0]);
7676

7777
//* Generate the SHA-384 hash
78-
this.nodes[nodeAlias].grpcCertificateHash = crypto.createHash('sha384').update(tlsCertDer).digest('hex');
78+
this.nodes[nodeAlias].grpcCertificateHash = crypto.createHash('sha384').update(tlsCertDer).digest('base64');
7979
}),
8080
);
8181
}

src/core/profile_manager.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,13 @@ export class ProfileManager {
266266
yamlRoot,
267267
);
268268

269-
const genesisNetworkJson = path.join(stagingDir, 'genesis-network.json');
269+
if (genesisNetworkData) {
270+
const genesisNetworkJson = path.join(stagingDir, 'genesis-network.json');
270271

271-
fs.writeFileSync(genesisNetworkJson, genesisNetworkData.toJSON());
272+
fs.writeFileSync(genesisNetworkJson, genesisNetworkData.toJSON());
272273

273-
this._setFileContentsAsValue('hedera.configMaps.genesisNetworkJson', genesisNetworkJson, yamlRoot);
274+
this._setFileContentsAsValue('hedera.configMaps.genesisNetworkJson', genesisNetworkJson, yamlRoot);
275+
}
274276

275277
if (this.configManager.getFlag(flags.applicationEnv)) {
276278
this._setFileContentsAsValue(

0 commit comments

Comments
 (0)