common/hexutil: return err

This commit is contained in:
kane 2018-12-13 03:49:09 -05:00
parent 4e6f53ac33
commit a0eb89f0d5

View file

@ -99,8 +99,8 @@ func UnmarshalFixedText(typname string, input, out []byte) error {
return ErrSyntax
}
}
hex.Decode(out, raw)
return nil
_, err = hex.Decode(out, raw)
return err
}
// UnmarshalFixedUnprefixedText decodes the input as a string with optional 0x prefix. The
@ -120,8 +120,8 @@ func UnmarshalFixedUnprefixedText(typname string, input, out []byte) error {
return ErrSyntax
}
}
hex.Decode(out, raw)
return nil
_, err = hex.Decode(out, raw)
return err
}
// Big marshals/unmarshals as a JSON string with 0x prefix.