Skip to content

i have a error when i use ethereum-php-eventlistener  #63

@hardyzp

Description

@hardyzp

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);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions