mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
eth-store - cbs default to noop
This commit is contained in:
parent
8b5e3aa287
commit
b233e7e37c
@ -76,13 +76,13 @@ class EthereumStore extends ObservableStore {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateAccounts (cb) {
|
_updateAccounts (cb = noop) {
|
||||||
const accounts = this.getState().accounts
|
const accounts = this.getState().accounts
|
||||||
const addresses = Object.keys(accounts)
|
const addresses = Object.keys(accounts)
|
||||||
async.each(addresses, this._updateAccount.bind(this), cb)
|
async.each(addresses, this._updateAccount.bind(this), cb)
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateAccount (address, cb) {
|
_updateAccount (address, cb = noop) {
|
||||||
const accounts = this.getState().accounts
|
const accounts = this.getState().accounts
|
||||||
this._getAccount(address, (err, result) => {
|
this._getAccount(address, (err, result) => {
|
||||||
if (err) return cb(err)
|
if (err) return cb(err)
|
||||||
@ -95,13 +95,13 @@ class EthereumStore extends ObservableStore {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateTransactions (block, cb) {
|
_updateTransactions (block, cb = noop) {
|
||||||
const transactions = this.getState().transactions
|
const transactions = this.getState().transactions
|
||||||
const txHashes = Object.keys(transactions)
|
const txHashes = Object.keys(transactions)
|
||||||
async.each(txHashes, this._updateTransaction.bind(this, block), cb)
|
async.each(txHashes, this._updateTransaction.bind(this, block), cb)
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateTransaction (block, txHash, cb) {
|
_updateTransaction (block, txHash, cb = noop) {
|
||||||
// would use the block here to determine how many confirmations the tx has
|
// would use the block here to determine how many confirmations the tx has
|
||||||
const transactions = this.getState().transactions
|
const transactions = this.getState().transactions
|
||||||
this._query.getTransaction(txHash, (err, result) => {
|
this._query.getTransaction(txHash, (err, result) => {
|
||||||
@ -114,7 +114,7 @@ class EthereumStore extends ObservableStore {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
_getAccount (address, cb) {
|
_getAccount (address, cb = noop) {
|
||||||
const query = this._query
|
const query = this._query
|
||||||
async.parallel({
|
async.parallel({
|
||||||
balance: query.getBalance.bind(query, address),
|
balance: query.getBalance.bind(query, address),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user