Merge branch 'master' into SignFullDataNotHash
@ -7,6 +7,8 @@
|
||||
- Make network loading indicator clickable to select accessible network.
|
||||
- Show more characters of addresses when space permits.
|
||||
- Fixed eth.sign behavior.
|
||||
- Fixed bug when signing messages under 64 hex characters long.
|
||||
- Add disclaimer view with placeholder text for first time users.
|
||||
|
||||
## 2.3.1 2016-06-09
|
||||
|
||||
|
54
CONTRIBUTING.md
Normal file
@ -0,0 +1,54 @@
|
||||
# Welcome to MetaMask!
|
||||
|
||||
If you're submitting code to MetaMask, there are some simple things we'd appreciate you doing to help us stay organized!
|
||||
|
||||
## Submitting pull requests
|
||||
|
||||
Before taking the time to code and implement something, feel free to open an issue and discuss it! There may even be an issue already open, and together we may come up with a specific strategy before you take your precious time to write code.
|
||||
|
||||
### Tests
|
||||
|
||||
For any new programmatic functionality, we like unit tests when possible, so if you can keep your code cleanly isolated, please do add a test file to the `tests` folder.
|
||||
|
||||
### PR Format
|
||||
|
||||
We use [waffle](https://waffle.io/) for project management, and it will automatically keep us organized if you do one simple thing:
|
||||
|
||||
If this PR closes the issue, add the line `Fixes #$ISSUE_NUMBER`. Ex. For closing issue 418, include the line `Fixes #418`.
|
||||
|
||||
If it doesn't close the issue but addresses it partially, just include a reference to the issue number, like `#418`.
|
||||
|
||||
## Before Merging
|
||||
|
||||
Make sure you get a `:thumbsup`, `:+1`, or `LGTM` from another collaborator before merging.
|
||||
|
||||
## Before Closing Issues
|
||||
|
||||
Make sure the relevant code has been reviewed and merged.
|
||||
|
||||
### Developing inside a node_modules folder
|
||||
|
||||
First make sure you are comfortable with [how require works](https://github.com/maxogden/art-of-node#how-require-works) in node.
|
||||
|
||||
We recommend creating a folder somewhere manually called `node_modules`. For example in `~/code/node_modules`. Clone all of your git copies of modules that you want to work on into here, so for example:
|
||||
|
||||
- `~/code/node_modules/dat`
|
||||
- `~/code/node_modules/hyperdrive`
|
||||
|
||||
When you run `npm install` inside of `~/code/node_modules/dat`, dat will get its own copy of `hyperdrive` (one if its dependencies) inside `~/code/node_modules/dat/node_modules`. However, if you encounter a bug in hyperdrive that you need to fix, but you want to test your fix in dat, you want dat to use your git copy of hyperdrive at `~/code/node_modules/hyperdrive` and not the npm copy of hyperdrive at `~/code/node_modules/dat/node_modules/hyperdrive`.
|
||||
|
||||
How do you get dat to use the git copy of hyperdrive? Just delete the npm copy!
|
||||
|
||||
```
|
||||
rm -rf ~/code/node_modules/dat/node_modules/hyperdrive
|
||||
```
|
||||
|
||||
Now when you run dat, and it tries to `require('hyperdrive')` it first looks in its own `node_modules` folder at `~/code/node_modules/dat/node_modules` but doesnt find hyperdrive. So it goes up to `~/code/node_modules` and finds `hyperdrive` there and uses that one, your git copy.
|
||||
|
||||
If you want to switch back to an npm copy, just run `npm install` inside `~/code/node_modules/dat/` and npm will download any missing modules into `~/code/node_modules/dat/node_modules` but wont touch anything in `~/code/node_modules`.
|
||||
|
||||
This might seem a bit complicated at first, but is simple once you get the hang of it. Here are some rules to help you get started:
|
||||
|
||||
- Never make any meaningful edits to code inside an "npm-managed" node_modules folder (such as `~/code/node_modules/dat/node_modules`), because when you run `npm install` inside those folders it could inadvertently delete all of your edits when installing an updated copy of a module. This has happened to me many times, so I just always use my git copy and delete the npm copy (as described above) to make edits to a module.
|
||||
- You should never need to run any npm commands in terminal when at your "manually managed"" node_modules folder at `~/code/node_modules`. Never running npm commands at that folder also prevents npm from accidentally erasing your git copies of modules
|
||||
- The location of your "manually managed" node_modules folder should be somewhere isolated from your normal require path. E.g. if you put it at `~/node_modules`, then when you run `npm install dat` at `~/Desktop` npm might decide to erase your git copy of dat at `~/node_modules/dat` and replace it with a copy from npm, which could make you lose work. Putting your manually managed `node_modules` folder in a sub-folder like `~/code` gets it "out of the way" and prevents accidents like that from happening.
|
BIN
app/images/.DS_Store
vendored
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 778 B After Width: | Height: | Size: 564 B |
Before Width: | Height: | Size: 751 B After Width: | Height: | Size: 662 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.4 KiB |
@ -188,6 +188,7 @@ function setupControllerConnection(stream){
|
||||
setRpcTarget: setRpcTarget,
|
||||
setProviderType: setProviderType,
|
||||
useEtherscanProvider: useEtherscanProvider,
|
||||
agreeToDisclaimer: agreeToDisclaimer,
|
||||
// forward directly to idStore
|
||||
createNewVault: idStore.createNewVault.bind(idStore),
|
||||
recoverFromSeed: idStore.recoverFromSeed.bind(idStore),
|
||||
@ -295,6 +296,15 @@ function addUnconfirmedMsg(msgParams, cb){
|
||||
// config
|
||||
//
|
||||
|
||||
function agreeToDisclaimer(cb) {
|
||||
try {
|
||||
configManager.setConfirmed(true)
|
||||
cb()
|
||||
} catch (e) {
|
||||
cb(e)
|
||||
}
|
||||
}
|
||||
|
||||
// called from popup
|
||||
function setRpcTarget(rpcTarget){
|
||||
configManager.setRpcTarget(rpcTarget)
|
||||
|
@ -270,6 +270,17 @@ ConfigManager.prototype._emitUpdates = function(state){
|
||||
})
|
||||
}
|
||||
|
||||
ConfigManager.prototype.setConfirmed = function(confirmed) {
|
||||
var data = this.getData()
|
||||
data.isConfirmed = confirmed
|
||||
this.setData(data)
|
||||
}
|
||||
|
||||
ConfigManager.prototype.getConfirmed = function() {
|
||||
var data = this.getData()
|
||||
return ('isConfirmed' in data) && data.isConfirmed
|
||||
}
|
||||
|
||||
|
||||
function loadData() {
|
||||
|
||||
|
@ -93,6 +93,7 @@ IdentityStore.prototype.getState = function(){
|
||||
isInitialized: !!configManager.getWallet() && !seedWords,
|
||||
isUnlocked: this._isUnlocked(),
|
||||
seedWords: seedWords,
|
||||
isConfirmed: configManager.getConfirmed(),
|
||||
unconfTxs: configManager.unconfirmedTxs(),
|
||||
transactions: configManager.getTxList(),
|
||||
unconfMsgs: messageManager.unconfirmedMsgs(),
|
||||
|
@ -4,11 +4,41 @@ var configManager
|
||||
|
||||
describe('config-manager', function() {
|
||||
|
||||
before(function() {
|
||||
beforeEach(function() {
|
||||
window.localStorage = {} // Hacking localStorage support into JSDom
|
||||
configManager = new ConfigManager()
|
||||
})
|
||||
|
||||
describe('confirmation', function() {
|
||||
|
||||
describe('#getConfirmed', function() {
|
||||
it('should return false if no previous key exists', function() {
|
||||
var result = configManager.getConfirmed()
|
||||
assert.ok(!result)
|
||||
})
|
||||
})
|
||||
|
||||
describe('#setConfirmed', function() {
|
||||
it('should make getConfirmed return true once set', function() {
|
||||
configManager.setConfirmed(true)
|
||||
var result = configManager.getConfirmed()
|
||||
assert.equal(result, true)
|
||||
})
|
||||
|
||||
it('should be able to set false', function() {
|
||||
configManager.setConfirmed(false)
|
||||
var result = configManager.getConfirmed()
|
||||
assert.equal(result, false)
|
||||
})
|
||||
|
||||
it('should persist to local storage', function() {
|
||||
configManager.setConfirmed(true)
|
||||
var data = configManager.getData()
|
||||
assert.equal(data.isConfirmed, true)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('#setConfig', function() {
|
||||
window.localStorage = {} // Hacking localStorage support into JSDom
|
||||
|
||||
|
@ -12,6 +12,8 @@ var actions = {
|
||||
UPDATE_METAMASK_STATE: 'UPDATE_METAMASK_STATE',
|
||||
updateMetamaskState: updateMetamaskState,
|
||||
// intialize screen
|
||||
AGREE_TO_DISCLAIMER: 'AGREE_TO_DISCLAIMER',
|
||||
agreeToDisclaimer: agreeToDisclaimer,
|
||||
CREATE_NEW_VAULT_IN_PROGRESS: 'CREATE_NEW_VAULT_IN_PROGRESS',
|
||||
SHOW_CREATE_VAULT: 'SHOW_CREATE_VAULT',
|
||||
SHOW_RESTORE_VAULT: 'SHOW_RESTORE_VAULT',
|
||||
@ -313,6 +315,18 @@ function showInitializeMenu() {
|
||||
}
|
||||
}
|
||||
|
||||
function agreeToDisclaimer() {
|
||||
return (dispatch) => {
|
||||
dispatch(this.showLoadingIndication())
|
||||
_accountManager.agreeToDisclaimer((err) => {
|
||||
dispatch(this.hideLoadingIndication())
|
||||
dispatch({
|
||||
type: this.AGREE_TO_DISCLAIMER,
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function createNewVaultInProgress() {
|
||||
return {
|
||||
type: actions.CREATE_NEW_VAULT_IN_PROGRESS,
|
||||
|
@ -8,6 +8,7 @@ const extend = require('xtend')
|
||||
const actions = require('./actions')
|
||||
const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
|
||||
// init
|
||||
const DisclaimerScreen = require('./first-time/disclaimer')
|
||||
const InitializeMenuScreen = require('./first-time/init-menu')
|
||||
const CreateVaultScreen = require('./first-time/create-vault')
|
||||
const CreateVaultCompleteScreen = require('./first-time/create-vault-complete')
|
||||
@ -39,6 +40,7 @@ function App() { Component.call(this) }
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
// state from plugin
|
||||
isConfirmed: state.metamask.isConfirmed,
|
||||
isInitialized: state.metamask.isInitialized,
|
||||
isUnlocked: state.metamask.isUnlocked,
|
||||
currentView: state.appState.currentView,
|
||||
@ -240,6 +242,10 @@ App.prototype.renderDropdown = function() {
|
||||
App.prototype.renderPrimary = function(){
|
||||
var props = this.props
|
||||
|
||||
if (!props.isConfirmed) {
|
||||
return h(DisclaimerScreen, {key: 'disclaimerScreen'})
|
||||
}
|
||||
|
||||
if (props.seedWords) {
|
||||
return h(CreateVaultCompleteScreen, {key: 'createVaultComplete'})
|
||||
}
|
||||
@ -314,37 +320,3 @@ App.prototype.toggleMetamaskActive = function(){
|
||||
}
|
||||
}
|
||||
|
||||
function onOffToggle(state){
|
||||
var buttonSize = '50px';
|
||||
var lockWidth = '20px';
|
||||
return (
|
||||
h('.app-toggle.flex-row.flex-center.lock' + (state.isUnlocked ? '.unlocked' : '.locked'), {
|
||||
width: buttonSize,
|
||||
height: buttonSize,
|
||||
}, [
|
||||
h('div', {
|
||||
onClick: state.toggleMetamaskActive,
|
||||
style: {
|
||||
width: lockWidth,
|
||||
height: '' + parseInt(lockWidth) * 1.5 + 'px',
|
||||
position: 'relative',
|
||||
}
|
||||
}, [
|
||||
h('img.lock-top', {
|
||||
src: 'images/lock-top.png',
|
||||
style: {
|
||||
width: lockWidth,
|
||||
position: 'absolute',
|
||||
}
|
||||
}),
|
||||
h('img', {
|
||||
src: 'images/lock-base.png',
|
||||
style: {
|
||||
width: lockWidth,
|
||||
position: 'absolute',
|
||||
}
|
||||
}),
|
||||
])
|
||||
])
|
||||
)
|
||||
}
|
||||
|
56
ui/app/first-time/disclaimer.js
Normal file
@ -0,0 +1,56 @@
|
||||
const inherits = require('util').inherits
|
||||
const Component = require('react').Component
|
||||
const h = require('react-hyperscript')
|
||||
const connect = require('react-redux').connect
|
||||
const actions = require('../actions')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const disclaimer = fs.readFileSync(path.join(__dirname, 'disclaimer.txt')).toString()
|
||||
module.exports = connect(mapStateToProps)(DisclaimerScreen)
|
||||
|
||||
function mapStateToProps(state) {
|
||||
return {}
|
||||
}
|
||||
|
||||
inherits(DisclaimerScreen, Component)
|
||||
function DisclaimerScreen() {
|
||||
Component.call(this)
|
||||
}
|
||||
|
||||
DisclaimerScreen.prototype.render = function() {
|
||||
|
||||
return (
|
||||
h('.flex-column.flex-center.flex-grow', [
|
||||
|
||||
h('h3.flex-center.text-transform-uppercase', {
|
||||
style: {
|
||||
background: '#EBEBEB',
|
||||
color: '#AEAEAE',
|
||||
marginBottom: 24,
|
||||
width: '100%',
|
||||
fontSize: '20px',
|
||||
padding: 6,
|
||||
},
|
||||
}, [
|
||||
'MetaMask Terms & Conditions',
|
||||
]),
|
||||
|
||||
h('div', {
|
||||
style: {
|
||||
whiteSpace: 'pre-line',
|
||||
background: 'rgb(235, 235, 235)',
|
||||
height: '336px',
|
||||
padding: '6px',
|
||||
width: '80%',
|
||||
overflowY: 'scroll',
|
||||
}
|
||||
}, disclaimer),
|
||||
|
||||
h('button', {
|
||||
style: { marginTop: '18px' },
|
||||
onClick: () => this.props.dispatch(actions.agreeToDisclaimer())
|
||||
}, 'I Agree')
|
||||
])
|
||||
)
|
||||
}
|
||||
|
11
ui/app/first-time/disclaimer.txt
Normal file
@ -0,0 +1,11 @@
|
||||
Full disclaimer coming soon. In the meanwhile, be aware this is experimental software. We are not responsible for how you use MetaMask, or any funds that you spend or lose with it. The only way to be absolutely sure you will lose no funds on the internet is to put no funds onto the internet. Enjoy!
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam accumsan tortor sed fringilla ultrices. Vestibulum congue fermentum nisi, venenatis dapibus urna semper id. Phasellus pretium faucibus nisi accumsan euismod. Nunc vel leo velit. Duis est felis, bibendum non dolor et, rhoncus gravida velit. Sed nec velit at nisi congue tincidunt non at felis. Praesent tincidunt, ipsum sit amet varius vulputate, purus lacus dictum tortor, vitae tempus dui turpis a lacus. Vivamus ut elit sodales, auctor nisi vitae, gravida est. Donec id massa ac ante rhoncus interdum. Aliquam gravida augue rhoncus libero ultricies scelerisque.
|
||||
|
||||
Cras a ornare tortor. Vestibulum et scelerisque lacus. Proin dapibus consectetur blandit. Aliquam viverra, orci eget efficitur pharetra, velit tortor rhoncus ipsum, sit amet sollicitudin turpis velit vitae nunc. Sed pretium ut nisl sed mollis. Proin libero erat, molestie id est sed, pellentesque hendrerit nulla. Donec vitae efficitur nunc. Integer ornare nisi volutpat nisi sodales cursus. Nam ante odio, congue vel turpis non, viverra congue mauris. Maecenas ullamcorper ligula eget lorem ornare mollis. Interdum et malesuada fames ac ante ipsum primis in faucibus.
|
||||
|
||||
Sed sem odio, malesuada ut convallis nec, accumsan sit amet nulla. Morbi fringilla, purus vestibulum lacinia suscipit, massa mi pulvinar lorem, sit amet vestibulum purus turpis ut dolor. Integer felis eros, accumsan id urna ac, tincidunt vehicula purus. Pellentesque felis massa, convallis euismod vestibulum a, molestie non ante. Nulla sodales fermentum ultricies. In id malesuada diam, eget blandit arcu. Nullam a lacus a mauris rhoncus maximus eu ut ex. Phasellus non mauris mi. Duis at lectus sollicitudin, malesuada augue malesuada, tempor velit. Etiam vehicula leo id sapien feugiat consequat. Donec eget ex at sapien facilisis dapibus. Morbi condimentum magna nec venenatis vulputate. Nullam lobortis ante turpis, ac fermentum ipsum posuere id. Nullam pharetra velit vel dolor faucibus vehicula. Fusce quis ipsum nec felis blandit elementum a ut augue.
|
||||
|
||||
Integer faucibus enim id odio auctor, ut sagittis diam luctus. Mauris iaculis rutrum risus, quis sagittis dolor fermentum eget. Praesent sit amet augue vitae erat efficitur placerat dictum ut magna. Suspendisse consectetur, risus quis pharetra molestie, enim dui accumsan erat, sed imperdiet orci dolor et nibh. Cras odio justo, pretium sit amet consequat luctus, imperdiet a lorem. Nam vulputate tincidunt erat, eget pellentesque dui elementum non. Sed vitae ante faucibus, pulvinar felis ornare, ornare felis.
|
||||
|
||||
Donec nec lorem velit. Mauris sollicitudin quam turpis, quis finibus mauris semper in. Nullam efficitur faucibus lectus, vitae sagittis neque pellentesque in. Vivamus neque tellus, mollis at ultricies at, dignissim sit amet odio. Curabitur nec mi et lacus interdum hendrerit at et est. Nullam varius purus eu volutpat luctus. Vestibulum non sem eros. Nulla tempor, leo eu varius euismod, massa est mattis massa, id finibus mi erat a odio. Quisque et tincidunt justo. Curabitur eu lacus leo. Aliquam eget odio tempor, tincidunt nunc a, maximus diam. Curabitur venenatis nunc risus, in ullamcorper neque pharetra sit amet. Sed euismod dolor sed enim venenatis dapibus. Mauris congue magna nisl, et tincidunt dui vulputate vel.
|
@ -25,6 +25,11 @@ function reduceMetamask(state, action) {
|
||||
case actions.UPDATE_METAMASK_STATE:
|
||||
return extend(metamaskState, action.value)
|
||||
|
||||
case actions.AGREE_TO_DISCLAIMER:
|
||||
return extend(metamaskState, {
|
||||
isConfirmed: true,
|
||||
})
|
||||
|
||||
case actions.UNLOCK_METAMASK:
|
||||
return extend(metamaskState, {
|
||||
isUnlocked: true,
|
||||
|
@ -16,15 +16,15 @@ function COMPONENTNAME() {
|
||||
}
|
||||
|
||||
COMPONENTNAME.prototype.render = function() {
|
||||
var state = this.props
|
||||
var rpc = state.rpc
|
||||
const props = this.props
|
||||
|
||||
return (
|
||||
h('div', {
|
||||
style: {
|
||||
display: 'none',
|
||||
background: 'blue',
|
||||
}
|
||||
}, [
|
||||
'Hello, world!'
|
||||
])
|
||||
)
|
||||
}
|
||||
|
BIN
ui/design/chromeStorePics/final_screen_dao_accounts.png
Normal file
After Width: | Height: | Size: 244 KiB |
BIN
ui/design/chromeStorePics/final_screen_dao_locked.png
Normal file
After Width: | Height: | Size: 215 KiB |
BIN
ui/design/chromeStorePics/final_screen_dao_notification.png
Normal file
After Width: | Height: | Size: 209 KiB |
BIN
ui/design/chromeStorePics/final_screen_wei_account.png
Normal file
After Width: | Height: | Size: 247 KiB |
BIN
ui/design/chromeStorePics/final_screen_wei_notification.png
Normal file
After Width: | Height: | Size: 189 KiB |
BIN
ui/design/chromeStorePics/icon-128.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
ui/design/chromeStorePics/icon-64.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
2383
ui/design/chromeStorePics/metamask_icon.ai
Normal file
BIN
ui/design/chromeStorePics/promo1400560.png
Normal file
After Width: | Height: | Size: 256 KiB |
BIN
ui/design/chromeStorePics/promo440280.png
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
ui/design/chromeStorePics/promo920680.png
Normal file
After Width: | Height: | Size: 202 KiB |
BIN
ui/design/chromeStorePics/screen_dao_accounts.png
Normal file
After Width: | Height: | Size: 506 KiB |
BIN
ui/design/chromeStorePics/screen_dao_locked.png
Normal file
After Width: | Height: | Size: 280 KiB |
BIN
ui/design/chromeStorePics/screen_dao_notification.png
Normal file
After Width: | Height: | Size: 290 KiB |
BIN
ui/design/chromeStorePics/screen_wei_account.png
Normal file
After Width: | Height: | Size: 638 KiB |
BIN
ui/design/chromeStorePics/screen_wei_notification.png
Normal file
After Width: | Height: | Size: 393 KiB |