fix compile error on gcc 13: (#4932)

The compilation fails due to an issue in the initializer list
of an optional argument, which holds a vector of pairs.
The code compiles correctly on earlier gcc versions, but fails on gcc 13.
This commit is contained in:
Gregory Tsipenyuk
2024-02-28 09:34:22 -05:00
committed by GitHub
parent e718378bdb
commit 8a2f6bec33

View File

@@ -35,10 +35,10 @@ public:
{
testcase("Errors");
using namespace jtx;
using Oracles = std::vector<std::pair<Account, std::uint32_t>>;
Account const owner{"owner"};
Account const some{"some"};
static std::vector<std::pair<Account, std::uint32_t>> oracles = {
{owner, 1}};
static Oracles oracles = {{owner, 1}};
{
Env env(*this);
@@ -62,7 +62,7 @@ public:
"Missing field 'oracles'.");
// empty oracles array
ret = Oracle::aggregatePrice(env, "XRP", "USD", {{}});
ret = Oracle::aggregatePrice(env, "XRP", "USD", Oracles{});
BEAST_EXPECT(ret[jss::error].asString() == "oracleMalformed");
// invalid oracle document id