@@ -31,6 +31,7 @@ import { AccountsController, EMPTY_ACCOUNT } from './AccountsController';
31
31
import {
32
32
createExpectedInternalAccount ,
33
33
createMockInternalAccount ,
34
+ createMockInternalAccountOptions ,
34
35
ETH_EOA_METHODS ,
35
36
} from './tests/mocks' ;
36
37
import {
@@ -901,6 +902,7 @@ describe('AccountsController', () => {
901
902
name : 'Account 3' ,
902
903
address : mockAccount3 . address ,
903
904
keyringType : KeyringTypes . hd ,
905
+ options : { } ,
904
906
} ) ,
905
907
] ) ;
906
908
} ) ;
@@ -1744,6 +1746,12 @@ describe('AccountsController', () => {
1744
1746
keyrings : [
1745
1747
{ type : KeyringTypes . hd , accounts : [ mockAddress1 , mockAddress2 ] } ,
1746
1748
] ,
1749
+ keyringsMetadata : [
1750
+ {
1751
+ id : 'mock-keyring-id-0' ,
1752
+ name : 'mock-keyring-id-name' ,
1753
+ } ,
1754
+ ] ,
1747
1755
} ) ,
1748
1756
) ;
1749
1757
@@ -1772,12 +1780,14 @@ describe('AccountsController', () => {
1772
1780
id : 'mock-id' ,
1773
1781
address : mockAddress1 ,
1774
1782
keyringType : KeyringTypes . hd ,
1783
+ options : createMockInternalAccountOptions ( 0 , KeyringTypes . hd , 0 ) ,
1775
1784
} ) ,
1776
1785
createExpectedInternalAccount ( {
1777
1786
name : 'Account 2' ,
1778
1787
id : 'mock-id2' ,
1779
1788
address : mockAddress2 ,
1780
1789
keyringType : KeyringTypes . hd ,
1790
+ options : createMockInternalAccountOptions ( 0 , KeyringTypes . hd , 1 ) ,
1781
1791
} ) ,
1782
1792
] ;
1783
1793
mockUUIDWithNormalAccounts ( expectedAccounts ) ;
@@ -1800,6 +1810,12 @@ describe('AccountsController', () => {
1800
1810
accounts : [ mockSnapAccount , mockSnapAccount2 ] ,
1801
1811
} ,
1802
1812
] ,
1813
+ keyringsMetadata : [
1814
+ {
1815
+ id : 'mock-keyring-id-1' ,
1816
+ name : 'mock-keyring-id-name' ,
1817
+ } ,
1818
+ ] ,
1803
1819
} ) ,
1804
1820
) ;
1805
1821
@@ -1893,6 +1909,12 @@ describe('AccountsController', () => {
1893
1909
keyrings : [
1894
1910
{ type : KeyringTypes . hd , accounts : [ mockAddress1 , mockAddress2 ] } ,
1895
1911
] ,
1912
+ keyringsMetadata : [
1913
+ {
1914
+ id : 'mock-keyring-id-0' ,
1915
+ name : 'mock-keyring-id-name' ,
1916
+ } ,
1917
+ ] ,
1896
1918
} ) ,
1897
1919
) ;
1898
1920
@@ -1918,12 +1940,16 @@ describe('AccountsController', () => {
1918
1940
messenger,
1919
1941
} ) ;
1920
1942
const expectedAccounts = [
1921
- mockAccount ,
1943
+ {
1944
+ ...mockAccount ,
1945
+ options : createMockInternalAccountOptions ( 0 , KeyringTypes . hd , 0 ) ,
1946
+ } ,
1922
1947
createExpectedInternalAccount ( {
1923
1948
name : 'Account 2' ,
1924
1949
id : 'mock-id2' ,
1925
1950
address : mockAddress2 ,
1926
1951
keyringType : KeyringTypes . hd ,
1952
+ options : createMockInternalAccountOptions ( 0 , KeyringTypes . hd , 1 ) ,
1927
1953
} ) ,
1928
1954
] ;
1929
1955
mockUUIDWithNormalAccounts ( expectedAccounts ) ;
@@ -1957,6 +1983,16 @@ describe('AccountsController', () => {
1957
1983
{ type : KeyringTypes . hd , accounts : [ mockAddress1 ] } ,
1958
1984
{ type : KeyringTypes . snap , accounts : [ '0x1234' ] } ,
1959
1985
] ,
1986
+ keyringsMetadata : [
1987
+ {
1988
+ id : 'mock-keyring-id-0' ,
1989
+ name : 'mock-keyring-id-name' ,
1990
+ } ,
1991
+ {
1992
+ id : 'mock-keyring-id-1' ,
1993
+ name : 'mock-keyring-id-name2' ,
1994
+ } ,
1995
+ ] ,
1960
1996
} ) ,
1961
1997
) ;
1962
1998
@@ -1975,6 +2011,7 @@ describe('AccountsController', () => {
1975
2011
id : 'mock-id' ,
1976
2012
address : mockAddress1 ,
1977
2013
keyringType : KeyringTypes . hd ,
2014
+ options : createMockInternalAccountOptions ( 0 , KeyringTypes . hd , 0 ) ,
1978
2015
} ) ,
1979
2016
createExpectedInternalAccount ( {
1980
2017
name : 'Snap Account 1' , // it is Snap Account 1 because it is the only snap account
@@ -2014,6 +2051,16 @@ describe('AccountsController', () => {
2014
2051
{ type : KeyringTypes . snap , accounts : [ '0x1234' ] } ,
2015
2052
{ type : KeyringTypes . hd , accounts : [ mockAddress1 ] } ,
2016
2053
] ,
2054
+ keyringsMetadata : [
2055
+ {
2056
+ id : 'mock-keyring-id-0' ,
2057
+ name : 'mock-keyring-id-name' ,
2058
+ } ,
2059
+ {
2060
+ id : 'mock-keyring-id-1' ,
2061
+ name : 'mock-keyring-id-name2' ,
2062
+ } ,
2063
+ ] ,
2017
2064
} ) ,
2018
2065
) ;
2019
2066
@@ -2032,6 +2079,7 @@ describe('AccountsController', () => {
2032
2079
id : 'mock-id' ,
2033
2080
address : mockAddress1 ,
2034
2081
keyringType : KeyringTypes . hd ,
2082
+ options : createMockInternalAccountOptions ( 1 , KeyringTypes . hd , 0 ) ,
2035
2083
} ) ,
2036
2084
createExpectedInternalAccount ( {
2037
2085
name : 'Snap Account 1' , // it is Snap Account 1 because it is the only snap account
@@ -2057,7 +2105,6 @@ describe('AccountsController', () => {
2057
2105
KeyringTypes . ledger ,
2058
2106
KeyringTypes . lattice ,
2059
2107
KeyringTypes . qr ,
2060
- 'Custody - JSON - RPC' ,
2061
2108
] ) ( 'should add accounts for %s type' , async ( keyringType ) => {
2062
2109
mockUUIDWithNormalAccounts ( [ mockAccount ] ) ;
2063
2110
@@ -2067,6 +2114,12 @@ describe('AccountsController', () => {
2067
2114
'KeyringController:getState' ,
2068
2115
mockGetState . mockReturnValue ( {
2069
2116
keyrings : [ { type : keyringType , accounts : [ mockAddress1 ] } ] ,
2117
+ keyringsMetadata : [
2118
+ {
2119
+ id : 'mock-keyring-id-0' ,
2120
+ name : 'mock-keyring-id-name' ,
2121
+ } ,
2122
+ ] ,
2070
2123
} ) ,
2071
2124
) ;
2072
2125
@@ -2096,6 +2149,7 @@ describe('AccountsController', () => {
2096
2149
id : 'mock-id' ,
2097
2150
address : mockAddress1 ,
2098
2151
keyringType : keyringType as KeyringTypes ,
2152
+ options : createMockInternalAccountOptions ( 0 , keyringType , 0 ) ,
2099
2153
} ) ,
2100
2154
] ;
2101
2155
@@ -2206,6 +2260,16 @@ describe('AccountsController', () => {
2206
2260
{ type : KeyringTypes . snap , accounts : [ '0x1234' ] } ,
2207
2261
{ type : KeyringTypes . hd , accounts : [ mockAddress1 ] } ,
2208
2262
] ,
2263
+ keyringsMetadata : [
2264
+ {
2265
+ id : 'mock-keyring-id-1' ,
2266
+ name : 'mock-keyring-id-name' ,
2267
+ } ,
2268
+ {
2269
+ id : 'mock-keyring-id-2' ,
2270
+ name : 'mock-keyring-id-name2' ,
2271
+ } ,
2272
+ ] ,
2209
2273
} ) ,
2210
2274
) ;
2211
2275
0 commit comments