From 80f96b9d3fc75514a659789b05683ba94ecafa36 Mon Sep 17 00:00:00 2001 From: zeroxbt Date: Fri, 5 Aug 2022 00:25:35 +0200 Subject: [PATCH] fix save identity in config --- ot-node.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ot-node.js b/ot-node.js index 066076e2c5..16a8f5f8ac 100644 --- a/ot-node.js +++ b/ot-node.js @@ -154,6 +154,7 @@ class OTNode { ) { this.saveIdentityInUserConfigurationFile( blockchainModuleManager.getIdentity(blockchain), + blockchain, ); } } @@ -239,18 +240,17 @@ class OTNode { } } - saveIdentityInUserConfigurationFile(identity) { + saveIdentityInUserConfigurationFile(identity, blockchain) { const configurationFilePath = path.join(appRootPath.path, '..', this.config.configFilename); const configFile = JSON.parse(fs.readFileSync(configurationFilePath)); if ( configFile.modules.blockchain && configFile.modules.blockchain.implementation && - configFile.modules.blockchain.implementation['web3-service'] && - configFile.modules.blockchain.implementation['web3-service'].config + configFile.modules.blockchain.implementation[blockchain] && + configFile.modules.blockchain.implementation[blockchain].config ) { - if (!configFile.modules.blockchain.implementation['web3-service'].config.identity) { - configFile.modules.blockchain.implementation['web3-service'].config.identity = - identity; + if (!configFile.modules.blockchain.implementation[blockchain].config.identity) { + configFile.modules.blockchain.implementation[blockchain].config.identity = identity; fs.writeFileSync(configurationFilePath, JSON.stringify(configFile, null, 2)); } }