-
-
Notifications
You must be signed in to change notification settings - Fork 172
Open
Description
Example response from Eth: Client RPC error response [uri] / [method] eth_estimateGas [error code] -32602 [error message] invalid argument 0: json: cannot unmarshal hex number with leading zero digits into Go struct field CallArgs.value of type *hexutil.Big
Method EthQ::hexValUnpadded() must return a string without leading zeros. For example, 0.2 ether (200000000000000000 wei) should be converted to 0x2c68af0bb140000 instead of 0x02c68af0bb140000.
Suggesting changes:
--- src/DataType/EthQ.php
+++ src/DataType/EthQ.php
@@ -282,7 +282,7 @@ class EthQ extends EthD
*/
public function hexValUnpadded()
{
- return '0x' . $this->value->toHex($this->value->is_negative);
+ return '0x' . ltrim($this->value->toHex($this->value->is_negative), '0');
}
Metadata
Metadata
Assignees
Labels
No labels