File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ describe('GasFeeController', () => {
199199 legacyAPIEndpoint = 'http://legacy.endpoint/<chain_id>' ,
200200 EIP1559APIEndpoint = 'http://eip-1559.endpoint/<chain_id>' ,
201201 clientId,
202+ getChainId,
202203 } : {
203204 getChainId ?: jest . Mock < `0x${string } ` | `${number } ` | number > ;
204205 getIsEIP1559Compatible ?: jest . Mock < Promise < boolean > > ;
@@ -211,6 +212,8 @@ describe('GasFeeController', () => {
211212 setupNetworkController ( controllerMessenger ) ;
212213 const messenger = getRestrictedMessenger ( controllerMessenger ) ;
213214 gasFeeController = new GasFeeController ( {
215+ getProvider : jest . fn ( ) ,
216+ getChainId,
214217 messenger,
215218 getCurrentNetworkLegacyGasAPICompatibility,
216219 getCurrentNetworkEIP1559Compatibility : getIsEIP1559Compatible , // change this for networkController.state.properties.isEIP1559Compatible ???
Original file line number Diff line number Diff line change @@ -304,7 +304,7 @@ export class GasFeeController extends BaseController<
304304 getCurrentNetworkLegacyGasAPICompatibility : ( ) => boolean ;
305305 getCurrentAccountEIP1559Compatibility ?: ( ) => boolean ;
306306 getChainId ?: ( ) => `0x${string } ` | `${number } ` | number ;
307- getProvider ? : ( ) => NetworkController [ 'provider' ] ;
307+ getProvider : ( ) => NetworkController [ 'provider' ] ;
308308 onNetworkStateChange ?: ( listener : ( state : NetworkState ) => void ) => void ;
309309 legacyAPIEndpoint ?: string ;
310310 EIP1559APIEndpoint ?: string ;
@@ -329,7 +329,9 @@ export class GasFeeController extends BaseController<
329329 this . EIP1559APIEndpoint = EIP1559APIEndpoint ;
330330 this . legacyAPIEndpoint = legacyAPIEndpoint ;
331331 this . clientId = clientId ;
332- if ( onNetworkStateChange && getChainId && getProvider ) {
332+ if ( onNetworkStateChange && getChainId ) {
333+ const initialProvider = getProvider ( ) ;
334+ this . ethQuery = new EthQuery ( initialProvider ) ;
333335 this . currentChainId = getChainId ( ) ;
334336 onNetworkStateChange ( async ( ) => {
335337 const newProvider = getProvider ( ) ;
You can’t perform that action at this time.
0 commit comments