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

Commit

Permalink
Merging develop into master (#1355)
Browse files Browse the repository at this point in the history
* Minor fixes on the internal links (#1323)

* Tens of new ABI signatures (#1341)

* Electron package renaming & Readme updates (#1339)

* Renaming electron-prebuilt to electron

* Updating Readme instructions

* [npm] tighten versions in dependency-graph

* Fix shell v ul ns  (#1354)

* fix vulns

* readd syncminimongo to popupWindows

* Removing duplicated instruction

* Version bump (#1356)
  • Loading branch information
evertonfraga authored Oct 26, 2016
1 parent 0df1f22 commit 7eb2d2f
Show file tree
Hide file tree
Showing 19 changed files with 359 additions and 152 deletions.
7 changes: 5 additions & 2 deletions MISTAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ else
## API


- [mist.platform](#mistmenuupdateid-options-callback)
- [mist.menu](#mistmenuupdateid-options-callback)
- [mist.platform](#mistplatform)
- [mist.requestAccount](#mistrequestaccountcallback)(callback)
- [mist.menu](#mistmenu)
- [mist.menu.setBadge](#mistmenusetbadgetext)(text)
- [mist.menu.add](#mistmenuaddid-options-callback)(id, options, callback)
- [mist.menu.update](#mistmenuupdateid--options--callback)(id [, options] [, callback])
- [mist.menu.remove](#mistmenuremoveid)(id)
- [mist.menu.clear](#mistmenuclear)()
- [mist.sounds](#mistsounds)
- [mist.sounds.bip](#mistsoundsbip)()


### mist.platform
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Requirements:
To run mist in development you need [Node.js NPM](https://nodejs.org) and [Meteor](https://www.meteor.com/install) and electron installed:

$ curl https://install.meteor.com/ | sh
$ npm install -g electron-prebuilt@1.3.5
$ npm install -g electron@1.3.5
$ npm install -g gulp

And some futher tools to help with downloading and unzipping client nodes:
Expand All @@ -53,14 +53,12 @@ Now you're ready to install Mist:
$ cd mist
$ git submodule update --init
$ npm install
$ gulp update-nodes

To update Mist in the future, run:

$ cd mist
$ git pull && git submodule update
$ npm install
$ gulp update-nodes


#### Options
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var type = 'mist';
var filenameLowercase = 'mist';
var filenameUppercase = 'Mist';
var applicationName = 'Mist';
var electronVersion = require('electron-prebuilt/package.json').version;
var electronVersion = require('electron/package.json').version;


var packJson = require('./package.json');
Expand Down
4 changes: 2 additions & 2 deletions interface/client/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// Contains the accounts
Tabs = new Mongo.Collection('tabs', {connection: null});

if (typeof window.mist.syncMinimongo !== 'undefined') {
Tabs = window.mist.syncMinimongo.frontendSync(Tabs);
if (typeof window.syncMinimongo !== 'undefined') {
Tabs = window.syncMinimongo.frontendSync(Tabs);
}


Expand Down
4 changes: 2 additions & 2 deletions interface/client/lib/helpers/templateHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Return the preload modules dirname.
@method (dirname)
**/
Template.registerHelper('preload_dirname', function(){
return window.mist.dirname + '/modules/preloader';
return window.dirname + '/modules/preloader';
});

/**
Expand Down Expand Up @@ -72,7 +72,7 @@ Return the app icon path.
@method (iconPath)
**/
Template.registerHelper('appIconPath', function(){
return 'file://'+ window.mist.dirname +'/icons/'+ window.mist.mode +'/icon2x.png';
return 'file://'+ window.dirname +'/icons/'+ window.mist.mode +'/icon2x.png';
});

/**
Expand Down
168 changes: 168 additions & 0 deletions interface/client/lib/signatures.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,172 @@
window.SIGNATURES = {
"0x30a24abd": [
"create(bytes4,bytes)"
],
"0xa039e3c7": [
"testSetNotTransferable()"
],
"0xac3e6b2f": [
"testSetNotRetractable()"
],
"0xee0dc478": [
"testSetEnforceRevisions()"
],
"0xad544dcb": [
"testSetNotUpdatable()"
],
"0xda5c0a7c": [
"testDisown()"
],
"0x804e11dc": [
"testThrowsDisownNotTransferable()"
],
"0x0af4626d": [
"testRetract()"
],
"0xd96e5565": [
"testThrowsRetractNotRetractable()"
],
"0xcaab0acc": [
"testThrowCreateRetracted()"
],
"0x465e759b": [
"testRestart()"
],
"0x5292c1a9": [
"testThrowsRestartEnforceRevisions()"
],
"0x1b769e74": [
"testThrowsRestartNotUpdatable()"
],
"0x40695625": [
"testRetractLatestRevision()"
],
"0xe0cfc05c": [
"testThrowsRetractLatestRevisionDoesntHaveAdditionalRevisions()"
],
"0x8e1ffb19": [
"testThrowsRetractLatestRevisionEnforceRevisions()"
],
"0xe82f7dd4": [
"testThrowsRetractLatestRevisionNotUpdatable()"
],
"0x1fb2f2a0": [
"testUpdateLatestRevision()"
],
"0x2eb5c61f": [
"testThrowsUpdateLatestRevisionEnforceRevisions()"
],
"0x13137731": [
"testThrowsUpdateLatestRevisionNotUpdatable()"
],
"0x22057bc7": [
"getAllRevisionBlockNumbers(bytes20)"
],
"0x74f8d96e": [
"getRevisionBlockNumber(bytes20,uint256)"
],
"0x3ef87414": [
"getRevisionCount(bytes20)"
],
"0xe487eb58": [
"getOwner(bytes20)"
],
"0xaa5d4719": [
"getTransferable(bytes20)"
],
"0x3c335b0e": [
"getRetractable(bytes20)"
],
"0xdba1ac3d": [
"getEnforceRevisions(bytes20)"
],
"0x3df91162": [
"getUpdatable(bytes20)"
],
"0x01fd89a4": [
"getFlags(bytes20)"
],
"0xba15e52e": [
"getInfo(bytes20)"
],
"0xec035393": [
"_getAllRevisionBlockNumbers(bytes20)"
],
"0xfb47a067": [
"_getRevisionBlockNumber(bytes20,uint256)"
],
"0x08b7c13b": [
"getExists(bytes20)"
],
"0xb971b4e5": [
"setNotTransferable(bytes20)"
],
"0x976b01c0": [
"setNotRetractable(bytes20)"
],
"0x9243e088": [
"setEnforceRevisions(bytes20)"
],
"0xd0c24e93": [
"setNotUpdatable(bytes20)"
],
"0xd6ca8ccb": [
"disown(bytes20)"
],
"0xb06df18e": [
"transfer(bytes20,address)"
],
"0x47bdb7f4": [
"transferDisable(bytes20)"
],
"0x12511c14": [
"transferEnable(bytes20)"
],
"0xcf7315c6": [
"retract(bytes20)"
],
"0xe0a70811": [
"restart(bytes20,bytes)"
],
"0x5ccd2f9b": [
"_deleteAllPackedRevisionBlockNumbers(bytes20)"
],
"0xa7e93e87": [
"retractLatestRevision(bytes20)"
],
"0x9e65c7e5": [
"updateLatestRevision(bytes20,bytes)"
],
"0xa84c5330": [
"createNewRevision(bytes20,bytes)"
],
"0x338a1379": [
"_setPackedBlockNumber(bytes20,uint256)"
],
"0x5b37e150": [
"create(bytes32,bytes)"
],
"0xd0b52156": [
"getIpfsHash(address,address)"
],
"0x337b1cf9": [
"setIpfsHash(bytes)"
],
"0x7fefde53": [
"WillRegistry()"
],
"0xe597f402": [
"create(bytes1,bytes32,bytes)"
],
"0x8d375da2": [
"testMakeItFail()"
],
"0x2551858e": [
"getFlags(bytes32)"
],
"0x5f0edfb8": [
"create(bytes,bytes32,bytes1)"
],
"0x85b73d3c": [
"testCreateNewRevision()"
],
Expand Down
2 changes: 1 addition & 1 deletion interface/client/templates/layout/browserBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Template['layout_browserBar'].events({
mist.requestAccount(function(e, addresses){
var tabId;

mist.syncMinimongo.frontendSync(Tabs);
window.syncMinimongo.frontendSync(Tabs);

tabId = LocalStore.get('selectedTab');

Expand Down
2 changes: 1 addition & 1 deletion interface/client/templates/popupWindows/splashScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Template['popupWindows_splashScreen'].helpers({
@method iconPath
*/
'iconPath': function(){
return 'file://'+ window.mist.dirname +'/icons/'+ window.mist.mode +'/icon2x.png';
return 'file://'+ window.dirname +'/icons/'+ window.mist.mode +'/icon2x.png';
},
/**
Updates the Sync Message live
Expand Down
2 changes: 1 addition & 1 deletion modules/ipc/ipcProviderBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class IpcProviderBackend {
// dynamically load in method processors
let processors = fs.readdirSync(path.join(__dirname, 'methods'));

// get response processors
this._processors = {};

processors.forEach((p) => {
let name = path.basename(p, '.js');

Expand Down
2 changes: 1 addition & 1 deletion modules/ipc/methods/eth_accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = class extends BaseProcessor {
* @override
*/
sanitizeResponsePayload (conn, payload, isPartOfABatch) {
this._log.trace('Sanitize account list', payload.result);
this._log.trace('Sanitize eth_acconts', payload.result);

// if not an admin connection then do a check
if (!this._isAdminConnection(conn)) {
Expand Down
32 changes: 32 additions & 0 deletions modules/ipc/methods/eth_coinbase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"use strict";

const _ = global._;
const BaseProcessor = require('./base');
const db = require('../../db');

/**
* Process method: eth_coinbase
*/
module.exports = class extends BaseProcessor {
/**
* @override
*/
sanitizeResponsePayload (conn, payload, isPartOfABatch) {
this._log.trace('Sanitize account eth_coinbase', payload.result);

// if not an admin connection then do a check
if (!this._isAdminConnection(conn)) {
let tab = db.getCollection('tabs').findOne({ webviewId: conn.id });

if(_.get(tab, 'permissions.accounts')) {
payload.result = _.contains(tab.permissions.accounts, payload.result) ? payload.result : null;
} else {
payload.result = null;
}
}

return super.sanitizeResponsePayload(conn, payload, isPartOfABatch);
}
}


4 changes: 0 additions & 4 deletions modules/mistAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

const electron = require('electron');
const packageJson = require('./../package.json');
const syncMinimongo = require('./syncMinimongo.js');
const remote = electron.remote;
const ipc = electron.ipcRenderer;

Expand Down Expand Up @@ -68,13 +67,10 @@ module.exports = function(isWallet) {
*/

var mist = {
syncMinimongo: syncMinimongo,
callbacks: {},
dirname: remote.getGlobal('dirname'),
version: packageJson.version,
mode: remote.getGlobal('mode'),
license: packageJson.license,
shell: remote.shell,
platform: process.platform,
requestAccount: function(callback){
if(callback) {
Expand Down
4 changes: 4 additions & 0 deletions modules/preloader/mistUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ const Menu = remote.Menu;
const MenuItem = remote.MenuItem;
const i18n = require('../i18n.js');
const mist = require('../mistAPI.js');
const syncMinimongo = require('../syncMinimongo.js');
const BigNumber = require('bignumber.js');
const Web3 = require('web3');
const ipcProviderWrapper = require('../ipc/ipcProviderWrapper.js');
const web3Admin = require('../web3Admin.js');


require('./include/setBasePath')('interface');

// register with window manager
Expand All @@ -33,6 +35,8 @@ setTimeout(function(){
}, 1000);

window.mist = mist();
window.dirname = remote.getGlobal('dirname');
window.syncMinimongo = syncMinimongo;
window.ipc = ipc;


Expand Down
2 changes: 2 additions & 0 deletions modules/preloader/popupWindows.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const electron = require('electron');
const ipc = electron.ipcRenderer;
require('../openExternal.js');
const mist = require('../mistAPI.js');
const syncMinimongo = require('../syncMinimongo.js');
const ipcProviderWrapper = require('../ipc/ipcProviderWrapper.js');
const BigNumber = require('bignumber.js');
const Q = require('bluebird');
Expand All @@ -30,6 +31,7 @@ ipc.on('data', function(e, data) {

// make variables globally accessable
window.mist = mist();
window.syncMinimongo = syncMinimongo;
window.BigNumber = BigNumber;
window.Q = Q;
window.web3 = new Web3(new Web3.providers.IpcProvider('', ipcProviderWrapper));
Expand Down
2 changes: 2 additions & 0 deletions modules/preloader/popupWindowsNoWeb3.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require('./include/common')('popup-no-web3');
const electron = require('electron');
const mist = require('../mistAPI.js');
const syncMinimongo = require('../syncMinimongo.js');
const ipc = electron.ipcRenderer;
const ipcProviderWrapper = require('../ipc/ipcProviderWrapper.js');

Expand All @@ -23,3 +24,4 @@ ipc.on('data', function(e, data) {

window.ipc = ipc;
window.mist = mist();
window.syncMinimongo = syncMinimongo;
Loading

0 comments on commit 7eb2d2f

Please sign in to comment.