diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index 185c5305c3..6e3026b4a7 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -27851,6 +27851,21 @@ paths: $ref: '#/definitions/googlerpcStatus' tags: - Query + /zeta-chain/zetacore/fungible/gas_stability_pool_balance: + get: + summary: Queries all gas stability pool balances. + operationId: Query_GasStabilityPoolBalanceAll + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/fungibleQueryAllGasStabilityPoolBalanceResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + tags: + - Query /zeta-chain/zetacore/fungible/gas_stability_pool_balance/{chain_id}: get: summary: Queries the balance of a gas stability pool on a given chain. @@ -50243,6 +50258,14 @@ definitions: - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + QueryAllGasStabilityPoolBalanceResponseBalance: + type: object + properties: + chain_id: + type: string + format: int64 + balance: + type: string bitcoinProof: type: object properties: @@ -50880,6 +50903,14 @@ definitions: $ref: '#/definitions/fungibleForeignCoins' pagination: $ref: '#/definitions/v1beta1PageResponse' + fungibleQueryAllGasStabilityPoolBalanceResponse: + type: object + properties: + balances: + type: array + items: + type: object + $ref: '#/definitions/QueryAllGasStabilityPoolBalanceResponseBalance' fungibleQueryGetForeignCoinsResponse: type: object properties: @@ -50895,8 +50926,6 @@ definitions: fungibleQueryGetGasStabilityPoolBalanceResponse: type: object properties: - contract_address: - type: string balance: type: string fungibleQueryGetSystemContractResponse: diff --git a/proto/fungible/query.proto b/proto/fungible/query.proto index 9abb33095c..a54730ba76 100644 --- a/proto/fungible/query.proto +++ b/proto/fungible/query.proto @@ -40,6 +40,11 @@ service Query { rpc GasStabilityPoolBalance(QueryGetGasStabilityPoolBalance) returns (QueryGetGasStabilityPoolBalanceResponse) { option (google.api.http).get = "/zeta-chain/zetacore/fungible/gas_stability_pool_balance/{chain_id}"; } + + // Queries all gas stability pool balances. + rpc GasStabilityPoolBalanceAll(QueryAllGasStabilityPoolBalance) returns (QueryAllGasStabilityPoolBalanceResponse) { + option (google.api.http).get = "/zeta-chain/zetacore/fungible/gas_stability_pool_balance"; + } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -86,6 +91,15 @@ message QueryGetGasStabilityPoolBalance { } message QueryGetGasStabilityPoolBalanceResponse { - string contract_address = 1; string balance = 2; } + +message QueryAllGasStabilityPoolBalance {} + +message QueryAllGasStabilityPoolBalanceResponse { + message Balance { + int64 chain_id = 1; + string balance = 2; + } + repeated Balance balances = 1 [(gogoproto.nullable) = false]; +} diff --git a/x/fungible/client/cli/query.go b/x/fungible/client/cli/query.go index 74b4a55adb..f0498d44b8 100644 --- a/x/fungible/client/cli/query.go +++ b/x/fungible/client/cli/query.go @@ -2,14 +2,9 @@ package cli import ( "fmt" - // "strings" - - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" - + "github.com/spf13/cobra" "github.com/zeta-chain/zetacore/x/fungible/types" ) @@ -30,6 +25,7 @@ func GetQueryCmd(_ string) *cobra.Command { CmdShowForeignCoins(), CmdGasStabilityPoolAddress(), CmdGasStabilityPoolBalance(), + CmdGasStabilityPoolBalances(), CmdSystemContract(), ) diff --git a/x/fungible/client/cli/query_gas_stability_pool.go b/x/fungible/client/cli/query_gas_stability_pool.go index 4aa9e24a18..46e2fa3ae8 100644 --- a/x/fungible/client/cli/query_gas_stability_pool.go +++ b/x/fungible/client/cli/query_gas_stability_pool.go @@ -68,3 +68,28 @@ func CmdGasStabilityPoolBalance() *cobra.Command { return cmd } + +func CmdGasStabilityPoolBalances() *cobra.Command { + cmd := &cobra.Command{ + Use: "gas-stability-pool-balances", + Short: "query all gas stability pool balances", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.GasStabilityPoolBalanceAll(context.Background(), &types.QueryAllGasStabilityPoolBalance{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/fungible/keeper/grpc_gas_stability_pool.go b/x/fungible/keeper/grpc_gas_stability_pool.go index 449a336594..023ef82836 100644 --- a/x/fungible/keeper/grpc_gas_stability_pool.go +++ b/x/fungible/keeper/grpc_gas_stability_pool.go @@ -42,3 +42,40 @@ func (k Keeper) GasStabilityPoolBalance( return &types.QueryGetGasStabilityPoolBalanceResponse{Balance: balance.String()}, nil } + +func (k Keeper) GasStabilityPoolBalanceAll( + c context.Context, + req *types.QueryAllGasStabilityPoolBalance, +) (*types.QueryAllGasStabilityPoolBalanceResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + // iterate supported chains + chains := k.observerKeeper.GetParams(ctx).GetSupportedChains() + balances := make([]types.QueryAllGasStabilityPoolBalanceResponse_Balance, 0, len(chains)) + for _, chain := range chains { + if chain == nil { + return nil, status.Error(codes.Internal, "invalid chain") + } + chainID := chain.ChainId + + balance, err := k.GetGasStabilityPoolBalance(ctx, chainID) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + if balance == nil { + return nil, status.Error(codes.NotFound, "no balance for the gas stability pool") + } + + balances = append(balances, types.QueryAllGasStabilityPoolBalanceResponse_Balance{ + ChainId: chainID, + Balance: balance.String(), + }) + } + + return &types.QueryAllGasStabilityPoolBalanceResponse{ + Balances: balances, + }, nil +} diff --git a/x/fungible/types/query.pb.go b/x/fungible/types/query.pb.go index f40c319e4e..0b2b3c1bc5 100644 --- a/x/fungible/types/query.pb.go +++ b/x/fungible/types/query.pb.go @@ -513,8 +513,7 @@ func (m *QueryGetGasStabilityPoolBalance) GetChainId() int64 { } type QueryGetGasStabilityPoolBalanceResponse struct { - ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` - Balance string `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance,omitempty"` + Balance string `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance,omitempty"` } func (m *QueryGetGasStabilityPoolBalanceResponse) Reset() { @@ -552,14 +551,145 @@ func (m *QueryGetGasStabilityPoolBalanceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryGetGasStabilityPoolBalanceResponse proto.InternalMessageInfo -func (m *QueryGetGasStabilityPoolBalanceResponse) GetContractAddress() string { +func (m *QueryGetGasStabilityPoolBalanceResponse) GetBalance() string { if m != nil { - return m.ContractAddress + return m.Balance } return "" } -func (m *QueryGetGasStabilityPoolBalanceResponse) GetBalance() string { +type QueryAllGasStabilityPoolBalance struct { +} + +func (m *QueryAllGasStabilityPoolBalance) Reset() { *m = QueryAllGasStabilityPoolBalance{} } +func (m *QueryAllGasStabilityPoolBalance) String() string { return proto.CompactTextString(m) } +func (*QueryAllGasStabilityPoolBalance) ProtoMessage() {} +func (*QueryAllGasStabilityPoolBalance) Descriptor() ([]byte, []int) { + return fileDescriptor_d671b6e9298b37cd, []int{12} +} +func (m *QueryAllGasStabilityPoolBalance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllGasStabilityPoolBalance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllGasStabilityPoolBalance.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 *QueryAllGasStabilityPoolBalance) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllGasStabilityPoolBalance.Merge(m, src) +} +func (m *QueryAllGasStabilityPoolBalance) XXX_Size() int { + return m.Size() +} +func (m *QueryAllGasStabilityPoolBalance) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllGasStabilityPoolBalance.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllGasStabilityPoolBalance proto.InternalMessageInfo + +type QueryAllGasStabilityPoolBalanceResponse struct { + Balances []QueryAllGasStabilityPoolBalanceResponse_Balance `protobuf:"bytes,1,rep,name=balances,proto3" json:"balances"` +} + +func (m *QueryAllGasStabilityPoolBalanceResponse) Reset() { + *m = QueryAllGasStabilityPoolBalanceResponse{} +} +func (m *QueryAllGasStabilityPoolBalanceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllGasStabilityPoolBalanceResponse) ProtoMessage() {} +func (*QueryAllGasStabilityPoolBalanceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d671b6e9298b37cd, []int{13} +} +func (m *QueryAllGasStabilityPoolBalanceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllGasStabilityPoolBalanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllGasStabilityPoolBalanceResponse.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 *QueryAllGasStabilityPoolBalanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllGasStabilityPoolBalanceResponse.Merge(m, src) +} +func (m *QueryAllGasStabilityPoolBalanceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllGasStabilityPoolBalanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllGasStabilityPoolBalanceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllGasStabilityPoolBalanceResponse proto.InternalMessageInfo + +func (m *QueryAllGasStabilityPoolBalanceResponse) GetBalances() []QueryAllGasStabilityPoolBalanceResponse_Balance { + if m != nil { + return m.Balances + } + return nil +} + +type QueryAllGasStabilityPoolBalanceResponse_Balance struct { + ChainId int64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Balance string `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance,omitempty"` +} + +func (m *QueryAllGasStabilityPoolBalanceResponse_Balance) Reset() { + *m = QueryAllGasStabilityPoolBalanceResponse_Balance{} +} +func (m *QueryAllGasStabilityPoolBalanceResponse_Balance) String() string { + return proto.CompactTextString(m) +} +func (*QueryAllGasStabilityPoolBalanceResponse_Balance) ProtoMessage() {} +func (*QueryAllGasStabilityPoolBalanceResponse_Balance) Descriptor() ([]byte, []int) { + return fileDescriptor_d671b6e9298b37cd, []int{13, 0} +} +func (m *QueryAllGasStabilityPoolBalanceResponse_Balance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllGasStabilityPoolBalanceResponse_Balance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllGasStabilityPoolBalanceResponse_Balance.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 *QueryAllGasStabilityPoolBalanceResponse_Balance) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllGasStabilityPoolBalanceResponse_Balance.Merge(m, src) +} +func (m *QueryAllGasStabilityPoolBalanceResponse_Balance) XXX_Size() int { + return m.Size() +} +func (m *QueryAllGasStabilityPoolBalanceResponse_Balance) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllGasStabilityPoolBalanceResponse_Balance.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllGasStabilityPoolBalanceResponse_Balance proto.InternalMessageInfo + +func (m *QueryAllGasStabilityPoolBalanceResponse_Balance) GetChainId() int64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *QueryAllGasStabilityPoolBalanceResponse_Balance) GetBalance() string { if m != nil { return m.Balance } @@ -579,62 +709,68 @@ func init() { proto.RegisterType((*QueryGetGasStabilityPoolAddressResponse)(nil), "zetachain.zetacore.fungible.QueryGetGasStabilityPoolAddressResponse") proto.RegisterType((*QueryGetGasStabilityPoolBalance)(nil), "zetachain.zetacore.fungible.QueryGetGasStabilityPoolBalance") proto.RegisterType((*QueryGetGasStabilityPoolBalanceResponse)(nil), "zetachain.zetacore.fungible.QueryGetGasStabilityPoolBalanceResponse") + proto.RegisterType((*QueryAllGasStabilityPoolBalance)(nil), "zetachain.zetacore.fungible.QueryAllGasStabilityPoolBalance") + proto.RegisterType((*QueryAllGasStabilityPoolBalanceResponse)(nil), "zetachain.zetacore.fungible.QueryAllGasStabilityPoolBalanceResponse") + proto.RegisterType((*QueryAllGasStabilityPoolBalanceResponse_Balance)(nil), "zetachain.zetacore.fungible.QueryAllGasStabilityPoolBalanceResponse.Balance") } func init() { proto.RegisterFile("fungible/query.proto", fileDescriptor_d671b6e9298b37cd) } var fileDescriptor_d671b6e9298b37cd = []byte{ - // 785 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4f, 0x4f, 0x13, 0x41, - 0x1c, 0xed, 0x82, 0x80, 0x0c, 0x08, 0x66, 0xac, 0x11, 0x0b, 0x6e, 0x75, 0x55, 0x10, 0x91, 0x1d, - 0xa1, 0x21, 0x41, 0xe0, 0x60, 0x41, 0x21, 0xc4, 0x0b, 0x96, 0x8b, 0x7a, 0x69, 0xa6, 0xed, 0xb0, - 0x6c, 0xb2, 0xdd, 0x29, 0x9d, 0x29, 0xa1, 0x12, 0x2e, 0x7e, 0x02, 0x13, 0x4f, 0x7e, 0x11, 0x2f, - 0x7a, 0xf0, 0xc8, 0x91, 0xc4, 0x8b, 0x27, 0x35, 0xe0, 0xc9, 0x4f, 0x61, 0x3a, 0x7f, 0x4a, 0x5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0x51, 0xbb, 0x80, 0x96, 0xaf, 0x0f, 0x2e, 0xb4, 0x75, 0x90, 0x81, 0xb1, 0x91, - 0x58, 0xec, 0x08, 0xab, 0x0c, 0xcc, 0x09, 0x03, 0x08, 0x4e, 0x47, 0x1b, 0x68, 0xf9, 0x15, 0x85, - 0xbf, 0x0d, 0x70, 0x2b, 0x24, 0x03, 0xe0, 0x52, 0x5b, 0x7a, 0x42, 0xd0, 0x89, 0x17, 0x97, 0x41, - 0xd7, 0x6d, 0x3d, 0x17, 0xb6, 0x16, 0xe0, 0x7c, 0xb4, 0x2d, 0x07, 0xb3, 0x2c, 0xd3, 0x7d, 0xb2, - 0x25, 0x4a, 0x3d, 0xfd, 0xf1, 0xc3, 0x7f, 0x01, 0x0e, 0x75, 0xe4, 0x74, 0xe6, 0x50, 0xa1, 0x3b, - 0x74, 0xd8, 0x12, 0x58, 0xd6, 0x2b, 0xe1, 0xf0, 0x25, 0x5c, 0xb9, 0xb0, 0x43, 0x95, 0x56, 0x68, - 0x5f, 0xc7, 0xe6, 0xc1, 0xf2, 0xfa, 0xe1, 0xb1, 0x69, 0x1c, 0x1d, 0x9b, 0xc6, 0x9f, 0x63, 0xd3, - 0xf8, 0x78, 0x62, 0xc6, 0x8e, 0x4e, 0xcc, 0xd8, 0xcf, 0x13, 0x33, 0xf6, 0x0e, 0x39, 0x2e, 0xdf, - 0xae, 0xe4, 0xec, 0x3c, 0x2d, 0x06, 0x12, 0xed, 0x9d, 0x52, 0xf1, 0x6a, 0x89, 0xb0, 0x5c, 0xaf, - 0xf8, 0xb3, 0x94, 0xfa, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xd3, 0x77, 0x16, 0x8c, 0x16, 0x0a, 0x00, - 0x00, + // 843 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcf, 0x4f, 0x13, 0x4d, + 0x18, 0xee, 0xc2, 0xc7, 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, 0x92, 0xfa, 0x93, 0x4f, 0x65, + 0x72, 0x6e, 0xda, 0x8c, 0xd0, 0x92, 0x45, 0xa8, 0xe3, 0x70, 0x57, 0xea, 0x80, 0x9e, 0x7a, 0x1c, + 0xe1, 0x67, 0x75, 0xa9, 0xdb, 0x92, 0x28, 0xc3, 0xf6, 0x2b, 0x4c, 0xb8, 0xfa, 0x73, 0xf4, 0x5f, + 0x68, 0x55, 0x94, 0xb8, 0x23, 0x18, 0x4e, 0xa1, 0x61, 0x4f, 0xd0, 0xa4, 0x72, 0x55, 0xb9, 0x35, + 0xb6, 0x78, 0xdd, 0x68, 0x73, 0x1e, 0x86, 0x07, 0x5e, 0xff, 0xeb, 0xe4, 0x5b, 0x22, 0x96, 0x01, + 0xa0, 0x9e, 0x44, 0x53, 0xb2, 0xf3, 0x26, 0x73, 0x37, 0x3c, 0xe7, 0xe9, 0xba, 0x71, 0x20, 0xc6, + 0x71, 0x34, 0x64, 0x39, 0x05, 0x76, 0x28, 0x09, 0xfe, 0xce, 0x78, 0x2f, 0xba, 0x40, 0xd3, 0xad, + 0x41, 0xa0, 0x6b, 0x07, 0x8d, 0xef, 0x36, 0xac, 0x83, 0xba, 0xdb, 0x6d, 0xd5, 0x35, 0x36, 0x02, + 0x8d, 0xa1, 0x26, 0x3a, 0x03, 0xa5, 0x29, 0xdb, 0x6e, 0xa5, 0x74, 0x03, 0xa1, 0xf3, 0x5b, 0x05, + 0xc6, 0x19, 0xc3, 0x1b, 0x01, 0xa3, 0x3e, 0x02, 0x86, 0x37, 0x38, 0x30, 0x02, 0xc6, 0x36, 0x35, + 0x19, 0x60, 0x33, 0x0d, 0x48, 0xfd, 0xa3, 0x02, 0xe6, 0xfe, 0xe0, 0x89, 0x34, 0x37, 0xd8, 0xb7, + 0x39, 0xbc, 0x19, 0x52, 0x3f, 0x20, 0xd5, 0xcf, 0x76, 0x54, 0xef, 0x29, 0x0a, 0xc9, 0x4f, 0xa0, + 0x2b, 0xfe, 0xd5, 0xec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, 0x41, 0x85, 0x49, 0x67, 0xc9, 0xa1, 0x94, + 0x54, 0xef, 0x75, 0x0f, 0xf0, 0xfc, 0xe8, 0x77, 0x5f, 0x7f, 0xfe, 0xf9, 0x76, 0x60, 0x06, 0xdf, + 0x20, 0xf5, 0xfa, 0x79, 0x09, 0x25, 0x3e, 0x94, 0x34, 0xa5, 0x3e, 0xfe, 0xa4, 0xa0, 0xf1, 0xc6, + 0x5f, 0x32, 0x5e, 0xee, 0x4c, 0xd8, 0x3a, 0x57, 0xd5, 0xfb, 0x3d, 0x20, 0x41, 0xf3, 0xaa, 0xd4, + 0xbc, 0x84, 0x93, 0xed, 0x35, 0x87, 0xfe, 0xc7, 0xc8, 0x91, 0x0c, 0xee, 0x63, 0xfc, 0x41, 0x41, + 0xff, 0x36, 0x76, 0x4d, 0xd9, 0x76, 0x37, 0x2e, 0x5a, 0x67, 0x6e, 0x37, 0x2e, 0x22, 0x52, 0x54, + 0x4f, 0x4a, 0x17, 0xf3, 0x78, 0xee, 0x02, 0x2e, 0xea, 0x17, 0xd0, 0x94, 0x28, 0x78, 0xa5, 0xab, + 0x83, 0x6c, 0x19, 0x85, 0xea, 0x6a, 0x4f, 0x58, 0x30, 0xb0, 0x24, 0x0d, 0x10, 0x3c, 0xdf, 0xde, + 0x40, 0xd3, 0x97, 0x01, 0xfe, 0xae, 0xa0, 0x4b, 0x11, 0xb9, 0x86, 0xd7, 0xba, 0xd2, 0x13, 0x81, + 0x56, 0x1f, 0xf5, 0x83, 0x0e, 0x6c, 0x3d, 0x94, 0xb6, 0x56, 0xf0, 0x72, 0x7b, 0x5b, 0x26, 0x15, + 0x59, 0xe1, 0xf7, 0xc9, 0x96, 0x38, 0xb7, 0xfd, 0x7c, 0xc5, 0xbf, 0x5a, 0x38, 0xf4, 0xc3, 0xa1, + 0x37, 0x87, 0x80, 0xee, 0xd1, 0x61, 0x53, 0x86, 0xe9, 0x4f, 0xa4, 0xc3, 0xc7, 0x38, 0x7d, 0x61, + 0x87, 0x90, 0x56, 0xe4, 0xc8, 0x0f, 0xb8, 0x63, 0x5c, 0x53, 0x90, 0x1a, 0x41, 0x58, 0xff, 0x69, + 0xad, 0xf5, 0x93, 0xba, 0xdd, 0xf8, 0xed, 0x9c, 0xd9, 0x7d, 0xdc, 0x28, 0xf8, 0x5d, 0xdf, 0x3a, + 0xa9, 0x69, 0xca, 0x69, 0x4d, 0x53, 0x7e, 0xd4, 0x34, 0xe5, 0xcd, 0x99, 0x16, 0x3b, 0x3d, 0xd3, + 0x62, 0x5f, 0xce, 0xb4, 0xd8, 0x4b, 0x62, 0x5a, 0xee, 0x5e, 0x25, 0x67, 0xe4, 0x79, 0xb1, 0x65, + 0xf7, 0xc3, 0xf3, 0xfe, 0x6e, 0xb5, 0xc4, 0x44, 0x6e, 0x58, 0x7e, 0xe5, 0x26, 0x7f, 0x07, 0x00, + 0x00, 0xff, 0xff, 0x70, 0xd2, 0xfa, 0xa6, 0xcf, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -661,6 +797,8 @@ type QueryClient interface { GasStabilityPoolAddress(ctx context.Context, in *QueryGetGasStabilityPoolAddress, opts ...grpc.CallOption) (*QueryGetGasStabilityPoolAddressResponse, error) // Queries the balance of a gas stability pool on a given chain. GasStabilityPoolBalance(ctx context.Context, in *QueryGetGasStabilityPoolBalance, opts ...grpc.CallOption) (*QueryGetGasStabilityPoolBalanceResponse, error) + // Queries all gas stability pool balances. + GasStabilityPoolBalanceAll(ctx context.Context, in *QueryAllGasStabilityPoolBalance, opts ...grpc.CallOption) (*QueryAllGasStabilityPoolBalanceResponse, error) } type queryClient struct { @@ -725,6 +863,15 @@ func (c *queryClient) GasStabilityPoolBalance(ctx context.Context, in *QueryGetG return out, nil } +func (c *queryClient) GasStabilityPoolBalanceAll(ctx context.Context, in *QueryAllGasStabilityPoolBalance, opts ...grpc.CallOption) (*QueryAllGasStabilityPoolBalanceResponse, error) { + out := new(QueryAllGasStabilityPoolBalanceResponse) + err := c.cc.Invoke(ctx, "/zetachain.zetacore.fungible.Query/GasStabilityPoolBalanceAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -739,6 +886,8 @@ type QueryServer interface { GasStabilityPoolAddress(context.Context, *QueryGetGasStabilityPoolAddress) (*QueryGetGasStabilityPoolAddressResponse, error) // Queries the balance of a gas stability pool on a given chain. GasStabilityPoolBalance(context.Context, *QueryGetGasStabilityPoolBalance) (*QueryGetGasStabilityPoolBalanceResponse, error) + // Queries all gas stability pool balances. + GasStabilityPoolBalanceAll(context.Context, *QueryAllGasStabilityPoolBalance) (*QueryAllGasStabilityPoolBalanceResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -763,6 +912,9 @@ func (*UnimplementedQueryServer) GasStabilityPoolAddress(ctx context.Context, re func (*UnimplementedQueryServer) GasStabilityPoolBalance(ctx context.Context, req *QueryGetGasStabilityPoolBalance) (*QueryGetGasStabilityPoolBalanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GasStabilityPoolBalance not implemented") } +func (*UnimplementedQueryServer) GasStabilityPoolBalanceAll(ctx context.Context, req *QueryAllGasStabilityPoolBalance) (*QueryAllGasStabilityPoolBalanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GasStabilityPoolBalanceAll not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -876,6 +1028,24 @@ func _Query_GasStabilityPoolBalance_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +func _Query_GasStabilityPoolBalanceAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllGasStabilityPoolBalance) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GasStabilityPoolBalanceAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zetachain.zetacore.fungible.Query/GasStabilityPoolBalanceAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GasStabilityPoolBalanceAll(ctx, req.(*QueryAllGasStabilityPoolBalance)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "zetachain.zetacore.fungible.Query", HandlerType: (*QueryServer)(nil), @@ -904,6 +1074,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "GasStabilityPoolBalance", Handler: _Query_GasStabilityPoolBalance_Handler, }, + { + MethodName: "GasStabilityPoolBalanceAll", + Handler: _Query_GasStabilityPoolBalanceAll_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "fungible/query.proto", @@ -1283,12 +1457,100 @@ func (m *QueryGetGasStabilityPoolBalanceResponse) MarshalToSizedBuffer(dAtA []by i-- dAtA[i] = 0x12 } - if len(m.ContractAddress) > 0 { - i -= len(m.ContractAddress) - copy(dAtA[i:], m.ContractAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ContractAddress))) + return len(dAtA) - i, nil +} + +func (m *QueryAllGasStabilityPoolBalance) 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 *QueryAllGasStabilityPoolBalance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllGasStabilityPoolBalance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryAllGasStabilityPoolBalanceResponse) 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 *QueryAllGasStabilityPoolBalanceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllGasStabilityPoolBalanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Balances) > 0 { + for iNdEx := len(m.Balances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Balances[iNdEx].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 (m *QueryAllGasStabilityPoolBalanceResponse_Balance) 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 *QueryAllGasStabilityPoolBalanceResponse_Balance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllGasStabilityPoolBalanceResponse_Balance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Balance) > 0 { + i -= len(m.Balance) + copy(dAtA[i:], m.Balance) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Balance))) + i-- + dAtA[i] = 0x12 + } + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -1444,10 +1706,46 @@ func (m *QueryGetGasStabilityPoolBalanceResponse) Size() (n int) { } var l int _ = l - l = len(m.ContractAddress) + l = len(m.Balance) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + return n +} + +func (m *QueryAllGasStabilityPoolBalance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryAllGasStabilityPoolBalanceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Balances) > 0 { + for _, e := range m.Balances { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryAllGasStabilityPoolBalanceResponse_Balance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } l = len(m.Balance) if l > 0 { n += 1 + l + sovQuery(uint64(l)) @@ -2360,9 +2658,9 @@ func (m *QueryGetGasStabilityPoolBalanceResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: QueryGetGasStabilityPoolBalanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2390,8 +2688,211 @@ func (m *QueryGetGasStabilityPoolBalanceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ContractAddress = string(dAtA[iNdEx:postIndex]) + m.Balance = 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 *QueryAllGasStabilityPoolBalance) 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: QueryAllGasStabilityPoolBalance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllGasStabilityPoolBalance: 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 *QueryAllGasStabilityPoolBalanceResponse) 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: QueryAllGasStabilityPoolBalanceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllGasStabilityPoolBalanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balances", 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 + } + m.Balances = append(m.Balances, QueryAllGasStabilityPoolBalanceResponse_Balance{}) + if err := m.Balances[len(m.Balances)-1].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 (m *QueryAllGasStabilityPoolBalanceResponse_Balance) 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: Balance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Balance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType) diff --git a/x/fungible/types/query.pb.gw.go b/x/fungible/types/query.pb.gw.go index 5e3c9f3e9a..509f8a452a 100644 --- a/x/fungible/types/query.pb.gw.go +++ b/x/fungible/types/query.pb.gw.go @@ -231,6 +231,24 @@ func local_request_Query_GasStabilityPoolBalance_0(ctx context.Context, marshale } +func request_Query_GasStabilityPoolBalanceAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllGasStabilityPoolBalance + var metadata runtime.ServerMetadata + + msg, err := client.GasStabilityPoolBalanceAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GasStabilityPoolBalanceAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllGasStabilityPoolBalance + var metadata runtime.ServerMetadata + + msg, err := server.GasStabilityPoolBalanceAll(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. @@ -375,6 +393,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_GasStabilityPoolBalanceAll_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_GasStabilityPoolBalanceAll_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_GasStabilityPoolBalanceAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -536,6 +577,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_GasStabilityPoolBalanceAll_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_GasStabilityPoolBalanceAll_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_GasStabilityPoolBalanceAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -551,6 +612,8 @@ var ( pattern_Query_GasStabilityPoolAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"zeta-chain", "zetacore", "fungible", "gas_stability_pool_address"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_GasStabilityPoolBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"zeta-chain", "zetacore", "fungible", "gas_stability_pool_balance", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GasStabilityPoolBalanceAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"zeta-chain", "zetacore", "fungible", "gas_stability_pool_balance"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -565,4 +628,6 @@ var ( forward_Query_GasStabilityPoolAddress_0 = runtime.ForwardResponseMessage forward_Query_GasStabilityPoolBalance_0 = runtime.ForwardResponseMessage + + forward_Query_GasStabilityPoolBalanceAll_0 = runtime.ForwardResponseMessage )