Fixing the SystemDbReader's handling of Object's Index/SortedIndex entry look-up #1662
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fix for a problem I encountered during development of Browse API's "get object collection entry" (see https://github.com/radixdlt/babylon-node/pull/755/files#diff-0a2c5a225e361800cb28568a6b51d0c0bbe1c5b5aded21ca10c783ef6fc0f743R174).
The
SystemDatabaseReader
was handlingObjectCollectionKey::KeyValue
case just fine (i.e. it expectedKeyValueEntrySubstate<V>
values). However, forObjectCollectionKey::Index/SortedIndex
cases, it wrongfully expected theV
values (withoutIndexEntrySubstate<V>/SortedIndexEntrySubstate<V>
wrappers).I unfortunately had to add the "unit" test in the
radix-engine-tests
(it cannot live next toSystemDatabaseReader
since theSubstateDatabase
impl required to run it is not available there).(In general, the
SystemDatabaseReader
seems to have been developed as a test util [not covered by its own tests, but tested indirectly by assertions in tests of higher-level features], and I was not trying to change it in this PR)