From 624f7ff6d566905e4345aa60e11d14f53443640c Mon Sep 17 00:00:00 2001 From: Peter Chen <34582813+PeterChen13579@users.noreply.github.com> Date: Wed, 12 Feb 2025 10:00:04 -0500 Subject: [PATCH] feat: Support Simulate (#1891) fixes #1887 --- src/rpc/common/impl/ForwardingProxy.hpp | 1 + tests/unit/rpc/ForwardingProxyTests.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/rpc/common/impl/ForwardingProxy.hpp b/src/rpc/common/impl/ForwardingProxy.hpp index e4e2b32e..c60773df 100644 --- a/src/rpc/common/impl/ForwardingProxy.hpp +++ b/src/rpc/common/impl/ForwardingProxy.hpp @@ -116,6 +116,7 @@ public: "manifest", "channel_authorize", "channel_verify", + "simulate", }; return kPROXIED_COMMANDS.contains(method); diff --git a/tests/unit/rpc/ForwardingProxyTests.cpp b/tests/unit/rpc/ForwardingProxyTests.cpp index aadce3c7..5626f926 100644 --- a/tests/unit/rpc/ForwardingProxyTests.cpp +++ b/tests/unit/rpc/ForwardingProxyTests.cpp @@ -105,6 +105,22 @@ generateTestValuesForParametersTest() .called = 1, .isAdmin = !isAdmin, .expected = shouldForward}, + {.testName = "ShouldForwardReturnsTrueSimulate", + .apiVersion = 1u, + .method = "simulate", + .testJson = "{}", + .mockedIsClioOnly = !isClioOnly, + .called = 1, + .isAdmin = isAdmin, + .expected = shouldForward}, + {.testName = "ShouldForwardReturnsTrueRipplePathFind", + .apiVersion = 2u, + .method = "ripple_path_find", + .testJson = R"({"force_forward": true})", + .mockedIsClioOnly = !isClioOnly, + .called = 1, + .isAdmin = isAdmin, + .expected = shouldForward}, {.testName = "ShouldForwardReturnsTrueIfCurrentLedgerSpecified", .apiVersion = 2u, .method = "anymethod",