Skip to content

Commit aad784a

Browse files
authored
fix(indexer): list_substates can also list nfts (tari-project#1302)
Description --- fix(indexer): list_substates can also list nfts Motivation and Context --- A change in the nft address format caused the indexer not to be able to list nfts ref tari-project#1080 How Has This Been Tested? --- Calling list_substates on the indexer with "NonFungible" What process can a PR reviewer use to test or verify this change? --- Breaking Changes --- - [x] None - [ ] Requires data directory to be deleted - [ ] Other - Please specify <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Simplified internal filtering logic for data queries by unifying the formatting approach. The update streamlines the process for constructing query filters, enhancing consistency in processing different types without changing public behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 3127a37 commit aad784a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

applications/tari_indexer/src/substate_storage_sqlite/sqlite_substate_store_factory.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,7 @@ impl SubstateStoreReadTransaction for SqliteSubstateStoreReadTransaction<'_> {
255255
}
256256

257257
if let Some(substate_type) = by_type {
258-
let address_like = match substate_type {
259-
SubstateType::NonFungible => format!("resource_% {}_%", substate_type.as_prefix_str()),
260-
_ => format!("{}_%", substate_type.as_prefix_str()),
261-
};
258+
let address_like = format!("{}_%", substate_type.as_prefix_str());
262259
query = query.filter(substates::address.like(address_like));
263260
}
264261

0 commit comments

Comments
 (0)