Skip to content

Commit

Permalink
feat: Support Simulate (#1891)
Browse files Browse the repository at this point in the history
fixes #1887
  • Loading branch information
PeterChen13579 authored Feb 12, 2025
1 parent e503dff commit 624f7ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rpc/common/impl/ForwardingProxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class ForwardingProxy {
"manifest",
"channel_authorize",
"channel_verify",
"simulate",
};

return kPROXIED_COMMANDS.contains(method);
Expand Down
16 changes: 16 additions & 0 deletions tests/unit/rpc/ForwardingProxyTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 624f7ff

Please sign in to comment.