Merge pull request #1121 from MetaMask/dev

Merge dev into master
feature/default_network_editable
Kevin Serrano 8 years ago committed by GitHub
commit 3bd23564fb
  1. 2
      CHANGELOG.md
  2. 1
      app/scripts/config.js
  3. 22
      app/scripts/lib/config-manager.js
  4. 2
      app/scripts/lib/idStore.js
  5. 5
      app/scripts/lib/inpage-provider.js
  6. 51
      app/scripts/metamask-controller.js
  7. 6
      app/scripts/migrations/002.js
  8. 5
      app/scripts/migrations/003.js
  9. 17
      app/scripts/migrations/004.js
  10. 7
      app/scripts/migrations/005.js
  11. 6
      app/scripts/migrations/006.js
  12. 6
      app/scripts/migrations/007.js
  13. 6
      app/scripts/migrations/008.js
  14. 9
      app/scripts/migrations/009.js
  15. 4
      app/scripts/migrations/010.js
  16. 33
      app/scripts/migrations/011.js
  17. 1
      app/scripts/migrations/index.js
  18. 6
      app/scripts/notice-controller.js
  19. 1
      development/states/account-detail-with-shapeshift-tx.json
  20. 1
      development/states/account-detail-with-transaction-history.json
  21. 1
      development/states/account-detail.json
  22. 3
      development/states/account-list-with-imported.json
  23. 3
      development/states/accounts-loose.json
  24. 1
      development/states/accounts.json
  25. 3
      development/states/compilation-bug.json
  26. 1
      development/states/config.json
  27. 3
      development/states/create-vault-password.json
  28. 1
      development/states/custom-rpc.json
  29. 1
      development/states/empty-account-detail.json
  30. 2
      development/states/first-time.json
  31. 3
      development/states/help.json
  32. 3
      development/states/import-private-key-warning.json
  33. 3
      development/states/import-private-key.json
  34. 1
      development/states/locked.json
  35. 1
      development/states/lost-accounts.json
  36. 3
      development/states/new-account.json
  37. 3
      development/states/new-vault.json
  38. 1
      development/states/notice.json
  39. 2
      development/states/pending-crash.json
  40. 1
      development/states/pending-signature.json
  41. 2
      development/states/pending-tx-contract.json
  42. 2
      development/states/pending-tx-send-coin.json
  43. 2
      development/states/pending-tx-value.json
  44. 6
      development/states/private-network.json
  45. 1
      development/states/restore-vault.json
  46. 1
      development/states/send.json
  47. 1
      development/states/shapeshift.json
  48. 1
      development/states/show-seed-words.json
  49. 3
      development/states/terms-and-conditions.json
  50. 7
      gulpfile.js
  51. 180
      notices/archive/notice_0.md
  52. 37
      notices/notice-generator.js
  53. 1
      notices/notice-nonce.json
  54. 2
      notices/notices.json
  55. 1
      package.json
  56. 48
      test/integration/lib/first-time.js
  57. 2
      test/integration/mocks/badVault.json
  58. 2
      test/integration/mocks/badVault2.json
  59. 2
      test/integration/mocks/oldVault.json
  60. 138
      test/lib/migrations/004.json
  61. 34
      test/unit/config-manager-test.js
  62. 91
      test/unit/migrations-test.js
  63. 19
      ui/app/actions.js
  64. 32
      ui/app/app.js
  65. 112
      ui/app/first-time/disclaimer.js
  66. 5
      ui/app/reducers/metamask.js

@ -1,6 +1,8 @@
# Changelog
## Current Master
- net_version has been made synchronous.
- Test suite for migrations expanded.
- Improve test coverage of eth.sign behavior, including a code example of verifying a signature.

@ -3,7 +3,6 @@ const TESTNET_RPC_URL = 'https://ropsten.infura.io/metamask'
const DEFAULT_RPC_URL = TESTNET_RPC_URL
global.METAMASK_DEBUG = 'GULP_METAMASK_DEBUG'
global.TOS_HASH = 'GULP_TOS_HASH'
module.exports = {
network: {

@ -228,28 +228,6 @@ ConfigManager.prototype._emitUpdates = function (state) {
})
}
ConfigManager.prototype.setConfirmedDisclaimer = function (confirmed) {
var data = this.getData()
data.isDisclaimerConfirmed = confirmed
this.setData(data)
}
ConfigManager.prototype.getConfirmedDisclaimer = function () {
var data = this.getData()
return data.isDisclaimerConfirmed
}
ConfigManager.prototype.setTOSHash = function (hash) {
var data = this.getData()
data.TOSHash = hash
this.setData(data)
}
ConfigManager.prototype.getTOSHash = function () {
var data = this.getData()
return data.TOSHash
}
ConfigManager.prototype.getGasMultiplier = function () {
var data = this.getData()
return data.gasMultiplier

@ -94,7 +94,6 @@ IdentityStore.prototype.getState = function () {
isInitialized: !!configManager.getWallet() && !seedWords,
isUnlocked: this._isUnlocked(),
seedWords: seedWords,
isDisclaimerConfirmed: configManager.getConfirmedDisclaimer(),
selectedAddress: configManager.getSelectedAccount(),
gasMultiplier: configManager.getGasMultiplier(),
}))
@ -343,4 +342,3 @@ IdentityStore.prototype._autoFaucet = function () {
}
// util

@ -84,6 +84,11 @@ MetamaskInpageProvider.prototype.send = function (payload) {
result = true
break
case 'net_version':
let networkVersion = self.publicConfigStore.getState().networkVersion
result = networkVersion
break
// throw not-supported Error
default:
var link = 'https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md#dizzy-all-async---think-of-metamask-as-a-light-client'

@ -107,8 +107,6 @@ module.exports = class MetamaskController extends EventEmitter {
this.messageManager = new MessageManager()
this.publicConfigStore = this.initPublicConfigStore()
this.checkTOSChange()
// TEMPORARY UNTIL FULL DEPRECATION:
this.idStoreMigrator = new IdStoreMigrator({
configManager: this.configManager,
@ -178,7 +176,7 @@ module.exports = class MetamaskController extends EventEmitter {
// sync publicConfigStore with transform
pipe(
this.store,
storeTransform(selectPublicState),
storeTransform(selectPublicState.bind(this)),
publicConfigStore
)
@ -186,6 +184,7 @@ module.exports = class MetamaskController extends EventEmitter {
const result = { selectedAddress: undefined }
try {
result.selectedAddress = state.PreferencesController.selectedAddress
result.networkVersion = this.getNetworkState()
} catch (_) {}
return result
}
@ -219,7 +218,6 @@ module.exports = class MetamaskController extends EventEmitter {
this.shapeshiftController.store.getState(),
{
lostAccounts: this.configManager.getLostAccounts(),
isDisclaimerConfirmed: this.configManager.getConfirmedDisclaimer(),
seedWords: this.configManager.getSeedWords(),
}
)
@ -242,11 +240,7 @@ module.exports = class MetamaskController extends EventEmitter {
setRpcTarget: this.setRpcTarget.bind(this),
setProviderType: this.setProviderType.bind(this),
useEtherscanProvider: this.useEtherscanProvider.bind(this),
agreeToDisclaimer: this.agreeToDisclaimer.bind(this),
resetDisclaimer: this.resetDisclaimer.bind(this),
setCurrentCurrency: this.setCurrentCurrency.bind(this),
setTOSHash: this.setTOSHash.bind(this),
checkTOSChange: this.checkTOSChange.bind(this),
setGasMultiplier: this.setGasMultiplier.bind(this),
markAccountsFound: this.markAccountsFound.bind(this),
// coinbase
@ -518,47 +512,6 @@ module.exports = class MetamaskController extends EventEmitter {
})
}
//
// disclaimer
//
agreeToDisclaimer (cb) {
try {
this.configManager.setConfirmedDisclaimer(true)
cb()
} catch (err) {
cb(err)
}
}
resetDisclaimer () {
try {
this.configManager.setConfirmedDisclaimer(false)
} catch (e) {
console.error(e)
}
}
setTOSHash (hash) {
try {
this.configManager.setTOSHash(hash)
} catch (err) {
console.error('Error in setting terms of service hash.')
}
}
checkTOSChange () {
try {
const storedHash = this.configManager.getTOSHash() || 0
if (storedHash !== global.TOS_HASH) {
this.resetDisclaimer()
this.setTOSHash(global.TOS_HASH)
}
} catch (err) {
console.error('Error in checking TOS change.')
}
}
//
// config
//

@ -1,9 +1,13 @@
const version = 2
const clone = require('clone')
module.exports = {
version,
migrate: function (versionedData) {
migrate: function (originalVersionedData) {
let versionedData = clone(originalVersionedData)
versionedData.meta.version = version
try {
if (versionedData.data.config.provider.type === 'etherscan') {

@ -2,10 +2,13 @@ const version = 3
const oldTestRpc = 'https://rawtestrpc.metamask.io/'
const newTestRpc = 'https://testrpc.metamask.io/'
const clone = require('clone')
module.exports = {
version,
migrate: function (versionedData) {
migrate: function (originalVersionedData) {
let versionedData = clone(originalVersionedData)
versionedData.meta.version = version
try {
if (versionedData.data.config.provider.rpcTarget === oldTestRpc) {

@ -1,25 +1,28 @@
const version = 4
const clone = require('clone')
module.exports = {
version,
version,
migrate: function (versionedData) {
versionedData.meta.version = version
let safeVersionedData = clone(versionedData)
safeVersionedData.meta.version = version
try {
if (versionedData.data.config.provider.type !== 'rpc') return Promise.resolve(versionedData)
switch (versionedData.data.config.provider.rpcTarget) {
if (safeVersionedData.data.config.provider.type !== 'rpc') return Promise.resolve(safeVersionedData)
switch (safeVersionedData.data.config.provider.rpcTarget) {
case 'https://testrpc.metamask.io/':
versionedData.data.config.provider = {
safeVersionedData.data.config.provider = {
type: 'testnet',
}
break
case 'https://rpc.metamask.io/':
versionedData.data.config.provider = {
safeVersionedData.data.config.provider = {
type: 'mainnet',
}
break
}
} catch (_) {}
return Promise.resolve(versionedData)
return Promise.resolve(safeVersionedData)
},
}

@ -7,11 +7,14 @@ This migration moves state from the flat state trie into KeyringController subst
*/
const extend = require('xtend')
const clone = require('clone')
module.exports = {
version,
version,
migrate: function (versionedData) {
migrate: function (originalVersionedData) {
let versionedData = clone(originalVersionedData)
versionedData.meta.version = version
try {
const state = versionedData.data

@ -7,11 +7,13 @@ This migration moves KeyringController.selectedAddress to PreferencesController.
*/
const extend = require('xtend')
const clone = require('clone')
module.exports = {
version,
version,
migrate: function (versionedData) {
migrate: function (originalVersionedData) {
let versionedData = clone(originalVersionedData)
versionedData.meta.version = version
try {
const state = versionedData.data

@ -7,11 +7,13 @@ This migration breaks out the TransactionManager substate
*/
const extend = require('xtend')
const clone = require('clone')
module.exports = {
version,
version,
migrate: function (versionedData) {
migrate: function (originalVersionedData) {
let versionedData = clone(originalVersionedData)
versionedData.meta.version = version
try {
const state = versionedData.data

@ -7,11 +7,13 @@ This migration breaks out the NoticeController substate
*/
const extend = require('xtend')
const clone = require('clone')
module.exports = {
version,
version,
migrate: function (versionedData) {
migrate: function (originalVersionedData) {
let versionedData = clone(originalVersionedData)
versionedData.meta.version = version
try {
const state = versionedData.data

@ -7,11 +7,13 @@ This migration breaks out the CurrencyController substate
*/
const merge = require('deep-extend')
const clone = require('clone')
module.exports = {
version,
version,
migrate: function (versionedData) {
migrate: function (originalVersionedData) {
let versionedData = clone(originalVersionedData)
versionedData.meta.version = version
try {
const state = versionedData.data
@ -27,12 +29,13 @@ module.exports = {
function transformState (state) {
const newState = merge({}, state, {
CurrencyController: {
currentCurrency: state.currentFiat || 'USD',
currentCurrency: state.currentFiat || state.fiatCurrency || 'USD',
conversionRate: state.conversionRate,
conversionDate: state.conversionDate,
},
})
delete newState.currentFiat
delete newState.fiatCurrency
delete newState.conversionRate
delete newState.conversionDate

@ -7,11 +7,13 @@ This migration breaks out the CurrencyController substate
*/
const merge = require('deep-extend')
const clone = require('clone')
module.exports = {
version,
migrate: function (versionedData) {
migrate: function (originalVersionedData) {
let versionedData = clone(originalVersionedData)
versionedData.meta.version = version
try {
const state = versionedData.data

@ -0,0 +1,33 @@
const version = 11
/*
This migration breaks out the CurrencyController substate
*/
const clone = require('clone')
module.exports = {
version,
migrate: function (originalVersionedData) {
let versionedData = clone(originalVersionedData)
versionedData.meta.version = version
try {
const state = versionedData.data
const newState = transformState(state)
versionedData.data = newState
} catch (err) {
console.warn(`MetaMask Migration #${version}` + err.stack)
}
return Promise.resolve(versionedData)
},
}
function transformState (state) {
const newState = state
delete newState.TOSHash
delete newState.isDisclaimerConfirmed
return newState
}

@ -21,4 +21,5 @@ module.exports = [
require('./008'),
require('./009'),
require('./010'),
require('./011'),
]

@ -35,12 +35,12 @@ module.exports = class NoticeController extends EventEmitter {
return Promise.resolve(true)
}
markNoticeRead (notice, cb) {
markNoticeRead (noticeToMark, cb) {
cb = cb || function (err) { if (err) throw err }
try {
var notices = this.getNoticesList()
var id = notice.id
notices[id].read = true
var index = notices.findIndex((currentNotice) => currentNotice.id === noticeToMark.id)
notices[index].read = true
this.setNoticesList(notices)
const latestNotice = this.getLatestUnreadNotice()
cb(null, latestNotice)

@ -136,7 +136,6 @@
"selectedAddress": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc",
"network": "1",
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"provider": {

@ -102,7 +102,6 @@
"selectedAddress": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc",
"network": "2",
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"provider": {

@ -60,7 +60,6 @@
"selectedAddress": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc",
"network": "2",
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"provider": {

@ -39,7 +39,6 @@
},
"selectedAddress": "0x9858e7d8b79fc3e6d989636721584498926da38a",
"selectedAccountTxList": [],
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],
@ -81,4 +80,4 @@
"forgottenPassword": false
},
"identities": {}
}
}

@ -78,7 +78,6 @@
"type": "testnet"
},
"selectedAddress": "0x87658c15aefe7448008a28513a11b6b130ef4cd0",
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],
@ -123,4 +122,4 @@
"forgottenPassword": false
},
"identities": {}
}
}

@ -90,7 +90,6 @@
},
"transactions": [],
"network": "2",
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],

@ -97,7 +97,6 @@
},
"selectedAddress": "0xac39b311dceb2a4b2f5d8461c1cdaf756f4f7ae9",
"seedWords": false,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],
@ -121,4 +120,4 @@
"warning": null
},
"identities": {}
}
}

@ -58,7 +58,6 @@
},
"transactions": [],
"network": "2",
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"provider": {

@ -10,7 +10,6 @@
"transactions": [],
"network": "2",
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"provider": {
@ -32,4 +31,4 @@
"warning": null
},
"identities": {}
}
}

@ -159,7 +159,6 @@
],
"network": "166",
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"provider": {

@ -57,7 +57,6 @@
"selectedAddress": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc",
"network": "2",
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"provider": {

@ -8,10 +8,10 @@
"currentFiat": "USD",
"conversionRate": 11.47635827,
"conversionDate": 1477606503,
"noActiveNotices": true,
"network": null,
"accounts": {},
"transactions": [],
"isDisclaimerConfirmed": false,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],

@ -55,7 +55,6 @@
},
"transactions": [],
"network": "2",
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"provider": {
@ -81,4 +80,4 @@
"scrollToBottom": true
},
"identities": {}
}
}

@ -30,7 +30,6 @@
"selectedAddress": "0x01208723ba84e15da2e71656544a2963b0c06d40",
"selectedAccountTxList": [],
"seedWords": false,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],
@ -89,4 +88,4 @@
"warning": "Invalid hex string"
},
"identities": {}
}
}

@ -30,7 +30,6 @@
"selectedAddress": "0x01208723ba84e15da2e71656544a2963b0c06d40",
"selectedAccountTxList": [],
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],
@ -61,4 +60,4 @@
"warning": null
},
"identities": {}
}
}

@ -14,7 +14,6 @@
"selectedAddress": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825",
"network": "1473186153102",
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],

@ -64,7 +64,6 @@
"selectedAddress": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc",
"network": "2",
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"provider": {

@ -37,7 +37,6 @@
"type": "testnet"
},
"selectedAddress": "0xa6ef573d60594731178b7f85d80da13cc2af52dd",
"isConfirmed": true,
"unconfMsgs": {},
"messages": [],
"selectedAddress": "0xa6ef573d60594731178b7f85d80da13cc2af52dd",
@ -63,4 +62,4 @@
"scrollToBottom": false
},
"identities": {}
}
}

@ -10,7 +10,6 @@
"transactions": [],
"network": "2",
"seedWords": null,
"isDisclaimerConfirmed": false,
"unconfMsgs": {},
"messages": [],
"provider": {
@ -32,4 +31,4 @@
"warning": null
},
"identities": {}
}
}

@ -35,7 +35,6 @@
},
"selectedAddress": "0x24a1d059462456aa332d6da9117aa7f91a46f2ac",
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],

File diff suppressed because one or more lines are too long

@ -354,7 +354,6 @@
"selectedAddress": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825",
"network": "1471904489432",
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {
"1472076978535283": {
"id": 1472076978535283,

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"metamask":{"isInitialized":true,"isUnlocked":true,"currentDomain":"example.com","rpcTarget":"https://rawtestrpc.metamask.io/","identities":{"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825":{"name":"Wallet 1","address":"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825","mayBeFauceting":false},"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb":{"name":"Wallet 2","address":"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb","mayBeFauceting":false},"0x2f8d4a878cfa04a6e60d46362f5644deab66572d":{"name":"Wallet 3","address":"0x2f8d4a878cfa04a6e60d46362f5644deab66572d","mayBeFauceting":false}},"unconfTxs":{"1467868023090690":{"id":1467868023090690,"txParams":{"data":"0xa9059cbb0000000000000000000000008deb4d106090c3eb8f1950f727e87c4f884fb06f0000000000000000000000000000000000000000000000000000000000000064","from":"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825","value":"0x16345785d8a0000","to":"0xbeb0ed3034c4155f3d16a64a5c5e7c8d4ea9e9c9","origin":"MetaMask","metamaskId":1467868023090690,"metamaskNetworkId":"2"},"time":1467868023090,"status":"unconfirmed","containsDelegateCall":false}},"accounts":{"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825":{"code":"0x","balance":"0x38326dc32cf80800","nonce":"0x10000c","address":"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825"},"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb":{"code":"0x","balance":"0x15e578bd8e9c8000","nonce":"0x100000","address":"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb"},"0x2f8d4a878cfa04a6e60d46362f5644deab66572d":{"code":"0x","nonce":"0x100000","balance":"0x2386f26fc10000","address":"0x2f8d4a878cfa04a6e60d46362f5644deab66572d"}},"transactions":[],"selectedAddress":"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825","network":"2","seedWords":null,"isDisclaimerConfirmed":true,"unconfMsgs":{},"messages":[],"provider":{"type":"testnet"},"selectedAddress":"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825"},"appState":{"menuOpen":false,"currentView":{"name":"confTx","context":0},"accountDetail":{"subview":"transactions"},"currentDomain":"extensions","transForward":true,"isLoading":false,"warning":null},"identities":{}}
{"metamask":{"isInitialized":true,"isUnlocked":true,"currentDomain":"example.com","rpcTarget":"https://rawtestrpc.metamask.io/","identities":{"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825":{"name":"Wallet 1","address":"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825","mayBeFauceting":false},"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb":{"name":"Wallet 2","address":"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb","mayBeFauceting":false},"0x2f8d4a878cfa04a6e60d46362f5644deab66572d":{"name":"Wallet 3","address":"0x2f8d4a878cfa04a6e60d46362f5644deab66572d","mayBeFauceting":false}},"unconfTxs":{"1467868023090690":{"id":1467868023090690,"txParams":{"data":"0xa9059cbb0000000000000000000000008deb4d106090c3eb8f1950f727e87c4f884fb06f0000000000000000000000000000000000000000000000000000000000000064","from":"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825","value":"0x16345785d8a0000","to":"0xbeb0ed3034c4155f3d16a64a5c5e7c8d4ea9e9c9","origin":"MetaMask","metamaskId":1467868023090690,"metamaskNetworkId":"2"},"time":1467868023090,"status":"unconfirmed","containsDelegateCall":false}},"accounts":{"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825":{"code":"0x","balance":"0x38326dc32cf80800","nonce":"0x10000c","address":"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825"},"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb":{"code":"0x","balance":"0x15e578bd8e9c8000","nonce":"0x100000","address":"0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb"},"0x2f8d4a878cfa04a6e60d46362f5644deab66572d":{"code":"0x","nonce":"0x100000","balance":"0x2386f26fc10000","address":"0x2f8d4a878cfa04a6e60d46362f5644deab66572d"}},"transactions":[],"selectedAddress":"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825","network":"2","seedWords":null,"unconfMsgs":{},"messages":[],"provider":{"type":"testnet"},"selectedAddress":"0xfdea65c8e26263f6d9a1b5de9555d2931a33b825"},"appState":{"menuOpen":false,"currentView":{"name":"confTx","context":0},"accountDetail":{"subview":"transactions"},"currentDomain":"extensions","transForward":true,"isLoading":false,"warning":null},"identities":{}}

File diff suppressed because one or more lines are too long

@ -54,7 +54,6 @@
],
"selectedAddress": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825",
"network": "1479753732793",
"isConfirmed": true,
"isEthConfirmed": true,
"unconfMsgs": {},
"messages": [],
@ -64,8 +63,7 @@
"type": "rpc",
"rpcTarget": "http://localhost:8545"
},
"selectedAddress": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825",
"isDisclaimerConfirmed": true
"selectedAddress": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825"
},
"appState": {
"menuOpen": false,
@ -83,4 +81,4 @@
"scrollToBottom": false
},
"identities": {}
}
}

@ -12,7 +12,6 @@
"accounts": {},
"transactions": [],
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],

@ -48,7 +48,6 @@
"transactions": [],
"network": "2",
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],

@ -49,7 +49,6 @@
"selectedAddress": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825",
"network": "1",
"seedWords": null,
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],

@ -45,7 +45,6 @@
"transactions": [],
"network": "2",
"seedWords": "debris dizzy just program just float decrease vacant alarm reduce speak stadium",
"isDisclaimerConfirmed": true,
"unconfMsgs": {},
"messages": [],
"provider": {

@ -14,7 +14,6 @@
"provider": {
"type": "testnet"
},
"isDisclaimerConfirmed": false,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],
@ -37,4 +36,4 @@
"warning": null
},
"identities": {}
}
}

@ -18,14 +18,8 @@ var path = require('path')
var manifest = require('./app/manifest.json')
var gulpif = require('gulp-if')
var replace = require('gulp-replace')
var disclaimer = fs.readFileSync(path.join(__dirname, 'USER_AGREEMENT.md')).toString()
var crypto = require('crypto')
var hash = crypto.createHash('sha256')
var mkdirp = require('mkdirp')
hash.update(disclaimer)
var tosHash = hash.digest('hex')
var disableLiveReload = gutil.env.disableLiveReload
var debug = gutil.env.debug
@ -307,7 +301,6 @@ function bundleTask(opts) {
// convert bundle stream to gulp vinyl stream
.pipe(source(opts.filename))
// inject variables into bundle
.pipe(replace('GULP_TOS_HASH', tosHash))
.pipe(replace('\'GULP_METAMASK_DEBUG\'', debug))
// buffer file contents (?)
.pipe(buffer())

@ -0,0 +1,180 @@
# Terms of Use #
**THIS AGREEMENT IS SUBJECT TO BINDING ARBITRATION AND A WAIVER OF CLASS ACTION RIGHTS AS DETAILED IN SECTION 13. PLEASE READ THE AGREEMENT CAREFULLY.**
_Our Terms of Use have been updated as of September 5, 2016_
## 1. Acceptance of Terms ##
MetaMask provides a platform for managing Ethereum (or "ETH") accounts, and allowing ordinary websites to interact with the Ethereum blockchain, while keeping the user in control over what transactions they approve, through our website located at[ ](http://metamask.io)[https://metamask.io/](https://metamask.io/) and browser plugin (the "Site") — which includes text, images, audio, code and other materials (collectively, the “Content”) and all of the features, and services provided. The Site, and any other features, tools, materials, or other services offered from time to time by MetaMask are referred to here as the “Service.” Please read these Terms of Use (the “Terms” or “Terms of Use”) carefully before using the Service. By using or otherwise accessing the Services, or clicking to accept or agree to these Terms where that option is made available, you (1) accept and agree to these Terms (2) consent to the collection, use, disclosure and other handling of information as described in our Privacy Policy and (3) any additional terms, rules and conditions of participation issued by MetaMask from time to time. If you do not agree to the Terms, then you may not access or use the Content or Services.
## 2. Modification of Terms of Use ##
Except for Section 13, providing for binding arbitration and waiver of class action rights, MetaMask reserves the right, at its sole discretion, to modify or replace the Terms of Use at any time. The most current version of these Terms will be posted on our Site. You shall be responsible for reviewing and becoming familiar with any such modifications. Use of the Services by you after any modification to the Terms constitutes your acceptance of the Terms of Use as modified.
## 3. Eligibility ##
You hereby represent and warrant that you are fully able and competent to enter into the terms, conditions, obligations, affirmations, representations and warranties set forth in these Terms and to abide by and comply with these Terms.
MetaMask is a global platform and by accessing the Content or Services, you are representing and warranting that, you are of the legal age of majority in your jurisdiction as is required to access such Services and Content and enter into arrangements as provided by the Service. You further represent that you are otherwise legally permitted to use the service in your jurisdiction including owning cryptographic tokens of value, and interacting with the Services or Content in any way. You further represent you are responsible for ensuring compliance with the laws of your jurisdiction and acknowledge that MetaMask is not liable for your compliance with such laws.
## 4 Account Password and Security ##
When setting up an account within MetaMask, you will be responsible for keeping your own account secrets, which may be a twelve-word seed phrase, an account file, or other locally stored secret information. MetaMask encrypts this information locally with a password you provide, that we never send to our servers. You agree to (a) never use the same password for MetaMask that you have ever used outside of this service; (b) keep your secret information and password confidential and do not share them with anyone else; (c) immediately notify MetaMask of any unauthorized use of your account or breach of security. MetaMask cannot and will not be liable for any loss or damage arising from your failure to comply with this section.
## 5. Representations, Warranties, and Risks ##
### 5.1. Warranty Disclaimer ###
You expressly understand and agree that your use of the Service is at your sole risk. The Service (including the Service and the Content) are provided on an "AS IS" and "as available" basis, without warranties of any kind, either express or implied, including, without limitation, implied warranties of merchantability, fitness for a particular purpose or non-infringement. You acknowledge that MetaMask has no control over, and no duty to take any action regarding: which users gain access to or use the Service; what effects the Content may have on you; how you may interpret or use the Content; or what actions you may take as a result of having been exposed to the Content. You release MetaMask from all liability for you having acquired or not acquired Content through the Service. MetaMask makes no representations concerning any Content contained in or accessed through the Service, and MetaMask will not be responsible or liable for the accuracy, copyright compliance, legality or decency of material contained in or accessed through the Service.
### 5.2 Sophistication and Risk of Cryptographic Systems ###
By utilizing the Service or interacting with the Content or platform in any way, you represent that you understand the inherent risks associated with cryptographic systems; and warrant that you have an understanding of the usage and intricacies of native cryptographic tokens, like Ether (ETH) and Bitcoin (BTC), smart contract based tokens such as those that follow the Ethereum Token Standard (https://github.com/ethereum/EIPs/issues/20), and blockchain-based software systems.
### 5.3 Risk of Regulatory Actions in One or More Jurisdictions ###
MetaMask and ETH could be impacted by one or more regulatory inquiries or regulatory action, which could impede or limit the ability of MetaMask to continue to develop, or which could impede or limit your ability to access or use the Service or Ethereum blockchain.
### 5.4 Risk of Weaknesses or Exploits in the Field of Cryptography ###
You acknowledge and understand that Cryptography is a progressing field. Advances in code cracking or technical advances such as the development of quantum computers may present risks to cryptocurrencies and Services of Content, which could result in the theft or loss of your cryptographic tokens or property. To the extent possible, MetaMask intends to update the protocol underlying Services to account for any advances in cryptography and to incorporate additional security measures, but does not guarantee or otherwise represent full security of the system. By using the Service or accessing Content, you acknowledge these inherent risks.
### 5.5 Volatility of Crypto Currencies ###
You understand that Ethereum and other blockchain technologies and associated currencies or tokens are highly volatile due to many factors including but not limited to adoption, speculation, technology and security risks. You also acknowledge that the cost of transacting on such technologies is variable and may increase at any time causing impact to any activities taking place on the Ethereum blockchain. You acknowledge these risks and represent that MetaMask cannot be held liable for such fluctuations or increased costs.
### 5.6 Application Security ###
You acknowledge that Ethereum applications are code subject to flaws and acknowledge that you are solely responsible for evaluating any code provided by the Services or Content and the trustworthiness of any third-party websites, products, smart-contracts, or Content you access or use through the Service. You further expressly acknowledge and represent that Ethereum applications can be written maliciously or negligently, that MetaMask cannot be held liable for your interaction with such applications and that such applications may cause the loss of property or even identity. This warning and others later provided by MetaMask in no way evidence or represent an on-going duty to alert you to all of the potential risks of utilizing the Service or Content.
## 6. Indemnity ##
You agree to release and to indemnify, defend and hold harmless MetaMask and its parents, subsidiaries, affiliates and agencies, as well as the officers, directors, employees, shareholders and representatives of any of the foregoing entities, from and against any and all losses, liabilities, expenses, damages, costs (including attorneys’ fees and court costs) claims or actions of any kind whatsoever arising or resulting from your use of the Service, your violation of these Terms of Use, and any of your acts or omissions that implicate publicity rights, defamation or invasion of privacy. MetaMask reserves the right, at its own expense, to assume exclusive defense and control of any matter otherwise subject to indemnification by you and, in such case, you agree to cooperate with MetaMask in the defense of such matter.
## 7. Limitation on liability ##
YOU ACKNOWLEDGE AND AGREE THAT YOU ASSUME FULL RESPONSIBILITY FOR YOUR USE OF THE SITE AND SERVICE. YOU ACKNOWLEDGE AND AGREE THAT ANY INFORMATION YOU SEND OR RECEIVE DURING YOUR USE OF THE SITE AND SERVICE MAY NOT BE SECURE AND MAY BE INTERCEPTED OR LATER ACQUIRED BY UNAUTHORIZED PARTIES. YOU ACKNOWLEDGE AND AGREE THAT YOUR USE OF THE SITE AND SERVICE IS AT YOUR OWN RISK. RECOGNIZING SUCH, YOU UNDERSTAND AND AGREE THAT, TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, NEITHER METAMASK NOR ITS SUPPLIERS OR LICENSORS WILL BE LIABLE TO YOU FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY OR OTHER DAMAGES OF ANY KIND, INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF PROFITS, GOODWILL, USE, DATA OR OTHER TANGIBLE OR INTANGIBLE LOSSES OR ANY OTHER DAMAGES BASED ON CONTRACT, TORT, STRICT LIABILITY OR ANY OTHER THEORY (EVEN IF METAMASK HAD BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES), RESULTING FROM THE SITE OR SERVICE; THE USE OR THE INABILITY TO USE THE SITE OR SERVICE; UNAUTHORIZED ACCESS TO OR ALTERATION OF YOUR TRANSMISSIONS OR DATA; STATEMENTS OR CONDUCT OF ANY THIRD PARTY ON THE SITE OR SERVICE; ANY ACTIONS WE TAKE OR FAIL TO TAKE AS A RESULT OF COMMUNICATIONS YOU SEND TO US; HUMAN ERRORS; TECHNICAL MALFUNCTIONS; FAILURES, INCLUDING PUBLIC UTILITY OR TELEPHONE OUTAGES; OMISSIONS, INTERRUPTIONS, LATENCY, DELETIONS OR DEFECTS OF ANY DEVICE OR NETWORK, PROVIDERS, OR SOFTWARE (INCLUDING, BUT NOT LIMITED TO, THOSE THAT DO NOT PERMIT PARTICIPATION IN THE SERVICE); ANY INJURY OR DAMAGE TO COMPUTER EQUIPMENT; INABILITY TO FULLY ACCESS THE SITE OR SERVICE OR ANY OTHER WEBSITE; THEFT, TAMPERING, DESTRUCTION, OR UNAUTHORIZED ACCESS TO, IMAGES OR OTHER CONTENT OF ANY KIND; DATA THAT IS PROCESSED LATE OR INCORRECTLY OR IS INCOMPLETE OR LOST; TYPOGRAPHICAL, PRINTING OR OTHER ERRORS, OR ANY COMBINATION THEREOF; OR ANY OTHER MATTER RELATING TO THE SITE OR SERVICE.
SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF CERTAIN WARRANTIES OR THE LIMITATION OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES. ACCORDINGLY, SOME OF THE ABOVE LIMITATIONS MAY NOT APPLY TO YOU.
## 8. Our Proprietary Rights ##
All title, ownership and intellectual property rights in and to the Service are owned by MetaMask or its licensors. You acknowledge and agree that the Service contains proprietary and confidential information that is protected by applicable intellectual property and other laws. Except as expressly authorized by MetaMask, you agree not to copy, modify, rent, lease, loan, sell, distribute, perform, display or create derivative works based on the Service, in whole or in part. MetaMask issues a license for MetaMask, found [here](https://github.com/MetaMask/metamask-plugin/blob/master/LICENSE). For information on other licenses utilized in the development of MetaMask, please see our attribution page at: [https://metamask.io/attributions.html](https://metamask.io/attributions.html)
## 9. Links ##
The Service provides, or third parties may provide, links to other World Wide Web or accessible sites, applications or resources. Because MetaMask has no control over such sites, applications and resources, you acknowledge and agree that MetaMask is not responsible for the availability of such external sites, applications or resources, and does not endorse and is not responsible or liable for any content, advertising, products or other materials on or available from such sites or resources. You further acknowledge and agree that MetaMask shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such site or resource.
## 10. Termination and Suspension ##
MetaMask may terminate or suspend all or part of the Service and your MetaMask access immediately, without prior notice or liability, if you breach any of the terms or conditions of the Terms. Upon termination of your access, your right to use the Service will immediately cease.
The following provisions of the Terms survive any termination of these Terms: INDEMNITY; WARRANTY DISCLAIMERS; LIMITATION ON LIABILITY; OUR PROPRIETARY RIGHTS; LINKS; TERMINATION; NO THIRD PARTY BENEFICIARIES; BINDING ARBITRATION AND CLASS ACTION WAIVER; GENERAL INFORMATION.
## 11. No Third Party Beneficiaries ##
You agree that, except as otherwise expressly provided in these Terms, there shall be no third party beneficiaries to the Terms.
## 12. Notice and Procedure For Making Claims of Copyright Infringement ##
If you believe that your copyright or the copyright of a person on whose behalf you are authorized to act has been infringed, please provide MetaMask’s Copyright Agent a written Notice containing the following information:
· an electronic or physical signature of the person authorized to act on behalf of the owner of the copyright or other intellectual property interest;
· a description of the copyrighted work or other intellectual property that you claim has been infringed;
· a description of where the material that you claim is infringing is located on the Service;
· your address, telephone number, and email address;
· a statement by you that you have a good faith belief that the disputed use is not authorized by the copyright owner, its agent, or the law;
· a statement by you, made under penalty of perjury, that the above information in your Notice is accurate and that you are the copyright or intellectual property owner or authorized to act on the copyright or intellectual property owner's behalf.
MetaMask’s Copyright Agent can be reached at:
Email: copyright [at] metamask [dot] io
Mail:
Attention:
MetaMask Copyright ℅ ConsenSys
49 Bogart Street
Brooklyn, NY 11206
## 13. Binding Arbitration and Class Action Waiver ##
PLEASE READ THIS SECTION CAREFULLY – IT MAY SIGNIFICANTLY AFFECT YOUR LEGAL RIGHTS, INCLUDING YOUR RIGHT TO FILE A LAWSUIT IN COURT
### 13.1 Initial Dispute Resolution ###
The parties shall use their best efforts to engage directly to settle any dispute, claim, question, or disagreement and engage in good faith negotiations which shall be a condition to either party initiating a lawsuit or arbitration.
### 13.2 Binding Arbitration ###
If the parties do not reach an agreed upon solution within a period of 30 days from the time informal dispute resolution under the Initial Dispute Resolution provision begins, then either party may initiate binding arbitration as the sole means to resolve claims, subject to the terms set forth below. Specifically, all claims arising out of or relating to these Terms (including their formation, performance and breach), the parties’ relationship with each other and/or your use of the Service shall be finally settled by binding arbitration administered by the American Arbitration Association in accordance with the provisions of its Commercial Arbitration Rules and the supplementary procedures for consumer related disputes of the American Arbitration Association (the "AAA"), excluding any rules or procedures governing or permitting class actions.
The arbitrator, and not any federal, state or local court or agency, shall have exclusive authority to resolve all disputes arising out of or relating to the interpretation, applicability, enforceability or formation of these Terms, including, but not limited to any claim that all or any part of these Terms are void or voidable, or whether a claim is subject to arbitration. The arbitrator shall be empowered to grant whatever relief would be available in a court under law or in equity. The arbitrator’s award shall be written, and binding on the parties and may be entered as a judgment in any court of competent jurisdiction.
The parties understand that, absent this mandatory provision, they would have the right to sue in court and have a jury trial. They further understand that, in some instances, the costs of arbitration could exceed the costs of litigation and the right to discovery may be more limited in arbitration than in court.
### 13.3 Location ###
Binding arbitration shall take place in New York. You agree to submit to the personal jurisdiction of any federal or state court in New York County, New York, in order to compel arbitration, to stay proceedings pending arbitration, or to confirm, modify, vacate or enter judgment on the award entered by the arbitrator.
### 13.4 Class Action Waiver ###
The parties further agree that any arbitration shall be conducted in their individual capacities only and not as a class action or other representative action, and the parties expressly waive their right to file a class action or seek relief on a class basis. YOU AND METAMASK AGREE THAT EACH MAY BRING CLAIMS AGAINST THE OTHER ONLY IN YOUR OR ITS INDIVIDUAL CAPACITY, AND NOT AS A PLAINTIFF OR CLASS MEMBER IN ANY PURPORTED CLASS OR REPRESENTATIVE PROCEEDING. If any court or arbitrator determines that the class action waiver set forth in this paragraph is void or unenforceable for any reason or that an arbitration can proceed on a class basis, then the arbitration provision set forth above shall be deemed null and void in its entirety and the parties shall be deemed to have not agreed to arbitrate disputes.
### 13.5 Exception - Litigation of Intellectual Property and Small Claims Court Claims ###
Notwithstanding the parties' decision to resolve all disputes through arbitration, either party may bring an action in state or federal court to protect its intellectual property rights ("intellectual property rights" means patents, copyrights, moral rights, trademarks, and trade secrets, but not privacy or publicity rights). Either party may also seek relief in a small claims court for disputes or claims within the scope of that court’s jurisdiction.
### 13.6 30-Day Right to Opt Out ###
You have the right to opt-out and not be bound by the arbitration and class action waiver provisions set forth above by sending written notice of your decision to opt-out to the following address: MetaMask ℅ ConsenSys, 49 Bogart Street, Brooklyn NY 11206 and via email at legal-opt@metamask.io. The notice must be sent within 30 days of September 6, 2016 or your first use of the Service, whichever is later, otherwise you shall be bound to arbitrate disputes in accordance with the terms of those paragraphs. If you opt-out of these arbitration provisions, MetaMask also will not be bound by them.
### 13.7 Changes to This Section ###
MetaMask will provide 60-days’ notice of any changes to this section. Changes will become effective on the 60th day, and will apply prospectively only to any claims arising after the 60th day.
For any dispute not subject to arbitration you and MetaMask agree to submit to the personal and exclusive jurisdiction of and venue in the federal and state courts located in New York, New York. You further agree to accept service of process by mail, and hereby waive any and all jurisdictional and venue defenses otherwise available.
The Terms and the relationship between you and MetaMask shall be governed by the laws of the State of New York without regard to conflict of law provisions.
## 14. General Information ##
### 14.1 Entire Agreement ###
These Terms (and any additional terms, rules and conditions of participation that MetaMask may post on the Service) constitute the entire agreement between you and MetaMask with respect to the Service and supersedes any prior agreements, oral or written, between you and MetaMask. In the event of a conflict between these Terms and the additional terms, rules and conditions of participation, the latter will prevail over the Terms to the extent of the conflict.
### 14.2 Waiver and Severability of Terms ###
The failure of MetaMask to exercise or enforce any right or provision of the Terms shall not constitute a waiver of such right or provision. If any provision of the Terms is found by an arbitrator or court of competent jurisdiction to be invalid, the parties nevertheless agree that the arbitrator or court should endeavor to give effect to the parties' intentions as reflected in the provision, and the other provisions of the Terms remain in full force and effect.
### 14.3 Statute of Limitations ###
You agree that regardless of any statute or law to the contrary, any claim or cause of action arising out of or related to the use of the Service or the Terms must be filed within one (1) year after such claim or cause of action arose or be forever barred.
### 14.4 Section Titles ###
The section titles in the Terms are for convenience only and have no legal or contractual effect.
### 14.5 Communications ###
Users with questions, complaints or claims with respect to the Service may contact us using the relevant contact information set forth above and at communications@metamask.io.
## 15 Related Links ##
**[Terms of Use](https://metamask.io/terms.html)**
**[Privacy](https://metamask.io/privacy.html)**
**[Attributions](https://metamask.io/attributions.html)**

@ -4,8 +4,8 @@ var prompt = require('prompt')
var open = require('open')
var extend = require('extend')
var notices = require('./notices.json')
var id = Number(require('./notice-nonce.json'))
var id = 0
var date = new Date().toDateString()
var notice = {
@ -13,24 +13,21 @@ var notice = {
date: date,
}
fsp.readdir('notices/archive')
.then((files) => {
files.forEach(file => { id ++ })
Promise.resolve()
}).then(() => {
fsp.writeFile(`notices/archive/notice_${id}.md`,'Message goes here. Please write out your notice and save before proceeding at the command line.')
.then(() => {
open(`notices/archive/notice_${id}.md`)
prompt.start()
prompt.get(['title'], (err, result) => {
notice.title = result.title
fsp.readFile(`notices/archive/notice_${id}.md`)
.then((body) => {
notice.body = body.toString()
notice.id = id
notices.push(notice)
return fsp.writeFile(`notices/notices.json`, JSON.stringify(notices))
})
fsp.writeFile(`notices/archive/notice_${id}.md`,'Message goes here. Please write out your notice and save before proceeding at the command line.')
.then(() => {
open(`notices/archive/notice_${id}.md`)
prompt.start()
prompt.get(['title'], (err, result) => {
notice.title = result.title
fsp.readFile(`notices/archive/notice_${id}.md`)
.then((body) => {
notice.body = body.toString()
notice.id = id
notices.push(notice)
return fsp.writeFile(`notices/notices.json`, JSON.stringify(notices))
}).then((completion) => {
id += 1
return fsp.writeFile(`notices/notice-nonce.json`, id)
})
})
})
})

File diff suppressed because one or more lines are too long

@ -117,6 +117,7 @@
"brfs": "^1.4.3",
"browserify": "^13.0.0",
"chai": "^3.5.0",
"clone": "^1.0.2",
"deep-freeze-strict": "^1.1.1",
"del": "^2.2.0",
"fs-promise": "^1.0.0",

@ -2,7 +2,7 @@ const PASSWORD = 'password123'
QUnit.module('first time usage')
QUnit.test('agree to terms', function (assert) {
QUnit.test('render init screen', function (assert) {
var done = assert.async()
let app
@ -10,22 +10,6 @@ QUnit.test('agree to terms', function (assert) {
app = $('iframe').contents().find('#app-content .mock-app-root')
// Scroll through terms
var termsHeader = app.find('h3.terms-header')[0]
assert.equal(termsHeader.textContent, 'MetaMask Terms & Conditions', 'Showing TOS')
let termsPage = app.find('.markdown')[0]
assert.ok(termsPage, 'on terms page')
termsPage.scrollTop = termsPage.scrollHeight
return wait()
}).then(function() {
// Agree to terms
var button = app.find('button')[0]
button.click()
return wait()
}).then(function() {
var title = app.find('h1').text()
assert.equal(title, 'MetaMask', 'title screen')
@ -34,7 +18,7 @@ QUnit.test('agree to terms', function (assert) {
var confBox = app.find('#password-box-confirm')[0]
pwBox.value = PASSWORD
confBox.value = PASSWORD
return wait()
}).then(function() {
@ -86,6 +70,34 @@ QUnit.test('agree to terms', function (assert) {
var detail = app.find('.account-detail-section')[0]
assert.ok(detail, 'Account detail section loaded again.')
return wait()
}).then(function (){
var qrButton = app.find('.fa.fa-qrcode')[0]
qrButton.click()
return wait(1000)
}).then(function (){
var qrHeader = app.find('.qr-header')[0]
var qrContainer = app.find('#qr-container')[0]
assert.equal(qrHeader.textContent, 'Account 1', 'Should show account label.')
assert.ok(qrContainer, 'QR Container found')
return wait()
}).then(function (){
var networkMenu = app.find('.network-indicator')[0]
networkMenu.click()
return wait()
}).then(function (){
var networkMenu = app.find('.network-indicator')[0]
var children = networkMenu.children
children.length[3]
assert.ok(children, 'All network options present')
done()
})
})

@ -1 +1 @@
{"meta":{"version":4},"data":{"fiatCurrency":"USD","conversionRate":8.34908448,"conversionDate":1481227505,"isConfirmed":true,"wallet":"{\"encSeed\":{\"encStr\":\"Te2KyAGY3S01bgUJ+7d4y3BOvr/8TKrXrkRZ29cGI6dgyedtN+YgTQxElC2td/pzuoXm7KeSfr+yAoFCvMgqFAJwRcX3arHOsMFQie8kp8mL5I65zwdg/HB2QecB4OJHytrxgApv2zZiKEo0kbu2cs8zYIn5wNlCBIHwgylYmHpUDIJcO1B4zg==\",\"nonce\":\"xnxqk4iy70bjt721F+KPLV4PNfBFNyct\"},\"ksData\":{\"m/44'/60'/0'/0\":{\"info\":{\"curve\":\"secp256k1\",\"purpose\":\"sign\"},\"encHdPathPriv\":{\"encStr\":\"vNrSjekRKLmaGFf77Uca9+aAebmDlvrBwtAV8YthpQ4OX/mXtLSycmnLsYdk4schaByfJvrm6/Mf9fxzOSaScJk+XvKw5XqNXedkDHtbWrmNnxFpuT+9tuB8Nupr3D9GZK9PgXhJD99/7Bn6Wk7/ne+PIDmbtdmx/SWmrdo3pg==\",\"nonce\":\"zqWq/gtJ5zfUVRWQQJkP/zoYjer6Rozj\"},\"hdIndex\":1,\"encPrivKeys\":{\"e15d894becb0354c501ae69429b05143679f39e0\":{\"key\":\"jBLQ9v1l5LOEY1C3kI8z7LpbJKHP1vpVfPAlz90MNSfa8Oe+XlxKQAGYs8Zb4fWm\",\"nonce\":\"fJyrSRo1t0RMNqp2MsneoJnYJWHQnSVY\"}},\"addresses\":[\"e15d894becb0354c501ae69429b05143679f39e0\"]}},\"encHdRootPriv\":{\"encStr\":\"mbvwiFBQGbjj4BJLmdeYzfYi8jb7gtFtwiCQOPfvmyz4h2/KMbHNGzumM16qRKpifioQXkhnBulMIQHaYg0Jwv1MoFsqHxHmuIAT+QP5XvJjz0MRl6708pHowmIVG+R8CZNTLqzE7XS8YkZ4ElRpTvLEM8Wngi5Sg287mQMP9w==\",\"nonce\":\"i5Tp2lQe92rXQzNhjZcu9fNNhfux6Wf4\"},\"salt\":\"FQpA8D9R/5qSp9WtQ94FILyfWZHMI6YZw6RmBYqK0N0=\",\"version\":2}","config":{"provider":{"type":"testnet"},"selectedAccount":"0xe15d894becb0354c501ae69429b05143679f39e0"},"isEthConfirmed":true,"transactions":[],"TOSHash":"a4f4e23f823a7ac51783e7ffba7914a911b09acdb97263296b7e14b527f80c5b","gasMultiplier":1}}
{"meta":{"version":4},"data":{"fiatCurrency":"USD","conversionRate":8.34908448,"conversionDate":1481227505,"wallet":"{\"encSeed\":{\"encStr\":\"Te2KyAGY3S01bgUJ+7d4y3BOvr/8TKrXrkRZ29cGI6dgyedtN+YgTQxElC2td/pzuoXm7KeSfr+yAoFCvMgqFAJwRcX3arHOsMFQie8kp8mL5I65zwdg/HB2QecB4OJHytrxgApv2zZiKEo0kbu2cs8zYIn5wNlCBIHwgylYmHpUDIJcO1B4zg==\",\"nonce\":\"xnxqk4iy70bjt721F+KPLV4PNfBFNyct\"},\"ksData\":{\"m/44'/60'/0'/0\":{\"info\":{\"curve\":\"secp256k1\",\"purpose\":\"sign\"},\"encHdPathPriv\":{\"encStr\":\"vNrSjekRKLmaGFf77Uca9+aAebmDlvrBwtAV8YthpQ4OX/mXtLSycmnLsYdk4schaByfJvrm6/Mf9fxzOSaScJk+XvKw5XqNXedkDHtbWrmNnxFpuT+9tuB8Nupr3D9GZK9PgXhJD99/7Bn6Wk7/ne+PIDmbtdmx/SWmrdo3pg==\",\"nonce\":\"zqWq/gtJ5zfUVRWQQJkP/zoYjer6Rozj\"},\"hdIndex\":1,\"encPrivKeys\":{\"e15d894becb0354c501ae69429b05143679f39e0\":{\"key\":\"jBLQ9v1l5LOEY1C3kI8z7LpbJKHP1vpVfPAlz90MNSfa8Oe+XlxKQAGYs8Zb4fWm\",\"nonce\":\"fJyrSRo1t0RMNqp2MsneoJnYJWHQnSVY\"}},\"addresses\":[\"e15d894becb0354c501ae69429b05143679f39e0\"]}},\"encHdRootPriv\":{\"encStr\":\"mbvwiFBQGbjj4BJLmdeYzfYi8jb7gtFtwiCQOPfvmyz4h2/KMbHNGzumM16qRKpifioQXkhnBulMIQHaYg0Jwv1MoFsqHxHmuIAT+QP5XvJjz0MRl6708pHowmIVG+R8CZNTLqzE7XS8YkZ4ElRpTvLEM8Wngi5Sg287mQMP9w==\",\"nonce\":\"i5Tp2lQe92rXQzNhjZcu9fNNhfux6Wf4\"},\"salt\":\"FQpA8D9R/5qSp9WtQ94FILyfWZHMI6YZw6RmBYqK0N0=\",\"version\":2}","config":{"provider":{"type":"testnet"},"selectedAccount":"0xe15d894becb0354c501ae69429b05143679f39e0"},"isEthConfirmed":true,"transactions":[],"gasMultiplier":1}}

@ -1 +1 @@
{"meta":{"version":4},"data":{"fiatCurrency":"USD","isConfirmed":true,"TOSHash":"a4f4e23f823a7ac51783e7ffba7914a911b09acdb97263296b7e14b527f80c5b","noticesList":[{"read":true,"date":"Fri Dec 16 2016","title":"Ending Morden Support","body":"Due to [recent events](https://blog.ethereum.org/2016/11/20/from-morden-to-ropsten/), MetaMask is now deprecating support for the Morden Test Network.\n\nUsers will still be able to access Morden through a locally hosted node, but we will no longer be providing hosted access to this network through [Infura](http://infura.io/).\n\nPlease use the new Ropsten Network as your new default test network.\n\nYou can fund your Ropsten account using the buy button on your account page.\n\nBest wishes!\nThe MetaMask Team\n\n","id":0}],"conversionRate":7.07341909,"conversionDate":1482539284,"wallet":"{\"encSeed\":{\"encStr\":\"LZsdN8lJzYkUe1UpmAalnERdgkBFt25gWDdK8kfQUwMAk/27XR+dc+8n5swgoF5qgwhc9LBgliEGNDs1Q/lnuld3aQLabkOeAW4BHS1vS7FxqKrzDS3iyzSuQO6wDQmGno/buuknVgDsKiyjW22hpt7vtVVWA+ZL1P3x6M0+AxGJjeGVrG+E8Q==\",\"nonce\":\"T6O9BmwmTj214XUK3KF0s3iCKo3OlrUD\"},\"ksData\":{\"m/44'/60'/0'/0\":{\"info\":{\"curve\":\"secp256k1\",\"purpose\":\"sign\"},\"encHdPathPriv\":{\"encStr\":\"GNNfZevCMlgMVh9y21y1UwrC9qcmH6XYq7v+9UoqbHnzPQJFlxidN5+x/Sldo72a6+5zJpQkkdZ+Q0lePrzvXfuSd3D/RO7WKFIKo9nAQI5+JWwz4INuCmVcmqCv2J4BTLGjrG8fp5pDJ62Bn0XHqkJo3gx3fpvs3cS66+ZKwg==\",\"nonce\":\"HRTlGj44khQs2veYHEF/GqTI1t0yYvyd\"},\"hdIndex\":3,\"encPrivKeys\":{\"e15d894becb0354c501ae69429b05143679f39e0\":{\"key\":\"ZAeZL9VcRUtiiO4VXOQKBFg787PR5R3iymjUeU5vpDRIqOXbjWN6N4ZNR8YpSXl+\",\"nonce\":\"xLsADagS8uqDYae6cImyhxF7o1kBDbPe\"},\"87658c15aefe7448008a28513a11b6b130ef4cd0\":{\"key\":\"ku0mm5s1agRJNAMYIJO0qeoDe+FqcbqdQI6azXF3GL1OLo6uMlt6I4qS+eeravFi\",\"nonce\":\"xdGfSUPKtkW8ge0SWIbbpahs/NyEMzn5\"},\"aa25854c0379e53c957ac9382e720c577fa31fd5\":{\"key\":\"NjpYC9FbiC95CTx/1kwgOHk5LSN9vl4RULEBbvwfVOjqSH8WixNoP3R6I/QyNIs2\",\"nonce\":\"M/HWpXXA9QvuZxEykkGQPJKKdz33ovQr\"}},\"addresses\":[\"e15d894becb0354c501ae69429b05143679f39e0\",\"87658c15aefe7448008a28513a11b6b130ef4cd0\",\"aa25854c0379e53c957ac9382e720c577fa31fd5\"]}},\"encHdRootPriv\":{\"encStr\":\"f+3prUOzl+95aNAV+ad6lZdsYZz120ZsL67ucjj3tiMXf/CC4X8XB9N2QguhoMy6fW+fATUsTdJe8+CbAAyb79V9HY0Pitzq9Yw/g1g0/Ii2JzsdGBriuMsPdwZSVqz+rvQFw/6Qms1xjW6cqa8S7kM2WA5l8RB1Ck6r5zaqbA==\",\"nonce\":\"oGahxNFekVxH9sg6PUCCHIByvo4WFSqm\"},\"salt\":\"N7xYoEA53yhSweOsEphku1UKkIEuZtX2MwLBhVM6RR8=\",\"version\":2}","config":{"provider":{"type":"testnet"},"selectedAccount":"0xe15d894becb0354c501ae69429b05143679f39e0"},"isDisclaimerConfirmed":true,"walletNicknames":{"0xac39b311dceb2a4b2f5d8461c1cdaf756f4f7ae9":"Account 1","0xd7c0cd9e7d2701c710d64fc492c7086679bdf7b4":"Account 2","0x1acfb961c5a8268eac8e09d6241a26cbeff42241":"Account 3"},"lostAccounts":["0xe15d894becb0354c501ae69429b05143679f39e0","0x87658c15aefe7448008a28513a11b6b130ef4cd0","0xaa25854c0379e53c957ac9382e720c577fa31fd5"]}}
{"meta":{"version":4},"data":{"fiatCurrency":"USD","noticesList":[{"read":true,"date":"Fri Dec 16 2016","title":"Ending Morden Support","body":"Due to [recent events](https://blog.ethereum.org/2016/11/20/from-morden-to-ropsten/), MetaMask is now deprecating support for the Morden Test Network.\n\nUsers will still be able to access Morden through a locally hosted node, but we will no longer be providing hosted access to this network through [Infura](http://infura.io/).\n\nPlease use the new Ropsten Network as your new default test network.\n\nYou can fund your Ropsten account using the buy button on your account page.\n\nBest wishes!\nThe MetaMask Team\n\n","id":0}],"conversionRate":7.07341909,"conversionDate":1482539284,"wallet":"{\"encSeed\":{\"encStr\":\"LZsdN8lJzYkUe1UpmAalnERdgkBFt25gWDdK8kfQUwMAk/27XR+dc+8n5swgoF5qgwhc9LBgliEGNDs1Q/lnuld3aQLabkOeAW4BHS1vS7FxqKrzDS3iyzSuQO6wDQmGno/buuknVgDsKiyjW22hpt7vtVVWA+ZL1P3x6M0+AxGJjeGVrG+E8Q==\",\"nonce\":\"T6O9BmwmTj214XUK3KF0s3iCKo3OlrUD\"},\"ksData\":{\"m/44'/60'/0'/0\":{\"info\":{\"curve\":\"secp256k1\",\"purpose\":\"sign\"},\"encHdPathPriv\":{\"encStr\":\"GNNfZevCMlgMVh9y21y1UwrC9qcmH6XYq7v+9UoqbHnzPQJFlxidN5+x/Sldo72a6+5zJpQkkdZ+Q0lePrzvXfuSd3D/RO7WKFIKo9nAQI5+JWwz4INuCmVcmqCv2J4BTLGjrG8fp5pDJ62Bn0XHqkJo3gx3fpvs3cS66+ZKwg==\",\"nonce\":\"HRTlGj44khQs2veYHEF/GqTI1t0yYvyd\"},\"hdIndex\":3,\"encPrivKeys\":{\"e15d894becb0354c501ae69429b05143679f39e0\":{\"key\":\"ZAeZL9VcRUtiiO4VXOQKBFg787PR5R3iymjUeU5vpDRIqOXbjWN6N4ZNR8YpSXl+\",\"nonce\":\"xLsADagS8uqDYae6cImyhxF7o1kBDbPe\"},\"87658c15aefe7448008a28513a11b6b130ef4cd0\":{\"key\":\"ku0mm5s1agRJNAMYIJO0qeoDe+FqcbqdQI6azXF3GL1OLo6uMlt6I4qS+eeravFi\",\"nonce\":\"xdGfSUPKtkW8ge0SWIbbpahs/NyEMzn5\"},\"aa25854c0379e53c957ac9382e720c577fa31fd5\":{\"key\":\"NjpYC9FbiC95CTx/1kwgOHk5LSN9vl4RULEBbvwfVOjqSH8WixNoP3R6I/QyNIs2\",\"nonce\":\"M/HWpXXA9QvuZxEykkGQPJKKdz33ovQr\"}},\"addresses\":[\"e15d894becb0354c501ae69429b05143679f39e0\",\"87658c15aefe7448008a28513a11b6b130ef4cd0\",\"aa25854c0379e53c957ac9382e720c577fa31fd5\"]}},\"encHdRootPriv\":{\"encStr\":\"f+3prUOzl+95aNAV+ad6lZdsYZz120ZsL67ucjj3tiMXf/CC4X8XB9N2QguhoMy6fW+fATUsTdJe8+CbAAyb79V9HY0Pitzq9Yw/g1g0/Ii2JzsdGBriuMsPdwZSVqz+rvQFw/6Qms1xjW6cqa8S7kM2WA5l8RB1Ck6r5zaqbA==\",\"nonce\":\"oGahxNFekVxH9sg6PUCCHIByvo4WFSqm\"},\"salt\":\"N7xYoEA53yhSweOsEphku1UKkIEuZtX2MwLBhVM6RR8=\",\"version\":2}","config":{"provider":{"type":"testnet"},"selectedAccount":"0xe15d894becb0354c501ae69429b05143679f39e0"},"walletNicknames":{"0xac39b311dceb2a4b2f5d8461c1cdaf756f4f7ae9":"Account 1","0xd7c0cd9e7d2701c710d64fc492c7086679bdf7b4":"Account 2","0x1acfb961c5a8268eac8e09d6241a26cbeff42241":"Account 3"},"lostAccounts":["0xe15d894becb0354c501ae69429b05143679f39e0","0x87658c15aefe7448008a28513a11b6b130ef4cd0","0xaa25854c0379e53c957ac9382e720c577fa31fd5"]}}

@ -4,8 +4,6 @@
},
"data": {
"fiatCurrency": "USD",
"isConfirmed": true,
"TOSHash": "a4f4e23f823a7ac51783e7ffba7914a911b09acdb97263296b7e14b527f80c5b",
"conversionRate": 9.47316629,
"conversionDate": 1479510994,
"wallet": "{\"encSeed\":{\"encStr\":\"a5tjKtDGlHkua+6Ta5s3wMFWPmsBqaPdMKGmqeI2z1kMbNs3V03HBaCptU7NtMra1DjHKbSNsUToxFUrmrvWBmUejamN16+l1CviwqASsv7kKzpot00/dfyyJgtZwwFP5Je+TAB1V231nRbPidOfeE1cDec5V8KTF8epl6qzsbA25pjeW76Dfw==\",\"nonce\":\"RzID6bAhWfGTSR74xdIh3RaT1+1sLk6F\"},\"ksData\":{\"m/44'/60'/0'/0\":{\"info\":{\"curve\":\"secp256k1\",\"purpose\":\"sign\"},\"encHdPathPriv\":{\"encStr\":\"6nlYAopRbmGcqerRZO08XwgeYaCJg9XRhh4oiYiVVdQtyNPdxvOI9TcE/mqvBiatMwBwA+TmsqTV6eZZe/VDZKYIGajKulQbScd0xQ71JhYfqqmzSG6EH2Pnzwa+aSAsfARgN1JJSaff2+p6wV6Zg5BUDtl72OGEIEfXhcUGwg==\",\"nonce\":\"Ee1KiDqtx7NvYToQUFvjEhKNinNQcXlK\"},\"hdIndex\":1,\"encPrivKeys\":{\"4dd5d356c5a016a220bcd69e82e5af680a430d00\":{\"key\":\"htGRGAH10lGF4M+fvioznmYVIUSWAzwp/yWSIo85psgZZwmCdJY72oyGanYsrFO8\",\"nonce\":\"PkP8XeZ+ok215rzEorvJu9nYTWzkOVr0\"}},\"addresses\":[\"4dd5d356c5a016a220bcd69e82e5af680a430d00\"]}},\"encHdRootPriv\":{\"encStr\":\"TAZAo71a+4IlAaoA66f0w4ts2f+V7ArTSUHRIrMltfAPXz7GfJBmKXNtHPORUYAjRiKqWK6FZnhKLf7Vcng2LG7VnDQwC4xPxzSRZzSEilnoY3V+zRY0HD7Wb/pndb4FliA/buZQmjohO4vezeX0hl70rJlPJEZTyYoWgxbxFA==\",\"nonce\":\"FlJOaLyBEHMaH5fEnYjdHc6nn18+WkRj\"},\"salt\":\"CmuCcWpbqpKUUv+1aE2ZwvQl7EIQ731uFibSq++vwtY=\",\"version\":2}",

@ -0,0 +1,138 @@
{
"meta":{
"version":4
},
"data":{
"seedWords":null,
"fiatCurrency":"USD",
"isDisclaimerConfirmed":true,
"TOSHash":"a4f4e23f823a7ac51783e7ffba7914a911b09acdb97263296b7e14b527f80c5b",
"shapeShiftTxList":[
{
"depositAddress": "1L8BJCR6KHkCiVceDqibt7zJscqPpH7pFw",
"depositType": "BTC",
"key": "shapeshift",
"time": 1471564825772,
"response": {
"status": "complete",
"outgoingCoin": "100.00",
"incomingCoin": "1.000",
"transaction": "0x3701e0ac344a12a1fc5417cf251109a7c41f3edab922310202630d9c012414c8"
}
},
{
"depositAddress": "1L8BJCR6KHkCiVceDqibt7zJscqPpH7pFw",
"depositType": "BTC",
"key": "shapeshift",
"time": 1471566579224,
"response": {
"status": "no_deposits",
"depositAddress": "1L8BJCR6KHkCiVceDqibt7zJscqPpH7pFw"
}
},
{
"depositAddress": "1L8BJCR6KHkCiVceDqibt7zJscqPpH7pFw",
"depositType": "BTC",
"key": "shapeshift",
"time": 1471566565378,
"response": {
"status": "received",
"depositAddress": "1L8BJCR6KHkCiVceDqibt7zJscqPpH7pFw"
}
}
],
"noticesList":[
{
"read":true,
"date":"Fri Dec 16 2016",
"title":"Ending Morden Support",
"body":"Due to [recent events](https://blog.ethereum.org/2016/11/20/from-morden-to-ropsten/), MetaMask is now deprecating support for the Morden Test Network.\n\nUsers will still be able to access Morden through a locally hosted node, but we will no longer be providing hosted access to this network through [Infura](http://infura.io/).\n\nPlease use the new Ropsten Network as your new default test network.\n\nYou can fund your Ropsten account using the buy button on your account page.\n\nBest wishes!\nThe MetaMask Team\n\n",
"id":0
}
],
"conversionRate":12.66441492,
"conversionDate":1487184182,
"vault":"{\"data\":\"Z5UFCeI/Tg9F9No0dC7eIhe4evCG91m6qeXhGpSeX48HHCQ/BepyNONKrh05YjB9hXCAd3Jy93judD+pcXNy7WS9zLujjmMI6sI90ToSrzThnMrOE6ixcH7HGS+TCcqvwBhZEsAQqUcQeHhT9CcdCQAxkKwBk8CK8W290MVeZoQVGK88hB2R8kL3mo/uayS5AnHPwWOS0rocgSfd/ioiucClpw==\",\"iv\":\"AYufeEPwp9f2Rdrfq7yS8g==\",\"salt\":\"g7BQIEx8tosH3IxWhPnrgZFu1XRkQn1Pp7l1ehTQQCo=\"}",
"config":{
"provider":{
"type":"testnet"
},
"selectedAccount":"0x0beb674745816b125fbc07285d39fd373e64895c"
},
"walletNicknames":{
"0x0beb674745816b125fbc07285d39fd373e64895c":"Account 1",
"0x433eb37d2e4895815b90f555425dfa123ddaed40":"Account 2"
},
"transactions":[
{
"id":3922064325443430,
"time":1487184358262,
"status":"confirmed",
"gasMultiplier":1,
"metamaskNetworkId":"3",
"txParams":{
"from":"0x0beb674745816b125fbc07285d39fd373e64895c",
"to":"0x18a3462427bcc9133bb46e88bcbe39cd7ef0e761",
"value":"0xde0b6b3a7640000",
"metamaskId":3922064325443430,
"metamaskNetworkId":"3",
"gas":"0x5209",
"gasPrice":"0x04a817c800",
"nonce":"0x0",
"gasLimit":"0x5209"
},
"gasLimitSpecified":false,
"estimatedGas":"0x5209",
"txFee":"17e0186e60800",
"txValue":"de0b6b3a7640000",
"maxCost":"de234b52e4a0800",
"hash":"0x0b36c5bb31528044e6a71e45a64e9872f5f365a14ac42ee1bea49e7766216c12"
},
{
"id":3922064325443431,
"time":1487184373172,
"status":"confirmed",
"gasMultiplier":1,
"metamaskNetworkId":"3",
"txParams":{
"from":"0x0beb674745816b125fbc07285d39fd373e64895c",
"to":"0x433eb37d2e4895815b90f555425dfa123ddaed40",
"value":"0xde0b6b3a7640000",
"metamaskId":3922064325443431,
"metamaskNetworkId":"3",
"gas":"0x5209",
"nonce":"0x01",
"gasPrice":"0x04a817c800",
"gasLimit":"0x5209"
},
"gasLimitSpecified":false,
"estimatedGas":"0x5209",
"txFee":"17e0186e60800",
"txValue":"de0b6b3a7640000",
"maxCost":"de234b52e4a0800",
"hash":"0x305548a8b8bb72de0ca8cf77df45e4fe2b29383e58c4da6b7eac7e9bd59e85e9"
},
{
"id":3922064325443432,
"time":1487184391226,
"status":"unapproved",
"gasMultiplier":1,
"metamaskNetworkId":"3",
"txParams":{
"from":"0x0beb674745816b125fbc07285d39fd373e64895c",
"to":"0x18a3462427bcc9133bb46e88bcbe39cd7ef0e761",
"value":"0xde0b6b3a7640000",
"metamaskId":3922064325443432,
"metamaskNetworkId":"3",
"gas":"0x5209"
},
"gasLimitSpecified":false,
"estimatedGas":"0x5209",
"txFee":"17e0186e60800",
"txValue":"de0b6b3a7640000",
"maxCost":"de234b52e4a0800"
}
],
"gasMultiplier":1
}
}

@ -14,37 +14,6 @@ describe('config-manager', function() {
configManager = configManagerGen()
})
describe('confirmation', function() {
describe('#getConfirmedDisclaimer', function() {
it('should return undefined if no previous key exists', function() {
var result = configManager.getConfirmedDisclaimer()
assert.ok(!result)
})
})
describe('#setConfirmedDisclaimer', function() {
it('should make getConfirmedDisclaimer return true once set', function() {
assert.equal(configManager.getConfirmedDisclaimer(), undefined)
configManager.setConfirmedDisclaimer(true)
var result = configManager.getConfirmedDisclaimer()
assert.equal(result, true)
})
it('should be able to set undefined', function() {
configManager.setConfirmedDisclaimer(undefined)
var result = configManager.getConfirmedDisclaimer()
assert.equal(result, undefined)
})
it('should persist to local storage', function() {
configManager.setConfirmedDisclaimer(true)
var data = configManager.getData()
assert.equal(data.isDisclaimerConfirmed, true)
})
})
})
describe('#setConfig', function() {
it('should set the config key', function () {
@ -68,7 +37,6 @@ describe('config-manager', function() {
rpcTarget: 'foobar'
},
}
configManager.setConfirmedDisclaimer(true)
configManager.setConfig(testConfig)
var testWallet = {
@ -79,7 +47,6 @@ describe('config-manager', function() {
var result = configManager.getData()
assert.equal(result.wallet.name, testWallet.name, 'wallet name is set')
assert.equal(result.config.provider.rpcTarget, testConfig.provider.rpcTarget)
assert.equal(configManager.getConfirmedDisclaimer(), true)
testConfig.provider.type = 'something else!'
configManager.setConfig(testConfig)
@ -88,7 +55,6 @@ describe('config-manager', function() {
assert.equal(result.wallet.name, testWallet.name, 'wallet name is set')
assert.equal(result.config.provider.rpcTarget, testConfig.provider.rpcTarget)
assert.equal(result.config.provider.type, testConfig.provider.type)
assert.equal(configManager.getConfirmedDisclaimer(), true)
})
})

@ -2,33 +2,96 @@ const assert = require('assert')
const path = require('path')
const wallet1 = require(path.join('..', 'lib', 'migrations', '001.json'))
const vault4 = require(path.join('..', 'lib', 'migrations', '004.json'))
let vault5, vault6, vault7, vault8, vault9, vault10, vault11
const migration2 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '002'))
const migration3 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '003'))
const migration4 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '004'))
const migration5 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '005'))
const migration6 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '006'))
const migration7 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '007'))
const migration8 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '008'))
const migration9 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '009'))
const migration10 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '010'))
const migration11 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '011'))
const oldTestRpc = 'https://rawtestrpc.metamask.io/'
const newTestRpc = 'https://testrpc.metamask.io/'
describe('wallet1 is migrated successfully', function() {
it('should convert providers', function() {
describe('wallet1 is migrated successfully', () => {
it('should convert providers', () => {
wallet1.data.config.provider = { type: 'etherscan', rpcTarget: null }
return migration2.migrate(wallet1)
.then((firstResult) => {
assert.equal(firstResult.data.config.provider.type, 'rpc', 'provider should be rpc')
assert.equal(firstResult.data.config.provider.rpcTarget, 'https://rpc.metamask.io/', 'main provider should be our rpc')
firstResult.data.config.provider.rpcTarget = oldTestRpc
return migration3.migrate(firstResult)
}).then((secondResult) => {
assert.equal(secondResult.data.config.provider.rpcTarget, newTestRpc)
return migration4.migrate(secondResult)
.then((secondResult) => {
const secondData = secondResult.data
assert.equal(secondData.config.provider.type, 'rpc', 'provider should be rpc')
assert.equal(secondData.config.provider.rpcTarget, 'https://rpc.metamask.io/', 'main provider should be our rpc')
secondResult.data.config.provider.rpcTarget = oldTestRpc
return migration3.migrate(secondResult)
}).then((thirdResult) => {
assert.equal(thirdResult.data.config.provider.rpcTarget, null)
assert.equal(thirdResult.data.config.provider.type, 'testnet')
assert.equal(thirdResult.data.config.provider.rpcTarget, newTestRpc, 'config.provider.rpcTarget should be set to the proper testrpc url.')
return migration4.migrate(thirdResult)
}).then((fourthResult) => {
const fourthData = fourthResult.data
assert.equal(fourthData.config.provider.rpcTarget, null, 'old rpcTarget should not exist.')
assert.equal(fourthData.config.provider.type, 'testnet', 'config.provider should be set to testnet.')
return migration5.migrate(vault4)
}).then((fifthResult) => {
const fifthData = fifthResult.data
assert.equal(fifthData.vault, null, 'old vault should not exist')
assert.equal(fifthData.walletNicknames, null, 'old walletNicknames should not exist')
assert.equal(fifthData.config.selectedAccount, null, 'old config.selectedAccount should not exist')
assert.equal(fifthData.KeyringController.vault, vault4.data.vault, 'KeyringController.vault should exist')
assert.equal(fifthData.KeyringController.selectedAccount, vault4.data.config.selectedAccount, 'KeyringController.selectedAccount should have moved')
assert.equal(fifthData.KeyringController.walletNicknames['0x0beb674745816b125fbc07285d39fd373e64895c'], vault4.data.walletNicknames['0x0beb674745816b125fbc07285d39fd373e64895c'], 'KeyringController.walletNicknames should have moved')
vault5 = fifthResult
return migration6.migrate(fifthResult)
}).then((sixthResult) => {
assert.equal(sixthResult.data.KeyringController.selectedAccount, null, 'old selectedAccount should not exist')
assert.equal(sixthResult.data.PreferencesController.selectedAddress, vault5.data.KeyringController.selectedAccount, 'selectedAccount should have moved')
vault6 = sixthResult
return migration7.migrate(sixthResult)
}).then((seventhResult) => {
assert.equal(seventhResult.data.transactions, null, 'old transactions should not exist')
assert.equal(seventhResult.data.gasMultiplier, null, 'old gasMultiplier should not exist')
assert.equal(seventhResult.data.TransactionManager.transactions[0].id, vault6.data.transactions[0].id, 'transactions should have moved')
assert.equal(seventhResult.data.TransactionManager.gasMultiplier, vault6.data.gasMultiplier, 'gasMultiplier should have moved')
vault7 = seventhResult
return migration8.migrate(seventhResult)
}).then((eighthResult) => {
assert.equal(eighthResult.data.noticesList, null, 'old noticesList should not exist')
assert.equal(eighthResult.data.NoticeController.noticesList[0].title, vault7.data.noticesList[0].title, 'noticesList should have moved')
vault8 = eighthResult
return migration9.migrate(eighthResult)
}).then((ninthResult) => {
assert.equal(ninthResult.data.currentFiat, null, 'old currentFiat should not exist')
assert.equal(ninthResult.data.fiatCurrency, null, 'old fiatCurrency should not exist')
assert.equal(ninthResult.data.conversionRate, null, 'old conversionRate should not exist')
assert.equal(ninthResult.data.conversionDate, null, 'old conversionDate should not exist')
assert.equal(ninthResult.data.CurrencyController.currentCurrency, vault8.data.fiatCurrency, 'currentFiat should have moved')
assert.equal(ninthResult.data.CurrencyController.conversionRate, vault8.data.conversionRate, 'conversionRate should have moved')
assert.equal(ninthResult.data.CurrencyController.conversionDate, vault8.data.conversionDate, 'conversionDate should have moved')
vault9 = ninthResult
return migration10.migrate(ninthResult)
}).then((tenthResult) => {
assert.equal(tenthResult.data.shapeShiftTxList, null, 'old shapeShiftTxList should not exist')
assert.equal(tenthResult.data.ShapeShiftController.shapeShiftTxList[0].transaction, vault9.data.shapeShiftTxList[0].transaction)
return migration11.migrate(tenthResult)
}).then((eleventhResult) => {
assert.equal(eleventhResult.data.isDisclaimerConfirmed, null, 'isDisclaimerConfirmed should not exist')
assert.equal(eleventhResult.data.TOSHash, null, 'TOSHash should not exist')
})
})
})

@ -22,8 +22,6 @@ var actions = {
clearNotices: clearNotices,
markAccountsFound,
// 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',
@ -450,23 +448,6 @@ function showImportPage () {
}
}
function agreeToDisclaimer () {
return (dispatch) => {
dispatch(this.showLoadingIndication())
if (global.METAMASK_DEBUG) console.log(`background.agreeToDisclaimer`)
background.agreeToDisclaimer((err) => {
if (err) {
return dispatch(actions.displayWarning(err.message))
}
dispatch(this.hideLoadingIndication())
dispatch({
type: this.AGREE_TO_DISCLAIMER,
})
})
}
}
function createNewVaultInProgress () {
return {
type: actions.CREATE_NEW_VAULT_IN_PROGRESS,

@ -5,7 +5,6 @@ const h = require('react-hyperscript')
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 NewKeyChainScreen = require('./new-keychain')
// unlock
@ -44,7 +43,6 @@ function mapStateToProps (state) {
// state from plugin
isLoading: state.appState.isLoading,
loadingMessage: state.appState.loadingMessage,
isDisclaimerConfirmed: state.metamask.isDisclaimerConfirmed,
noActiveNotices: state.metamask.noActiveNotices,
isInitialized: state.metamask.isInitialized,
isUnlocked: state.metamask.isUnlocked,
@ -351,8 +349,19 @@ App.prototype.renderBackButton = function (style, justArrow = false) {
App.prototype.renderPrimary = function () {
var props = this.props
if (!props.isDisclaimerConfirmed) {
return h(DisclaimerScreen, {key: 'disclaimerScreen'})
// notices
if (!props.noActiveNotices && !global.METAMASK_DEBUG) {
return h(NoticeScreen, {
notice: props.lastUnreadNotice,
key: 'NoticeScreen',
onConfirm: () => props.dispatch(actions.markNoticeRead(props.lastUnreadNotice)),
})
} else if (props.lostAccounts && props.lostAccounts.length > 0) {
return h(NoticeScreen, {
notice: generateLostAccountsNotice(props.lostAccounts),
key: 'LostAccountsNotice',
onConfirm: () => props.dispatch(actions.markAccountsFound()),
})
}
if (props.seedWords) {
@ -384,21 +393,6 @@ App.prototype.renderPrimary = function () {
}
}
// notices
if (!props.noActiveNotices) {
return h(NoticeScreen, {
notice: props.lastUnreadNotice,
key: 'NoticeScreen',
onConfirm: () => props.dispatch(actions.markNoticeRead(props.lastUnreadNotice)),
})
} else if (props.lostAccounts && props.lostAccounts.length > 0) {
return h(NoticeScreen, {
notice: generateLostAccountsNotice(props.lostAccounts),
key: 'LostAccountsNotice',
onConfirm: () => props.dispatch(actions.markAccountsFound()),
})
}
// show current view
switch (props.currentView.name) {

@ -1,112 +0,0 @@
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 ReactMarkdown = require('react-markdown')
const fs = require('fs')
const path = require('path')
const linker = require('extension-link-enabler')
const findDOMNode = require('react-dom').findDOMNode
const disclaimer = fs.readFileSync(path.join(__dirname, '..', '..', '..', 'USER_AGREEMENT.md')).toString()
module.exports = connect(mapStateToProps)(DisclaimerScreen)
function mapStateToProps (state) {
return {}
}
inherits(DisclaimerScreen, Component)
function DisclaimerScreen () {
Component.call(this)
}
DisclaimerScreen.prototype.render = function () {
const state = this.state || {disclaimerDisabled: true}
const disabled = state.disclaimerDisabled
return (
h('.flex-column.flex-center.flex-grow', [
h('h3.flex-center.text-transform-uppercase.terms-header', {
style: {
background: '#EBEBEB',
color: '#AEAEAE',
marginBottom: 24,
width: '100%',
fontSize: '20px',
textAlign: 'center',
padding: 6,
},
}, [
'MetaMask Terms & Conditions',
]),
h('style', `
.markdown {
font-family: Times New Roman;
overflow-x: hidden;
}
.markdown h1, .markdown h2, .markdown h3 {
margin: 10px 0;
font-weight: bold;
}
.markdown strong {
font-weight: bold;
}
.markdown em {
font-style: italic;
}
.markdown p {
margin: 10px 0;
}
.markdown a {
color: blue;
}
`),
h('div.markdown', {
onScroll: (e) => {
var object = e.currentTarget
if (object.offsetHeight + object.scrollTop + 100 >= object.scrollHeight) {
this.setState({disclaimerDisabled: false})
}
},
style: {
background: 'rgb(235, 235, 235)',
height: '310px',
padding: '6px',
width: '80%',
overflowY: 'scroll',
},
}, [
h(ReactMarkdown, {
source: disclaimer,
skipHtml: true,
}),
]),
h('button', {
style: { marginTop: '18px' },
disabled,
onClick: () => this.props.dispatch(actions.agreeToDisclaimer()),
}, disabled ? 'Scroll Down to Enable' : 'I Agree'),
])
)
}
DisclaimerScreen.prototype.componentDidMount = function () {
var node = findDOMNode(this)
linker.setupListener(node)
}
DisclaimerScreen.prototype.componentWillUnmount = function () {
var node = findDOMNode(this)
linker.teardownListener(node)
}

@ -41,11 +41,6 @@ function reduceMetamask (state, action) {
case actions.UPDATE_METAMASK_STATE:
return extend(metamaskState, action.value)
case actions.AGREE_TO_DISCLAIMER:
return extend(metamaskState, {
isDisclaimerConfirmed: true,
})
case actions.UNLOCK_METAMASK:
return extend(metamaskState, {
isUnlocked: true,

Loading…
Cancel
Save