Page MenuHomePhabricator

RPC: Remove final comma for last entry of fixed-size Arrays and Objects in RPCResult
ClosedPublic

Authored by PiRK on Wed, Jan 13, 09:31.

Details

Summary

JSON doesn't allow a trailing comma in Arrays/Objects

This is a backport of Core PR18444

Test Plan

Look at the help message for a command that return a JSON object, and verify that the last item in the output example does not have a trailing comma

src/bitcoin-cli help getblockstats

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

PiRK requested review of this revision.Wed, Jan 13, 09:31
Fabien requested changes to this revision.Wed, Jan 13, 10:58
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/rpc/util.cpp
655 ↗(On Diff #26898)

??? did you hit that mouse wheel button unexpectedly ?

This revision now requires changes to proceed.Wed, Jan 13, 10:58
src/rpc/util.cpp
655 ↗(On Diff #26898)

Git was completely unable to to locate the changed text and put the conflict in a random place. I must have missed a line when I deleted the conflict

remove accidental copy past or conflict left-over

This revision is now accepted and ready to land.Wed, Jan 13, 11:34