Skip to content

Commit

Permalink
add default denom on all-alias query & update metadata for default_pa…
Browse files Browse the repository at this point in the history
…rameters
  • Loading branch information
kiragpg committed Jan 4, 2024
1 parent 04856d3 commit 84c11b0
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 46 deletions.
1 change: 1 addition & 0 deletions proto/kira/tokens/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ message AllTokenAliasesRequest {}

message AllTokenAliasesResponse {
repeated kira.tokens.TokenAlias data = 1;
string default_denom = 2;
}

message TokenAliasesByDenomRequest {
Expand Down
2 changes: 1 addition & 1 deletion x/gov/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) {
"description": "After what time function execution should fail"
},
"default_parameters": {
"type": "bool",
"type": "uint64",
"description": "Default values that the function in question will consume as input parameters before execution"
},
"proposer": {
Expand Down
6 changes: 5 additions & 1 deletion x/tokens/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package keeper
import (
"context"

appparams "github.com/KiraCore/sekai/app/params"
"github.com/KiraCore/sekai/x/tokens/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down Expand Up @@ -32,7 +33,10 @@ func (q Querier) GetTokenAliasesByDenom(ctx context.Context, request *types.Toke
func (q Querier) GetAllTokenAliases(ctx context.Context, request *types.AllTokenAliasesRequest) (*types.AllTokenAliasesResponse, error) {
aliases := q.keeper.ListTokenAlias(sdk.UnwrapSDKContext(ctx))

return &types.AllTokenAliasesResponse{Data: aliases}, nil
return &types.AllTokenAliasesResponse{
Data: aliases,
DefaultDenom: appparams.DefaultDenom,
}, nil
}

func (q Querier) GetTokenRate(ctx context.Context, request *types.TokenRateRequest) (*types.TokenRateResponse, error) {
Expand Down
140 changes: 96 additions & 44 deletions x/tokens/types/query.pb.go

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

0 comments on commit 84c11b0

Please sign in to comment.