1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 17:33:23 +01:00

Delete all code related to disclaimers.

This commit is contained in:
Kevin Serrano 2017-02-09 18:17:50 -08:00
parent 1d0fcf129c
commit 65c84ac4b2
No known key found for this signature in database
GPG Key ID: 7CC862A58D2889B4
44 changed files with 30 additions and 316 deletions

View File

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

View File

@ -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 () { ConfigManager.prototype.getGasMultiplier = function () {
var data = this.getData() var data = this.getData()
return data.gasMultiplier return data.gasMultiplier

View File

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

View File

@ -107,8 +107,6 @@ module.exports = class MetamaskController extends EventEmitter {
this.messageManager = new MessageManager() this.messageManager = new MessageManager()
this.publicConfigStore = this.initPublicConfigStore() this.publicConfigStore = this.initPublicConfigStore()
this.checkTOSChange()
// TEMPORARY UNTIL FULL DEPRECATION: // TEMPORARY UNTIL FULL DEPRECATION:
this.idStoreMigrator = new IdStoreMigrator({ this.idStoreMigrator = new IdStoreMigrator({
configManager: this.configManager, configManager: this.configManager,
@ -219,7 +217,6 @@ module.exports = class MetamaskController extends EventEmitter {
this.shapeshiftController.store.getState(), this.shapeshiftController.store.getState(),
{ {
lostAccounts: this.configManager.getLostAccounts(), lostAccounts: this.configManager.getLostAccounts(),
isDisclaimerConfirmed: this.configManager.getConfirmedDisclaimer(),
seedWords: this.configManager.getSeedWords(), seedWords: this.configManager.getSeedWords(),
} }
) )
@ -242,11 +239,7 @@ module.exports = class MetamaskController extends EventEmitter {
setRpcTarget: this.setRpcTarget.bind(this), setRpcTarget: this.setRpcTarget.bind(this),
setProviderType: this.setProviderType.bind(this), setProviderType: this.setProviderType.bind(this),
useEtherscanProvider: this.useEtherscanProvider.bind(this), useEtherscanProvider: this.useEtherscanProvider.bind(this),
agreeToDisclaimer: this.agreeToDisclaimer.bind(this),
resetDisclaimer: this.resetDisclaimer.bind(this),
setCurrentCurrency: this.setCurrentCurrency.bind(this), setCurrentCurrency: this.setCurrentCurrency.bind(this),
setTOSHash: this.setTOSHash.bind(this),
checkTOSChange: this.checkTOSChange.bind(this),
setGasMultiplier: this.setGasMultiplier.bind(this), setGasMultiplier: this.setGasMultiplier.bind(this),
markAccountsFound: this.markAccountsFound.bind(this), markAccountsFound: this.markAccountsFound.bind(this),
// coinbase // coinbase
@ -518,47 +511,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 // config
// //

View File

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

View File

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

View File

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

View File

@ -39,7 +39,6 @@
}, },
"selectedAddress": "0x9858e7d8b79fc3e6d989636721584498926da38a", "selectedAddress": "0x9858e7d8b79fc3e6d989636721584498926da38a",
"selectedAccountTxList": [], "selectedAccountTxList": [],
"isDisclaimerConfirmed": true,
"unconfMsgs": {}, "unconfMsgs": {},
"messages": [], "messages": [],
"shapeShiftTxList": [], "shapeShiftTxList": [],

View File

@ -78,7 +78,6 @@
"type": "testnet" "type": "testnet"
}, },
"selectedAddress": "0x87658c15aefe7448008a28513a11b6b130ef4cd0", "selectedAddress": "0x87658c15aefe7448008a28513a11b6b130ef4cd0",
"isDisclaimerConfirmed": true,
"unconfMsgs": {}, "unconfMsgs": {},
"messages": [], "messages": [],
"shapeShiftTxList": [], "shapeShiftTxList": [],

View File

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

View File

@ -97,7 +97,6 @@
}, },
"selectedAddress": "0xac39b311dceb2a4b2f5d8461c1cdaf756f4f7ae9", "selectedAddress": "0xac39b311dceb2a4b2f5d8461c1cdaf756f4f7ae9",
"seedWords": false, "seedWords": false,
"isDisclaimerConfirmed": true,
"unconfMsgs": {}, "unconfMsgs": {},
"messages": [], "messages": [],
"shapeShiftTxList": [], "shapeShiftTxList": [],

View File

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

View File

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

View File

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

View File

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

View File

@ -11,7 +11,6 @@
"network": null, "network": null,
"accounts": {}, "accounts": {},
"transactions": [], "transactions": [],
"isDisclaimerConfirmed": false,
"unconfMsgs": {}, "unconfMsgs": {},
"messages": [], "messages": [],
"shapeShiftTxList": [], "shapeShiftTxList": [],

View File

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

View File

@ -30,7 +30,6 @@
"selectedAddress": "0x01208723ba84e15da2e71656544a2963b0c06d40", "selectedAddress": "0x01208723ba84e15da2e71656544a2963b0c06d40",
"selectedAccountTxList": [], "selectedAccountTxList": [],
"seedWords": false, "seedWords": false,
"isDisclaimerConfirmed": true,
"unconfMsgs": {}, "unconfMsgs": {},
"messages": [], "messages": [],
"shapeShiftTxList": [], "shapeShiftTxList": [],

View File

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

View File

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

View File

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

View File

@ -37,7 +37,6 @@
"type": "testnet" "type": "testnet"
}, },
"selectedAddress": "0xa6ef573d60594731178b7f85d80da13cc2af52dd", "selectedAddress": "0xa6ef573d60594731178b7f85d80da13cc2af52dd",
"isConfirmed": true,
"unconfMsgs": {}, "unconfMsgs": {},
"messages": [], "messages": [],
"selectedAddress": "0xa6ef573d60594731178b7f85d80da13cc2af52dd", "selectedAddress": "0xa6ef573d60594731178b7f85d80da13cc2af52dd",

View File

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

View File

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

File diff suppressed because one or more lines are too long

View File

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

File diff suppressed because one or more lines are too long

View File

@ -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

View File

@ -54,7 +54,6 @@
], ],
"selectedAddress": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", "selectedAddress": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825",
"network": "1479753732793", "network": "1479753732793",
"isConfirmed": true,
"isEthConfirmed": true, "isEthConfirmed": true,
"unconfMsgs": {}, "unconfMsgs": {},
"messages": [], "messages": [],
@ -65,7 +64,6 @@
"rpcTarget": "http://localhost:8545" "rpcTarget": "http://localhost:8545"
}, },
"selectedAddress": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", "selectedAddress": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825",
"isDisclaimerConfirmed": true
}, },
"appState": { "appState": {
"menuOpen": false, "menuOpen": false,

View File

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

View File

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

View File

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

View File

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

View File

@ -14,7 +14,6 @@
"provider": { "provider": {
"type": "testnet" "type": "testnet"
}, },
"isDisclaimerConfirmed": false,
"unconfMsgs": {}, "unconfMsgs": {},
"messages": [], "messages": [],
"shapeShiftTxList": [], "shapeShiftTxList": [],

View File

@ -18,14 +18,8 @@ var path = require('path')
var manifest = require('./app/manifest.json') var manifest = require('./app/manifest.json')
var gulpif = require('gulp-if') var gulpif = require('gulp-if')
var replace = require('gulp-replace') 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') var mkdirp = require('mkdirp')
hash.update(disclaimer)
var tosHash = hash.digest('hex')
var disableLiveReload = gutil.env.disableLiveReload var disableLiveReload = gutil.env.disableLiveReload
var debug = gutil.env.debug var debug = gutil.env.debug
@ -307,7 +301,6 @@ function bundleTask(opts) {
// convert bundle stream to gulp vinyl stream // convert bundle stream to gulp vinyl stream
.pipe(source(opts.filename)) .pipe(source(opts.filename))
// inject variables into bundle // inject variables into bundle
.pipe(replace('GULP_TOS_HASH', tosHash))
.pipe(replace('\'GULP_METAMASK_DEBUG\'', debug)) .pipe(replace('\'GULP_METAMASK_DEBUG\'', debug))
// buffer file contents (?) // buffer file contents (?)
.pipe(buffer()) .pipe(buffer())

View File

@ -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}}

View File

@ -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"]}}

View File

@ -4,8 +4,6 @@
}, },
"data": { "data": {
"fiatCurrency": "USD", "fiatCurrency": "USD",
"isConfirmed": true,
"TOSHash": "a4f4e23f823a7ac51783e7ffba7914a911b09acdb97263296b7e14b527f80c5b",
"conversionRate": 9.47316629, "conversionRate": 9.47316629,
"conversionDate": 1479510994, "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}", "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}",

View File

@ -14,37 +14,6 @@ describe('config-manager', function() {
configManager = configManagerGen() 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() { describe('#setConfig', function() {
it('should set the config key', function () { it('should set the config key', function () {
@ -68,7 +37,6 @@ describe('config-manager', function() {
rpcTarget: 'foobar' rpcTarget: 'foobar'
}, },
} }
configManager.setConfirmedDisclaimer(true)
configManager.setConfig(testConfig) configManager.setConfig(testConfig)
var testWallet = { var testWallet = {
@ -79,7 +47,6 @@ describe('config-manager', function() {
var result = configManager.getData() var result = configManager.getData()
assert.equal(result.wallet.name, testWallet.name, 'wallet name is set') 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.rpcTarget, testConfig.provider.rpcTarget)
assert.equal(configManager.getConfirmedDisclaimer(), true)
testConfig.provider.type = 'something else!' testConfig.provider.type = 'something else!'
configManager.setConfig(testConfig) 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.wallet.name, testWallet.name, 'wallet name is set')
assert.equal(result.config.provider.rpcTarget, testConfig.provider.rpcTarget) assert.equal(result.config.provider.rpcTarget, testConfig.provider.rpcTarget)
assert.equal(result.config.provider.type, testConfig.provider.type) assert.equal(result.config.provider.type, testConfig.provider.type)
assert.equal(configManager.getConfirmedDisclaimer(), true)
}) })
}) })

View File

@ -22,8 +22,6 @@ var actions = {
clearNotices: clearNotices, clearNotices: clearNotices,
markAccountsFound, markAccountsFound,
// intialize screen // intialize screen
AGREE_TO_DISCLAIMER: 'AGREE_TO_DISCLAIMER',
agreeToDisclaimer: agreeToDisclaimer,
CREATE_NEW_VAULT_IN_PROGRESS: 'CREATE_NEW_VAULT_IN_PROGRESS', CREATE_NEW_VAULT_IN_PROGRESS: 'CREATE_NEW_VAULT_IN_PROGRESS',
SHOW_CREATE_VAULT: 'SHOW_CREATE_VAULT', SHOW_CREATE_VAULT: 'SHOW_CREATE_VAULT',
SHOW_RESTORE_VAULT: 'SHOW_RESTORE_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 () { function createNewVaultInProgress () {
return { return {
type: actions.CREATE_NEW_VAULT_IN_PROGRESS, type: actions.CREATE_NEW_VAULT_IN_PROGRESS,

View File

@ -5,7 +5,6 @@ const h = require('react-hyperscript')
const actions = require('./actions') const actions = require('./actions')
const ReactCSSTransitionGroup = require('react-addons-css-transition-group') const ReactCSSTransitionGroup = require('react-addons-css-transition-group')
// init // init
const DisclaimerScreen = require('./first-time/disclaimer')
const InitializeMenuScreen = require('./first-time/init-menu') const InitializeMenuScreen = require('./first-time/init-menu')
const NewKeyChainScreen = require('./new-keychain') const NewKeyChainScreen = require('./new-keychain')
// unlock // unlock
@ -44,7 +43,6 @@ function mapStateToProps (state) {
// state from plugin // state from plugin
isLoading: state.appState.isLoading, isLoading: state.appState.isLoading,
loadingMessage: state.appState.loadingMessage, loadingMessage: state.appState.loadingMessage,
isDisclaimerConfirmed: state.metamask.isDisclaimerConfirmed,
noActiveNotices: state.metamask.noActiveNotices, noActiveNotices: state.metamask.noActiveNotices,
isInitialized: state.metamask.isInitialized, isInitialized: state.metamask.isInitialized,
isUnlocked: state.metamask.isUnlocked, isUnlocked: state.metamask.isUnlocked,
@ -351,8 +349,19 @@ App.prototype.renderBackButton = function (style, justArrow = false) {
App.prototype.renderPrimary = function () { App.prototype.renderPrimary = function () {
var props = this.props var props = this.props
if (!props.isDisclaimerConfirmed) { // notices
return h(DisclaimerScreen, {key: 'disclaimerScreen'}) 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()),
})
} }
if (props.seedWords) { 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 // show current view
switch (props.currentView.name) { switch (props.currentView.name) {

View File

@ -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)
}

View File

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