From f5dfa8cc3558058ef55bb2ff61b9f132197f5daf Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Mon, 16 Dec 2024 01:39:52 -0300 Subject: [PATCH] Revert "debug" This reverts commit 610cf5ec343011ec8693ed089d1ce3fd1306f409. --- turbo/jsonrpc/otterscan_api.go | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/turbo/jsonrpc/otterscan_api.go b/turbo/jsonrpc/otterscan_api.go index 76072b3dd78..161a8d1388e 100644 --- a/turbo/jsonrpc/otterscan_api.go +++ b/turbo/jsonrpc/otterscan_api.go @@ -67,9 +67,6 @@ type OtterscanAPI interface { GetTransactionError(ctx context.Context, hash common.Hash) (hexutility.Bytes, error) GetTransactionBySenderAndNonce(ctx context.Context, addr common.Address, nonce uint64) (*common.Hash, error) GetContractCreator(ctx context.Context, addr common.Address) (*ContractCreatorData, error) - - // TODO: remove test - TxNum2Block(ctx context.Context, txNum uint64) (uint64, error) } type OtterscanAPIImpl struct { @@ -86,24 +83,6 @@ func NewOtterscanAPI(base *BaseAPI, db kv.TemporalRoDB, maxPageSize uint64) *Ott } } -func (api *OtterscanAPIImpl) TxNum2Block(ctx context.Context, txNum uint64) (uint64, error) { - tx, err := api.db.BeginTemporalRo(ctx) - if err != nil { - return 0, err - } - defer tx.Rollback() - - ok, blockNum, err := rawdbv3.TxNums.FindBlockNum(tx, txNum) - if !ok { - return 0, nil - } - if err != nil { - return 0, err - } - - return blockNum, nil -} - func (api *OtterscanAPIImpl) GetApiLevel() uint8 { return API_LEVEL }