test: re-enable CLI test support by using EncodeDecimal in json.dumps()
Summary:
As mentioned in
https://github.com/bitcoin/bitcoin/pull/17675#issuecomment-563188648
This makes more functional tests compatible with option --usecli, by fixing the JSON serialization error for Decimal objects. This was the most common error preventing tests to run with --usecli in D8316.
I found two more tests that are fixed by this change, that were not activated in the original PR: wallet_address_types.py and feature_csv_activation.py
Before:
$ ninja && test/functional/test_runner.py --usecli 2>&1 | cut -f2 -d'|' | grep -E ' (Passed|Skipped|Failed|) *$' | sort | uniq -c 97 ✓ Passed 49 ○ Skipped
After:
$ ninja && test/functional/test_runner.py --usecli 2>&1 | cut -f2 -d'|' | grep -E ' (Passed|Skipped|Failed|) *$' | sort | uniq -c 110 ✓ Passed 36 ○ Skipped
This is a backport of Core PR17705
Depends on D8317
Test Plan: test/functional/test_runner.py --usecli
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D8320