From 1dcdc55ca384f213a145c2908493ff94f2d23d8e Mon Sep 17 00:00:00 2001 From: Arul Date: Tue, 5 Jun 2018 17:25:46 +0800 Subject: [PATCH] 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 --- src/Validators/HexValidator.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Validators/HexValidator.php b/src/Validators/HexValidator.php index ade1ae7..f1defa7 100644 --- a/src/Validators/HexValidator.php +++ b/src/Validators/HexValidator.php @@ -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); } -} \ No newline at end of file +}