Fixing HexValidator
> Fatal error: Uncaught InvalidArgumentException: Please make sure bytecode is valid. I was getting the above error when I was trying to deploy my contract. Even though my bytecode is valid, it was failing the test I fixed the code to use `ctype_xdigit` instead of regular express test
This commit is contained in:
parent
be7403a00b
commit
1dcdc55ca3
@ -23,9 +23,6 @@ class HexValidator
|
|||||||
*/
|
*/
|
||||||
public static function validate($value)
|
public static function validate($value)
|
||||||
{
|
{
|
||||||
if (!is_string($value)) {
|
return is_string($value) && ctype_xdigit($value);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return (preg_match('/^0x[a-fA-F0-9]*$/', $value) >= 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user