From e17f775a8ce565ff139e7a151cb5b7e4bc8c1017 Mon Sep 17 00:00:00 2001 From: Luca Zeug Date: Fri, 13 Jan 2017 15:56:26 +0100 Subject: [PATCH 1/2] add 'mist.solidity.version' to mistAPI --- modules/preloader/include/mistAPI.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/preloader/include/mistAPI.js b/modules/preloader/include/mistAPI.js index 996dcbf57..78cfbad3b 100644 --- a/modules/preloader/include/mistAPI.js +++ b/modules/preloader/include/mistAPI.js @@ -56,6 +56,9 @@ module.exports = () => { ipcRenderer.send('mistAPI_requestAccount'); }, + solidity: { + version: packageJson.dependencies.solc, + }, sounds: { bip: function playSound() { ipcRenderer.sendToHost('mistAPI_sound', `file://${__dirname}/../../../sounds/bip.mp3`); From ca1c50f35df8d8c0c0e895153d2d1ace5b690910 Mon Sep 17 00:00:00 2001 From: Everton Fraga Date: Fri, 13 Jan 2017 13:28:54 -0200 Subject: [PATCH 2/2] Adding tests for in Mist API --- tests/mocha-in-browser/spec/general-spec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/mocha-in-browser/spec/general-spec.js b/tests/mocha-in-browser/spec/general-spec.js index d5773843b..3c6d8aabb 100644 --- a/tests/mocha-in-browser/spec/general-spec.js +++ b/tests/mocha-in-browser/spec/general-spec.js @@ -26,6 +26,7 @@ describe('General', function () { 'requestAccount', 'sounds', 'menu', + 'solidity' ]; expect(mist).to.have.all.keys(allowedAttributes); @@ -34,6 +35,10 @@ describe('General', function () { it('should return platform', function () { expect(mist.platform).to.be.oneOf(['darwin', 'win32', 'freebsd', 'linux', 'sunos']); }); + + it('should report solidity version', function () { + expect(mist.solidity.version).to.match(/^\d\.\d{1,2}\.\d{1,2}$/); // match examples: 0.4.6, 0.5.10, 0.10.0 + }); }); describe('mist.menu', function () {