core icon indicating copy to clipboard operation
core copied to clipboard

Replace use of `any` with types for `query` from `controller-utils`

Open mcmire opened this issue 1 year ago • 1 comments

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-controllers
    • AccountTrackerController.getBalanceFromChain
    • AccountTrackerController.syncBalancesWithAddresses
  • user-operation-controller
    • getSuggestedGasFees
    • PendingUserOperationTracker#onUserOperationConfirmed
    • Bundler.estimateUserOperations
  • gas-fee-controller
    • fetchEthGasPriceEstimate
    • fetchLatestBlock
    • fetchBlockFeeHistory
  • transaction-controller
    • updatePostTransactionBalance
    • getSuggestedGasFees
    • TransactionController.approveTransaction
    • TransactionController.publishTransaction
    • estimateGas
    • getCode
    • getLatestBlock
    • readAddressAsContract
    • PendingTransactionTracker#getTransactionReceipt
    • PendingTransactionTracker#getBlockByHash
    • PendingTransactionTracker#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.

mcmire avatar Feb 15 '24 17:02 mcmire

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.

MajorLift avatar Feb 28 '24 02:02 MajorLift