Page MenuHomePhabricator

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

Authored by Fabien on Jun 5 2024, 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

Event Timeline

Fabien requested review of this revision.Jun 5 2024, 20:54
PiRK requested changes to this revision.Jun 6 2024, 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.Jun 6 2024, 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.Jun 6 2024, 10:00