@@ -57,9 +57,9 @@ namespace data::cassandra {
5757/* *
5858 * @brief Implements @ref CassandraBackendFamily for Keyspace
5959 *
60- * @tparam SettingsProviderType The settings provider type to use
61- * @tparam ExecutionStrategyType The execution strategy type to use
62- * @tparam FetchLedgerCacheType The ledger header cache type to use
60+ * @tparam SettingsProviderType The settings provider type
61+ * @tparam ExecutionStrategyType The execution strategy type
62+ * @tparam FetchLedgerCacheType The ledger header cache type
6363 */
6464template <
6565 SomeSettingsProvider SettingsProviderType,
@@ -101,9 +101,9 @@ class BasicKeyspaceBackend : public CassandraBackendFamily<
101101 // !range_.has_value() means the table 'ledger_range' is not populated;
102102 // This would be the first write to the table.
103103 // In this case, insert both min_sequence/max_sequence range into the table.
104- if (not ( range_.has_value () )) {
105- executor_.writeSync (schema_->insertLedgerRange , false , ledgerSequence_);
106- executor_.writeSync (schema_->insertLedgerRange , true , ledgerSequence_);
104+ if (not range_.has_value ()) {
105+ executor_.writeSync (schema_->insertLedgerRange , /* isLatestLedger = */ false , ledgerSequence_);
106+ executor_.writeSync (schema_->insertLedgerRange , /* isLatestLedger = */ true , ledgerSequence_);
107107 }
108108
109109 if (not this ->executeSyncUpdate (schema_->updateLedgerRange .bind (ledgerSequence_, true , ledgerSequence_ - 1 ))) {
@@ -130,7 +130,7 @@ class BasicKeyspaceBackend : public CassandraBackendFamily<
130130 // Keyspace and ScyllaDB uses the same logic for taxon-filtered queries
131131 nftIDs = fetchNFTIDsByTaxon (issuer, *taxon, limit, cursorIn, yield);
132132 } else {
133- // --- Amazon Keyspaces Workflow for non-taxon queries ---
133+ // Amazon Keyspaces Workflow for non-taxon queries
134134 auto const startTaxon = cursorIn.has_value () ? ripple::nft::toUInt32 (ripple::nft::getTaxon (*cursorIn)) : 0 ;
135135 auto const startTokenID = cursorIn.value_or (ripple::uint256 (0 ));
136136
@@ -140,8 +140,8 @@ class BasicKeyspaceBackend : public CassandraBackendFamily<
140140 firstQuery.bindAt (3 , Limit{limit});
141141
142142 auto const firstRes = executor_.read (yield, firstQuery);
143- if (firstRes) {
144- for (auto const [nftID] : extract<ripple::uint256>(firstRes. value () ))
143+ if (firstRes. has_value () ) {
144+ for (auto const [nftID] : extract<ripple::uint256>(* firstRes))
145145 nftIDs.push_back (nftID);
146146 }
147147
@@ -152,8 +152,8 @@ class BasicKeyspaceBackend : public CassandraBackendFamily<
152152 secondQuery.bindAt (2 , Limit{remainingLimit});
153153
154154 auto const secondRes = executor_.read (yield, secondQuery);
155- if (secondRes) {
156- for (auto const [nftID] : extract<ripple::uint256>(secondRes. value () ))
155+ if (secondRes. has_value () ) {
156+ for (auto const [nftID] : extract<ripple::uint256>(* secondRes))
157157 nftIDs.push_back (nftID);
158158 }
159159 }
@@ -163,7 +163,7 @@ class BasicKeyspaceBackend : public CassandraBackendFamily<
163163
164164 /* *
165165 * @brief (Unsupported in Keyspaces) Fetches account root object indexes by page.
166- * * @note Loading the cache by enumerating all accounts is currently unsupported by the AWS Keyspaces backend.
166+ * @note Loading the cache by enumerating all accounts is currently unsupported by the AWS Keyspaces backend.
167167 * This function's logic relies on "PER PARTITION LIMIT 1", which Keyspaces does not support, and there is
168168 * no efficient alternative. This is acceptable as the cache is primarily loaded via diffs. Calling this
169169 * function will throw an exception.
@@ -203,8 +203,8 @@ class BasicKeyspaceBackend : public CassandraBackendFamily<
203203 statement.bindAt (3 , Limit{limit});
204204
205205 auto const res = executor_.read (yield, statement);
206- if (res && res. value (). hasRows ()) {
207- for (auto const [nftID] : extract<ripple::uint256>(res. value () ))
206+ if (res. has_value () && res-> hasRows ()) {
207+ for (auto const [nftID] : extract<ripple::uint256>(* res))
208208 nftIDs.push_back (nftID);
209209 }
210210 return nftIDs;
@@ -229,8 +229,8 @@ class BasicKeyspaceBackend : public CassandraBackendFamily<
229229 firstQuery.bindAt (3 , Limit{limit});
230230
231231 auto const firstRes = executor_.read (yield, firstQuery);
232- if (firstRes) {
233- for (auto const [nftID] : extract<ripple::uint256>(firstRes. value () ))
232+ if (firstRes. has_value () ) {
233+ for (auto const [nftID] : extract<ripple::uint256>(* firstRes))
234234 nftIDs.push_back (nftID);
235235 }
236236
@@ -241,8 +241,8 @@ class BasicKeyspaceBackend : public CassandraBackendFamily<
241241 secondQuery.bindAt (2 , Limit{remainingLimit});
242242
243243 auto const secondRes = executor_.read (yield, secondQuery);
244- if (secondRes) {
245- for (auto const [nftID] : extract<ripple::uint256>(secondRes. value () ))
244+ if (secondRes. has_value () ) {
245+ for (auto const [nftID] : extract<ripple::uint256>(* secondRes))
246246 nftIDs.push_back (nftID);
247247 }
248248 }
@@ -291,10 +291,11 @@ class BasicKeyspaceBackend : public CassandraBackendFamily<
291291
292292 // Combine the results into final NFT objects.
293293 for (auto i = 0u ; i < nftIDs.size (); ++i) {
294- if (auto const maybeRow = nftInfos[i].template get <uint32_t , ripple::AccountID, bool >(); maybeRow) {
294+ if (auto const maybeRow = nftInfos[i].template get <uint32_t , ripple::AccountID, bool >();
295+ maybeRow.has_value ()) {
295296 auto [seq, owner, isBurned] = *maybeRow;
296297 NFT nft (nftIDs[i], seq, owner, isBurned);
297- if (auto const maybeUri = nftUris[i].template get <ripple::Blob>(); maybeUri)
298+ if (auto const maybeUri = nftUris[i].template get <ripple::Blob>(); maybeUri. has_value () )
298299 nft.uri = *maybeUri;
299300 ret.nfts .push_back (nft);
300301 }
0 commit comments