Page MenuHomePhabricator

Merge #11027: [RPC] Only return hex field once in getrawtransaction
ClosedPublic

Authored by jasonbcox on Mar 19 2019, 17:08.

Details

Summary

6bbdafc Pass serialization flags and whether to include hex to TxToUniv (Andrew Chow)
e029c6e Only return hex field once in getrawtransaction (Andrew Chow)

Pull request description:

The hex is already returned in `TxToUniv()`, no need to give it out a second time in getrawtransaction itself.

Tree-SHA512: 270289f2d6dea37f51f5a42db3dae5debdbe83c6b504fccfd3391588da986ed474592c6655d522dc51022d4b08fa90ed1ebb249afe036309f95adfe3652cb262

Backport of Core PR 11027
https://github.com/bitcoin/bitcoin/pull/11027
Completes T564

Test Plan

ninja check
test_runner.py

Run bitcoin-cli <txid> 1 and ensure that there is a single top-level "hex" field in the returned JSON.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Note to reviewers:
If you try to reproduce the described problem, you will not be able to do so.
This is because this fixes is against an older version of univalue. Our current version will prevent inserting the same key twice, thus masking the duplicated entry.
You can find the library update commit and the diff between the versions here search for pushKV in univalue.cpp.

Note 2 : even if there is no issue to fix, this diff impacts the output by moving the "hex" field from the beginning to the near end of the JSON. This should have no impact if proper JSON decoding is used.

Fabien edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Mar 20 2019, 12:25