2022-11-03 04:32:15 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-01-27 04:34:04 +00:00
|
|
|
"github.com/ledgerwatch/erigon-lib/common"
|
2023-01-13 18:12:18 +00:00
|
|
|
|
2022-11-03 04:32:15 +00:00
|
|
|
"github.com/ledgerwatch/erigon/common/hexutil"
|
|
|
|
)
|
|
|
|
|
2023-01-27 04:34:04 +00:00
|
|
|
func (api *OtterscanAPIImpl) GetTransactionError(ctx context.Context, hash common.Hash) (hexutil.Bytes, error) {
|
2022-11-03 04:32:15 +00: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
|
|
|
|
}
|