internal/ethapi: add 0x prefix for the revert bytes

This commit is contained in:
islishude 2024-03-24 13:00:19 +08:00
parent 0f7056fc56
commit cbb1fab481

View file

@ -50,7 +50,7 @@ func newRevertError(revert []byte) *revertError {
if errUnpack == nil {
err = fmt.Errorf("%w: %v", vm.ErrExecutionReverted, reason)
} else if len(revert) >= 4 {
err = fmt.Errorf("execution reverted with a custom error: %x", revert)
err = fmt.Errorf("execution reverted with a custom error: %#x", revert)
}
return &revertError{
error: err,