From aace43724515b19d0ee1db086424a96e4572f8e9 Mon Sep 17 00:00:00 2001 From: cyan317 <120398799+cindyyan317@users.noreply.github.com> Date: Wed, 17 May 2023 19:02:55 +0100 Subject: [PATCH] Add the missing input check for "diff" field of "ledger" (#643) Fixes #644 --- src/rpc/handlers/Ledger.h | 1 + unittests/rpc/handlers/LedgerTest.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/rpc/handlers/Ledger.h b/src/rpc/handlers/Ledger.h index 0936eda0..273a8d99 100644 --- a/src/rpc/handlers/Ledger.h +++ b/src/rpc/handlers/Ledger.h @@ -77,6 +77,7 @@ public: {JS(transactions), validation::Type{}}, {JS(expand), validation::Type{}}, {JS(binary), validation::Type{}}, + {"diff", validation::Type{}}, }; return rpcSpec; diff --git a/unittests/rpc/handlers/LedgerTest.cpp b/unittests/rpc/handlers/LedgerTest.cpp index 5b2a3f47..d7d68104 100644 --- a/unittests/rpc/handlers/LedgerTest.cpp +++ b/unittests/rpc/handlers/LedgerTest.cpp @@ -152,6 +152,12 @@ generateTestValuesForParametersTest() "invalidParams", "Invalid parameters.", }, + { + "DiffNotBool", + R"({"diff": "x"})", + "invalidParams", + "Invalid parameters.", + }, }; }