Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
[mistAPI] add 'mist.solidity.version' (#1586)
Browse files Browse the repository at this point in the history
* add 'mist.solidity.version' to mistAPI

* Adding tests for  in Mist API
  • Loading branch information
luclu authored and evertonfraga committed Jan 13, 2017
1 parent d59a0ba commit 75dd12c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/preloader/include/mistAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down
5 changes: 5 additions & 0 deletions tests/mocha-in-browser/spec/general-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('General', function () {
'requestAccount',
'sounds',
'menu',
'solidity'
];

expect(mist).to.have.all.keys(allowedAttributes);
Expand All @@ -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 () {
Expand Down

0 comments on commit 75dd12c

Please sign in to comment.