internal/ethapi: fix Call handle revert error

This commit is contained in:
JukLee0ira 2024-12-23 17:55:41 +08:00 committed by Daniel Liu
parent 48d1f22fde
commit 517f4a16a6

View file

@ -1448,7 +1448,7 @@ func (s *PublicBlockChainAPI) Call(ctx context.Context, args TransactionArgs, bl
return nil, err
}
// If the result contains a revert reason, try to unpack and return it.
if result.Failed() && len(result.Return()) > 0 {
if result.Failed() {
return nil, newRevertError(result.Return())
}
return result.Return(), nil