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: allow sending denoms with URL encoding #6847

Merged
merged 8 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

* [#6847](https://github.com/osmosis-labs/osmosis/pull/6847) feat: allow sending denoms with URL encoding
* [#6766](https://github.com/osmosis-labs/osmosis/pull/6766) CLI: Query pool by coin denom
* [#6468](https://github.com/osmosis-labs/osmosis/pull/6468) feat: remove osmo multihop discount
* [#6420](https://github.com/osmosis-labs/osmosis/pull/6420) feat[CL]: Creates a governance set whitelist of addresses that can bypass the normal pool creation restrictions on concentrated liquidity pools
Expand Down
6 changes: 6 additions & 0 deletions x/tokenfactory/client/cli/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ func (s *QueryTestSuite) TestQueriesNeverAlterState() {
&types.QueryDenomAuthorityMetadataRequest{Denom: "tokenfactory"},
&types.QueryDenomAuthorityMetadataResponse{},
},
{
"Query denom with encoded values",
"/osmosis.tokenfactory.v1beta1.Query/DenomAuthorityMetadata",
&types.QueryDenomAuthorityMetadataRequest{Denom: "factory%2Fosmo1zs0txy03pv5crj2rvty8wemd3zhrka2ne8u05n%2Fdenom"},
&types.QueryDenomAuthorityMetadataResponse{},
},
{
"Query denoms by creator",
"/osmosis.tokenfactory.v1beta1.Query/DenomsFromCreator",
Expand Down
7 changes: 5 additions & 2 deletions x/tokenfactory/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"

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

"net/url"
"github.com/osmosis-labs/osmosis/v20/x/tokenfactory/types"
)

Expand All @@ -19,7 +19,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
mattverse marked this conversation as resolved.
Show resolved Hide resolved
}
authorityMetadata, err := k.GetAuthorityMetadata(sdkCtx, req.GetDenom())
if err != nil {
return nil, err
Expand Down