From a64a9973ce33c4a1f24ce4d013778b9c10fd60a5 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:37:07 -0500 Subject: [PATCH 1/3] feat: query denoms by admin --- Makefile | 2 +- .../osmosis/tokenfactory/v1beta1/query.proto | 20 + x/tokenfactory/client/cli/query.go | 29 ++ x/tokenfactory/keeper/admins.go | 19 + x/tokenfactory/keeper/admins_test.go | 48 ++ x/tokenfactory/keeper/creators.go | 1 - x/tokenfactory/keeper/grpc_query.go | 9 + x/tokenfactory/types/query.pb.go | 468 ++++++++++++++++-- x/tokenfactory/types/query.pb.gw.go | 101 ++++ 9 files changed, 657 insertions(+), 40 deletions(-) diff --git a/Makefile b/Makefile index b05b9bd..27293e5 100644 --- a/Makefile +++ b/Makefile @@ -174,7 +174,7 @@ coverage: ## Run coverage report protoVer=0.14.0 protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) -protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) +protoImage=$(DOCKER) run --user root --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) proto-all: proto-format proto-lint proto-gen diff --git a/proto/osmosis/tokenfactory/v1beta1/query.proto b/proto/osmosis/tokenfactory/v1beta1/query.proto index 86d983c..b84b03c 100755 --- a/proto/osmosis/tokenfactory/v1beta1/query.proto +++ b/proto/osmosis/tokenfactory/v1beta1/query.proto @@ -32,6 +32,14 @@ service Query { option (google.api.http).get = "/osmosis/tokenfactory/v1beta1/denoms_from_creator/{creator}"; } + + // DenomsFromAdmin defines a gRPC query method for fetching all + // denominations owned by a specific admin. + rpc DenomsFromAdmin(QueryDenomsFromAdminRequest) + returns (QueryDenomsFromAdminResponse) { + option (google.api.http).get = + "/osmosis/tokenfactory/v1beta1/denoms_from_admin/{admin}"; + } } // QueryParamsRequest is the request type for the Query/Params RPC method. @@ -69,3 +77,15 @@ message QueryDenomsFromCreatorRequest { message QueryDenomsFromCreatorResponse { repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ]; } + +// QueryDenomsFromAdminRequest defines the request structure for the +// DenomsFromAdmin gRPC query. +message QueryDenomsFromAdminRequest { + string admin = 1 [ (gogoproto.moretags) = "yaml:\"admin\"" ]; +} + +// QueryDenomsFromAdminRequest defines the response structure for the +// DenomsFromAdmin gRPC query. +message QueryDenomsFromAdminResponse { + repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ]; +} diff --git a/x/tokenfactory/client/cli/query.go b/x/tokenfactory/client/cli/query.go index b49c170..edacc5c 100644 --- a/x/tokenfactory/client/cli/query.go +++ b/x/tokenfactory/client/cli/query.go @@ -25,6 +25,7 @@ func GetQueryCmd() *cobra.Command { GetParams(), GetCmdDenomAuthorityMetadata(), GetCmdDenomsFromCreator(), + GetCmdDenomsFromAdmin(), ) return cmd @@ -114,3 +115,31 @@ func GetCmdDenomsFromCreator() *cobra.Command { return cmd } + +func GetCmdDenomsFromAdmin() *cobra.Command { + cmd := &cobra.Command{ + Use: "denoms-from-admin [admin address] [flags]", + Short: "Returns a list of all tokens owned by a specific admin address", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.DenomsFromAdmin(cmd.Context(), &types.QueryDenomsFromAdminRequest{ + Admin: args[0], + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/tokenfactory/keeper/admins.go b/x/tokenfactory/keeper/admins.go index 9b08bc5..2dda568 100644 --- a/x/tokenfactory/keeper/admins.go +++ b/x/tokenfactory/keeper/admins.go @@ -50,3 +50,22 @@ func (k Keeper) setAdmin(ctx context.Context, denom string, admin string) error return k.setAuthorityMetadata(ctx, denom, metadata) } + +// GetDenomsFromAdmin returns all denoms for which the provided address is the admin +func (k Keeper) GetDenomsFromAdmin(ctx context.Context, admin string) ([]string, error) { + iterator := k.GetAllDenomsIterator(ctx) + defer iterator.Close() + + denoms := []string{} + for ; iterator.Valid(); iterator.Next() { + denom := string(iterator.Value()) + metadata, err := k.GetAuthorityMetadata(sdk.UnwrapSDKContext(ctx), denom) + if err != nil { + return nil, err + } + if metadata.Admin == admin { + denoms = append(denoms, denom) + } + } + return denoms, nil +} diff --git a/x/tokenfactory/keeper/admins_test.go b/x/tokenfactory/keeper/admins_test.go index 679b1dd..cb4a6c1 100644 --- a/x/tokenfactory/keeper/admins_test.go +++ b/x/tokenfactory/keeper/admins_test.go @@ -23,6 +23,20 @@ func (suite *KeeperTestSuite) TestAdminMsgs() { suite.Require().NoError(err) suite.Require().Equal(suite.TestAccs[0].String(), queryRes.AuthorityMetadata.Admin) + // Test getting denoms from admin + adminRes, err := suite.queryClient.DenomsFromAdmin(suite.Ctx.Context(), &types.QueryDenomsFromAdminRequest{ + Admin: suite.TestAccs[0].String(), + }) + suite.Require().NoError(err) + suite.Require().Equal([]string{suite.defaultDenom}, adminRes.Denoms) + + // Veriry that the other account has no denoms + adminRes, err = suite.queryClient.DenomsFromAdmin(suite.Ctx.Context(), &types.QueryDenomsFromAdminRequest{ + Admin: suite.TestAccs[1].String(), + }) + suite.Require().NoError(err) + suite.Require().Nil(adminRes.Denoms) + // Test minting to admins own account _, err = suite.msgServer.Mint(suite.Ctx, types.NewMsgMint(suite.TestAccs[0].String(), sdk.NewInt64Coin(suite.defaultDenom, 10))) addr0bal += 10 @@ -57,6 +71,20 @@ func (suite *KeeperTestSuite) TestAdminMsgs() { suite.Require().NoError(err) suite.Require().Equal(suite.TestAccs[1].String(), queryRes.AuthorityMetadata.Admin) + // Test query from admin returns the correct denoms. The old admin should have no denoms + adminRes, err = suite.queryClient.DenomsFromAdmin(suite.Ctx.Context(), &types.QueryDenomsFromAdminRequest{ + Admin: suite.TestAccs[0].String(), + }) + suite.Require().NoError(err) + suite.Require().Nil(adminRes.Denoms) + + // The new admin should have the default denom + adminRes, err = suite.queryClient.DenomsFromAdmin(suite.Ctx.Context(), &types.QueryDenomsFromAdminRequest{ + Admin: suite.TestAccs[1].String(), + }) + suite.Require().NoError(err) + suite.Require().Equal([]string{suite.defaultDenom}, adminRes.Denoms) + // Make sure old admin can no longer do actions _, err = suite.msgServer.Burn(suite.Ctx, types.NewMsgBurn(suite.TestAccs[0].String(), sdk.NewInt64Coin(suite.defaultDenom, 5))) suite.Require().Error(err) @@ -75,6 +103,26 @@ func (suite *KeeperTestSuite) TestAdminMsgs() { }) suite.Require().NoError(err) suite.Require().Equal("", queryRes.AuthorityMetadata.Admin) + + // Make sure retrieving denoms by admin works with empty admin + adminRes, err = suite.queryClient.DenomsFromAdmin(suite.Ctx.Context(), &types.QueryDenomsFromAdminRequest{ + Admin: "", + }) + suite.Require().NoError(err) + suite.Require().Equal([]string{suite.defaultDenom}, adminRes.Denoms) + + // Make sure the other accounts are not admins + adminRes, err = suite.queryClient.DenomsFromAdmin(suite.Ctx.Context(), &types.QueryDenomsFromAdminRequest{ + Admin: suite.TestAccs[0].String(), + }) + suite.Require().NoError(err) + suite.Require().Nil(adminRes.Denoms) + + adminRes, err = suite.queryClient.DenomsFromAdmin(suite.Ctx.Context(), &types.QueryDenomsFromAdminRequest{ + Admin: suite.TestAccs[1].String(), + }) + suite.Require().NoError(err) + suite.Require().Nil(adminRes.Denoms) } // TestMintDenom ensures the following properties of the MintMessage: diff --git a/x/tokenfactory/keeper/creators.go b/x/tokenfactory/keeper/creators.go index 47b1d53..bb034c6 100644 --- a/x/tokenfactory/keeper/creators.go +++ b/x/tokenfactory/keeper/creators.go @@ -4,7 +4,6 @@ import ( "context" "cosmossdk.io/store" - sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/tokenfactory/keeper/grpc_query.go b/x/tokenfactory/keeper/grpc_query.go index 7f6cc10..80559e6 100644 --- a/x/tokenfactory/keeper/grpc_query.go +++ b/x/tokenfactory/keeper/grpc_query.go @@ -33,3 +33,12 @@ func (k Keeper) DenomsFromCreator(ctx context.Context, req *types.QueryDenomsFro denoms := k.GetDenomsFromCreator(sdkCtx, req.GetCreator()) return &types.QueryDenomsFromCreatorResponse{Denoms: denoms}, nil } + +func (k Keeper) DenomsFromAdmin(ctx context.Context, req *types.QueryDenomsFromAdminRequest) (*types.QueryDenomsFromAdminResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + denoms, err := k.GetDenomsFromAdmin(sdkCtx, req.GetAdmin()) + if err != nil { + return nil, err + } + return &types.QueryDenomsFromAdminResponse{Denoms: denoms}, nil +} diff --git a/x/tokenfactory/types/query.pb.go b/x/tokenfactory/types/query.pb.go index b29db79..cce9222 100644 --- a/x/tokenfactory/types/query.pb.go +++ b/x/tokenfactory/types/query.pb.go @@ -297,6 +297,98 @@ func (m *QueryDenomsFromCreatorResponse) GetDenoms() []string { return nil } +// QueryDenomsFromAdminRequest defines the request structure for the +// DenomsFromAdmin gRPC query. +type QueryDenomsFromAdminRequest struct { + Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty" yaml:"admin"` +} + +func (m *QueryDenomsFromAdminRequest) Reset() { *m = QueryDenomsFromAdminRequest{} } +func (m *QueryDenomsFromAdminRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDenomsFromAdminRequest) ProtoMessage() {} +func (*QueryDenomsFromAdminRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6f22013ad0f72e3f, []int{6} +} +func (m *QueryDenomsFromAdminRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomsFromAdminRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomsFromAdminRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDenomsFromAdminRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomsFromAdminRequest.Merge(m, src) +} +func (m *QueryDenomsFromAdminRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomsFromAdminRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomsFromAdminRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomsFromAdminRequest proto.InternalMessageInfo + +func (m *QueryDenomsFromAdminRequest) GetAdmin() string { + if m != nil { + return m.Admin + } + return "" +} + +// QueryDenomsFromAdminRequest defines the response structure for the +// DenomsFromAdmin gRPC query. +type QueryDenomsFromAdminResponse struct { + Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty" yaml:"denoms"` +} + +func (m *QueryDenomsFromAdminResponse) Reset() { *m = QueryDenomsFromAdminResponse{} } +func (m *QueryDenomsFromAdminResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDenomsFromAdminResponse) ProtoMessage() {} +func (*QueryDenomsFromAdminResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6f22013ad0f72e3f, []int{7} +} +func (m *QueryDenomsFromAdminResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomsFromAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomsFromAdminResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDenomsFromAdminResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomsFromAdminResponse.Merge(m, src) +} +func (m *QueryDenomsFromAdminResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomsFromAdminResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomsFromAdminResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomsFromAdminResponse proto.InternalMessageInfo + +func (m *QueryDenomsFromAdminResponse) GetDenoms() []string { + if m != nil { + return m.Denoms + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "osmosis.tokenfactory.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "osmosis.tokenfactory.v1beta1.QueryParamsResponse") @@ -304,6 +396,8 @@ func init() { proto.RegisterType((*QueryDenomAuthorityMetadataResponse)(nil), "osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse") proto.RegisterType((*QueryDenomsFromCreatorRequest)(nil), "osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest") proto.RegisterType((*QueryDenomsFromCreatorResponse)(nil), "osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse") + proto.RegisterType((*QueryDenomsFromAdminRequest)(nil), "osmosis.tokenfactory.v1beta1.QueryDenomsFromAdminRequest") + proto.RegisterType((*QueryDenomsFromAdminResponse)(nil), "osmosis.tokenfactory.v1beta1.QueryDenomsFromAdminResponse") } func init() { @@ -311,44 +405,48 @@ func init() { } var fileDescriptor_6f22013ad0f72e3f = []byte{ - // 578 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcf, 0x4f, 0x13, 0x41, - 0x14, 0xee, 0x2a, 0xd4, 0x30, 0xfe, 0x88, 0x8c, 0xc4, 0x68, 0x83, 0x5b, 0x1d, 0x09, 0x29, 0x06, - 0x77, 0x2c, 0x72, 0x12, 0x8d, 0x76, 0x31, 0x7a, 0x50, 0x12, 0xdd, 0x9b, 0x7a, 0x68, 0xa6, 0x65, - 0x58, 0x36, 0x76, 0xf7, 0x2d, 0x33, 0xd3, 0xc6, 0x86, 0x70, 0xf1, 0xe0, 0xd9, 0xc4, 0xa3, 0xff, - 0x83, 0x7f, 0x07, 0x47, 0x12, 0x2e, 0x9e, 0x1a, 0xd3, 0x12, 0xff, 0x80, 0xfe, 0x05, 0xa6, 0x33, - 0x03, 0x02, 0xad, 0x9b, 0xaa, 0xa7, 0x4e, 0x67, 0xbe, 0xef, 0x7b, 0xdf, 0xf7, 0xde, 0xcb, 0xa2, - 0x12, 0xc8, 0x18, 0x64, 0x24, 0xa9, 0x82, 0xf7, 0x3c, 0xd9, 0x60, 0x75, 0x05, 0xa2, 0x4d, 0x5b, - 0xe5, 0x1a, 0x57, 0xac, 0x4c, 0xb7, 0x9a, 0x5c, 0xb4, 0xbd, 0x54, 0x80, 0x02, 0x3c, 0x6b, 0x91, - 0xde, 0x71, 0xa4, 0x67, 0x91, 0x85, 0x99, 0x10, 0x42, 0xd0, 0x40, 0x3a, 0x38, 0x19, 0x4e, 0x61, - 0x36, 0x04, 0x08, 0x1b, 0x9c, 0xb2, 0x34, 0xa2, 0x2c, 0x49, 0x40, 0x31, 0x15, 0x41, 0x22, 0xed, - 0xeb, 0x9d, 0xba, 0x96, 0xa4, 0x35, 0x26, 0xb9, 0x29, 0x75, 0x54, 0x38, 0x65, 0x61, 0x94, 0x68, - 0xb0, 0xc5, 0x2e, 0x67, 0xfa, 0x64, 0x4d, 0xb5, 0x09, 0x22, 0x52, 0xed, 0x35, 0xae, 0xd8, 0x3a, - 0x53, 0xcc, 0xb2, 0x16, 0x32, 0x59, 0x29, 0x13, 0x2c, 0xb6, 0x66, 0xc8, 0x0c, 0xc2, 0xaf, 0x07, - 0x16, 0x5e, 0xe9, 0xcb, 0x80, 0x6f, 0x35, 0xb9, 0x54, 0xe4, 0x0d, 0xba, 0x72, 0xe2, 0x56, 0xa6, - 0x90, 0x48, 0x8e, 0x7d, 0x94, 0x37, 0xe4, 0x6b, 0xce, 0x4d, 0xa7, 0x74, 0x7e, 0x69, 0xce, 0xcb, - 0x6a, 0x8e, 0x67, 0xd8, 0xfe, 0xc4, 0x6e, 0xa7, 0x98, 0x0b, 0x2c, 0x93, 0xbc, 0x44, 0x44, 0x4b, - 0x3f, 0xe5, 0x09, 0xc4, 0x95, 0xd3, 0x01, 0xac, 0x01, 0x3c, 0x8f, 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xd7, 0x69, 0x2a, 0xf8, 0x71, 0x76, 0x1a, 0xd3, 0x75, 0xba, 0xad, 0x7f, 0x77, 0xe8, 0xf0, - 0x02, 0xe1, 0x7d, 0x07, 0x4d, 0x0f, 0x4d, 0x16, 0xaf, 0x8c, 0xeb, 0x70, 0xc4, 0x7a, 0x15, 0x1e, - 0xfe, 0x1b, 0xd9, 0x26, 0x5b, 0xd5, 0xc9, 0x1e, 0xe1, 0x95, 0x71, 0x92, 0x55, 0x37, 0x04, 0xc4, - 0x55, 0xbb, 0xa9, 0x74, 0xdb, 0x1e, 0x76, 0xfc, 0x77, 0xbb, 0x5d, 0xd7, 0xd9, 0xeb, 0xba, 0xce, - 0x8f, 0xae, 0xeb, 0x7c, 0xee, 0xb9, 0xb9, 0xbd, 0x9e, 0x9b, 0xfb, 0xde, 0x73, 0x73, 0x6f, 0x2b, - 0x61, 0xa4, 0x36, 0x9b, 0x35, 0xaf, 0x0e, 0x31, 0x95, 0x4a, 0xb0, 0x24, 0xe4, 0x0d, 0x68, 0xf1, - 0xbb, 0x2d, 0x9e, 0xa8, 0xa6, 0xe0, 0xa7, 0xaa, 0x7d, 0x38, 0xf9, 0x57, 0xb5, 0x53, 0x2e, 0x6b, - 0x79, 0xfd, 0x59, 0xbb, 0xff, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x67, 0x38, 0x85, 0xa8, 0xe1, 0x05, - 0x00, 0x00, + // 646 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcb, 0x6e, 0xd3, 0x4c, + 0x14, 0x8e, 0xff, 0x9f, 0x06, 0x75, 0xb8, 0x76, 0xa8, 0x10, 0x98, 0xe2, 0xc0, 0x50, 0x55, 0x2d, + 0x2a, 0x1e, 0x5a, 0x2a, 0xa1, 0xb6, 0xa0, 0x12, 0x97, 0x8b, 0x10, 0x54, 0x02, 0xef, 0x80, 0x45, + 0x35, 0x49, 0xa7, 0xae, 0x45, 0xed, 0x71, 0x3d, 0x93, 0x88, 0x28, 0xca, 0x86, 0x05, 0x6b, 0x24, + 0x96, 0xbc, 0x03, 0xe2, 0x31, 0xca, 0xae, 0x52, 0x37, 0xac, 0x22, 0x94, 0x20, 0x1e, 0x20, 0x4f, + 0x80, 0x3c, 0x33, 0x2d, 0x69, 0x1c, 0xac, 0xa4, 0xac, 0x6c, 0x9f, 0xcb, 0x77, 0xbe, 0xef, 0x5c, + 0x64, 0x30, 0xcd, 0x78, 0xc0, 0xb8, 0xcf, 0xb1, 0x60, 0x6f, 0x69, 0xb8, 0x49, 0xca, 0x82, 0xc5, + 0x35, 0x5c, 0x9d, 0x2b, 0x51, 0x41, 0xe6, 0xf0, 0x4e, 0x85, 0xc6, 0x35, 0x3b, 0x8a, 0x99, 0x60, + 0x70, 0x42, 0x47, 0xda, 0xdd, 0x91, 0xb6, 0x8e, 0x34, 0xc7, 0x3d, 0xe6, 0x31, 0x19, 0x88, 0x93, + 0x37, 0x95, 0x63, 0x4e, 0x78, 0x8c, 0x79, 0xdb, 0x14, 0x93, 0xc8, 0xc7, 0x24, 0x0c, 0x99, 0x20, + 0xc2, 0x67, 0x21, 0xd7, 0xde, 0x9b, 0x65, 0x09, 0x89, 0x4b, 0x84, 0x53, 0x55, 0xea, 0xb0, 0x70, + 0x44, 0x3c, 0x3f, 0x94, 0xc1, 0x3a, 0x76, 0x21, 0x93, 0x27, 0xa9, 0x88, 0x2d, 0x16, 0xfb, 0xa2, + 0xb6, 0x46, 0x05, 0xd9, 0x20, 0x82, 0xe8, 0xac, 0x99, 0xcc, 0xac, 0x88, 0xc4, 0x24, 0xd0, 0x64, + 0xd0, 0x38, 0x80, 0x2f, 0x13, 0x0a, 0x2f, 0xa4, 0xd1, 0xa5, 0x3b, 0x15, 0xca, 0x05, 0x7a, 0x05, + 0x2e, 0x1c, 0xb1, 0xf2, 0x88, 0x85, 0x9c, 0x42, 0x07, 0xe4, 0x55, 0xf2, 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cc, 0x02, 0xcc, 0x45, 0x4c, 0x42, 0x8f, + 0x6e, 0xb3, 0x2a, 0xbd, 0x55, 0xa5, 0xa1, 0xa8, 0xc4, 0xb4, 0xa7, 0xd2, 0xbb, 0xa3, 0x9f, 0xa2, + 0x16, 0x51, 0x5e, 0xca, 0xcb, 0x9f, 0xc6, 0x9d, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x31, 0xa9, + 0x11, 0x4c, 0x3f, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -372,6 +470,9 @@ type QueryClient interface { // DenomsFromCreator defines a gRPC query method for fetching all // denominations created by a specific admin/creator. DenomsFromCreator(ctx context.Context, in *QueryDenomsFromCreatorRequest, opts ...grpc.CallOption) (*QueryDenomsFromCreatorResponse, error) + // DenomsFromAdmin defines a gRPC query method for fetching all + // denominations owned by a specific admin. + DenomsFromAdmin(ctx context.Context, in *QueryDenomsFromAdminRequest, opts ...grpc.CallOption) (*QueryDenomsFromAdminResponse, error) } type queryClient struct { @@ -409,6 +510,15 @@ func (c *queryClient) DenomsFromCreator(ctx context.Context, in *QueryDenomsFrom return out, nil } +func (c *queryClient) DenomsFromAdmin(ctx context.Context, in *QueryDenomsFromAdminRequest, opts ...grpc.CallOption) (*QueryDenomsFromAdminResponse, error) { + out := new(QueryDenomsFromAdminResponse) + err := c.cc.Invoke(ctx, "/osmosis.tokenfactory.v1beta1.Query/DenomsFromAdmin", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Params defines a gRPC query method that returns the tokenfactory module's @@ -420,6 +530,9 @@ type QueryServer interface { // DenomsFromCreator defines a gRPC query method for fetching all // denominations created by a specific admin/creator. DenomsFromCreator(context.Context, *QueryDenomsFromCreatorRequest) (*QueryDenomsFromCreatorResponse, error) + // DenomsFromAdmin defines a gRPC query method for fetching all + // denominations owned by a specific admin. + DenomsFromAdmin(context.Context, *QueryDenomsFromAdminRequest) (*QueryDenomsFromAdminResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -435,6 +548,9 @@ func (*UnimplementedQueryServer) DenomAuthorityMetadata(ctx context.Context, req func (*UnimplementedQueryServer) DenomsFromCreator(ctx context.Context, req *QueryDenomsFromCreatorRequest) (*QueryDenomsFromCreatorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomsFromCreator not implemented") } +func (*UnimplementedQueryServer) DenomsFromAdmin(ctx context.Context, req *QueryDenomsFromAdminRequest) (*QueryDenomsFromAdminResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomsFromAdmin not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -494,6 +610,24 @@ func _Query_DenomsFromCreator_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Query_DenomsFromAdmin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomsFromAdminRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DenomsFromAdmin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/osmosis.tokenfactory.v1beta1.Query/DenomsFromAdmin", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DenomsFromAdmin(ctx, req.(*QueryDenomsFromAdminRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "osmosis.tokenfactory.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -510,6 +644,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "DenomsFromCreator", Handler: _Query_DenomsFromCreator_Handler, }, + { + MethodName: "DenomsFromAdmin", + Handler: _Query_DenomsFromAdmin_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "osmosis/tokenfactory/v1beta1/query.proto", @@ -696,6 +834,68 @@ func (m *QueryDenomsFromCreatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *QueryDenomsFromAdminRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDenomsFromAdminRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomsFromAdminRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Admin) > 0 { + i -= len(m.Admin) + copy(dAtA[i:], m.Admin) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Admin))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDenomsFromAdminResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDenomsFromAdminResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomsFromAdminResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denoms) > 0 { + for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denoms[iNdEx]) + copy(dAtA[i:], m.Denoms[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denoms[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -779,6 +979,34 @@ func (m *QueryDenomsFromCreatorResponse) Size() (n int) { return n } +func (m *QueryDenomsFromAdminRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Admin) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDenomsFromAdminResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Denoms) > 0 { + for _, s := range m.Denoms { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1247,6 +1475,170 @@ func (m *QueryDenomsFromCreatorResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryDenomsFromAdminRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDenomsFromAdminRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomsFromAdminRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Admin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomsFromAdminResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDenomsFromAdminResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomsFromAdminResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/tokenfactory/types/query.pb.gw.go b/x/tokenfactory/types/query.pb.gw.go index 0b895e7..70db7e8 100644 --- a/x/tokenfactory/types/query.pb.gw.go +++ b/x/tokenfactory/types/query.pb.gw.go @@ -159,6 +159,60 @@ func local_request_Query_DenomsFromCreator_0(ctx context.Context, marshaler runt } +func request_Query_DenomsFromAdmin_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomsFromAdminRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["admin"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "admin") + } + + protoReq.Admin, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "admin", err) + } + + msg, err := client.DenomsFromAdmin(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DenomsFromAdmin_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomsFromAdminRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["admin"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "admin") + } + + protoReq.Admin, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "admin", err) + } + + msg, err := server.DenomsFromAdmin(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -234,6 +288,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_DenomsFromAdmin_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DenomsFromAdmin_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomsFromAdmin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -335,6 +412,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_DenomsFromAdmin_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DenomsFromAdmin_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomsFromAdmin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -344,6 +441,8 @@ var ( pattern_Query_DenomAuthorityMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"osmosis", "tokenfactory", "v1beta1", "denoms", "denom", "authority_metadata"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_DenomsFromCreator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "tokenfactory", "v1beta1", "denoms_from_creator", "creator"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DenomsFromAdmin_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "tokenfactory", "v1beta1", "denoms_from_admin", "admin"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -352,4 +451,6 @@ var ( forward_Query_DenomAuthorityMetadata_0 = runtime.ForwardResponseMessage forward_Query_DenomsFromCreator_0 = runtime.ForwardResponseMessage + + forward_Query_DenomsFromAdmin_0 = runtime.ForwardResponseMessage ) From 10d0870d1a13858dcc5c3e7b246ec715b064f2df Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:45:08 -0500 Subject: [PATCH 2/3] docs: denoms-from-admin --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d117e20..07fdb1e 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ and the following queries: - `params`: Get the tokenfactory module parameters. - `denom-authority-metadata`: Get the authority metadata of a denom. - `denoms-from-creator`: Returns a list of all denoms created by a given creator. +- `denoms-from-admin`: Returns a list of all denoms for which a given address is the admin. ## Testing From dbda9f0426b9e67cf677fee9f577cf193450d325 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:57:24 -0500 Subject: [PATCH 3/3] fix: local docker --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 27293e5..b05b9bd 100644 --- a/Makefile +++ b/Makefile @@ -174,7 +174,7 @@ coverage: ## Run coverage report protoVer=0.14.0 protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) -protoImage=$(DOCKER) run --user root --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) +protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) proto-all: proto-format proto-lint proto-gen