mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge branch 'i328-MultiVault' of github.com:MetaMask/metamask-plugin into i328-MultiVault
This commit is contained in:
commit
6c469a1826
@ -39,7 +39,6 @@ module.exports = class KeyringController extends EventEmitter {
|
|||||||
isInitialized: !!this.configManager.getVault(),
|
isInitialized: !!this.configManager.getVault(),
|
||||||
isUnlocked: !!this.key,
|
isUnlocked: !!this.key,
|
||||||
isConfirmed: true, // AUDIT this.configManager.getConfirmed(),
|
isConfirmed: true, // AUDIT this.configManager.getConfirmed(),
|
||||||
isEthConfirmed: this.configManager.getShouldntShowWarning(),
|
|
||||||
unconfTxs: this.configManager.unconfirmedTxs(),
|
unconfTxs: this.configManager.unconfirmedTxs(),
|
||||||
transactions: this.configManager.getTxList(),
|
transactions: this.configManager.getTxList(),
|
||||||
unconfMsgs: messageManager.unconfirmedMsgs(),
|
unconfMsgs: messageManager.unconfirmedMsgs(),
|
||||||
|
@ -368,21 +368,6 @@ ConfigManager.prototype.getConversionDate = function () {
|
|||||||
return (('conversionDate' in data) && data.conversionDate) || 'N/A'
|
return (('conversionDate' in data) && data.conversionDate) || 'N/A'
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigManager.prototype.setShouldntShowWarning = function () {
|
|
||||||
var data = this.getData()
|
|
||||||
if (data.isEthConfirmed) {
|
|
||||||
data.isEthConfirmed = !data.isEthConfirmed
|
|
||||||
} else {
|
|
||||||
data.isEthConfirmed = true
|
|
||||||
}
|
|
||||||
this.setData(data)
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigManager.prototype.getShouldntShowWarning = function () {
|
|
||||||
var data = this.getData()
|
|
||||||
return ('isEthConfirmed' in data) && data.isEthConfirmed
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigManager.prototype.getShapeShiftTxList = function () {
|
ConfigManager.prototype.getShapeShiftTxList = function () {
|
||||||
var data = this.getData()
|
var data = this.getData()
|
||||||
var shapeShiftTxList = data.shapeShiftTxList ? data.shapeShiftTxList : []
|
var shapeShiftTxList = data.shapeShiftTxList ? data.shapeShiftTxList : []
|
||||||
|
@ -103,7 +103,6 @@ IdentityStore.prototype.getState = function () {
|
|||||||
isUnlocked: this._isUnlocked(),
|
isUnlocked: this._isUnlocked(),
|
||||||
seedWords: seedWords,
|
seedWords: seedWords,
|
||||||
isConfirmed: configManager.getConfirmed(),
|
isConfirmed: configManager.getConfirmed(),
|
||||||
isEthConfirmed: configManager.getShouldntShowWarning(),
|
|
||||||
unconfTxs: configManager.unconfirmedTxs(),
|
unconfTxs: configManager.unconfirmedTxs(),
|
||||||
transactions: configManager.getTxList(),
|
transactions: configManager.getTxList(),
|
||||||
unconfMsgs: messageManager.unconfirmedMsgs(),
|
unconfMsgs: messageManager.unconfirmedMsgs(),
|
||||||
|
@ -54,7 +54,6 @@ module.exports = class MetamaskController {
|
|||||||
agreeToDisclaimer: this.agreeToDisclaimer.bind(this),
|
agreeToDisclaimer: this.agreeToDisclaimer.bind(this),
|
||||||
resetDisclaimer: this.resetDisclaimer.bind(this),
|
resetDisclaimer: this.resetDisclaimer.bind(this),
|
||||||
setCurrentFiat: this.setCurrentFiat.bind(this),
|
setCurrentFiat: this.setCurrentFiat.bind(this),
|
||||||
agreeToEthWarning: this.agreeToEthWarning.bind(this),
|
|
||||||
setTOSHash: this.setTOSHash.bind(this),
|
setTOSHash: this.setTOSHash.bind(this),
|
||||||
checkTOSChange: this.checkTOSChange.bind(this),
|
checkTOSChange: this.checkTOSChange.bind(this),
|
||||||
setGasMultiplier: this.setGasMultiplier.bind(this),
|
setGasMultiplier: this.setGasMultiplier.bind(this),
|
||||||
@ -334,15 +333,6 @@ module.exports = class MetamaskController {
|
|||||||
}, 300000)
|
}, 300000)
|
||||||
}
|
}
|
||||||
|
|
||||||
agreeToEthWarning (cb) {
|
|
||||||
try {
|
|
||||||
this.configManager.setShouldntShowWarning()
|
|
||||||
cb()
|
|
||||||
} catch (e) {
|
|
||||||
cb(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// called from popup
|
// called from popup
|
||||||
setRpcTarget (rpcTarget) {
|
setRpcTarget (rpcTarget) {
|
||||||
this.configManager.setRpcTarget(rpcTarget)
|
this.configManager.setRpcTarget(rpcTarget)
|
||||||
|
File diff suppressed because one or more lines are too long
@ -2,7 +2,6 @@
|
|||||||
"metamask": {
|
"metamask": {
|
||||||
"isInitialized": true,
|
"isInitialized": true,
|
||||||
"isUnlocked": true,
|
"isUnlocked": true,
|
||||||
"isEthConfirmed": true,
|
|
||||||
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
||||||
"identities": {
|
"identities": {
|
||||||
"0x0abdd95cafcabec9b3e99dcd09fc4b441037cb80": {
|
"0x0abdd95cafcabec9b3e99dcd09fc4b441037cb80": {
|
||||||
@ -116,4 +115,4 @@
|
|||||||
"scrollToBottom": true
|
"scrollToBottom": true
|
||||||
},
|
},
|
||||||
"identities": {}
|
"identities": {}
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,6 @@
|
|||||||
"network": "166",
|
"network": "166",
|
||||||
"seedWords": null,
|
"seedWords": null,
|
||||||
"isConfirmed": true,
|
"isConfirmed": true,
|
||||||
"isEthConfirmed": true,
|
|
||||||
"unconfMsgs": {},
|
"unconfMsgs": {},
|
||||||
"messages": [],
|
"messages": [],
|
||||||
"provider": {
|
"provider": {
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"metamask": {
|
"metamask": {
|
||||||
"isInitialized": true,
|
"isInitialized": true,
|
||||||
"isUnlocked": false,
|
"isUnlocked": false,
|
||||||
"isEthConfirmed": true,
|
|
||||||
"currentDomain": "example.com",
|
"currentDomain": "example.com",
|
||||||
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
||||||
"identities": {},
|
"identities": {},
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"metamask": {
|
"metamask": {
|
||||||
"isInitialized": true,
|
"isInitialized": true,
|
||||||
"isUnlocked": true,
|
"isUnlocked": true,
|
||||||
"isEthConfirmed": true,
|
|
||||||
"currentDomain": "example.com",
|
"currentDomain": "example.com",
|
||||||
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
||||||
"identities": {
|
"identities": {
|
||||||
@ -403,4 +402,4 @@
|
|||||||
"warning": null
|
"warning": null
|
||||||
},
|
},
|
||||||
"identities": {}
|
"identities": {}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"metamask": {
|
"metamask": {
|
||||||
"isInitialized": false,
|
"isInitialized": false,
|
||||||
"isUnlocked": false,
|
"isUnlocked": false,
|
||||||
"isEthConfirmed": false,
|
|
||||||
"currentDomain": "example.com",
|
"currentDomain": "example.com",
|
||||||
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
||||||
"identities": {},
|
"identities": {},
|
||||||
@ -36,4 +35,4 @@
|
|||||||
"warning": null
|
"warning": null
|
||||||
},
|
},
|
||||||
"identities": {}
|
"identities": {}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"metamask": {
|
"metamask": {
|
||||||
"isInitialized": true,
|
"isInitialized": true,
|
||||||
"isUnlocked": true,
|
"isUnlocked": true,
|
||||||
"isEthConfirmed": false,
|
|
||||||
"currentDomain": "example.com",
|
"currentDomain": "example.com",
|
||||||
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
||||||
"identities": {
|
"identities": {
|
||||||
@ -73,4 +72,4 @@
|
|||||||
"detailView": {}
|
"detailView": {}
|
||||||
},
|
},
|
||||||
"identities": {}
|
"identities": {}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"metamask": {
|
"metamask": {
|
||||||
"isInitialized": true,
|
"isInitialized": true,
|
||||||
"isUnlocked": true,
|
"isUnlocked": true,
|
||||||
"isEthConfirmed": true,
|
|
||||||
"currentDomain": "example.com",
|
"currentDomain": "example.com",
|
||||||
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
||||||
"identities": {
|
"identities": {
|
||||||
@ -345,4 +344,4 @@
|
|||||||
"isSubLoading": false
|
"isSubLoading": false
|
||||||
},
|
},
|
||||||
"identities": {}
|
"identities": {}
|
||||||
}
|
}
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
"metamask": {
|
|
||||||
"isInitialized": false,
|
|
||||||
"isUnlocked": false,
|
|
||||||
"currentDomain": "example.com",
|
|
||||||
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
|
||||||
"identities": {},
|
|
||||||
"unconfTxs": {},
|
|
||||||
"accounts": {},
|
|
||||||
"transactions": [],
|
|
||||||
"network": "2",
|
|
||||||
"seedWords": null,
|
|
||||||
"isConfirmed": false,
|
|
||||||
"isEthConfirmed": false,
|
|
||||||
"unconfMsgs": {},
|
|
||||||
"messages": [],
|
|
||||||
"provider": {
|
|
||||||
"type": "testnet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"appState": {
|
|
||||||
"menuOpen": false,
|
|
||||||
"currentView": {
|
|
||||||
"name": "EthStoreWarning"
|
|
||||||
},
|
|
||||||
"accountDetail": {
|
|
||||||
"subview": "transactions"
|
|
||||||
},
|
|
||||||
"currentDomain": "127.0.0.1:9966",
|
|
||||||
"transForward": true,
|
|
||||||
"isLoading": false,
|
|
||||||
"warning": null
|
|
||||||
},
|
|
||||||
"identities": {}
|
|
||||||
}
|
|
@ -5,7 +5,6 @@ QUnit.test('agree to terms', function (assert) {
|
|||||||
var app = $('iframe').contents().find('#app-content .mock-app-root')
|
var app = $('iframe').contents().find('#app-content .mock-app-root')
|
||||||
|
|
||||||
app.find('.markdown').prop('scrollTop', 100000000)
|
app.find('.markdown').prop('scrollTop', 100000000)
|
||||||
|
|
||||||
wait().then(function() {
|
wait().then(function() {
|
||||||
app.find('button').click()
|
app.find('button').click()
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
@ -22,4 +21,3 @@ QUnit.test('agree to terms', function (assert) {
|
|||||||
|
|
||||||
// Wait for view to transition:
|
// Wait for view to transition:
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@ function mapStateToProps (state) {
|
|||||||
network: state.metamask.network,
|
network: state.metamask.network,
|
||||||
unconfTxs: valuesFor(state.metamask.unconfTxs),
|
unconfTxs: valuesFor(state.metamask.unconfTxs),
|
||||||
unconfMsgs: valuesFor(state.metamask.unconfMsgs),
|
unconfMsgs: valuesFor(state.metamask.unconfMsgs),
|
||||||
isEthWarningConfirmed: state.metamask.isEthConfirmed,
|
|
||||||
shapeShiftTxList: state.metamask.shapeShiftTxList,
|
shapeShiftTxList: state.metamask.shapeShiftTxList,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,10 +61,6 @@ var actions = {
|
|||||||
showPrivateKey: showPrivateKey,
|
showPrivateKey: showPrivateKey,
|
||||||
SAVE_ACCOUNT_LABEL: 'SAVE_ACCOUNT_LABEL',
|
SAVE_ACCOUNT_LABEL: 'SAVE_ACCOUNT_LABEL',
|
||||||
saveAccountLabel: saveAccountLabel,
|
saveAccountLabel: saveAccountLabel,
|
||||||
AGREE_TO_ETH_WARNING: 'AGREE_TO_ETH_WARNING',
|
|
||||||
agreeToEthWarning: agreeToEthWarning,
|
|
||||||
SHOW_ETH_WARNING: 'SHOW_ETH_WARNING',
|
|
||||||
showEthWarning: showEthWarning,
|
|
||||||
// tx conf screen
|
// tx conf screen
|
||||||
COMPLETED_TX: 'COMPLETED_TX',
|
COMPLETED_TX: 'COMPLETED_TX',
|
||||||
TRANSACTION_ERROR: 'TRANSACTION_ERROR',
|
TRANSACTION_ERROR: 'TRANSACTION_ERROR',
|
||||||
@ -596,25 +592,6 @@ function showSendPage () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function agreeToEthWarning () {
|
|
||||||
return (dispatch) => {
|
|
||||||
background.agreeToEthWarning((err) => {
|
|
||||||
if (err) {
|
|
||||||
return dispatch(actions.showEthWarning(err.message))
|
|
||||||
}
|
|
||||||
dispatch({
|
|
||||||
type: actions.AGREE_TO_ETH_WARNING,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function showEthWarning () {
|
|
||||||
return {
|
|
||||||
type: actions.SHOW_ETH_WARNING,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function buyEth (address, amount) {
|
function buyEth (address, amount) {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
background.buyEth(address, amount)
|
background.buyEth(address, amount)
|
||||||
|
@ -25,7 +25,6 @@ const MenuDroppo = require('menu-droppo')
|
|||||||
const DropMenuItem = require('./components/drop-menu-item')
|
const DropMenuItem = require('./components/drop-menu-item')
|
||||||
const NetworkIndicator = require('./components/network')
|
const NetworkIndicator = require('./components/network')
|
||||||
const Tooltip = require('./components/tooltip')
|
const Tooltip = require('./components/tooltip')
|
||||||
const EthStoreWarning = require('./eth-store-warning')
|
|
||||||
const BuyView = require('./components/buy-button-subview')
|
const BuyView = require('./components/buy-button-subview')
|
||||||
const QrView = require('./components/qr-code')
|
const QrView = require('./components/qr-code')
|
||||||
module.exports = connect(mapStateToProps)(App)
|
module.exports = connect(mapStateToProps)(App)
|
||||||
@ -38,7 +37,6 @@ function mapStateToProps (state) {
|
|||||||
// state from plugin
|
// state from plugin
|
||||||
isLoading: state.appState.isLoading,
|
isLoading: state.appState.isLoading,
|
||||||
isConfirmed: state.metamask.isConfirmed,
|
isConfirmed: state.metamask.isConfirmed,
|
||||||
isEthConfirmed: state.metamask.isEthConfirmed,
|
|
||||||
isInitialized: state.metamask.isInitialized,
|
isInitialized: state.metamask.isInitialized,
|
||||||
isUnlocked: state.metamask.isUnlocked,
|
isUnlocked: state.metamask.isUnlocked,
|
||||||
currentView: state.appState.currentView,
|
currentView: state.appState.currentView,
|
||||||
@ -421,9 +419,6 @@ App.prototype.renderPrimary = function () {
|
|||||||
|
|
||||||
// show current view
|
// show current view
|
||||||
switch (props.currentView.name) {
|
switch (props.currentView.name) {
|
||||||
case 'EthStoreWarning':
|
|
||||||
return h(EthStoreWarning, {key: 'ethWarning'})
|
|
||||||
|
|
||||||
case 'accounts':
|
case 'accounts':
|
||||||
return h(AccountsScreen, {key: 'accounts'})
|
return h(AccountsScreen, {key: 'accounts'})
|
||||||
|
|
||||||
|
@ -1,89 +0,0 @@
|
|||||||
const connect = require('react-redux').connect
|
|
||||||
const Component = require('react').Component
|
|
||||||
const h = require('react-hyperscript')
|
|
||||||
const inherits = require('util').inherits
|
|
||||||
const actions = require('./actions')
|
|
||||||
|
|
||||||
module.exports = connect(mapStateToProps)(EthStoreWarning)
|
|
||||||
|
|
||||||
inherits(EthStoreWarning, Component)
|
|
||||||
function EthStoreWarning () {
|
|
||||||
Component.call(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
function mapStateToProps (state) {
|
|
||||||
return {
|
|
||||||
selectedAccount: state.metamask.selectedAccount,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EthStoreWarning.prototype.render = function () {
|
|
||||||
|
|
||||||
return (
|
|
||||||
|
|
||||||
h('.flex-column', {
|
|
||||||
key: 'ethWarning',
|
|
||||||
style: {
|
|
||||||
paddingTop: '25px',
|
|
||||||
marginRight: '30px',
|
|
||||||
marginLeft: '30px',
|
|
||||||
alignItems: 'center',
|
|
||||||
},
|
|
||||||
}, [
|
|
||||||
h('.warning', {
|
|
||||||
style: {
|
|
||||||
margin: '10px 10px 10px 10px',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
`MetaMask is currently in beta; use
|
|
||||||
caution in storing large
|
|
||||||
amounts of ether.
|
|
||||||
`),
|
|
||||||
|
|
||||||
h('i.fa.fa-exclamation-triangle.fa-4', {
|
|
||||||
style: {
|
|
||||||
fontSize: '152px',
|
|
||||||
color: '#AEAEAE',
|
|
||||||
textAlign: 'center',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
|
|
||||||
h('.flex-row', {
|
|
||||||
style: {
|
|
||||||
marginTop: '25px',
|
|
||||||
marginBottom: '10px',
|
|
||||||
},
|
|
||||||
}, [
|
|
||||||
h('input', {
|
|
||||||
type: 'checkbox',
|
|
||||||
onChange: this.toggleShowWarning.bind(this),
|
|
||||||
}),
|
|
||||||
h('.warning', {
|
|
||||||
style: {
|
|
||||||
fontSize: '11px',
|
|
||||||
},
|
|
||||||
|
|
||||||
}, 'Don\'t show me this message again'),
|
|
||||||
]),
|
|
||||||
h('.flex-row', {
|
|
||||||
style: {
|
|
||||||
width: '100%',
|
|
||||||
justifyContent: 'space-around',
|
|
||||||
},
|
|
||||||
}, [
|
|
||||||
h('button', {
|
|
||||||
onClick: this.toAccounts.bind(this),
|
|
||||||
},
|
|
||||||
'Continue to MetaMask'),
|
|
||||||
]),
|
|
||||||
])
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
EthStoreWarning.prototype.toggleShowWarning = function () {
|
|
||||||
this.props.dispatch(actions.agreeToEthWarning())
|
|
||||||
}
|
|
||||||
|
|
||||||
EthStoreWarning.prototype.toAccounts = function () {
|
|
||||||
this.props.dispatch(actions.showAccountDetail(this.props.account))
|
|
||||||
}
|
|
@ -29,13 +29,10 @@ function reduceApp (state, action) {
|
|||||||
name: 'createVaultComplete',
|
name: 'createVaultComplete',
|
||||||
seedWords,
|
seedWords,
|
||||||
}
|
}
|
||||||
var ethStoreWarning = {
|
|
||||||
name: 'EthStoreWarning',
|
|
||||||
}
|
|
||||||
|
|
||||||
var appState = extend({
|
var appState = extend({
|
||||||
menuOpen: false,
|
menuOpen: false,
|
||||||
currentView: seedWords ? seedConfView : !state.metamask.isEthConfirmed ? ethStoreWarning : defaultView,
|
currentView: seedWords ? seedConfView : defaultView,
|
||||||
accountDetail: {
|
accountDetail: {
|
||||||
subview: 'transactions',
|
subview: 'transactions',
|
||||||
},
|
},
|
||||||
|
@ -10,7 +10,6 @@ function reduceMetamask (state, action) {
|
|||||||
var metamaskState = extend({
|
var metamaskState = extend({
|
||||||
isInitialized: false,
|
isInitialized: false,
|
||||||
isUnlocked: false,
|
isUnlocked: false,
|
||||||
isEthConfirmed: false,
|
|
||||||
rpcTarget: 'https://rawtestrpc.metamask.io/',
|
rpcTarget: 'https://rawtestrpc.metamask.io/',
|
||||||
identities: {},
|
identities: {},
|
||||||
unconfTxs: {},
|
unconfTxs: {},
|
||||||
@ -34,11 +33,6 @@ function reduceMetamask (state, action) {
|
|||||||
isConfirmed: true,
|
isConfirmed: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
case actions.AGREE_TO_ETH_WARNING:
|
|
||||||
return extend(metamaskState, {
|
|
||||||
isEthConfirmed: !metamaskState.isEthConfirmed,
|
|
||||||
})
|
|
||||||
|
|
||||||
case actions.UNLOCK_METAMASK:
|
case actions.UNLOCK_METAMASK:
|
||||||
return extend(metamaskState, {
|
return extend(metamaskState, {
|
||||||
isUnlocked: true,
|
isUnlocked: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user