Skip to content

Commit

Permalink
add fault tolerance when failed to get revert message (#1846)
Browse files Browse the repository at this point in the history
  • Loading branch information
tclemos committed Mar 17, 2023
1 parent c1f8793 commit 13dc968
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/operations/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,13 @@ func RevertReason(ctx context.Context, c ethClienter, tx *types.Transaction, blo
return "", err
}

return abi.UnpackRevert(hex)
unpackedMsg, err := abi.UnpackRevert(hex)
if err != nil {
log.Warnf("failed to get the revert message for tx %v: %v", tx.Hash(), err)
return "", errors.New("execution reverted")
}

return unpackedMsg, nil
}

// WaitGRPCHealthy waits for a gRPC endpoint to be responding according to the
Expand Down

0 comments on commit 13dc968

Please sign in to comment.