Write improved forAllApiVersions used in NetworkOPs (#4833)

This commit is contained in:
Bronek Kozicki
2024-03-23 04:28:16 +09:00
committed by GitHub
parent 47c8cc24f4
commit 6edf03c152
26 changed files with 1724 additions and 689 deletions

View File

@@ -1088,10 +1088,7 @@ struct PayChan_test : public beast::unit_test::suite
args[jss::amount] = 51110000;
// test for all api versions
for (auto apiVersion = RPC::apiMinimumSupportedVersion;
apiVersion <= RPC::apiBetaVersion;
++apiVersion)
{
forAllApiVersions([&, this](unsigned apiVersion) {
testcase(
"PayChan Channel_Auth RPC Api " + std::to_string(apiVersion));
args[jss::api_version] = apiVersion;
@@ -1101,7 +1098,7 @@ struct PayChan_test : public beast::unit_test::suite
args.toStyledString())[jss::result];
auto const error = apiVersion < 2u ? "invalidParams" : "badKeyType";
BEAST_EXPECT(rs[jss::error] == error);
}
});
}
void