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

fix: querying token factory from LCD #207

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions proto/osmosis/tokenfactory/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ service Query {
option (google.api.http).get = "/osmosis/tokenfactory/v1beta1/params";
}

// DenomAuthorityMetadata defines a gRPC query method for fetching
// DenomAuthorityMetadata for a particular denom.
// Given the denom, returns the authority metadata for the denom.
// This method can receive both the denom encoded to URL (for the LCD requests)
// and the denom not encoded:
// e.g. factory%2Fterra1v0eee20gjl68fuk0chyrkch2z7suw2mhg3wkxf%2Futoken931
rpc DenomAuthorityMetadata(QueryDenomAuthorityMetadataRequest)
returns (QueryDenomAuthorityMetadataResponse) {
option (google.api.http).get =
Expand Down
5 changes: 5 additions & 0 deletions x/tokenfactory/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package keeper

import (
"context"
"net/url"

sdk "github.com/cosmos/cosmos-sdk/types"

Expand All @@ -19,6 +20,10 @@ func (k Keeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*typ

func (k Keeper) DenomAuthorityMetadata(ctx context.Context, req *types.QueryDenomAuthorityMetadataRequest) (*types.QueryDenomAuthorityMetadataResponse, error) {
sdkCtx := sdk.UnwrapSDKContext(ctx)
decodedDenom, err := url.QueryUnescape(req.Denom)
if err == nil {
req.Denom = decodedDenom
}

authorityMetadata, err := k.GetAuthorityMetadata(sdkCtx, req.GetDenom())
if err != nil {
Expand Down
12 changes: 8 additions & 4 deletions x/tokenfactory/types/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

324 changes: 324 additions & 0 deletions x/wasmd/types/executed_contracts.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading