Update ethclient/ethclient.go

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
This commit is contained in:
Felix Lange 2024-10-30 08:28:40 +01:00 committed by GitHub
parent 2b50c7bcfd
commit f17139da36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -637,8 +637,7 @@ func RevertErrorData(err error) ([]byte, bool) {
var ec rpc.Error
var ed rpc.DataError
if errors.As(err, &ec) && errors.As(err, &ed) && ec.ErrorCode() == 3 {
eds, ok := ed.ErrorData().(string)
if ok {
if eds, ok := ed.ErrorData().(string); ok {
revertData, err := hexutil.Decode(eds)
if err == nil {
return revertData, true