mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Change fauceting to become a response of an emit.
This commit is contained in:
parent
f5b0795ac5
commit
1cbab788ec
@ -9,7 +9,6 @@ const EventEmitter = require('events').EventEmitter
|
|||||||
const normalize = require('./lib/sig-util').normalize
|
const normalize = require('./lib/sig-util').normalize
|
||||||
const encryptor = require('./lib/encryptor')
|
const encryptor = require('./lib/encryptor')
|
||||||
const messageManager = require('./lib/message-manager')
|
const messageManager = require('./lib/message-manager')
|
||||||
const autoFaucet = require('./lib/auto-faucet')
|
|
||||||
const IdStoreMigrator = require('./lib/idStore-migrator')
|
const IdStoreMigrator = require('./lib/idStore-migrator')
|
||||||
const BN = ethUtil.BN
|
const BN = ethUtil.BN
|
||||||
|
|
||||||
@ -160,7 +159,7 @@ module.exports = class KeyringController extends EventEmitter {
|
|||||||
this.configManager.setSelectedAccount(firstAccount)
|
this.configManager.setSelectedAccount(firstAccount)
|
||||||
|
|
||||||
this.placeSeedWords()
|
this.placeSeedWords()
|
||||||
autoFaucet(hexAccount)
|
this.emit('newAccount', hexAccount)
|
||||||
this.setupAccounts(accounts)
|
this.setupAccounts(accounts)
|
||||||
this.persistAllKeyrings()
|
this.persistAllKeyrings()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
@ -7,6 +7,8 @@ const HostStore = require('./lib/remote-store.js').HostStore
|
|||||||
const Web3 = require('web3')
|
const Web3 = require('web3')
|
||||||
const ConfigManager = require('./lib/config-manager')
|
const ConfigManager = require('./lib/config-manager')
|
||||||
const extension = require('./lib/extension')
|
const extension = require('./lib/extension')
|
||||||
|
const autoFaucet = require('./lib/auto-faucet')
|
||||||
|
|
||||||
|
|
||||||
module.exports = class MetamaskController {
|
module.exports = class MetamaskController {
|
||||||
|
|
||||||
@ -174,6 +176,10 @@ module.exports = class MetamaskController {
|
|||||||
this.sendUpdate()
|
this.sendUpdate()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.keyringController.on('newAccount', (account) => {
|
||||||
|
autoFaucet(account)
|
||||||
|
})
|
||||||
|
|
||||||
// keyringController substate
|
// keyringController substate
|
||||||
function keyringControllerToPublic (state) {
|
function keyringControllerToPublic (state) {
|
||||||
return {
|
return {
|
||||||
|
@ -261,7 +261,7 @@ function showInfoPage () {
|
|||||||
|
|
||||||
function setselectedAccount (address) {
|
function setselectedAccount (address) {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
background.setselectedAccount(address)
|
background.setSelectedAccount(address)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -455,7 +455,7 @@ function lockMetamask () {
|
|||||||
function showAccountDetail (address) {
|
function showAccountDetail (address) {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
dispatch(actions.showLoadingIndication())
|
dispatch(actions.showLoadingIndication())
|
||||||
background.setselectedAccount(address, (err, address) => {
|
background.setSelectedAccount(address, (err, address) => {
|
||||||
dispatch(actions.hideLoadingIndication())
|
dispatch(actions.hideLoadingIndication())
|
||||||
if (err) {
|
if (err) {
|
||||||
return dispatch(actions.displayWarning(err.message))
|
return dispatch(actions.displayWarning(err.message))
|
||||||
|
Loading…
Reference in New Issue
Block a user