diff --git a/app/app.go b/app/app.go index 12b69aea4..8e1b61e75 100644 --- a/app/app.go +++ b/app/app.go @@ -629,7 +629,7 @@ func New( app.ContractManagerKeeper, interchainqueriesmodulekeeper.Verifier{}, interchainqueriesmodulekeeper.TransactionVerifier{}, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), ) app.InterchainTxsKeeper = *interchaintxskeeper.NewKeeper( appCodec, @@ -639,7 +639,7 @@ func New( app.ICAControllerKeeper, app.ContractManagerKeeper, app.FeeKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(), ) app.CronKeeper = *cronkeeper.NewKeeper(appCodec, keys[crontypes.StoreKey], keys[crontypes.MemStoreKey], app.AccountKeeper, authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String()) diff --git a/proto/osmosis/tokenfactory/v1beta1/query.proto b/proto/osmosis/tokenfactory/v1beta1/query.proto index 4254767a7..09864e8a1 100644 --- a/proto/osmosis/tokenfactory/v1beta1/query.proto +++ b/proto/osmosis/tokenfactory/v1beta1/query.proto @@ -21,7 +21,7 @@ service Query { rpc DenomAuthorityMetadata(QueryDenomAuthorityMetadataRequest) returns (QueryDenomAuthorityMetadataResponse) { option (google.api.http).get = - "/osmosis/tokenfactory/v1beta1/denoms/{denom}/authority_metadata"; + "/osmosis/tokenfactory/v1beta1/denoms/factory/{creator}/{subdenom}/authority_metadata"; } // DenomsFromCreator defines a gRPC query method for fetching all @@ -37,7 +37,7 @@ service Query { rpc BeforeSendHookAddress(QueryBeforeSendHookAddressRequest) returns (QueryBeforeSendHookAddressResponse) { option (google.api.http).get = - "/osmosis/tokenfactory/v1beta1/denoms/{denom}/before_send_hook"; + "/osmosis/tokenfactory/v1beta1/denoms/factory/{creator}/{subdenom}/before_send_hook"; } } @@ -53,7 +53,8 @@ message QueryParamsResponse { // QueryDenomAuthorityMetadataRequest defines the request structure for the // DenomAuthorityMetadata gRPC query. message QueryDenomAuthorityMetadataRequest { - string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ]; + string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ]; } // QueryDenomAuthorityMetadataResponse defines the response structure for the @@ -78,7 +79,8 @@ message QueryDenomsFromCreatorResponse { } message QueryBeforeSendHookAddressRequest { - string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ]; + string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ]; } // QueryBeforeSendHookAddressResponse defines the response structure for the diff --git a/wasmbinding/bindings/msg.go b/wasmbinding/bindings/msg.go index d4b3cb7cc..dfd1e1529 100644 --- a/wasmbinding/bindings/msg.go +++ b/wasmbinding/bindings/msg.go @@ -41,8 +41,8 @@ type NeutronMsg struct { /// Contracts can burn native tokens for an existing factory denom /// that they are the admin of. /// Currently, the burn from address must be the admin contract. - BurnTokens *BurnTokens `json:"burn_tokens,omitempty"` - SetBeforeSend *SetBeforeSend `json:"set_before_send,omitempty"` + BurnTokens *BurnTokens `json:"burn_tokens,omitempty"` + SetBeforeSendHook *SetBeforeSendHook `json:"set_before_send_hook,omitempty"` // Cron types AddSchedule *AddSchedule `json:"add_schedule,omitempty"` @@ -180,7 +180,7 @@ type BurnTokens struct { BurnFromAddress string `json:"burn_from_address"` } -type SetBeforeSend struct { +type SetBeforeSendHook struct { Denom string `json:"denom"` CosmWasmAddr string `json:"cosm_wasm_addr"` } diff --git a/wasmbinding/bindings/query.go b/wasmbinding/bindings/query.go index 0d76a9ac2..b9e0438f7 100644 --- a/wasmbinding/bindings/query.go +++ b/wasmbinding/bindings/query.go @@ -34,6 +34,8 @@ type NeutronQuery struct { FullDenom *FullDenom `json:"full_denom,omitempty"` // Returns the admin of a denom, if the denom is a Token Factory denom. DenomAdmin *DenomAdmin `json:"denom_admin,omitempty"` + // + BeforeSendHook *BeforeSendHook `json:"before_send_hook,omitempty"` // Contractmanager queries // Query all failures for address Failures *Failures `json:"failures,omitempty"` @@ -183,6 +185,14 @@ type DenomAdmin struct { Subdenom string `json:"subdenom"` } +type BeforeSendHook struct { + Denom string `json:"denom"` +} + +type BeforeSendHookResponse struct { + CosmWasmAddr string `json:"cosm_wasm_addr"` +} + type DenomAdminResponse struct { Admin string `json:"admin"` } diff --git a/wasmbinding/custom_querier.go b/wasmbinding/custom_querier.go index 385ab69e8..36d0d6c63 100644 --- a/wasmbinding/custom_querier.go +++ b/wasmbinding/custom_querier.go @@ -128,6 +128,19 @@ func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessag return bz, nil + case contractQuery.BeforeSendHook != nil: + res, err := qp.GetBeforeSendHook(ctx, contractQuery.BeforeSendHook.Denom) + if err != nil { + return nil, errors.Wrap(err, "unable to get denom before send hook") + } + + bz, err := json.Marshal(res) + if err != nil { + return nil, errors.Wrap(err, "failed to JSON marshal BeforeSendHookResponse response") + } + + return bz, nil + case contractQuery.Failures != nil: res, err := qp.GetFailures(ctx, contractQuery.Failures.Address, contractQuery.Failures.Pagination) if err != nil { diff --git a/wasmbinding/message_plugin.go b/wasmbinding/message_plugin.go index 68d7b5670..c11ae3931 100644 --- a/wasmbinding/message_plugin.go +++ b/wasmbinding/message_plugin.go @@ -121,8 +121,8 @@ func (m *CustomMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddre if contractMsg.MintTokens != nil { return m.mintTokens(ctx, contractAddr, contractMsg.MintTokens) } - if contractMsg.SetBeforeSend != nil { - return m.setBeforeSend(ctx, contractAddr, contractMsg.SetBeforeSend) + if contractMsg.SetBeforeSendHook != nil { + return m.setBeforeSendHook(ctx, contractAddr, contractMsg.SetBeforeSendHook) } if contractMsg.ChangeAdmin != nil { return m.changeAdmin(ctx, contractAddr, contractMsg.ChangeAdmin) @@ -499,10 +499,10 @@ func (m *CustomMessenger) mintTokens(ctx sdk.Context, contractAddr sdk.AccAddres } // mintTokens mints tokens of a specified denom to an address. -func (m *CustomMessenger) setBeforeSend(ctx sdk.Context, contractAddr sdk.AccAddress, set *bindings.SetBeforeSend) ([]sdk.Event, [][]byte, error) { - err := PerformSetBeforeSend(m.TokenFactory, ctx, contractAddr, set) +func (m *CustomMessenger) setBeforeSendHook(ctx sdk.Context, contractAddr sdk.AccAddress, set *bindings.SetBeforeSendHook) ([]sdk.Event, [][]byte, error) { + err := PerformSetBeforeSendHook(m.TokenFactory, ctx, contractAddr, set) if err != nil { - return nil, nil, errors.Wrap(err, "perform mint") + return nil, nil, errors.Wrap(err, "perform set before send hook") } return nil, nil, nil } @@ -535,13 +535,13 @@ func PerformMint(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk return nil } -func PerformSetBeforeSend(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, set *bindings.SetBeforeSend) error { +func PerformSetBeforeSendHook(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, set *bindings.SetBeforeSendHook) error { sdkMsg := tokenfactorytypes.NewMsgSetBeforeSendHook(contractAddr.String(), set.Denom, set.CosmWasmAddr) if err := sdkMsg.ValidateBasic(); err != nil { return err } - // SetBeforeSend through token factory / message server + // SetBeforeSendHook through token factory / message server msgServer := tokenfactorykeeper.NewMsgServerImpl(*f) _, err := msgServer.SetBeforeSendHook(sdk.WrapSDKContext(ctx), sdkMsg) if err != nil { diff --git a/wasmbinding/queries.go b/wasmbinding/queries.go index ef5930b0d..1d3cf42c6 100644 --- a/wasmbinding/queries.go +++ b/wasmbinding/queries.go @@ -95,6 +95,13 @@ func (qp QueryPlugin) GetDenomAdmin(ctx sdk.Context, denom string) (*bindings.De return &bindings.DenomAdminResponse{Admin: metadata.Admin}, nil } +// GetBeforeSendHook is a query to get denom before send hook. +func (qp QueryPlugin) GetBeforeSendHook(ctx sdk.Context, denom string) (*bindings.BeforeSendHookResponse, error) { + cosmWasmAddr := qp.tokenFactoryKeeper.GetBeforeSendHook(ctx, denom) + + return &bindings.BeforeSendHookResponse{CosmWasmAddr: cosmWasmAddr}, nil +} + func (qp *QueryPlugin) GetTotalBurnedNeutronsAmount(ctx sdk.Context, _ *bindings.QueryTotalBurnedNeutronsAmountRequest) (*bindings.QueryTotalBurnedNeutronsAmountResponse, error) { grpcResp := qp.feeBurnerKeeper.GetTotalBurnedNeutronsAmount(ctx) return &bindings.QueryTotalBurnedNeutronsAmountResponse{Coin: grpcResp.Coin}, nil diff --git a/x/tokenfactory/client/cli/query.go b/x/tokenfactory/client/cli/query.go index 11e4dc944..425bf783d 100644 --- a/x/tokenfactory/client/cli/query.go +++ b/x/tokenfactory/client/cli/query.go @@ -84,7 +84,7 @@ func GetCmdDenomAuthorityMetadata() *cobra.Command { } res, err := queryClient.DenomAuthorityMetadata(cmd.Context(), &types.QueryDenomAuthorityMetadataRequest{ - Denom: args[0], + Subdenom: args[0], }) if err != nil { return err @@ -113,7 +113,7 @@ func GetCmdDenomsFromCreator() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) res, err := queryClient.BeforeSendHookAddress(cmd.Context(), &types.QueryBeforeSendHookAddressRequest{ - Denom: args[0], + Subdenom: args[0], }) if err != nil { return err diff --git a/x/tokenfactory/keeper/grpc_query.go b/x/tokenfactory/keeper/grpc_query.go index ea2ad259c..59c62a1e4 100644 --- a/x/tokenfactory/keeper/grpc_query.go +++ b/x/tokenfactory/keeper/grpc_query.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,7 +21,8 @@ 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) - authorityMetadata, err := k.GetAuthorityMetadata(sdkCtx, req.GetDenom()) + denom := fmt.Sprintf("factory/%s/%s", req.GetCreator(), req.GetSubdenom()) + authorityMetadata, err := k.GetAuthorityMetadata(sdkCtx, denom) if err != nil { return nil, err } @@ -37,7 +39,8 @@ func (k Keeper) DenomsFromCreator(ctx context.Context, req *types.QueryDenomsFro func (k Keeper) BeforeSendHookAddress(ctx context.Context, req *types.QueryBeforeSendHookAddressRequest) (*types.QueryBeforeSendHookAddressResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) - cosmwasmAddress := k.GetBeforeSendHook(sdkCtx, req.GetDenom()) + denom := fmt.Sprintf("factory/%s/%s", req.GetCreator(), req.GetSubdenom()) + cosmwasmAddress := k.GetBeforeSendHook(sdkCtx, denom) return &types.QueryBeforeSendHookAddressResponse{CosmwasmAddress: cosmwasmAddress}, nil } diff --git a/x/tokenfactory/types/query.pb.go b/x/tokenfactory/types/query.pb.go index 126c06e8b..1d06ab5fd 100644 --- a/x/tokenfactory/types/query.pb.go +++ b/x/tokenfactory/types/query.pb.go @@ -115,7 +115,8 @@ func (m *QueryParamsResponse) GetParams() Params { // QueryDenomAuthorityMetadataRequest defines the request structure for the // DenomAuthorityMetadata gRPC query. type QueryDenomAuthorityMetadataRequest struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty" yaml:"creator"` + Subdenom string `protobuf:"bytes,2,opt,name=subdenom,proto3" json:"subdenom,omitempty" yaml:"subdenom"` } func (m *QueryDenomAuthorityMetadataRequest) Reset() { *m = QueryDenomAuthorityMetadataRequest{} } @@ -151,9 +152,16 @@ func (m *QueryDenomAuthorityMetadataRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryDenomAuthorityMetadataRequest proto.InternalMessageInfo -func (m *QueryDenomAuthorityMetadataRequest) GetDenom() string { +func (m *QueryDenomAuthorityMetadataRequest) GetCreator() string { if m != nil { - return m.Denom + return m.Creator + } + return "" +} + +func (m *QueryDenomAuthorityMetadataRequest) GetSubdenom() string { + if m != nil { + return m.Subdenom } return "" } @@ -297,7 +305,8 @@ func (m *QueryDenomsFromCreatorResponse) GetDenoms() []string { } type QueryBeforeSendHookAddressRequest struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty" yaml:"creator"` + Subdenom string `protobuf:"bytes,2,opt,name=subdenom,proto3" json:"subdenom,omitempty" yaml:"subdenom"` } func (m *QueryBeforeSendHookAddressRequest) Reset() { *m = QueryBeforeSendHookAddressRequest{} } @@ -333,9 +342,16 @@ func (m *QueryBeforeSendHookAddressRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryBeforeSendHookAddressRequest proto.InternalMessageInfo -func (m *QueryBeforeSendHookAddressRequest) GetDenom() string { +func (m *QueryBeforeSendHookAddressRequest) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *QueryBeforeSendHookAddressRequest) GetSubdenom() string { if m != nil { - return m.Denom + return m.Subdenom } return "" } @@ -402,48 +418,49 @@ func init() { } var fileDescriptor_6f22013ad0f72e3f = []byte{ - // 653 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x95, 0x4d, 0x4f, 0x53, 0x4d, - 0x14, 0xc7, 0x7b, 0x9f, 0x47, 0x6a, 0x18, 0xdf, 0x60, 0xc4, 0xb7, 0x8a, 0xb7, 0x32, 0x12, 0x02, - 0x09, 0x76, 0xe4, 0x65, 0x25, 0x12, 0xe8, 0x45, 0xd1, 0x04, 0x49, 0xf4, 0xba, 0xd2, 0x4d, 0x33, - 0x6d, 0x87, 0xd2, 0xc0, 0xbd, 0xa7, 0xcc, 0x4c, 0xd5, 0x86, 0xb0, 0x71, 0xe1, 0xda, 0xc4, 0xa5, - 0xdf, 0xc1, 0xc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, 0xe6, 0x33, 0x05, 0x08, 0x78, 0x28, 0xab, 0x46, 0x41, 0x78, 0x1f, 0x54, - 0xa9, 0xf5, 0xcd, 0xdf, 0x1f, 0x2f, 0x68, 0x6a, 0x15, 0xa9, 0xf3, 0x49, 0xfb, 0x3f, 0x33, 0xf3, - 0x3b, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x1b, 0x6a, 0xf2, 0x46, 0x07, 0x00, 0x00, + // 671 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x95, 0x4f, 0x4f, 0x53, 0x4d, + 0x14, 0xc6, 0x3b, 0xbc, 0xaf, 0x55, 0xc6, 0x28, 0x32, 0xa0, 0x62, 0xc5, 0x5b, 0x19, 0x89, 0x81, + 0x04, 0x3b, 0xf2, 0x67, 0x25, 0x1a, 0xe1, 0x62, 0x88, 0x89, 0x21, 0xd1, 0x2b, 0x31, 0x91, 0x98, + 0x34, 0xd3, 0x76, 0x28, 0x0d, 0xdc, 0x7b, 0xca, 0xcc, 0x54, 0x6d, 0x08, 0x1b, 0x4c, 0x5c, 0x9b, + 0xb8, 0xf4, 0x3b, 0xf8, 0x39, 0x58, 0x92, 0xb0, 0x71, 0xd5, 0x18, 0xf0, 0x13, 0x74, 0xe1, 0xc6, + 0x8d, 0xe9, 0xcc, 0x14, 0x84, 0x96, 0x9b, 0x0a, 0x89, 0xbb, 0x9b, 0x99, 0x73, 0x9e, 0xf3, 0xfc, + 0xe6, 0x9c, 0x93, 0x8b, 0x47, 0x40, 0x85, 0xa0, 0x4a, 0x8a, 0x69, 0x58, 0x15, 0xd1, 0x32, 0xcf, + 0x6b, 0x90, 0x55, 0xf6, 0x76, 0x3c, 0x27, 0x34, 0x1f, 0x67, 0xeb, 0x15, 0x21, 0xab, 0x99, 0xb2, + 0x04, 0x0d, 0x64, 0xd0, 0x45, 0x66, 0xfe, 0x8c, 0xcc, 0xb8, 0xc8,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, 0x47, 0xf3, 0xc6, 0xd0, 0xbc, 0x22, 0x8b, 0xf1, 0x34, + 0x76, 0xd0, 0x58, 0xf3, 0x78, 0xc3, 0x4d, 0xc9, 0x26, 0xdb, 0x68, 0xf6, 0x7f, 0x93, 0xb5, 0x2e, + 0x12, 0xd9, 0x45, 0xb8, 0xb7, 0x65, 0xc2, 0xc9, 0x74, 0xa7, 0xb6, 0xdb, 0xac, 0x59, 0xea, 0xe1, + 0xe9, 0x92, 0x1d, 0xee, 0x9c, 0xc1, 0x7d, 0x44, 0xa6, 0x3b, 0xc1, 0xcd, 0x2e, 0x4b, 0x08, 0xb3, + 0x0e, 0xf5, 0x90, 0x99, 0xfc, 0x44, 0xf8, 0x6a, 0xdb, 0x29, 0x27, 0x8f, 0x3b, 0x30, 0x17, 0xb7, + 0xa3, 0xa9, 0x99, 0xd3, 0x0b, 0x38, 0xc2, 0x25, 0x43, 0xb8, 0x48, 0x82, 0xb3, 0x37, 0x34, 0x67, + 0x0a, 0x65, 0x95, 0x88, 0x0a, 0xd9, 0x15, 0x80, 0x55, 0x7f, 0x61, 0x7b, 0xcf, 0x43, 0x3b, 0x7b, + 0x1e, 0xfa, 0xbe, 0xe7, 0xa1, 0x4f, 0xfb, 0x5e, 0x62, 0x67, 0xdf, 0x4b, 0x7c, 0xdb, 0xf7, 0x12, + 0x4b, 0x93, 0xc5, 0x92, 0x5e, 0xa9, 0xe4, 0x32, 0x79, 0x08, 0x59, 0x24, 0x2a, 0x5a, 0x42, 0x74, + 0x0f, 0x64, 0xb1, 0xf9, 0xcd, 0xde, 0x1f, 0x75, 0xa1, 0xab, 0x65, 0xa1, 0x72, 0x49, 0xf3, 0x07, + 0x9c, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x90, 0xae, 0xbc, 0xc7, 0xe0, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -726,10 +743,17 @@ func (m *QueryDenomAuthorityMetadataRequest) MarshalToSizedBuffer(dAtA []byte) ( _ = i var l int _ = l - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + if len(m.Subdenom) > 0 { + i -= len(m.Subdenom) + copy(dAtA[i:], m.Subdenom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Subdenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Creator))) i-- dAtA[i] = 0xa } @@ -851,10 +875,17 @@ func (m *QueryBeforeSendHookAddressRequest) MarshalToSizedBuffer(dAtA []byte) (i _ = i var l int _ = l - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + if len(m.Subdenom) > 0 { + i -= len(m.Subdenom) + copy(dAtA[i:], m.Subdenom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Subdenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Creator))) i-- dAtA[i] = 0xa } @@ -928,7 +959,11 @@ func (m *QueryDenomAuthorityMetadataRequest) Size() (n int) { } var l int _ = l - l = len(m.Denom) + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Subdenom) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -980,7 +1015,11 @@ func (m *QueryBeforeSendHookAddressRequest) Size() (n int) { } var l int _ = l - l = len(m.Denom) + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Subdenom) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -1170,7 +1209,39 @@ func (m *QueryDenomAuthorityMetadataRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subdenom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1198,7 +1269,7 @@ func (m *QueryDenomAuthorityMetadataRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denom = string(dAtA[iNdEx:postIndex]) + m.Subdenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1499,7 +1570,39 @@ func (m *QueryBeforeSendHookAddressRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subdenom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1527,7 +1630,7 @@ func (m *QueryBeforeSendHookAddressRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denom = string(dAtA[iNdEx:postIndex]) + m.Subdenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/tokenfactory/types/query.pb.gw.go b/x/tokenfactory/types/query.pb.gw.go index 5d75e90ba..3da3e9e6d 100644 --- a/x/tokenfactory/types/query.pb.gw.go +++ b/x/tokenfactory/types/query.pb.gw.go @@ -62,15 +62,26 @@ func request_Query_DenomAuthorityMetadata_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["denom"] + val, ok = pathParams["creator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "creator") + } + + protoReq.Creator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "creator", err) + } + + val, ok = pathParams["subdenom"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subdenom") } - protoReq.Denom, err = runtime.String(val) + protoReq.Subdenom, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subdenom", err) } msg, err := client.DenomAuthorityMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -89,15 +100,26 @@ func local_request_Query_DenomAuthorityMetadata_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["denom"] + val, ok = pathParams["creator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "creator") + } + + protoReq.Creator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "creator", err) + } + + val, ok = pathParams["subdenom"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subdenom") } - protoReq.Denom, err = runtime.String(val) + protoReq.Subdenom, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subdenom", err) } msg, err := server.DenomAuthorityMetadata(ctx, &protoReq) @@ -170,15 +192,26 @@ func request_Query_BeforeSendHookAddress_0(ctx context.Context, marshaler runtim _ = err ) - val, ok = pathParams["denom"] + val, ok = pathParams["creator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "creator") + } + + protoReq.Creator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "creator", err) + } + + val, ok = pathParams["subdenom"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subdenom") } - protoReq.Denom, err = runtime.String(val) + protoReq.Subdenom, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subdenom", err) } msg, err := client.BeforeSendHookAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -197,15 +230,26 @@ func local_request_Query_BeforeSendHookAddress_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["denom"] + val, ok = pathParams["creator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "creator") + } + + protoReq.Creator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "creator", err) + } + + val, ok = pathParams["subdenom"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subdenom") } - protoReq.Denom, err = runtime.String(val) + protoReq.Subdenom, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subdenom", err) } msg, err := server.BeforeSendHookAddress(ctx, &protoReq) @@ -438,11 +482,11 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "tokenfactory", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - 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_DenomAuthorityMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"osmosis", "tokenfactory", "v1beta1", "denoms", "factory", "creator", "subdenom", "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_BeforeSendHookAddress_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", "before_send_hook"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_BeforeSendHookAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"osmosis", "tokenfactory", "v1beta1", "denoms", "factory", "creator", "subdenom", "before_send_hook"}, "", runtime.AssumeColonVerbOpt(false))) ) var (