Merge pull request #728 from embark-framework/bug_fix/whisper-config

whisper config should be stringified only once
This commit is contained in:
Michael Bradley 2018-08-22 11:15:20 -05:00 committed by GitHub
commit fa551f67a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -75,15 +75,13 @@ class Whisper {
let connection = this.communicationConfig.connection || {};
// todo: make the add code a function as well
let config = JSON.stringify({
let config = {
server: canonicalHost(connection.host || defaultHost),
port: connection.port || '8546',
type: connection.type || 'ws'
});
};
config = JSON.stringify(config);
let code = "\nEmbarkJS.Messages.setProvider('whisper'," + config + ");";
let code = `\nEmbarkJS.Messages.setProvider('whisper', ${JSON.stringify(config)});`;
let shouldInit = (communicationConfig) => {
return (communicationConfig.provider === 'whisper' && communicationConfig.enabled === true);