mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-29 23:37:44 +01:00
test: re-enable CLI test support by using EncodeDecimal in json.dumps()
As mentioned in https://github.com/bitcoin/bitcoin/pull/17675#issuecomment-563188648
This commit is contained in:
@@ -190,6 +190,11 @@ def check_json_precision():
|
||||
if satoshis != 2000000000000003:
|
||||
raise RuntimeError("JSON encode/decode loses precision")
|
||||
|
||||
def EncodeDecimal(o):
|
||||
if isinstance(o, Decimal):
|
||||
return str(o)
|
||||
raise TypeError(repr(o) + " is not JSON serializable")
|
||||
|
||||
def count_bytes(hex_string):
|
||||
return len(bytearray.fromhex(hex_string))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user