From 1c00726071ac7221c14bfa22a2e2a6018d33c56c Mon Sep 17 00:00:00 2001 From: samricotta <37125168+samricotta@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:24:42 +0300 Subject: [PATCH] chore: update exposed db objects in `x/incentive` module (#200) ## Summary Part closes: https://github.com/babylonlabs-io/pm/issues/72 Currently some of the objects in the babylon apis are exposed and need to be handled correctly seen in https://github.com/babylonlabs-io/pm/issues/72 This PR handles the exposed objects in `x/incentive` --- CHANGELOG.md | 11 +- proto/babylon/incentive/query.proto | 27 +- test/e2e/btc_timestamping_e2e_test.go | 2 +- .../e2e/configurer/chain/queries_incentive.go | 4 +- x/incentive/keeper/grpc_query.go | 16 +- x/incentive/types/query.pb.go | 472 ++++++++++++++++-- 6 files changed, 469 insertions(+), 63 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f453beb63..6a9d5d660 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,12 +39,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### API Breaking -* [#194](https://github.com/babylonlabs-io/babylon/pull/194) Adjusted handling of `FinalityProviderSigningInfo` in finality keeper queries to improve API security - * Modified `QuerySigningInfosResponse` to remove direct exposure of sensitive fields - * Updated related tests in `x/finality/keeper/grpc_query_test.go` -* [#201](https://github.com/babylonlabs-io/babylon/pull/201) Adjusted handling of `ValidatorWithBlsKey` in checkpoint keeper queries to improve API security - * Modified `QueryBlsPublicKeyListResponse` to remove direct exposure of sensitive fields - * Updated related tests in `x/checkpointing/keeper/grpc_query_bls.go` +* [#194](https://github.com/babylonlabs-io/babylon/pull/194) Adjusted handling of `FinalityProviderSigningInfo` in finality keeper queries to improve API security. + * Modified `QuerySigningInfosResponse` to remove direct exposure of sensitive fields. + * Updated related tests in `x/finality/keeper/grpc_query_test.go`. +* [#200](https://github.com/babylonlabs-io/babylon/pull/200) Adjusted handling of `Gauge` in incentive keeper queries to improve API security. +* [#201](https://github.com/babylonlabs-io/babylon/pull/201) Adjusted handling of `ValidatorWithBlsKey` in checkpoint keeper queries to improve API security. ### State Machine Breaking diff --git a/proto/babylon/incentive/query.proto b/proto/babylon/incentive/query.proto index f31a511cb..17bcad0fc 100644 --- a/proto/babylon/incentive/query.proto +++ b/proto/babylon/incentive/query.proto @@ -5,6 +5,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "babylon/incentive/params.proto"; import "babylon/incentive/incentive.proto"; +import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/babylonlabs-io/babylon/x/incentive/types"; @@ -56,10 +57,30 @@ message QueryBTCStakingGaugeRequest { uint64 height = 1; } +message BTCStakingGaugeResponse { + // coins that have been in the gauge + // can have multiple coin denoms + repeated cosmos.base.v1beta1.Coin coins = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + +} + +message BTCTimestampingGaugeResponse { + // coins that have been in the gauge + // can have multiple coin denoms + repeated cosmos.base.v1beta1.Coin coins = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + +} + // QueryBTCStakingGaugeResponse is response type for the Query/BTCStakingGauge RPC method. message QueryBTCStakingGaugeResponse { // gauge is the BTC staking gauge at the queried height - Gauge gauge = 1; + BTCStakingGaugeResponse gauge = 1; } // QueryBTCTimestampingGaugeRequest is request type for the Query/BTCTimestampingGauge RPC method. @@ -71,5 +92,5 @@ message QueryBTCTimestampingGaugeRequest { // QueryBTCTimestampingGaugeResponse is response type for the Query/BTCTimestampingGauge RPC method. message QueryBTCTimestampingGaugeResponse { // gauge is the BTC timestamping gauge at the queried epoch - Gauge gauge = 1; -} + BTCTimestampingGaugeResponse gauge = 1; +} \ No newline at end of file diff --git a/test/e2e/btc_timestamping_e2e_test.go b/test/e2e/btc_timestamping_e2e_test.go index 09a9f35e2..8bfb0547a 100644 --- a/test/e2e/btc_timestamping_e2e_test.go +++ b/test/e2e/btc_timestamping_e2e_test.go @@ -283,7 +283,7 @@ func (s *BTCTimestampingTestSuite) Test6InterceptFeeCollector() { // at the 1st block of an epoch, the gauge does not exist since incentive's BeginBlock // at this block accumulates rewards for BTC timestamping gauge for the previous block // need to wait for a block to ensure the gauge is created - var btcTimestampingGauge *itypes.Gauge + var btcTimestampingGauge *itypes.BTCTimestampingGaugeResponse s.Eventually(func() bool { btcTimestampingGauge, err = nonValidatorNode.QueryBTCTimestampingGauge(curEpoch) if err != nil { diff --git a/test/e2e/configurer/chain/queries_incentive.go b/test/e2e/configurer/chain/queries_incentive.go index 152c42352..21bd65716 100644 --- a/test/e2e/configurer/chain/queries_incentive.go +++ b/test/e2e/configurer/chain/queries_incentive.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" ) -func (n *NodeConfig) QueryBTCStakingGauge(height uint64) (*incentivetypes.Gauge, error) { +func (n *NodeConfig) QueryBTCStakingGauge(height uint64) (*incentivetypes.BTCStakingGaugeResponse, error) { path := fmt.Sprintf("/babylon/incentive/btc_staking_gauge/%d", height) bz, err := n.QueryGRPCGateway(path, url.Values{}) if err != nil { @@ -52,7 +52,7 @@ func (n *NodeConfig) QueryRewardGauge(sAddr sdk.AccAddress) (map[string]*incenti return resp.RewardGauges, nil } -func (n *NodeConfig) QueryBTCTimestampingGauge(epoch uint64) (*incentivetypes.Gauge, error) { +func (n *NodeConfig) QueryBTCTimestampingGauge(epoch uint64) (*incentivetypes.BTCTimestampingGaugeResponse, error) { path := fmt.Sprintf("/babylon/incentive/btc_timestamping_gauge/%d", epoch) bz, err := n.QueryGRPCGateway(path, url.Values{}) if err != nil { diff --git a/x/incentive/keeper/grpc_query.go b/x/incentive/keeper/grpc_query.go index 3f1274d3b..1e47384bb 100644 --- a/x/incentive/keeper/grpc_query.go +++ b/x/incentive/keeper/grpc_query.go @@ -54,7 +54,7 @@ func (k Keeper) BTCStakingGauge(goCtx context.Context, req *types.QueryBTCStakin return nil, types.ErrBTCStakingGaugeNotFound } - return &types.QueryBTCStakingGaugeResponse{Gauge: gauge}, nil + return &types.QueryBTCStakingGaugeResponse{Gauge: convertGaugeToBTCStakingResponse(*gauge)}, nil } func (k Keeper) BTCTimestampingGauge(goCtx context.Context, req *types.QueryBTCTimestampingGaugeRequest) (*types.QueryBTCTimestampingGaugeResponse, error) { @@ -69,5 +69,17 @@ func (k Keeper) BTCTimestampingGauge(goCtx context.Context, req *types.QueryBTCT return nil, types.ErrBTCTimestampingGaugeNotFound } - return &types.QueryBTCTimestampingGaugeResponse{Gauge: gauge}, nil + return &types.QueryBTCTimestampingGaugeResponse{Gauge: convertGaugeToBTCTimestampingResponse(*gauge)}, nil +} + +func convertGaugeToBTCStakingResponse(gauge types.Gauge) *types.BTCStakingGaugeResponse { + return &types.BTCStakingGaugeResponse{ + Coins: gauge.Coins, + } +} + +func convertGaugeToBTCTimestampingResponse(gauge types.Gauge) *types.BTCTimestampingGaugeResponse { + return &types.BTCTimestampingGaugeResponse{ + Coins: gauge.Coins, + } } diff --git a/x/incentive/types/query.pb.go b/x/incentive/types/query.pb.go index a0829633e..78a4c886e 100644 --- a/x/incentive/types/query.pb.go +++ b/x/incentive/types/query.pb.go @@ -6,6 +6,8 @@ package types import ( context "context" fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -251,17 +253,109 @@ func (m *QueryBTCStakingGaugeRequest) GetHeight() uint64 { return 0 } +type BTCStakingGaugeResponse struct { + // coins that have been in the gauge + // can have multiple coin denoms + Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` +} + +func (m *BTCStakingGaugeResponse) Reset() { *m = BTCStakingGaugeResponse{} } +func (m *BTCStakingGaugeResponse) String() string { return proto.CompactTextString(m) } +func (*BTCStakingGaugeResponse) ProtoMessage() {} +func (*BTCStakingGaugeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e1a59cc0c7c44135, []int{5} +} +func (m *BTCStakingGaugeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BTCStakingGaugeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BTCStakingGaugeResponse.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 *BTCStakingGaugeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BTCStakingGaugeResponse.Merge(m, src) +} +func (m *BTCStakingGaugeResponse) XXX_Size() int { + return m.Size() +} +func (m *BTCStakingGaugeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BTCStakingGaugeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_BTCStakingGaugeResponse proto.InternalMessageInfo + +func (m *BTCStakingGaugeResponse) GetCoins() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Coins + } + return nil +} + +type BTCTimestampingGaugeResponse struct { + // coins that have been in the gauge + // can have multiple coin denoms + Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` +} + +func (m *BTCTimestampingGaugeResponse) Reset() { *m = BTCTimestampingGaugeResponse{} } +func (m *BTCTimestampingGaugeResponse) String() string { return proto.CompactTextString(m) } +func (*BTCTimestampingGaugeResponse) ProtoMessage() {} +func (*BTCTimestampingGaugeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e1a59cc0c7c44135, []int{6} +} +func (m *BTCTimestampingGaugeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BTCTimestampingGaugeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BTCTimestampingGaugeResponse.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 *BTCTimestampingGaugeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BTCTimestampingGaugeResponse.Merge(m, src) +} +func (m *BTCTimestampingGaugeResponse) XXX_Size() int { + return m.Size() +} +func (m *BTCTimestampingGaugeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BTCTimestampingGaugeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_BTCTimestampingGaugeResponse proto.InternalMessageInfo + +func (m *BTCTimestampingGaugeResponse) GetCoins() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Coins + } + return nil +} + // QueryBTCStakingGaugeResponse is response type for the Query/BTCStakingGauge RPC method. type QueryBTCStakingGaugeResponse struct { // gauge is the BTC staking gauge at the queried height - Gauge *Gauge `protobuf:"bytes,1,opt,name=gauge,proto3" json:"gauge,omitempty"` + Gauge *BTCStakingGaugeResponse `protobuf:"bytes,1,opt,name=gauge,proto3" json:"gauge,omitempty"` } func (m *QueryBTCStakingGaugeResponse) Reset() { *m = QueryBTCStakingGaugeResponse{} } func (m *QueryBTCStakingGaugeResponse) String() string { return proto.CompactTextString(m) } func (*QueryBTCStakingGaugeResponse) ProtoMessage() {} func (*QueryBTCStakingGaugeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e1a59cc0c7c44135, []int{5} + return fileDescriptor_e1a59cc0c7c44135, []int{7} } func (m *QueryBTCStakingGaugeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -290,7 +384,7 @@ func (m *QueryBTCStakingGaugeResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryBTCStakingGaugeResponse proto.InternalMessageInfo -func (m *QueryBTCStakingGaugeResponse) GetGauge() *Gauge { +func (m *QueryBTCStakingGaugeResponse) GetGauge() *BTCStakingGaugeResponse { if m != nil { return m.Gauge } @@ -307,7 +401,7 @@ func (m *QueryBTCTimestampingGaugeRequest) Reset() { *m = QueryBTCTimest func (m *QueryBTCTimestampingGaugeRequest) String() string { return proto.CompactTextString(m) } func (*QueryBTCTimestampingGaugeRequest) ProtoMessage() {} func (*QueryBTCTimestampingGaugeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e1a59cc0c7c44135, []int{6} + return fileDescriptor_e1a59cc0c7c44135, []int{8} } func (m *QueryBTCTimestampingGaugeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -346,14 +440,14 @@ func (m *QueryBTCTimestampingGaugeRequest) GetEpochNum() uint64 { // QueryBTCTimestampingGaugeResponse is response type for the Query/BTCTimestampingGauge RPC method. type QueryBTCTimestampingGaugeResponse struct { // gauge is the BTC timestamping gauge at the queried epoch - Gauge *Gauge `protobuf:"bytes,1,opt,name=gauge,proto3" json:"gauge,omitempty"` + Gauge *BTCTimestampingGaugeResponse `protobuf:"bytes,1,opt,name=gauge,proto3" json:"gauge,omitempty"` } func (m *QueryBTCTimestampingGaugeResponse) Reset() { *m = QueryBTCTimestampingGaugeResponse{} } func (m *QueryBTCTimestampingGaugeResponse) String() string { return proto.CompactTextString(m) } func (*QueryBTCTimestampingGaugeResponse) ProtoMessage() {} func (*QueryBTCTimestampingGaugeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e1a59cc0c7c44135, []int{7} + return fileDescriptor_e1a59cc0c7c44135, []int{9} } func (m *QueryBTCTimestampingGaugeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -382,7 +476,7 @@ func (m *QueryBTCTimestampingGaugeResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryBTCTimestampingGaugeResponse proto.InternalMessageInfo -func (m *QueryBTCTimestampingGaugeResponse) GetGauge() *Gauge { +func (m *QueryBTCTimestampingGaugeResponse) GetGauge() *BTCTimestampingGaugeResponse { if m != nil { return m.Gauge } @@ -396,6 +490,8 @@ func init() { proto.RegisterType((*QueryRewardGaugesResponse)(nil), "babylon.incentive.QueryRewardGaugesResponse") proto.RegisterMapType((map[string]*RewardGauge)(nil), "babylon.incentive.QueryRewardGaugesResponse.RewardGaugesEntry") proto.RegisterType((*QueryBTCStakingGaugeRequest)(nil), "babylon.incentive.QueryBTCStakingGaugeRequest") + proto.RegisterType((*BTCStakingGaugeResponse)(nil), "babylon.incentive.BTCStakingGaugeResponse") + proto.RegisterType((*BTCTimestampingGaugeResponse)(nil), "babylon.incentive.BTCTimestampingGaugeResponse") proto.RegisterType((*QueryBTCStakingGaugeResponse)(nil), "babylon.incentive.QueryBTCStakingGaugeResponse") proto.RegisterType((*QueryBTCTimestampingGaugeRequest)(nil), "babylon.incentive.QueryBTCTimestampingGaugeRequest") proto.RegisterType((*QueryBTCTimestampingGaugeResponse)(nil), "babylon.incentive.QueryBTCTimestampingGaugeResponse") @@ -404,46 +500,52 @@ func init() { func init() { proto.RegisterFile("babylon/incentive/query.proto", fileDescriptor_e1a59cc0c7c44135) } var fileDescriptor_e1a59cc0c7c44135 = []byte{ - // 611 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x3f, 0x6f, 0xd3, 0x40, - 0x18, 0xc6, 0xe3, 0xb4, 0x09, 0xf4, 0x5a, 0x04, 0x3d, 0x22, 0xe4, 0x38, 0xc5, 0x24, 0x96, 0x40, - 0x95, 0xa0, 0xb6, 0xc8, 0x1f, 0x15, 0x90, 0x00, 0x29, 0x08, 0x31, 0x11, 0x81, 0xdb, 0x89, 0x25, - 0x3a, 0x27, 0x27, 0xc7, 0x6a, 0xec, 0x73, 0xed, 0x73, 0x21, 0x54, 0x59, 0xf8, 0x04, 0x48, 0x4c, - 0xec, 0x2c, 0x7c, 0x0b, 0xc6, 0x8e, 0x95, 0x58, 0x98, 0x10, 0x24, 0x7c, 0x10, 0x94, 0xbb, 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 0x6b, 0xc9, 0x10, 0xc0, 0xbb, - 0xe7, 0x8b, 0x18, 0x07, 0xb9, 0x77, 0x91, 0x3c, 0x6a, 0x0f, 0x19, 0x4e, 0x03, 0xde, 0x4f, 0xc1, - 0x11, 0x9f, 0x85, 0x71, 0x28, 0x0e, 0x63, 0x23, 0x99, 0x7f, 0xf8, 0x55, 0x02, 0x57, 0x4f, 0xc5, - 0x01, 0xea, 0x59, 0xcb, 0xd3, 0xe3, 0xa6, 0x18, 0xe7, 0xd6, 0x0b, 0xde, 0x16, 0xe3, 0x35, 0xe0, - 0x56, 0x0a, 0xaf, 0x45, 0x7b, 0xdd, 0x90, 0x0f, 0x71, 0x44, 0xe3, 0x90, 0xa7, 0x77, 0x0c, 0xbf, - 0x49, 0xa0, 0x94, 0x96, 0x14, 0xd8, 0x38, 0x03, 0x20, 0x2b, 0x98, 0x4a, 0xf3, 0x62, 0x43, 0x02, - 0xfd, 0x31, 0x43, 0xdf, 0x86, 0xad, 0x0c, 0x74, 0x9a, 0x98, 0x8c, 0xf9, 0xe7, 0xf9, 0x1f, 0xb7, - 0x5f, 0x1e, 0x4d, 0x54, 0xe9, 0x78, 0xa2, 0x4a, 0xbf, 0x26, 0xaa, 0xf4, 0x71, 0xaa, 0xe6, 0x8e, - 0xa7, 0x6a, 0xee, 0xc7, 0x54, 0xcd, 0xbd, 0x69, 0xd8, 0x0e, 0x1d, 0x44, 0x96, 0xde, 0x23, 0x6e, - 0x6c, 0x3d, 0x44, 0x56, 0xb8, 0xe5, 0x90, 0xf9, 0xa6, 0x77, 0x89, 0x5d, 0x74, 0xe4, 0xe3, 0xd0, - 0x2a, 0xb2, 0xbf, 0xe3, 0xc6, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8a, 0xfc, 0x04, 0x89, 0x39, - 0x06, 0x00, 0x00, + // 712 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x95, 0x4d, 0x4f, 0xd4, 0x40, + 0x18, 0xc7, 0xb7, 0xc0, 0xae, 0x32, 0x60, 0x94, 0x91, 0xe8, 0xee, 0x82, 0x05, 0x9a, 0x68, 0x88, + 0x4a, 0x47, 0x58, 0x08, 0x6a, 0xe2, 0x4b, 0x96, 0x10, 0x4f, 0x12, 0xad, 0x9c, 0xbc, 0xac, 0xd3, + 0xee, 0xa4, 0x5b, 0xd9, 0x76, 0x4a, 0x67, 0x8a, 0xae, 0xc8, 0x41, 0x3f, 0x81, 0x89, 0x27, 0xef, + 0x5e, 0xf4, 0x53, 0x78, 0xe4, 0x48, 0xe2, 0xc5, 0x93, 0x2f, 0xe0, 0x07, 0x31, 0x3b, 0x33, 0xdd, + 0x14, 0xb7, 0x45, 0x38, 0x79, 0xda, 0xe9, 0x3c, 0x6f, 0xbf, 0x99, 0xe7, 0xf9, 0xcf, 0x82, 0x4b, + 0x36, 0xb6, 0x3b, 0x6d, 0x1a, 0x20, 0x2f, 0x70, 0x48, 0xc0, 0xbd, 0x2d, 0x82, 0x36, 0x63, 0x12, + 0x75, 0xcc, 0x30, 0xa2, 0x9c, 0xc2, 0x31, 0x65, 0x36, 0x7b, 0xe6, 0xea, 0xb8, 0x4b, 0x5d, 0x2a, + 0xac, 0xa8, 0xbb, 0x92, 0x8e, 0xd5, 0x49, 0x97, 0x52, 0xb7, 0x4d, 0x10, 0x0e, 0x3d, 0x84, 0x83, + 0x80, 0x72, 0xcc, 0x3d, 0x1a, 0x30, 0x65, 0xd5, 0xfb, 0xab, 0x84, 0x38, 0xc2, 0x7e, 0x62, 0x9f, + 0xe9, 0xb7, 0xf7, 0x56, 0x49, 0x0a, 0x87, 0x32, 0x9f, 0x32, 0x64, 0x63, 0x46, 0xd0, 0xd6, 0xbc, + 0x4d, 0x38, 0x9e, 0x47, 0x0e, 0xf5, 0x02, 0x69, 0x37, 0xc6, 0x01, 0x7c, 0xdc, 0x05, 0x7f, 0x24, + 0xf2, 0x5a, 0x64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fa, + 0x49, 0xa4, 0x6b, 0xdc, 0x12, 0x38, 0x35, 0x38, 0x9f, 0x81, 0xa3, 0x5e, 0x10, 0xb4, 0xad, 0x16, + 0x3b, 0x28, 0xfd, 0x54, 0xc0, 0x4f, 0x1a, 0x38, 0xfb, 0x57, 0xf3, 0xa1, 0x99, 0x57, 0x3c, 0x5b, + 0x99, 0x55, 0x74, 0x6c, 0x7f, 0xc5, 0xbb, 0x24, 0x78, 0x11, 0x9c, 0xcb, 0xe0, 0xb5, 0xb9, 0xd3, + 0x60, 0x32, 0x48, 0x22, 0xa2, 0x6d, 0x29, 0xf4, 0x1d, 0xf8, 0x45, 0x03, 0xe3, 0x59, 0x03, 0x00, + 0x6b, 0x47, 0x00, 0xe4, 0xcd, 0x6b, 0x75, 0xf1, 0x64, 0x41, 0x0a, 0xfd, 0x8e, 0x40, 0x5f, 0x86, + 0x4b, 0x39, 0xe8, 0x3c, 0x15, 0x99, 0xf0, 0xf7, 0x64, 0xb1, 0x53, 0x7f, 0xb8, 0xbb, 0xaf, 0x6b, + 0x7b, 0xfb, 0xba, 0xf6, 0x73, 0x5f, 0xd7, 0xde, 0x1d, 0xe8, 0x85, 0xbd, 0x03, 0xbd, 0xf0, 0xed, + 0x40, 0x2f, 0x3c, 0xad, 0xa5, 0x54, 0xaf, 0x52, 0xb7, 0xb1, 0xcd, 0xe6, 0x3c, 0xda, 0xab, 0xf4, + 0x32, 0x55, 0x4b, 0x3c, 0x03, 0x76, 0x49, 0xfc, 0x73, 0xd5, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, + 0x54, 0x7a, 0x48, 0x0b, 0x84, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -805,6 +907,80 @@ func (m *QueryBTCStakingGaugeRequest) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } +func (m *BTCStakingGaugeResponse) 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 *BTCStakingGaugeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BTCStakingGaugeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Coins) > 0 { + for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Coins[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 *BTCTimestampingGaugeResponse) 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 *BTCTimestampingGaugeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BTCTimestampingGaugeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Coins) > 0 { + for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Coins[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 *QueryBTCStakingGaugeResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -981,6 +1157,36 @@ func (m *QueryBTCStakingGaugeRequest) Size() (n int) { return n } +func (m *BTCStakingGaugeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Coins) > 0 { + for _, e := range m.Coins { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *BTCTimestampingGaugeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Coins) > 0 { + for _, e := range m.Coins { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func (m *QueryBTCStakingGaugeResponse) Size() (n int) { if m == nil { return 0 @@ -1488,6 +1694,174 @@ func (m *QueryBTCStakingGaugeRequest) Unmarshal(dAtA []byte) error { } return nil } +func (m *BTCStakingGaugeResponse) 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: BTCStakingGaugeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BTCStakingGaugeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Coins", 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.Coins = append(m.Coins, types.Coin{}) + if err := m.Coins[len(m.Coins)-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 *BTCTimestampingGaugeResponse) 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: BTCTimestampingGaugeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BTCTimestampingGaugeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Coins", 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.Coins = append(m.Coins, types.Coin{}) + if err := m.Coins[len(m.Coins)-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 *QueryBTCStakingGaugeResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1547,7 +1921,7 @@ func (m *QueryBTCStakingGaugeResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Gauge == nil { - m.Gauge = &Gauge{} + m.Gauge = &BTCStakingGaugeResponse{} } if err := m.Gauge.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1702,7 +2076,7 @@ func (m *QueryBTCTimestampingGaugeResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Gauge == nil { - m.Gauge = &Gauge{} + m.Gauge = &BTCTimestampingGaugeResponse{} } if err := m.Gauge.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err