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:
Arul 2018-06-05 17:25:46 +08:00 committed by GitHub
parent be7403a00b
commit 1dcdc55ca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,9 +23,6 @@ class HexValidator
*/
public static function validate($value)
{
if (!is_string($value)) {
return false;
}
return (preg_match('/^0x[a-fA-F0-9]*$/', $value) >= 1);
return is_string($value) && ctype_xdigit($value);
}
}
}