mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
chore: fix warnings
This commit is contained in:
@@ -224,7 +224,8 @@ public:
|
|||||||
|
|
||||||
if (!ledger->info().accountHash.isNonZero())
|
if (!ledger->info().accountHash.isNonZero())
|
||||||
{
|
{
|
||||||
JLOG(j.fatal()) << "AH is zero: " << getJson({*ledger, {}});
|
JLOG(j.fatal())
|
||||||
|
<< "AH is zero: " << getJson({*ledger, {}}).asString();
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -239,8 +239,7 @@ verifyHandshake(
|
|||||||
throw std::runtime_error("Invalid server domain");
|
throw std::runtime_error("Invalid server domain");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the network. Omitting Network-ID (on either side ours, or theirs)
|
if (auto const iter = headers.find("Network-ID"); iter != headers.end())
|
||||||
// means NID=0
|
|
||||||
{
|
{
|
||||||
uint32_t peer_nid = 0;
|
uint32_t peer_nid = 0;
|
||||||
if (auto const iter = headers.find("Network-ID"); iter != headers.end())
|
if (auto const iter = headers.find("Network-ID"); iter != headers.end())
|
||||||
@@ -250,8 +249,10 @@ verifyHandshake(
|
|||||||
throw std::runtime_error("Invalid peer network identifier");
|
throw std::runtime_error("Invalid peer network identifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t our_nid = networkID ? *networkID : 0;
|
if (!beast::lexicalCastChecked(peer_nid, std::string(iter->value())))
|
||||||
if (peer_nid != our_nid)
|
throw std::runtime_error("Invalid peer network identifier");
|
||||||
|
|
||||||
|
if (networkID && peer_nid != *networkID)
|
||||||
throw std::runtime_error("Peer is on a different network");
|
throw std::runtime_error("Peer is on a different network");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -226,13 +226,15 @@ public:
|
|||||||
// SOCI requires boost::optional (not std::optional) as
|
// SOCI requires boost::optional (not std::optional) as
|
||||||
// parameters.
|
// parameters.
|
||||||
boost::optional<std::int32_t> ig;
|
boost::optional<std::int32_t> ig;
|
||||||
boost::optional<std::uint32_t> uig;
|
// Known bug: https://github.com/SOCI/soci/issues/926
|
||||||
|
// boost::optional<std::uint32_t> uig;
|
||||||
|
uint32_t uig = 0;
|
||||||
boost::optional<std::int64_t> big;
|
boost::optional<std::int64_t> big;
|
||||||
boost::optional<std::uint64_t> ubig;
|
boost::optional<std::uint64_t> ubig;
|
||||||
s << "SELECT I, UI, BI, UBI from STT;", soci::into(ig),
|
s << "SELECT I, UI, BI, UBI from STT;", soci::into(ig),
|
||||||
soci::into(uig), soci::into(big), soci::into(ubig);
|
soci::into(uig), soci::into(big), soci::into(ubig);
|
||||||
BEAST_EXPECT(
|
BEAST_EXPECT(
|
||||||
*ig == id[0] && *uig == uid[0] && *big == bid[0] &&
|
*ig == id[0] && uig == uid[0] && *big == bid[0] &&
|
||||||
*ubig == ubid[0]);
|
*ubig == ubid[0]);
|
||||||
}
|
}
|
||||||
catch (std::exception&)
|
catch (std::exception&)
|
||||||
@@ -357,18 +359,13 @@ public:
|
|||||||
bfs::remove(dbPath);
|
bfs::remove(dbPath);
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
testSQLite()
|
run() override
|
||||||
{
|
{
|
||||||
testSQLiteFileNames();
|
testSQLiteFileNames();
|
||||||
testSQLiteSession();
|
testSQLiteSession();
|
||||||
testSQLiteSelect();
|
testSQLiteSelect();
|
||||||
testSQLiteDeleteWithSubselect();
|
testSQLiteDeleteWithSubselect();
|
||||||
}
|
}
|
||||||
void
|
|
||||||
run() override
|
|
||||||
{
|
|
||||||
testSQLite();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
BEAST_DEFINE_TESTSUITE(SociDB, core, ripple);
|
BEAST_DEFINE_TESTSUITE(SociDB, core, ripple);
|
||||||
|
|||||||
Reference in New Issue
Block a user