Skip to content

Commit

Permalink
Revert "debug"
Browse files Browse the repository at this point in the history
This reverts commit 610cf5e.
  • Loading branch information
wmitsuda committed Dec 16, 2024
1 parent 610cf5e commit f5dfa8c
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions turbo/jsonrpc/otterscan_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
Expand Down

0 comments on commit f5dfa8c

Please sign in to comment.