core
core copied to clipboard
Replace use of `any` with types for `query` from `controller-utils`
The query function in controller-utils uses any for its arguments as well as its return type. This means that any will infect other functions that use query
query is used in the following places throughout core:
assets-controllersAccountTrackerController.getBalanceFromChainAccountTrackerController.syncBalancesWithAddresses
user-operation-controllergetSuggestedGasFeesPendingUserOperationTracker#onUserOperationConfirmedBundler.estimateUserOperations
gas-fee-controllerfetchEthGasPriceEstimatefetchLatestBlockfetchBlockFeeHistory
transaction-controllerupdatePostTransactionBalancegetSuggestedGasFeesTransactionController.approveTransactionTransactionController.publishTransactionestimateGasgetCodegetLatestBlockreadAddressAsContractPendingTransactionTracker#getTransactionReceiptPendingTransactionTracker#getBlockByHashPendingTransactionTracker#getNetworkTransactionCount
Changing the type of the arguments that query takes or its return type may affect all of these packages, or any other packages downstream.
The attached PR (#3912) records an initial approach discussed by the team during refinement.
The ticket is available for anyone to take over and build on top of (or discard) the PR.