2023-07-08 19:01:26 +02:00
|
|
|
package jsonrpc
|
2022-11-03 01:32:15 -03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-01-27 11:34:04 +07:00
|
|
|
"github.com/ledgerwatch/erigon-lib/common"
|
2023-04-13 13:19:02 +02:00
|
|
|
"github.com/ledgerwatch/erigon-lib/common/hexutility"
|
2022-11-03 01:32:15 -03:00
|
|
|
)
|
|
|
|
|
2023-04-13 13:19:02 +02:00
|
|
|
func (api *OtterscanAPIImpl) GetTransactionError(ctx context.Context, hash common.Hash) (hexutility.Bytes, error) {
|
2022-11-03 01:32:15 -03:00
|
|
|
tx, err := api.db.BeginRo(ctx)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
defer tx.Rollback()
|
|
|
|
|
|
|
|
result, err := api.runTracer(ctx, tx, hash, nil)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return result.Revert(), nil
|
|
|
|
}
|