Merge pull request #53 from sei-protocol/tony/pass-whether-last-success

revert if prev traced tx failed
This commit is contained in:
codchen 2025-05-29 21:55:54 +08:00 committed by GitHub
commit 5a06321a8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -643,6 +643,7 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, metadata []t
res, err := api.traceTx(ctx, tx, msg, txctx, blockCtx, statedb, config) res, err := api.traceTx(ctx, tx, msg, txctx, blockCtx, statedb, config)
if err != nil { if err != nil {
results[i] = &TxTraceResult{TxHash: tx.Hash(), Error: err.Error()} results[i] = &TxTraceResult{TxHash: tx.Hash(), Error: err.Error()}
statedb.RevertToSnapshot(0)
} else { } else {
results[i] = &TxTraceResult{TxHash: tx.Hash(), Result: res} results[i] = &TxTraceResult{TxHash: tx.Hash(), Result: res}
} }