Page MenuHomePhabricator

refactor: rpc: Remove unnecessary uses of ParseNonRFCJSONValue() and rename it
ClosedPublic

Authored by Fabien on Wed, Jun 5, 20:54.

Details

Summary
ParseNonRFCJSONValue() is no longer necessary and we can use UniValue::read() directly

[...]

To avoid code duplication, we keep the function to throw on invalid input data but rename it to Parse() and remove it from the header.

The existing test coverage we had on ParseNonRFCJSONValue() is moved over to UniValue::read().

Backport of core#27256.

Test Plan
ninja all check-all

Diff Detail

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

Event Timeline

Fabien requested review of this revision.Wed, Jun 5, 20:54
PiRK requested changes to this revision.Thu, Jun 6, 07:01
PiRK added a subscriber: PiRK.

This is a partial backport. Did you skip the second commit intentionally?

This revision now requires changes to proceed.Thu, Jun 6, 07:01

No, that's a squash mistake, I will update

Fabien retitled this revision from test: move coverage on ParseNonRFCJSONValue() to UniValue::read() to refactor: rpc: Remove unnecessary uses of ParseNonRFCJSONValue() and rename it.
Fabien edited the summary of this revision. (Show Details)
Fabien removed a reviewer: PiRK.

Squash the 2 commits, update the summary

This revision is now accepted and ready to land.Thu, Jun 6, 10:00