Skip to content
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: support indexing denom metadata denom units #247

Merged
merged 10 commits into from
Jun 7, 2022

Conversation

alexanderbez
Copy link
Collaborator

@alexanderbez alexanderbez commented May 26, 2022

  • Support indexing denomination metadata DenomUnits acting a reverse lookup to the base denom's metadata. This will allow us to retrieve the base denomination and the corresponding metadata for IBC assets.
  • Add BaseDenom gRPC query

E.g. by providing uatom (assuming that's exists as a denom unit for the IBC atom metadata), one could fetch the true base denom (i.e. ibc/...).

closes: osmosis-labs/osmosis#1510

@alexanderbez alexanderbez marked this pull request as ready for review May 31, 2022 12:52
@alexanderbez alexanderbez requested a review from a team May 31, 2022 12:52
Copy link
Member

@mattverse mattverse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix in addition with the changes to querier as well! LGTM

Comment on lines +337 to +342
// Note, it is the caller's responsibility to ensure they are not overwriting
// denomination metadata for assets with the same base denom, or rather to
// ensure that metadata cannot exist for more than one base denom. The same
// applies for base units. In other words, the caller must ensure base denoms
// and their denom units are globally unique.
func (k BaseKeeper) SetDenomMetaData(ctx sdk.Context, denomMetadata types.Metadata) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for having secondary validation here to ensure duplicate meta data deos not exist? Is it due to computational overhead compared to the benefit it can have?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If say you have duplicate denom units in metadata, how do you know what unit to use? Also, it will overwrite any units if duplicates exist.

@alexanderbez alexanderbez merged commit f97eb2c into osmosis-main Jun 7, 2022
@alexanderbez alexanderbez deleted the bez/1510-metadata-aliases branch June 7, 2022 15:34
ValarDragon added a commit that referenced this pull request Jun 7, 2022
@alexanderbez alexanderbez restored the bez/1510-metadata-aliases branch June 8, 2022 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[v9 optional] Bank Aliases for Certain Denoms
3 participants