diff --git a/proto/stratos/pot/v1/query.proto b/proto/stratos/pot/v1/query.proto index 5dbe08c8..4097baa8 100644 --- a/proto/stratos/pot/v1/query.proto +++ b/proto/stratos/pot/v1/query.proto @@ -35,6 +35,10 @@ service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/stratos/pot/v1/params"; } + + rpc TotalMinedToken(QueryTotalMinedTokenRequest) returns (QueryTotalMinedTokenResponse) { + option (google.api.http).get = "/stratos/pot/v1/total-mined-token"; + } } // QueryVolumeReportRequest is request type for the Query/VolumeReport RPC method @@ -116,6 +120,15 @@ message QuerySlashingByOwnerResponse { } +message QueryTotalMinedTokenRequest{} + +message QueryTotalMinedTokenResponse{ + cosmos.base.v1beta1.Coin total_mined_token = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "total_mined_token", + (gogoproto.moretags) = "yaml:\"total_mined_token\"" + ]; +} diff --git a/x/pot/client/cli/query.go b/x/pot/client/cli/query.go index 93047fa2..f123af25 100644 --- a/x/pot/client/cli/query.go +++ b/x/pot/client/cli/query.go @@ -5,12 +5,14 @@ import ( "strconv" "strings" + "github.com/spf13/cobra" + "github.com/spf13/viper" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" - "github.com/spf13/cobra" - "github.com/spf13/viper" + "github.com/stratosnet/stratos-chain/x/pot/types" ) @@ -28,11 +30,40 @@ func GetQueryCmd() *cobra.Command { potQueryCmd.AddCommand( GetCmdQueryVolumeReport(), GetCmdQueryParams(), + GetCmdQueryTotalMinedTokens(), ) return potQueryCmd } +func GetCmdQueryTotalMinedTokens() *cobra.Command { + cmd := &cobra.Command{ + Use: "total-mined-token", + Args: cobra.NoArgs, + Short: "Query the total mined tokens", + Long: strings.TrimSpace( + fmt.Sprintf(`Query the total mined tokens.`), + ), + 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.TotalMinedToken(cmd.Context(), &types.QueryTotalMinedTokenRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + // GetCmdQueryParams implements the params query command. func GetCmdQueryParams() *cobra.Command { cmd := &cobra.Command{ @@ -72,10 +103,9 @@ $ %s query pot params // GetCmdQueryVolumeReport implements the query volume report command. func GetCmdQueryVolumeReport() *cobra.Command { cmd := &cobra.Command{ - Use: "report [flags]", // reporter: []byte + Use: "report [flags]", Short: "Query volume report hash by epoch", Long: strings.TrimSpace( - //fmt.Sprintf(`Query volume report hash by reporter.`), fmt.Sprintf(`Query volume report hash by epoch.`), ), @@ -110,16 +140,6 @@ func GetCmdQueryVolumeReport() *cobra.Command { return cmd } -//func QueryVolumeReport(cliCtx context.CLIContext, queryRoute string, epoch sdk.Int) (types.ReportInfo, int64, error) { -// route := fmt.Sprintf("custom/%s/%s", queryRoute, keeper.QueryVolumeReport) -// resp, height, err := cliCtx.QueryWithData(route, []byte(epoch.String())) -// if err != nil { -// return types.ReportInfo{}, height, err -// } -// reportRes := types.NewReportInfo(epoch, string(resp)) -// return reportRes, height, nil -//} - func checkFlagEpoch(epochStr string) (sdk.Int, error) { epochInt64, err := strconv.ParseInt(epochStr, 10, 64) if err != nil { diff --git a/x/pot/client/rest/query.go b/x/pot/client/rest/query.go index 47876524..fa636743 100644 --- a/x/pot/client/rest/query.go +++ b/x/pot/client/rest/query.go @@ -5,10 +5,12 @@ import ( "net/http" "strconv" + "github.com/gorilla/mux" + "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/rest" - "github.com/gorilla/mux" + "github.com/stratosnet/stratos-chain/x/pot/types" ) @@ -18,6 +20,7 @@ func registerQueryRoutes(clientCtx client.Context, r *mux.Router) { r.HandleFunc("/pot/rewards/wallet/{walletAddress}", getRewardsByWalletAddrHandlerFn(clientCtx, types.QueryRewardsByWalletAddr)).Methods("GET") r.HandleFunc("/pot/slashing/{walletAddress}", getSlashingByWalletAddressHandlerFn(clientCtx, types.QuerySlashingByWalletAddr)).Methods("GET") r.HandleFunc("/pot/params", potParamsHandlerFn(clientCtx, types.QueryPotParams)).Methods("GET") + r.HandleFunc("/pot/total-mined-token", getTotalMinedTokenHandlerFn(clientCtx, types.QueryTotalMinedToken)).Methods("GET") } // GET request handler to query params of POT module @@ -187,3 +190,21 @@ func getSlashingByWalletAddressHandlerFn(clientCtx client.Context, queryPath str rest.PostProcessResponse(w, cliCtx, res) } } + +func getTotalMinedTokenHandlerFn(clientCtx client.Context, queryPath string) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, clientCtx, r) + if !ok { + return + } + + route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, queryPath) + res, height, err := cliCtx.Query(route) + if err != nil { + rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) + return + } + cliCtx = cliCtx.WithHeight(height) + rest.PostProcessResponse(w, cliCtx, res) + } +} diff --git a/x/pot/client/rest/rest.go b/x/pot/client/rest/rest.go index 576eeb81..6bbd90cd 100644 --- a/x/pot/client/rest/rest.go +++ b/x/pot/client/rest/rest.go @@ -1,15 +1,15 @@ package rest import ( + "github.com/gorilla/mux" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/rest" - "github.com/gorilla/mux" ) const ( - RestWalletAddress = "wallet_address" - RestEpoch = "epoch" - RestHeight = "height" + RestEpoch = "epoch" + RestHeight = "height" ) // RegisterRoutes registers pot-related REST handlers to a router diff --git a/x/pot/keeper/grpc_query.go b/x/pot/keeper/grpc_query.go index cb361c1a..6e693db1 100644 --- a/x/pot/keeper/grpc_query.go +++ b/x/pot/keeper/grpc_query.go @@ -7,8 +7,6 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - db "github.com/tendermint/tm-db" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -103,10 +101,7 @@ func (q Querier) RewardsByEpoch(c context.Context, req *types.QueryRewardsByEpoc return &types.QueryRewardsByEpochResponse{}, status.Error(codes.Internal, err.Error()) } height := ctx.BlockHeight() - //var rewards []*types.Reward - //for i, v := range res { - // rewards[i] = &v - //} + return &types.QueryRewardsByEpochResponse{Rewards: res, Height: height, Pagination: rewardsPageRes}, nil } @@ -373,18 +368,9 @@ func Paginate( return res, nil } -func GetIterator(prefixStore storetypes.KVStore, start []byte, reverse bool) db.Iterator { - if reverse { - var end []byte - if start != nil { - itr := prefixStore.Iterator(start, nil) - defer itr.Close() - if itr.Valid() { - itr.Next() - end = itr.Key() - } - } - return prefixStore.ReverseIterator(nil, end) - } - return prefixStore.Iterator(start, nil) +func (q Querier) TotalMinedToken(c context.Context, _ *types.QueryTotalMinedTokenRequest) (*types.QueryTotalMinedTokenResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + totalMinedToken := q.GetTotalMinedTokens(ctx) + + return &types.QueryTotalMinedTokenResponse{TotalMinedToken: totalMinedToken}, nil } diff --git a/x/pot/keeper/store.go b/x/pot/keeper/store.go index 0731a67d..378df184 100644 --- a/x/pot/keeper/store.go +++ b/x/pot/keeper/store.go @@ -3,6 +3,9 @@ package keeper import ( gogotypes "github.com/gogo/protobuf/types" + db "github.com/tendermint/tm-db" + + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" stratos "github.com/stratosnet/stratos-chain/types" @@ -216,3 +219,19 @@ func (k Keeper) SetIsReadyToDistributeReward(ctx sdk.Context, isReady bool) { b := k.cdc.MustMarshalLengthPrefixed(&gogotypes.BoolValue{Value: isReady}) store.Set(types.IsReadyToDistributeReward, b) } + +func GetIterator(prefixStore storetypes.KVStore, start []byte, reverse bool) db.Iterator { + if reverse { + var end []byte + if start != nil { + itr := prefixStore.Iterator(start, nil) + defer itr.Close() + if itr.Valid() { + itr.Next() + end = itr.Key() + } + } + return prefixStore.ReverseIterator(nil, end) + } + return prefixStore.Iterator(start, nil) +} diff --git a/x/pot/types/querier.go b/x/pot/types/querier.go index 8ccd7757..4e098cd0 100644 --- a/x/pot/types/querier.go +++ b/x/pot/types/querier.go @@ -10,6 +10,7 @@ const ( QueryRewardsByWalletAddr = "query_pot_rewards_by_wallet_address" QuerySlashingByWalletAddr = "query_pot_slashing_by_wallet_address" QueryPotParams = "query_pot_params" + QueryTotalMinedToken = "query_total_mined_token" QueryDefaultLimit = 100 ) diff --git a/x/pot/types/query.pb.go b/x/pot/types/query.pb.go index 1ec194dc..043648a7 100644 --- a/x/pot/types/query.pb.go +++ b/x/pot/types/query.pb.go @@ -661,6 +661,86 @@ func (m *QuerySlashingByOwnerResponse) GetHeight() int64 { return 0 } +type QueryTotalMinedTokenRequest struct { +} + +func (m *QueryTotalMinedTokenRequest) Reset() { *m = QueryTotalMinedTokenRequest{} } +func (m *QueryTotalMinedTokenRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTotalMinedTokenRequest) ProtoMessage() {} +func (*QueryTotalMinedTokenRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c09bd09df76a68e0, []int{12} +} +func (m *QueryTotalMinedTokenRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalMinedTokenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalMinedTokenRequest.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 *QueryTotalMinedTokenRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalMinedTokenRequest.Merge(m, src) +} +func (m *QueryTotalMinedTokenRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalMinedTokenRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalMinedTokenRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalMinedTokenRequest proto.InternalMessageInfo + +type QueryTotalMinedTokenResponse struct { + TotalMinedToken types.Coin `protobuf:"bytes,1,opt,name=total_mined_token,json=totalMinedToken,proto3" json:"total_mined_token" yaml:"total_mined_token"` +} + +func (m *QueryTotalMinedTokenResponse) Reset() { *m = QueryTotalMinedTokenResponse{} } +func (m *QueryTotalMinedTokenResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTotalMinedTokenResponse) ProtoMessage() {} +func (*QueryTotalMinedTokenResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c09bd09df76a68e0, []int{13} +} +func (m *QueryTotalMinedTokenResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalMinedTokenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalMinedTokenResponse.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 *QueryTotalMinedTokenResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalMinedTokenResponse.Merge(m, src) +} +func (m *QueryTotalMinedTokenResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalMinedTokenResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalMinedTokenResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalMinedTokenResponse proto.InternalMessageInfo + +func (m *QueryTotalMinedTokenResponse) GetTotalMinedToken() types.Coin { + if m != nil { + return m.TotalMinedToken + } + return types.Coin{} +} + func init() { proto.RegisterType((*QueryVolumeReportRequest)(nil), "stratos.pot.v1.QueryVolumeReportRequest") proto.RegisterType((*QueryVolumeReportResponse)(nil), "stratos.pot.v1.QueryVolumeReportResponse") @@ -674,65 +754,74 @@ func init() { proto.RegisterType((*RewardByOwner)(nil), "stratos.pot.v1.RewardByOwner") proto.RegisterType((*QuerySlashingByOwnerRequest)(nil), "stratos.pot.v1.QuerySlashingByOwnerRequest") proto.RegisterType((*QuerySlashingByOwnerResponse)(nil), "stratos.pot.v1.QuerySlashingByOwnerResponse") + proto.RegisterType((*QueryTotalMinedTokenRequest)(nil), "stratos.pot.v1.QueryTotalMinedTokenRequest") + proto.RegisterType((*QueryTotalMinedTokenResponse)(nil), "stratos.pot.v1.QueryTotalMinedTokenResponse") } func init() { proto.RegisterFile("stratos/pot/v1/query.proto", fileDescriptor_c09bd09df76a68e0) } var fileDescriptor_c09bd09df76a68e0 = []byte{ - // 840 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcd, 0x4e, 0xdb, 0x48, - 0x1c, 0xc0, 0xe3, 0x64, 0x09, 0x30, 0x2c, 0xac, 0x76, 0x40, 0xac, 0xf1, 0xb2, 0x06, 0x79, 0xc5, - 0xf2, 0xb5, 0xf1, 0x10, 0xf6, 0xc0, 0x61, 0x4f, 0x0b, 0xcb, 0x6e, 0x39, 0x54, 0xa5, 0x6e, 0xd5, - 0x43, 0x2f, 0x68, 0x92, 0x0c, 0xb6, 0xd5, 0xc4, 0x63, 0x3c, 0x93, 0x40, 0x84, 0xb8, 0xf4, 0x09, - 0xaa, 0xf6, 0xd2, 0x5b, 0xd5, 0x1e, 0x7b, 0xe2, 0x31, 0x38, 0x22, 0xf5, 0xd2, 0x53, 0x5b, 0x41, - 0x5f, 0xa0, 0x6f, 0x50, 0x65, 0x66, 0x12, 0x62, 0xc7, 0x21, 0x51, 0xd5, 0x53, 0xec, 0xf9, 0x7f, - 0xfd, 0xfe, 0x1f, 0xf3, 0x77, 0x80, 0xc1, 0x78, 0x84, 0x39, 0x65, 0x28, 0xa4, 0x1c, 0x35, 0x8a, - 0xe8, 0xa8, 0x4e, 0xa2, 0xa6, 0x1d, 0x46, 0x94, 0x53, 0x38, 0xa5, 0x64, 0x76, 0x48, 0xb9, 0xdd, - 0x28, 0x1a, 0x33, 0x2e, 0x75, 0xa9, 0x10, 0xa1, 0xd6, 0x93, 0xd4, 0x32, 0xe6, 0x5d, 0x4a, 0xdd, - 0x2a, 0x41, 0x38, 0xf4, 0x11, 0x0e, 0x02, 0xca, 0x31, 0xf7, 0x69, 0xc0, 0x94, 0xd4, 0x2c, 0x53, - 0x56, 0xa3, 0x0c, 0x95, 0x30, 0x23, 0xa8, 0x51, 0x2c, 0x11, 0x8e, 0x8b, 0xa8, 0x4c, 0xfd, 0x40, - 0xc9, 0xd7, 0xba, 0xe5, 0x22, 0x78, 0x47, 0x2b, 0xc4, 0xae, 0x1f, 0x08, 0x67, 0x4a, 0x57, 0x4f, - 0xb0, 0xb6, 0xb0, 0x84, 0xc4, 0xda, 0x00, 0xfa, 0xfd, 0x96, 0xed, 0x23, 0x5a, 0xad, 0xd7, 0x88, - 0x43, 0x42, 0x1a, 0x71, 0x87, 0x1c, 0xd5, 0x09, 0xe3, 0x70, 0x06, 0x8c, 0x90, 0x90, 0x96, 0x3d, - 0x5d, 0x5b, 0xd4, 0x56, 0x72, 0x8e, 0x7c, 0xb1, 0x42, 0x30, 0x97, 0x62, 0xc1, 0x42, 0x1a, 0x30, - 0x02, 0xff, 0x06, 0x13, 0x91, 0x38, 0x39, 0xf0, 0x83, 0x43, 0x2a, 0x0c, 0x27, 0x36, 0x0d, 0x3b, - 0x5e, 0x0e, 0x5b, 0x1a, 0xed, 0x05, 0x87, 0xd4, 0x01, 0x51, 0xe7, 0x19, 0xce, 0x82, 0xbc, 0x47, - 0x7c, 0xd7, 0xe3, 0x7a, 0x56, 0x04, 0x54, 0x6f, 0x56, 0x1d, 0x80, 0x1b, 0x8b, 0x74, 0x2a, 0x38, - 0x0f, 0xc6, 0x23, 0x72, 0x48, 0x22, 0x12, 0x94, 0x89, 0x30, 0x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x0d, 0x72, 0x06, 0x5f, 0x6a, 0x60, 0x2a, 0x7e, - 0x9d, 0xe1, 0x5a, 0x6a, 0xb0, 0xd4, 0xbd, 0x64, 0xac, 0x0f, 0xa5, 0x3b, 0x08, 0x4d, 0x5d, 0x08, - 0x24, 0x98, 0x3a, 0x68, 0x6f, 0xba, 0xd1, 0xe4, 0x3d, 0x18, 0x80, 0xd6, 0xdd, 0xf3, 0x41, 0x68, - 0xb1, 0xce, 0x5a, 0x5b, 0x02, 0xad, 0x08, 0x51, 0x3f, 0x34, 0x39, 0x28, 0xe8, 0x34, 0x3e, 0x46, - 0x67, 0xf0, 0x95, 0x06, 0x7e, 0x4a, 0x8c, 0x0b, 0x4c, 0x8f, 0x9c, 0x3e, 0x9a, 0xc6, 0x9f, 0xc3, - 0x29, 0x2b, 0xce, 0xa2, 0xe0, 0x5c, 0x87, 0xab, 0x49, 0xce, 0xf6, 0x1c, 0xf6, 0x12, 0x1e, 0x81, - 0xbc, 0xfc, 0xd6, 0x40, 0x2b, 0x35, 0x54, 0xec, 0x73, 0x66, 0xfc, 0x7e, 0xab, 0x8e, 0xa2, 0x30, - 0x05, 0x85, 0x0e, 0x67, 0x93, 0x14, 0xf2, 0x63, 0xb6, 0xbd, 0x77, 0x71, 0x65, 0x6a, 0x97, 0x57, - 0xa6, 0xf6, 0xe9, 0xca, 0xd4, 0x9e, 0x5d, 0x9b, 0x99, 0xcb, 0x6b, 0x33, 0xf3, 0xfe, 0xda, 0xcc, - 0x3c, 0x46, 0x5d, 0xd7, 0x5c, 0xd9, 0x06, 0x84, 0xb7, 0x1f, 0x0b, 0x65, 0x0f, 0xfb, 0x01, 0x3a, - 0x11, 0xee, 0xc4, 0x9d, 0x2f, 0xe5, 0xc5, 0xdf, 0x92, 0xbf, 0xbe, 0x06, 0x00, 0x00, 0xff, 0xff, - 0x53, 0x30, 0x78, 0x78, 0x5e, 0x09, 0x00, 0x00, + // 945 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0x80, 0xb3, 0x09, 0x75, 0xda, 0x17, 0x9a, 0xa8, 0xd3, 0x28, 0x6c, 0x97, 0xd4, 0x29, 0x53, + 0x95, 0x26, 0x2d, 0xde, 0x89, 0x83, 0x50, 0x25, 0x38, 0x91, 0x52, 0x20, 0x87, 0x8a, 0xb2, 0x54, + 0x1c, 0xb8, 0x58, 0x13, 0x7b, 0xb2, 0xbb, 0xaa, 0x3d, 0xb3, 0xd9, 0x19, 0x27, 0xb1, 0x4a, 0x2e, + 0x5c, 0xb9, 0x20, 0x38, 0xc0, 0x01, 0x09, 0xc1, 0x91, 0x53, 0x7f, 0x46, 0x8f, 0x91, 0xb8, 0x70, + 0x0a, 0x28, 0xe1, 0xc4, 0x91, 0x5f, 0x80, 0x76, 0x66, 0xec, 0x78, 0xd7, 0xeb, 0x38, 0x42, 0x9c, + 0xbc, 0x33, 0xef, 0xbd, 0x79, 0xdf, 0x7b, 0xf3, 0xde, 0x1b, 0x83, 0x27, 0x55, 0x4a, 0x95, 0x90, + 0x24, 0x11, 0x8a, 0xec, 0xd5, 0xc9, 0x6e, 0x97, 0xa5, 0x3d, 0x3f, 0x49, 0x85, 0x12, 0x68, 0xde, + 0xca, 0xfc, 0x44, 0x28, 0x7f, 0xaf, 0xee, 0x2d, 0x86, 0x22, 0x14, 0x5a, 0x44, 0xb2, 0x2f, 0xa3, + 0xe5, 0x2d, 0x87, 0x42, 0x84, 0x6d, 0x46, 0x68, 0x12, 0x13, 0xca, 0xb9, 0x50, 0x54, 0xc5, 0x82, + 0x4b, 0x2b, 0xad, 0x36, 0x85, 0xec, 0x08, 0x49, 0xb6, 0xa9, 0x64, 0x64, 0xaf, 0xbe, 0xcd, 0x14, + 0xad, 0x93, 0xa6, 0x88, 0xb9, 0x95, 0xdf, 0x1b, 0x96, 0x6b, 0xe7, 0x03, 0xad, 0x84, 0x86, 0x31, + 0xd7, 0x87, 0x59, 0x5d, 0xb7, 0xc0, 0x9a, 0x61, 0x69, 0x09, 0x5e, 0x07, 0xf7, 0xd3, 0xcc, 0xf6, + 0x73, 0xd1, 0xee, 0x76, 0x58, 0xc0, 0x12, 0x91, 0xaa, 0x80, 0xed, 0x76, 0x99, 0x54, 0x68, 0x11, + 0x2e, 0xb1, 0x44, 0x34, 0x23, 0xd7, 0xb9, 0xe5, 0xac, 0xce, 0x04, 0x66, 0x81, 0x13, 0xb8, 0x51, + 0x62, 0x21, 0x13, 0xc1, 0x25, 0x43, 0xef, 0xc1, 0x5c, 0xaa, 0x77, 0x1a, 0x31, 0xdf, 0x11, 0xda, + 0x70, 0x6e, 0xc3, 0xf3, 0xf3, 0xe9, 0xf0, 0x8d, 0xd1, 0x16, 0xdf, 0x11, 0x01, 0xa4, 0x83, 0x6f, + 0xb4, 0x04, 0x95, 0x88, 0xc5, 0x61, 0xa4, 0xdc, 0x69, 0xed, 0xd0, 0xae, 0x70, 0x17, 0xe0, 0xcc, + 0xa2, 0x9c, 0x0a, 0x2d, 0xc3, 0x95, 0x94, 0xed, 0xb0, 0x94, 0xf1, 0x26, 0xd3, 0xe6, 0x57, 0x82, + 0xb3, 0x0d, 0xf4, 0x1a, 0xcc, 0xaa, 0x83, 0x46, 0x44, 0x65, 0xe4, 0xce, 0x68, 0x59, 0x45, 0x1d, + 0x7c, 0x4c, 0x65, 0x84, 0x3c, 0xb8, 0x6c, 0x00, 0x58, 0xea, 0xbe, 0xa2, 0x25, 0x83, 0x35, 0x5e, + 0x04, 0xa4, 0x03, 0x7d, 0x42, 0x53, 0xda, 0x91, 0x36, 0x29, 0xf8, 0x11, 0x5c, 0xcf, 0xed, 0xda, + 0xc0, 0x7d, 0xa8, 0x24, 0x7a, 0xc7, 0xc6, 0xbc, 0x54, 0x8c, 0xd9, 0xea, 0x5b, 0x2d, 0xfc, 0xb3, + 0x03, 0x9e, 0x3e, 0x27, 0x60, 0xfb, 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03, 0x7d, 0xb2, 0x9e, 0xa5, 0xdb, 0x15, 0xfd, + 0x77, 0xef, 0xed, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x9c, 0xef, 0xd6, 0xb6, 0x0a, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -757,6 +846,7 @@ type QueryClient interface { SlashingByOwner(ctx context.Context, in *QuerySlashingByOwnerRequest, opts ...grpc.CallOption) (*QuerySlashingByOwnerResponse, error) // Params queries POT module Params info. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + TotalMinedToken(ctx context.Context, in *QueryTotalMinedTokenRequest, opts ...grpc.CallOption) (*QueryTotalMinedTokenResponse, error) } type queryClient struct { @@ -812,6 +902,15 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } +func (c *queryClient) TotalMinedToken(ctx context.Context, in *QueryTotalMinedTokenRequest, opts ...grpc.CallOption) (*QueryTotalMinedTokenResponse, error) { + out := new(QueryTotalMinedTokenResponse) + err := c.cc.Invoke(ctx, "/stratos.pot.v1.Query/TotalMinedToken", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // VolumeReport queries VolumeReport info for given epoch. @@ -824,6 +923,7 @@ type QueryServer interface { SlashingByOwner(context.Context, *QuerySlashingByOwnerRequest) (*QuerySlashingByOwnerResponse, error) // Params queries POT module Params info. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + TotalMinedToken(context.Context, *QueryTotalMinedTokenRequest) (*QueryTotalMinedTokenResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -845,6 +945,9 @@ func (*UnimplementedQueryServer) SlashingByOwner(ctx context.Context, req *Query func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } +func (*UnimplementedQueryServer) TotalMinedToken(ctx context.Context, req *QueryTotalMinedTokenRequest) (*QueryTotalMinedTokenResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TotalMinedToken not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -940,6 +1043,24 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_TotalMinedToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTotalMinedTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TotalMinedToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stratos.pot.v1.Query/TotalMinedToken", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalMinedToken(ctx, req.(*QueryTotalMinedTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "stratos.pot.v1.Query", HandlerType: (*QueryServer)(nil), @@ -964,6 +1085,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, + { + MethodName: "TotalMinedToken", + Handler: _Query_TotalMinedToken_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "stratos/pot/v1/query.proto", @@ -1438,6 +1563,62 @@ func (m *QuerySlashingByOwnerResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *QueryTotalMinedTokenRequest) 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 *QueryTotalMinedTokenRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalMinedTokenRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryTotalMinedTokenResponse) 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 *QueryTotalMinedTokenResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalMinedTokenResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.TotalMinedToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1648,6 +1829,26 @@ func (m *QuerySlashingByOwnerResponse) Size() (n int) { return n } +func (m *QueryTotalMinedTokenRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryTotalMinedTokenResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.TotalMinedToken.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2925,6 +3126,139 @@ func (m *QuerySlashingByOwnerResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryTotalMinedTokenRequest) 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: QueryTotalMinedTokenRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalMinedTokenRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryTotalMinedTokenResponse) 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: QueryTotalMinedTokenResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalMinedTokenResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalMinedToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalMinedToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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/pot/types/query.pb.gw.go b/x/pot/types/query.pb.gw.go index 9593f114..c19c0dbf 100644 --- a/x/pot/types/query.pb.gw.go +++ b/x/pot/types/query.pb.gw.go @@ -283,6 +283,24 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } +func request_Query_TotalMinedToken_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalMinedTokenRequest + var metadata runtime.ServerMetadata + + msg, err := client.TotalMinedToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TotalMinedToken_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalMinedTokenRequest + var metadata runtime.ServerMetadata + + msg, err := server.TotalMinedToken(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. @@ -389,6 +407,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_TotalMinedToken_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.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TotalMinedToken_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalMinedToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -530,6 +568,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_TotalMinedToken_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_TotalMinedToken_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_TotalMinedToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -543,6 +601,8 @@ var ( pattern_Query_SlashingByOwner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"stratos", "pot", "v1", "slashing", "wallet_address"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"stratos", "pot", "v1", "params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_TotalMinedToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"stratos", "pot", "v1", "total-mined-token"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -555,4 +615,6 @@ var ( forward_Query_SlashingByOwner_0 = runtime.ForwardResponseMessage forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_TotalMinedToken_0 = runtime.ForwardResponseMessage )