For RPCResults, the type may be ELISION, which is confusing and brittle:
- The elision should only affect the help output, not the type.
- The type should be the real type, so that type checks can be run on it.
Fix this issue by introducing a new print_elision option and using it in decodepsbt.
This change will ensure that RPCResult::MatchesType is properly run.
Can be tested by introducing a bug:
0diff --git a/src/core_io.cpp b/src/core_io.cpp
1index 7492e9ca50..4927b70c8e 100644
2--- a/src/core_io.cpp
3+++ b/src/core_io.cpp
4@@ -436,2 +436,3 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry
5 entry.pushKV("version", tx.version);
6+ entry.pushKV("bug", "error!");
7 entry.pushKV("size", tx.ComputeTotalSize());
And then running (in a debug build) decodepsbt cHNidP8BAAoCAAAAAAAAAAAAAA==
Before, on master: passes Now, on this pull: Properly detects the bug