File tree 1 file changed +42
-0
lines changed
1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,48 @@ describe('migration #126', () => {
134
134
} ) ;
135
135
} ) ;
136
136
137
+ it ( 'uses the network from network configurations if set' , async ( ) => {
138
+ const oldStorage = getMockState ( NETWORK_TYPES . SEPOLIA , {
139
+ [ NETWORK_TYPES . SEPOLIA ] : {
140
+ chainId : CHAIN_IDS . LINEA_SEPOLIA ,
141
+ } ,
142
+ } ) ;
143
+
144
+ const newStorage = await migrate ( oldStorage ) ;
145
+ expect ( newStorage . data . PermissionController ) . toStrictEqual ( {
146
+ subjects : {
147
+ [ MOCK_SNAP_ID ] : {
148
+ permissions : {
149
+ [ SnapEndowments . EthereumProvider ] : {
150
+ caveats : [ ] ,
151
+ date : 1664187844588 ,
152
+ id : 'izn0WGUO8cvq_jqvLQuQP' ,
153
+ invoker : MOCK_ORIGIN ,
154
+ parentCapability : SnapEndowments . EthereumProvider ,
155
+ } ,
156
+ [ PermissionNames . permittedChains ] : {
157
+ caveats : [
158
+ CaveatFactories [ CaveatTypes . restrictNetworkSwitching ] (
159
+ [ CHAIN_IDS . LINEA_SEPOLIA ] ,
160
+ )
161
+ ] ,
162
+ date : 1723635247705 ,
163
+ id : expect . any ( String ) ,
164
+ invoker : MOCK_SNAP_ID ,
165
+ parentCapability : PermissionNames . permittedChains ,
166
+ }
167
+ } ,
168
+ } ,
169
+ }
170
+ } ) ;
171
+
172
+ expect ( newStorage . data . SelectedNetworkController ) . toStrictEqual ( {
173
+ domains : {
174
+ [ MOCK_SNAP_ID ] : NETWORK_TYPES . SEPOLIA
175
+ }
176
+ } ) ;
177
+ } ) ;
178
+
137
179
// @ts -expect-error - Property `each` does not exist on type `TestFunction`.
138
180
it . each ( [
139
181
{ } ,
You can’t perform that action at this time.
0 commit comments