feat: Support Simulate (#1891)

fixes #1887
This commit is contained in:
Peter Chen
2025-02-12 10:00:04 -05:00
committed by GitHub
parent e503dffc9a
commit 624f7ff6d5
2 changed files with 17 additions and 0 deletions

View File

@@ -116,6 +116,7 @@ public:
"manifest", "manifest",
"channel_authorize", "channel_authorize",
"channel_verify", "channel_verify",
"simulate",
}; };
return kPROXIED_COMMANDS.contains(method); return kPROXIED_COMMANDS.contains(method);

View File

@@ -105,6 +105,22 @@ generateTestValuesForParametersTest()
.called = 1, .called = 1,
.isAdmin = !isAdmin, .isAdmin = !isAdmin,
.expected = shouldForward}, .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", {.testName = "ShouldForwardReturnsTrueIfCurrentLedgerSpecified",
.apiVersion = 2u, .apiVersion = 2u,
.method = "anymethod", .method = "anymethod",