As mentioned in #17675 (comment).
test: re-enable CLI test support by using EncodeDecimal in json.dumps() #17705
pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:test_framework_json_dumps changing 14 files +7 −13-
fanquake commented at 8:17 PM on December 9, 2019: member
-
b6f9e3576a
test: re-enable CLI test support by using EncodeDecimal in json.dumps()
As mentioned in https://github.com/bitcoin/bitcoin/pull/17675#issuecomment-563188648
- fanquake added the label Tests on Dec 9, 2019
-
practicalswift commented at 8:23 PM on December 9, 2019: contributor
Thanks for following up on this!
ACK b6f9e3576a1ea18572e4803aeb3f39330f0cb759 assuming Travis is happy too -- diff looks correct :)
-
in test/functional/test_framework/util.py:196 in b6f9e3576a
189 | @@ -190,6 +190,11 @@ def check_json_precision(): 190 | if satoshis != 2000000000000003: 191 | raise RuntimeError("JSON encode/decode loses precision") 192 | 193 | +def EncodeDecimal(o): 194 | + if isinstance(o, Decimal): 195 | + return str(o) 196 | + raise TypeError(repr(o) + " is not JSON serializable")
MarcoFalke commented at 8:24 PM on December 9, 2019:Any reason why this is duplicated from the identical function in authproxy?
fanquake commented at 8:27 PM on December 9, 2019:There were include issues running tests directly when I moved the authproxy usage into util. I can take another look.
MarcoFalke commented at 8:30 PM on December 9, 2019:ok, you may leave it as is
MarcoFalke approvedMarcoFalke commented at 8:31 PM on December 9, 2019: memberACK b6f9e35 assuming Travis is happy too -- diff looks correct :)
travis doesn't run with
--useclipracticalswift commented at 8:34 PM on December 9, 2019: contributor@MarcoFalke I think it does for
wallet_multiwallet.py,wallet_createwallet.py,wallet_watchonly.pyandrpc_deriveaddresses.py? :)MarcoFalke commented at 8:44 PM on December 9, 2019: member@MarcoFalke I think it does for wallet_multiwallet.py, wallet_createwallet.py, wallet_watchonly.py and rpc_deriveaddresses.py? :)
Yeah, but none of these files are touched in this pull
practicalswift commented at 9:30 PM on December 9, 2019: contributor@MarcoFalke They all use
arg_to_cliwhich is touched by this pull, no? :)fanquake referenced this in commit 3f1966ead6 on Dec 12, 2019fanquake merged this on Dec 12, 2019fanquake closed this on Dec 12, 2019fanquake deleted the branch on Dec 12, 2019sidhujag referenced this in commit 62e261894a on Dec 12, 2019jasonbcox referenced this in commit 47048ca9d3 on Nov 10, 2020sidhujag referenced this in commit c2abcf8957 on Nov 10, 2020DrahtBot locked this on Dec 16, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-16 18:14 UTC
More mirrored repositories can be found on mirror.b10c.me