@@ -26,7 +26,6 @@ const PreferencesController = require('./controllers/preferences')
26
26
const CurrencyController = require ( './controllers/currency' )
27
27
const NoticeController = require ( './notice-controller' )
28
28
const ShapeShiftController = require ( './controllers/shapeshift' )
29
- const AddressBookController = require ( './controllers/address-book' )
30
29
const InfuraController = require ( './controllers/infura' )
31
30
const BlacklistController = require ( './controllers/blacklist' )
32
31
const CachedBalancesController = require ( './controllers/cached-balances' )
@@ -55,6 +54,7 @@ const HW_WALLETS_KEYRINGS = [TrezorKeyring.type, LedgerBridgeKeyring.type]
55
54
const EthQuery = require ( 'eth-query' )
56
55
const ethUtil = require ( 'ethereumjs-util' )
57
56
const sigUtil = require ( 'eth-sig-util' )
57
+ const { AddressBookController } = require ( 'gaba' )
58
58
59
59
60
60
module . exports = class MetamaskController extends EventEmitter {
@@ -175,11 +175,7 @@ module.exports = class MetamaskController extends EventEmitter {
175
175
keyringMemStore : this . keyringController . memStore ,
176
176
} )
177
177
178
- // address book controller
179
- this . addressBookController = new AddressBookController ( {
180
- initState : initState . AddressBookController ,
181
- preferencesStore : this . preferencesController . store ,
182
- } )
178
+ this . addressBookController = new AddressBookController ( undefined , initState . AddressBookController )
183
179
184
180
// tx mgmt
185
181
this . txController = new TransactionController ( {
@@ -245,7 +241,7 @@ module.exports = class MetamaskController extends EventEmitter {
245
241
TransactionController : this . txController . store ,
246
242
KeyringController : this . keyringController . store ,
247
243
PreferencesController : this . preferencesController . store ,
248
- AddressBookController : this . addressBookController . store ,
244
+ AddressBookController : this . addressBookController ,
249
245
CurrencyController : this . currencyController . store ,
250
246
NoticeController : this . noticeController . store ,
251
247
ShapeShiftController : this . shapeshiftController . store ,
@@ -267,7 +263,7 @@ module.exports = class MetamaskController extends EventEmitter {
267
263
KeyringController : this . keyringController . memStore ,
268
264
PreferencesController : this . preferencesController . store ,
269
265
RecentBlocksController : this . recentBlocksController . store ,
270
- AddressBookController : this . addressBookController . store ,
266
+ AddressBookController : this . addressBookController ,
271
267
CurrencyController : this . currencyController . store ,
272
268
NoticeController : this . noticeController . memStore ,
273
269
ShapeshiftController : this . shapeshiftController . store ,
@@ -376,7 +372,6 @@ module.exports = class MetamaskController extends EventEmitter {
376
372
const preferencesController = this . preferencesController
377
373
const txController = this . txController
378
374
const noticeController = this . noticeController
379
- const addressBookController = this . addressBookController
380
375
const networkController = this . networkController
381
376
const providerApprovalController = this . providerApprovalController
382
377
@@ -443,7 +438,7 @@ module.exports = class MetamaskController extends EventEmitter {
443
438
whitelistPhishingDomain : this . whitelistPhishingDomain . bind ( this ) ,
444
439
445
440
// AddressController
446
- setAddressBook : nodeify ( addressBookController . setAddressBook , addressBookController ) ,
441
+ setAddressBook : this . addressBookController . set . bind ( this . addressBookController ) ,
447
442
448
443
// KeyringController
449
444
setLocked : nodeify ( this . setLocked , this ) ,
0 commit comments