Fix DynamicBytes.php

Call inputFormat failed when toBn return array of data
See: https://github.com/sc0Vu/web3.php/pull/97
This commit is contained in:
sc0Vu 2019-01-17 00:57:08 +08:00
parent fbf2ba4f97
commit fcb959dec7
No known key found for this signature in database
GPG Key ID: A53323E7065B1FA7

View File

@ -66,7 +66,7 @@ class DynamicBytes extends SolidityType implements IType
// if (mb_strlen($value) % 2 !== 0) {
// throw new InvalidArgumentException('The value to inputFormat has invalid length.');
// }
$bn = Utils::toBn(mb_strlen($value) / 2);
$bn = Utils::toBn(floor(mb_strlen($value) / 2));
$bnHex = $bn->toHex(true);
$padded = mb_substr($bnHex, 0, 1);