mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 08:46:46 +00:00
chore: Fix tests for clang-tidy bugprone-unchecked-optional-access check (#6502)
This commit is contained in:
@@ -41,7 +41,7 @@ class Simulate_test : public beast::unit_test::suite
|
||||
else
|
||||
{
|
||||
auto const unHexed = strUnHex(result[jss::tx_blob].asString());
|
||||
SerialIter sitTrans(makeSlice(*unHexed));
|
||||
SerialIter sitTrans(makeSlice(*unHexed)); // NOLINT(bugprone-unchecked-optional-access)
|
||||
tx_json = STObject(std::ref(sitTrans), sfGeneric).getJson(JsonOptions::none);
|
||||
}
|
||||
BEAST_EXPECT(tx_json[jss::TransactionType] == tx[jss::TransactionType]);
|
||||
@@ -87,6 +87,7 @@ class Simulate_test : public beast::unit_test::suite
|
||||
// It is technically not a valid STObject, so the following line
|
||||
// will crash
|
||||
STParsedJSONObject const parsed(std::string(jss::tx_json), tx);
|
||||
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
|
||||
auto const tx_blob = strHex(parsed.object->getSerializer().peekData());
|
||||
if (BEAST_EXPECT(parsed.object.has_value()))
|
||||
{
|
||||
@@ -136,7 +137,7 @@ class Simulate_test : public beast::unit_test::suite
|
||||
if (txResult.isMember(jss::meta_blob))
|
||||
{
|
||||
auto unHexed = strUnHex(txResult[jss::meta_blob].asString());
|
||||
SerialIter sitTrans(makeSlice(*unHexed));
|
||||
SerialIter sitTrans(makeSlice(*unHexed)); // NOLINT(bugprone-unchecked-optional-access)
|
||||
return STObject(std::ref(sitTrans), sfGeneric).getJson(JsonOptions::none);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user