We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP Fatal error: Uncaught Exception: Graze\GuzzleHttp\JsonRpc\Exception\ClientException: Client RPC error response [uri] / [method] eth_getBlockByNumber [error code] -32602 [error message] invalid argument 0: hex number with leading zero digits
this is my temporary solution that change the DataType/EthBlockParam.php. Can you fix this problem? public function hexVal() { if ($this->isTag()) { return $this->value; } else { $val = intval($this->value->toString()); $val = ($val === 0) ? $val : $this->value->toHex(false); $pattern = "/([0]*)([0-9a-f]+)/i"; $replacement = "$2"; $val = preg_replace($pattern,$replacement,$val); // Unpaded positive Hex value. return $this->ensureHexPrefix($val); } }
The text was updated successfully, but these errors were encountered:
block number: 65537 PHP Fatal error: Uncaught Graze\GuzzleHttp\JsonRpc\Exception\ClientException: Client RPC error response [uri] / [method] eth_getBlockByNumber [error code] -32602 [error message] invalid argument 0: hex number with leading zero digits in /root/vendor/graze/guzzle-jsonrpc/src/Exception/RequestException.php:52
+++ digitaldonkey/ethereum-php/src/DataType/EthBlockParam.php 2022-03-07 21:34:03.341242711 +0800 @@ -105,6 +105,7 @@ } else { $val = intval($this->value->toString()); - $val = ($val === 0) ? $val : $this->value->toHex(false); + $val = ($val === 0) ? $val : ltrim($this->value->toHex(false), 0); // Unpaded positive Hex value. return $this->ensureHexPrefix($val);
Sorry, something went wrong.
same error here
No branches or pull requests
PHP Fatal error: Uncaught Exception: Graze\GuzzleHttp\JsonRpc\Exception\ClientException: Client RPC error response [uri] / [method] eth_getBlockByNumber [error code] -32602 [error message] invalid argument 0: hex number with leading zero digits
this is my temporary solution that change the DataType/EthBlockParam.php. Can you fix this problem?
public function hexVal()
{
if ($this->isTag()) {
return $this->value;
} else {
$val = intval($this->value->toString());
$val = ($val === 0) ? $val : $this->value->toHex(false);
$pattern = "/([0]*)([0-9a-f]+)/i";
$replacement = "$2";
$val = preg_replace($pattern,$replacement,$val);
// Unpaded positive Hex value.
return $this->ensureHexPrefix($val);
}
}
The text was updated successfully, but these errors were encountered: