-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(collections): IndexedMap #14397
Conversation
[Cosmos SDK - Collections] Kudos, SonarCloud Quality Gate passed! |
Hey, @testinginprod -- thanks for all this! Really interesting, watching you lay this out. |
# Conflicts: # collections/collections_test.go
[Cosmos SDK] Kudos, SonarCloud Quality Gate passed! |
# Conflicts: # collections/collections.go # collections/collections_test.go # collections/iter.go # collections/keys.go # collections/pair.go # collections/pair_test.go
Built the concrete indexes here with examples: #14706 |
* [#14397](https://github.com/cosmos/cosmos-sdk/pull/14397) Add IndexedMap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH these changelog entries are superfluous -- as a dev, they tell me nothing useful.
Honestly, we can probably have a single collections CL entry that outlines all the additions and changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it makes sense to me. When we release the first "stable" version we can add a comprehensive list of the features in the changelog, and then apply the classic by PR changelog after the first release.
} | ||
|
||
// NewGenericUniqueIndex instantiates a GenericUniqueIndex. Works in the same way as NewGenericMultiIndex. | ||
func NewGenericUniqueIndex[ReferencingKey, ReferencedKey, PrimaryKey, Value any]( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an example of how/where this is to be used? As a developer looking at this and trying to understand how to use it, I would be pretty confused as I find it somewhat daunting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#14706, this is where the real indexes are implemented, I've also added the examples
# Conflicts: # collections/collections_test.go # collections/iter.go # collections/map.go # go.mod # go.sum # simapp/go.sum # tests/go.mod # tests/go.sum # x/nft/go.sum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UtACK
# Conflicts: # collections/collections_test.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few nits
Co-authored-by: Likhita Polavarapu <78951027+likhita-809@users.noreply.github.com>
Co-authored-by: Likhita Polavarapu <78951027+likhita-809@users.noreply.github.com>
Co-authored-by: testinginprod <testinginprod@somewhere.idk> Co-authored-by: Marko <marbar3778@yahoo.com> Co-authored-by: Likhita Polavarapu <78951027+likhita-809@users.noreply.github.com>
Description
Closes: #14670
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change