@@ -58,7 +58,7 @@ type API interface {
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.
61- GetStorageAt (ctx context.Context , address common.Address , position hexutil.Big , blockNrOrHash ethrpc.BlockNumberOrHash ) (hexutil.Big , error )
61+ GetStorageAt (ctx context.Context , address common.Address , position hexutil.Big , blockNrOrHash ethrpc.BlockNumberOrHash ) (hexutil.Bytes , error )
6262 // GetBalance returns the provided account's balance up to the provided block number.
6363 GetBalance (ctx context.Context , address common.Address , blockNrOrHash ethrpc.BlockNumberOrHash ) (* hexutil.Big , error )
6464 // ChainId return the EIP-155 chain id for the current network.
@@ -232,13 +232,13 @@ func (api *publicAPI) GetBlockTransactionCountByNumber(ctx context.Context, bloc
232232 return hexutil .Uint (n ), nil
233233}
234234
235- func (api * publicAPI ) GetStorageAt (ctx context.Context , address common.Address , position hexutil.Big , blockNrOrHash ethrpc.BlockNumberOrHash ) (hexutil.Big , error ) {
235+ func (api * publicAPI ) GetStorageAt (ctx context.Context , address common.Address , position hexutil.Big , blockNrOrHash ethrpc.BlockNumberOrHash ) (hexutil.Bytes , error ) {
236236 logger := api .Logger .With ("method" , "eth_getStorageAt" , "address" , address , "position" , position , "block_or_hash" , blockNrOrHash )
237237 logger .Debug ("request" )
238238
239239 round , err := api .getBlockRound (ctx , logger , blockNrOrHash )
240240 if err != nil {
241- return hexutil.Big {}, err
241+ return hexutil.Bytes {}, err
242242 }
243243 if api .shouldQueryArchive (round ) {
244244 return api .archiveClient .GetStorageAt (ctx , address , position , round )
@@ -253,12 +253,9 @@ func (api *publicAPI) GetStorageAt(ctx context.Context, address common.Address,
253253 res , err := ethmod .Storage (ctx , round , address [:], position256 )
254254 if err != nil {
255255 logger .Error ("failed to query storage" , "err" , err )
256- return hexutil. Big {} , ErrInternalError
256+ return nil , ErrInternalError
257257 }
258- // Some apps expect no leading zeros, so output as big integer.
259- var resultBI big.Int
260- resultBI .SetBytes (res )
261- return hexutil .Big (resultBI ), nil
258+ return res [:], nil
262259}
263260
264261func (api * publicAPI ) GetBalance (ctx context.Context , address common.Address , blockNrOrHash ethrpc.BlockNumberOrHash ) (* hexutil.Big , error ) {
0 commit comments