aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2024-01-18 18:03:18 -0500
committerluigi1111 <luigi1111w@gmail.com>2024-01-18 18:03:18 -0500
commite9a4deef81830a87e42778af90642faabef1cedb (patch)
treee44517ff321119ba379e92d99fa90aba7f9807e8 /tests/unit_tests
parentMerge pull request #9077 (diff)
parentFix missing checks for IsObject in ZMQ jsonrpc reading (diff)
downloadmonero-e9a4deef81830a87e42778af90642faabef1cedb.tar.xz
Merge pull request #9079
eed975d Fix missing checks for IsObject in ZMQ jsonrpc reading (Lee Clagett)
Diffstat (limited to 'tests/unit_tests')
-rw-r--r--tests/unit_tests/json_serialization.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit_tests/json_serialization.cpp b/tests/unit_tests/json_serialization.cpp
index 9fa589139..aa46b68dc 100644
--- a/tests/unit_tests/json_serialization.cpp
+++ b/tests/unit_tests/json_serialization.cpp
@@ -13,6 +13,7 @@
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "cryptonote_core/cryptonote_tx_utils.h"
#include "serialization/json_object.h"
+#include "rpc/daemon_messages.h"
namespace test
@@ -240,3 +241,9 @@ TEST(JsonSerialization, BulletproofTransaction)
EXPECT_EQ(tx_bytes, tx_copy_bytes);
}
+TEST(JsonRpcSerialization, HandlerFromJson)
+{
+ cryptonote::rpc::FullMessage req_full("{\"jsonrpc\":\"2.0\",\"method\":\"get_hashes_fast\",\"params\":[1]}", true);
+ cryptonote::rpc::GetHashesFast::Request request{};
+ EXPECT_THROW(request.fromJson(req_full.getMessage()), cryptonote::json::WRONG_TYPE);
+}