5454// API is the eth_ prefixed set of APIs in the Web3 JSON-RPC spec.
5555type API interface {
5656 // GetBlockByNumber returns the block identified by number.
57- GetBlockByNumber (ctx context.Context , blockNum ethrpc.BlockNumber , fullTx bool ) (map [string ]interface {} , error )
57+ GetBlockByNumber (ctx context.Context , blockNum ethrpc.BlockNumber , fullTx bool ) (map [string ]any , error )
5858 // GetBlockTransactionCountByNumber returns the number of transactions in the block.
5959 GetBlockTransactionCountByNumber (ctx context.Context , blockNum ethrpc.BlockNumber ) (hexutil.Uint , error )
6060 // GetStorageAt returns the storage value at the provided position.
@@ -82,15 +82,15 @@ type API interface {
8282 // EstimateGas returns an estimate of gas usage for the given transaction.
8383 EstimateGas (ctx context.Context , args utils.TransactionArgs , blockNum * ethrpc.BlockNumber ) (hexutil.Uint64 , error )
8484 // GetBlockByHash returns the block identified by hash.
85- GetBlockByHash (ctx context.Context , blockHash common.Hash , fullTx bool ) (map [string ]interface {} , error )
85+ GetBlockByHash (ctx context.Context , blockHash common.Hash , fullTx bool ) (map [string ]any , error )
8686 // GetTransactionByHash returns the transaction identified by hash.
8787 GetTransactionByHash (ctx context.Context , hash common.Hash ) (* utils.RPCTransaction , error )
8888 // GetTransactionByBlockHashAndIndex returns the transaction for the given block hash and index.
8989 GetTransactionByBlockHashAndIndex (ctx context.Context , blockHash common.Hash , index hexutil.Uint ) (* utils.RPCTransaction , error )
9090 // GetTransactionByBlockNumberAndIndex returns the transaction identified by number and index.
9191 GetTransactionByBlockNumberAndIndex (ctx context.Context , blockNum ethrpc.BlockNumber , index hexutil.Uint ) (* utils.RPCTransaction , error )
9292 // GetTransactionReceipt returns the transaction receipt by hash.
93- GetTransactionReceipt (ctx context.Context , txHash common.Hash ) (map [string ]interface {} , error )
93+ GetTransactionReceipt (ctx context.Context , txHash common.Hash ) (map [string ]any , error )
9494 // GetLogs returns the ethereum logs.
9595 GetLogs (ctx context.Context , filter filters.FilterCriteria ) ([]* ethtypes.Log , error )
9696 // GetBlockHash returns the block hash by the given number.
@@ -105,7 +105,7 @@ type API interface {
105105 Hashrate () hexutil.Uint64
106106 // Syncing returns false in case the node is currently not syncing with the network, otherwise
107107 // returns syncing information.
108- Syncing (ctx context.Context ) (interface {} , error )
108+ Syncing (ctx context.Context ) (any , error )
109109}
110110
111111type publicAPI struct {
@@ -195,7 +195,7 @@ func (api *publicAPI) roundParamFromBlockNum(ctx context.Context, logger *loggin
195195 }
196196}
197197
198- func (api * publicAPI ) GetBlockByNumber (ctx context.Context , blockNum ethrpc.BlockNumber , fullTx bool ) (map [string ]interface {} , error ) {
198+ func (api * publicAPI ) GetBlockByNumber (ctx context.Context , blockNum ethrpc.BlockNumber , fullTx bool ) (map [string ]any , error ) {
199199 logger := api .Logger .With ("method" , "eth_getBlockByNumber" , "block_number" , blockNum , "full_tx" , fullTx )
200200 logger .Debug ("request" )
201201
@@ -542,7 +542,7 @@ func (api *publicAPI) EstimateGas(ctx context.Context, args utils.TransactionArg
542542 return hexutil .Uint64 (gas ), nil
543543}
544544
545- func (api * publicAPI ) GetBlockByHash (ctx context.Context , blockHash common.Hash , fullTx bool ) (map [string ]interface {} , error ) {
545+ func (api * publicAPI ) GetBlockByHash (ctx context.Context , blockHash common.Hash , fullTx bool ) (map [string ]any , error ) {
546546 logger := api .Logger .With ("method" , "eth_getBlockByHash" , "block_hash" , blockHash , "full_tx" , fullTx )
547547 logger .Debug ("request" )
548548
@@ -598,7 +598,7 @@ func (api *publicAPI) GetTransactionByBlockNumberAndIndex(ctx context.Context, b
598598 return api .GetTransactionByBlockHashAndIndex (ctx , blockHash , index )
599599}
600600
601- func (api * publicAPI ) GetTransactionReceipt (ctx context.Context , txHash common.Hash ) (map [string ]interface {} , error ) {
601+ func (api * publicAPI ) GetTransactionReceipt (ctx context.Context , txHash common.Hash ) (map [string ]any , error ) {
602602 logger := api .Logger .With ("method" , "eth_getTransactionReceipt" , "hash" , txHash )
603603 logger .Debug ("request" )
604604
@@ -769,7 +769,7 @@ func (api *publicAPI) Hashrate() hexutil.Uint64 {
769769 return 0
770770}
771771
772- func (api * publicAPI ) Syncing (_ context.Context ) (interface {} , error ) {
772+ func (api * publicAPI ) Syncing (_ context.Context ) (any , error ) {
773773 logger := api .Logger .With ("method" , "eth_syncing" )
774774 logger .Debug ("request" )
775775
0 commit comments