From fcea26d3eefd4d5e808481122664ca6c5a8f047d Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Thu, 24 Feb 2022 14:27:53 +0000 Subject: [PATCH] chore: update grpc queries to handle multiple fees (#967) * adding new proto types and codegen * refactoring ics29 fees for more efficient storage * updating tests * updating protos and existing queries * updating grpc queries and refactoring tests * format error correct in favour of proto string() method * leveraging ParseKeyFeesInEscrow to obtain packet id in query --- docs/ibc/proto-docs.md | 4 +- modules/apps/29-fee/keeper/grpc_query.go | 28 ++-- modules/apps/29-fee/keeper/grpc_query_test.go | 138 ++++++++---------- modules/apps/29-fee/types/fee.go | 9 ++ modules/apps/29-fee/types/query.pb.go | 109 +++++++------- proto/ibc/applications/fee/v1/query.proto | 4 +- 6 files changed, 139 insertions(+), 153 deletions(-) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 0fe35525dc0..eb2ddc97e3a 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -946,7 +946,7 @@ QueryIncentivizedPacketsResponse is the response type for the incentivized packe | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `incentivized_packet` | [IdentifiedPacketFee](#ibc.applications.fee.v1.IdentifiedPacketFee) | | Incentivized_packet | +| `incentivized_packet` | [IdentifiedPacketFees](#ibc.applications.fee.v1.IdentifiedPacketFees) | | Incentivized_packet | @@ -977,7 +977,7 @@ QueryIncentivizedPacketsResponse is the response type for the incentivized packe | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `incentivized_packets` | [IdentifiedPacketFee](#ibc.applications.fee.v1.IdentifiedPacketFee) | repeated | Map of all incentivized_packets | +| `incentivized_packets` | [IdentifiedPacketFees](#ibc.applications.fee.v1.IdentifiedPacketFees) | repeated | Map of all incentivized_packets | diff --git a/modules/apps/29-fee/keeper/grpc_query.go b/modules/apps/29-fee/keeper/grpc_query.go index 1dae09d9265..3d4852831ad 100644 --- a/modules/apps/29-fee/keeper/grpc_query.go +++ b/modules/apps/29-fee/keeper/grpc_query.go @@ -24,22 +24,25 @@ func (k Keeper) IncentivizedPackets(c context.Context, req *types.QueryIncentivi ctx := sdk.UnwrapSDKContext(c).WithBlockHeight(int64(req.QueryHeight)) - var packets []*types.IdentifiedPacketFee - store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.FeeInEscrowPrefix)) - _, err := query.Paginate(store, req.Pagination, func(_, value []byte) error { - result := k.MustUnmarshalFee(value) - packets = append(packets, &result) + var identifiedPackets []types.IdentifiedPacketFees + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.FeesInEscrowPrefix)) + _, err := query.Paginate(store, req.Pagination, func(key, value []byte) error { + packetID, err := types.ParseKeyFeesInEscrow(types.FeesInEscrowPrefix + string(key)) + if err != nil { + return err + } + + packetFees := k.MustUnmarshalFees(value) + identifiedPackets = append(identifiedPackets, types.NewIdentifiedPacketFees(packetID, packetFees.PacketFees)) return nil }) if err != nil { - return nil, status.Error( - codes.NotFound, err.Error(), - ) + return nil, status.Error(codes.NotFound, err.Error()) } return &types.QueryIncentivizedPacketsResponse{ - IncentivizedPackets: packets, + IncentivizedPackets: identifiedPackets, }, nil } @@ -51,15 +54,14 @@ func (k Keeper) IncentivizedPacket(c context.Context, req *types.QueryIncentiviz ctx := sdk.UnwrapSDKContext(c).WithBlockHeight(int64(req.QueryHeight)) - fee, exists := k.GetFeeInEscrow(ctx, req.PacketId) + feesInEscrow, exists := k.GetFeesInEscrow(ctx, req.PacketId) if !exists { return nil, status.Error( codes.NotFound, - sdkerrors.Wrap(types.ErrFeeNotFound, req.PacketId.String()).Error(), - ) + sdkerrors.Wrapf(types.ErrFeeNotFound, "channel: %s, port: %s, sequence: %d", req.PacketId.ChannelId, req.PacketId.PortId, req.PacketId.Sequence).Error()) } return &types.QueryIncentivizedPacketResponse{ - IncentivizedPacket: &fee, + IncentivizedPacket: types.NewIdentifiedPacketFees(req.PacketId, feesInEscrow.PacketFees), }, nil } diff --git a/modules/apps/29-fee/keeper/grpc_query_test.go b/modules/apps/29-fee/keeper/grpc_query_test.go index 649ff89e6b9..37626b40bac 100644 --- a/modules/apps/29-fee/keeper/grpc_query_test.go +++ b/modules/apps/29-fee/keeper/grpc_query_test.go @@ -1,8 +1,6 @@ package keeper_test import ( - "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" @@ -11,25 +9,10 @@ import ( ibctesting "github.com/cosmos/ibc-go/v3/testing" ) -func (suite *KeeperTestSuite) TestQueryIncentivizedPacketI() { - +func (suite *KeeperTestSuite) TestQueryIncentivizedPackets() { var ( - req *types.QueryIncentivizedPacketRequest - ) - - // setup - suite.coordinator.Setup(suite.path) // setup channel - validPacketId := channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, 1) - invalidPacketId := channeltypes.NewPacketId(ibctesting.FirstChannelID, ibctesting.MockFeePort, 2) - identifiedPacketFee := types.NewIdentifiedPacketFee( - validPacketId, - types.Fee{ - AckFee: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))), - RecvFee: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))), - TimeoutFee: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))), - }, - "", // leave empty here and then populate on each testcase since suite resets - []string(nil), + req *types.QueryIncentivizedPacketsRequest + expectedPackets []types.IdentifiedPacketFees ) testCases := []struct { @@ -40,22 +23,36 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacketI() { { "success", func() { - req = &types.QueryIncentivizedPacketRequest{ - PacketId: validPacketId, + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, ibctesting.FirstChannelID) + + fee := types.NewFee(defaultReceiveFee, defaultAckFee, defaultTimeoutFee) + packetFee := types.NewPacketFee(fee, suite.chainA.SenderAccount.GetAddress().String(), []string(nil)) + + for i := 0; i < 3; i++ { + // escrow packet fees for three different packets + packetID := channeltypes.NewPacketId(ibctesting.FirstChannelID, ibctesting.MockFeePort, uint64(i+1)) + suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, packetFee) + + expectedPackets = append(expectedPackets, types.NewIdentifiedPacketFees(packetID, []types.PacketFee{packetFee})) + } + + req = &types.QueryIncentivizedPacketsRequest{ + Pagination: &query.PageRequest{ + Limit: 5, + CountTotal: false, + }, QueryHeight: 0, } }, true, }, { - "packetId not found", + "empty pagination", func() { - req = &types.QueryIncentivizedPacketRequest{ - PacketId: invalidPacketId, - QueryHeight: 0, - } + expectedPackets = nil + req = &types.QueryIncentivizedPacketsRequest{} }, - false, + true, }, } @@ -63,22 +60,15 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacketI() { suite.Run(tc.name, func() { suite.SetupTest() // reset - refundAcc := suite.chainA.SenderAccount.GetAddress() - // populate RefundAddress field - identifiedPacketFee.RefundAddress = refundAcc.String() - - tc.malleate() - - suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), validPacketId.PortId, validPacketId.ChannelId) - suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeInEscrow(suite.chainA.GetContext(), identifiedPacketFee) + tc.malleate() // malleate mutates test data ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.IncentivizedPacket(ctx, req) + res, err := suite.queryClient.IncentivizedPackets(ctx, req) if tc.expPass { suite.Require().NoError(err) suite.Require().NotNil(res) - suite.Require().Equal(&identifiedPacketFee, res.IncentivizedPacket) + suite.Require().Equal(expectedPackets, res.IncentivizedPackets) } else { suite.Require().Error(err) } @@ -86,71 +76,63 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacketI() { } } -func (suite *KeeperTestSuite) TestQueryIncentivizedPackets() { +func (suite *KeeperTestSuite) TestQueryIncentivizedPacket() { var ( - req *types.QueryIncentivizedPacketsRequest - expPackets []*types.IdentifiedPacketFee + req *types.QueryIncentivizedPacketRequest ) - fee := types.Fee{ - AckFee: sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(100)}}, - RecvFee: sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(100)}}, - TimeoutFee: sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(100)}}, - } - testCases := []struct { - msg string + name string malleate func() expPass bool }{ { - "empty pagination", - func() { - req = &types.QueryIncentivizedPacketsRequest{} - }, + "success", + func() {}, true, }, { - "success", + "fees not found for packet id", func() { - refundAcc := suite.chainA.SenderAccount.GetAddress() - - fee1 := types.NewIdentifiedPacketFee(channeltypes.NewPacketId(ibctesting.FirstChannelID, ibctesting.MockFeePort, 1), fee, refundAcc.String(), []string(nil)) - fee2 := types.NewIdentifiedPacketFee(channeltypes.NewPacketId(ibctesting.FirstChannelID, ibctesting.MockFeePort, 2), fee, refundAcc.String(), []string(nil)) - fee3 := types.NewIdentifiedPacketFee(channeltypes.NewPacketId(ibctesting.FirstChannelID, ibctesting.MockFeePort, 3), fee, refundAcc.String(), []string(nil)) - - expPackets = []*types.IdentifiedPacketFee{} - expPackets = append(expPackets, &fee1, &fee2, &fee3) - - suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, ibctesting.FirstChannelID) - for _, packetFee := range expPackets { - suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeInEscrow(suite.chainA.GetContext(), *packetFee) - } - - req = &types.QueryIncentivizedPacketsRequest{ - Pagination: &query.PageRequest{ - Limit: 5, - CountTotal: false, - }, + req = &types.QueryIncentivizedPacketRequest{ + PacketId: channeltypes.NewPacketId(ibctesting.FirstChannelID, ibctesting.MockFeePort, 100), QueryHeight: 0, } }, - true, + false, }, } for _, tc := range testCases { - suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + suite.Run(tc.name, func() { suite.SetupTest() // reset - tc.malleate() - ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) - res, err := suite.queryClient.IncentivizedPackets(ctx, req) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, ibctesting.FirstChannelID) + + packetID := channeltypes.NewPacketId(ibctesting.FirstChannelID, ibctesting.MockFeePort, 1) + fee := types.NewFee(defaultReceiveFee, defaultAckFee, defaultTimeoutFee) + packetFee := types.NewPacketFee(fee, suite.chainA.SenderAccount.GetAddress().String(), []string(nil)) + + for i := 0; i < 3; i++ { + // escrow three packet fees for the same packet + err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), packetID, packetFee) + suite.Require().NoError(err) + } + + req = &types.QueryIncentivizedPacketRequest{ + PacketId: packetID, + QueryHeight: 0, + } + + tc.malleate() // malleate mutates test data + + ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) + res, err := suite.queryClient.IncentivizedPacket(ctx, req) if tc.expPass { suite.Require().NoError(err) suite.Require().NotNil(res) - suite.Require().Equal(expPackets, res.IncentivizedPackets) + suite.Require().Equal(types.NewIdentifiedPacketFees(packetID, []types.PacketFee{packetFee, packetFee, packetFee}), res.IncentivizedPacket) } else { suite.Require().Error(err) } diff --git a/modules/apps/29-fee/types/fee.go b/modules/apps/29-fee/types/fee.go index 4dd73893888..bdcb2fc94ba 100644 --- a/modules/apps/29-fee/types/fee.go +++ b/modules/apps/29-fee/types/fee.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" ) // NewPacketFee creates and returns a new PacketFee struct including the incentivization fees, refund addres and relayers @@ -42,6 +43,14 @@ func NewPacketFees(packetFees []PacketFee) PacketFees { } } +// NewIdentifiedPacketFees creates and returns a new IdentifiedPacketFees struct containing a packet ID and packet fees +func NewIdentifiedPacketFees(packetID channeltypes.PacketId, packetFees []PacketFee) IdentifiedPacketFees { + return IdentifiedPacketFees{ + PacketId: packetID, + PacketFees: packetFees, + } +} + // NewFee creates and returns a new Fee struct encapsulating the receive, acknowledgement and timeout fees as sdk.Coins func NewFee(recvFee, ackFee, timeoutFee sdk.Coins) Fee { return Fee{ diff --git a/modules/apps/29-fee/types/query.pb.go b/modules/apps/29-fee/types/query.pb.go index 3bbbbee7b17..ef1b0512d25 100644 --- a/modules/apps/29-fee/types/query.pb.go +++ b/modules/apps/29-fee/types/query.pb.go @@ -89,7 +89,7 @@ func (m *QueryIncentivizedPacketsRequest) GetQueryHeight() uint64 { // QueryIncentivizedPacketsResponse is the response type for the incentivized packets RPC type QueryIncentivizedPacketsResponse struct { // Map of all incentivized_packets - IncentivizedPackets []*IdentifiedPacketFee `protobuf:"bytes,1,rep,name=incentivized_packets,json=incentivizedPackets,proto3" json:"incentivized_packets,omitempty"` + IncentivizedPackets []IdentifiedPacketFees `protobuf:"bytes,1,rep,name=incentivized_packets,json=incentivizedPackets,proto3" json:"incentivized_packets"` } func (m *QueryIncentivizedPacketsResponse) Reset() { *m = QueryIncentivizedPacketsResponse{} } @@ -125,7 +125,7 @@ func (m *QueryIncentivizedPacketsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryIncentivizedPacketsResponse proto.InternalMessageInfo -func (m *QueryIncentivizedPacketsResponse) GetIncentivizedPackets() []*IdentifiedPacketFee { +func (m *QueryIncentivizedPacketsResponse) GetIncentivizedPackets() []IdentifiedPacketFees { if m != nil { return m.IncentivizedPackets } @@ -190,7 +190,7 @@ func (m *QueryIncentivizedPacketRequest) GetQueryHeight() uint64 { // QueryIncentivizedPacketsResponse is the response type for the incentivized packet RPC type QueryIncentivizedPacketResponse struct { // Incentivized_packet - IncentivizedPacket *IdentifiedPacketFee `protobuf:"bytes,1,opt,name=incentivized_packet,json=incentivizedPacket,proto3" json:"incentivized_packet,omitempty"` + IncentivizedPacket IdentifiedPacketFees `protobuf:"bytes,1,opt,name=incentivized_packet,json=incentivizedPacket,proto3" json:"incentivized_packet"` } func (m *QueryIncentivizedPacketResponse) Reset() { *m = QueryIncentivizedPacketResponse{} } @@ -226,11 +226,11 @@ func (m *QueryIncentivizedPacketResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryIncentivizedPacketResponse proto.InternalMessageInfo -func (m *QueryIncentivizedPacketResponse) GetIncentivizedPacket() *IdentifiedPacketFee { +func (m *QueryIncentivizedPacketResponse) GetIncentivizedPacket() IdentifiedPacketFees { if m != nil { return m.IncentivizedPacket } - return nil + return IdentifiedPacketFees{} } func init() { @@ -246,41 +246,41 @@ func init() { var fileDescriptor_0638a8a78ca2503c = []byte{ // 554 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xc1, 0x6b, 0x13, 0x4f, - 0x14, 0xce, 0xa4, 0xfd, 0xfd, 0xd0, 0x89, 0xa7, 0x49, 0xc1, 0x10, 0x74, 0x9b, 0x46, 0xd4, 0x20, - 0x66, 0x86, 0xa4, 0x88, 0xed, 0x4d, 0x7a, 0x28, 0xe6, 0x64, 0xcd, 0x51, 0x90, 0xb0, 0x3b, 0xfb, - 0xb2, 0x19, 0x4c, 0x76, 0xb6, 0x99, 0xc9, 0x42, 0xab, 0x05, 0xa9, 0x78, 0xeb, 0x41, 0xf0, 0xaf, - 0xf1, 0x3f, 0xe8, 0xb1, 0xe8, 0xc5, 0x93, 0x48, 0xe2, 0x1f, 0x22, 0xb3, 0x3b, 0x89, 0x0b, 0xc9, - 0x62, 0xe3, 0x6d, 0xf7, 0xbd, 0xef, 0x7b, 0xdf, 0xb7, 0xdf, 0x9b, 0x59, 0x7c, 0x4f, 0x78, 0x9c, - 0xb9, 0x51, 0x34, 0x14, 0xdc, 0xd5, 0x42, 0x86, 0x8a, 0xf5, 0x01, 0x58, 0xdc, 0x62, 0xc7, 0x13, - 0x18, 0x9f, 0xd0, 0x68, 0x2c, 0xb5, 0x24, 0xb7, 0x85, 0xc7, 0x69, 0x16, 0x44, 0xfb, 0x00, 0x34, - 0x6e, 0x55, 0xb7, 0x02, 0x19, 0xc8, 0x04, 0xc3, 0xcc, 0x53, 0x0a, 0xaf, 0xee, 0xe4, 0xcd, 0x34, - 0xac, 0x14, 0x72, 0x27, 0x90, 0x32, 0x18, 0x02, 0x73, 0x23, 0xc1, 0xdc, 0x30, 0x94, 0xda, 0xce, - 0xcd, 0x0c, 0xe0, 0x72, 0x0c, 0x8c, 0x0f, 0xdc, 0x30, 0x84, 0xa1, 0x21, 0xdb, 0x47, 0x0b, 0x79, - 0xc4, 0xa5, 0x1a, 0x49, 0xc5, 0x3c, 0x57, 0x41, 0xea, 0x95, 0xc5, 0x2d, 0x0f, 0xb4, 0xdb, 0x62, - 0x91, 0x1b, 0x88, 0x30, 0x99, 0x97, 0x62, 0xeb, 0x17, 0x08, 0x6f, 0xbf, 0x34, 0x90, 0x4e, 0xc8, - 0x21, 0xd4, 0x22, 0x16, 0xa7, 0xe0, 0x1f, 0xb9, 0xfc, 0x0d, 0x68, 0xd5, 0x85, 0xe3, 0x09, 0x28, - 0x4d, 0x0e, 0x31, 0xfe, 0xc3, 0xab, 0xa0, 0x1a, 0x6a, 0x94, 0xda, 0x0f, 0x68, 0x2a, 0x42, 0x8d, - 0x08, 0x4d, 0x03, 0xb1, 0x22, 0xf4, 0xc8, 0x0d, 0xc0, 0x72, 0xbb, 0x19, 0x26, 0xd9, 0xc1, 0xb7, - 0x12, 0x60, 0x6f, 0x00, 0x22, 0x18, 0xe8, 0x4a, 0xb1, 0x86, 0x1a, 0x9b, 0xdd, 0x52, 0x52, 0x7b, - 0x9e, 0x94, 0xea, 0x1f, 0x10, 0xae, 0xe5, 0xdb, 0x51, 0x91, 0x0c, 0x15, 0x90, 0x1e, 0xde, 0x12, - 0x99, 0x76, 0x2f, 0x4a, 0xfb, 0x15, 0x54, 0xdb, 0x68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d, 0x1d, 0xbc, 0xb8, - 0x9c, 0x3a, 0xe8, 0x6a, 0xea, 0xa0, 0x9f, 0x53, 0x07, 0x7d, 0x9a, 0x39, 0x85, 0xab, 0x99, 0x53, - 0xf8, 0x3e, 0x73, 0x0a, 0xaf, 0x9e, 0x04, 0x42, 0x0f, 0x26, 0x1e, 0xe5, 0x72, 0xc4, 0xec, 0x5f, - 0x44, 0x78, 0xbc, 0x19, 0x48, 0x16, 0xef, 0xb2, 0x91, 0xf4, 0x27, 0x43, 0x50, 0xa9, 0xe9, 0xf6, - 0x7e, 0xd3, 0xf8, 0xd6, 0x27, 0x11, 0x28, 0xef, 0xff, 0xe4, 0x67, 0xb2, 0xfb, 0x3b, 0x00, 0x00, - 0xff, 0xff, 0xd3, 0xea, 0xdd, 0xe2, 0x32, 0x05, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x41, 0x6b, 0x13, 0x41, + 0x14, 0xce, 0xb4, 0x55, 0x74, 0xe2, 0x69, 0x52, 0x30, 0x04, 0xdd, 0xa6, 0x11, 0x35, 0x08, 0x99, + 0x21, 0x29, 0x62, 0x7b, 0x93, 0x1e, 0x8a, 0x39, 0x59, 0x73, 0xf4, 0x12, 0x76, 0x67, 0x5f, 0x36, + 0x83, 0xc9, 0xce, 0x36, 0x33, 0x59, 0x68, 0xb5, 0x97, 0x82, 0x08, 0xd2, 0x83, 0xe0, 0xaf, 0xf1, + 0x1f, 0xf4, 0x58, 0xf4, 0xe2, 0x49, 0x24, 0xf1, 0x87, 0xc8, 0xec, 0xce, 0xc6, 0x85, 0x64, 0xb1, + 0xed, 0x6d, 0xf7, 0xbd, 0xef, 0x7b, 0xdf, 0xb7, 0xdf, 0x9b, 0x1d, 0xfc, 0x48, 0x78, 0x9c, 0xb9, + 0x51, 0x34, 0x12, 0xdc, 0xd5, 0x42, 0x86, 0x8a, 0x0d, 0x00, 0x58, 0xdc, 0x66, 0x47, 0x53, 0x98, + 0x1c, 0xd3, 0x68, 0x22, 0xb5, 0x24, 0xf7, 0x85, 0xc7, 0x69, 0x1e, 0x44, 0x07, 0x00, 0x34, 0x6e, + 0xd7, 0x36, 0x03, 0x19, 0xc8, 0x04, 0xc3, 0xcc, 0x53, 0x0a, 0xaf, 0x6d, 0x17, 0xcd, 0x34, 0xac, + 0x14, 0xf2, 0x20, 0x90, 0x32, 0x18, 0x01, 0x73, 0x23, 0xc1, 0xdc, 0x30, 0x94, 0xda, 0xce, 0xcd, + 0x0d, 0xe0, 0x72, 0x02, 0x8c, 0x0f, 0xdd, 0x30, 0x84, 0x91, 0x21, 0xdb, 0x47, 0x0b, 0x79, 0xc6, + 0xa5, 0x1a, 0x4b, 0xc5, 0x3c, 0x57, 0x41, 0xea, 0x95, 0xc5, 0x6d, 0x0f, 0xb4, 0xdb, 0x66, 0x91, + 0x1b, 0x88, 0x30, 0x99, 0x97, 0x62, 0x1b, 0xe7, 0x08, 0x6f, 0xbd, 0x31, 0x90, 0x6e, 0xc8, 0x21, + 0xd4, 0x22, 0x16, 0x27, 0xe0, 0x1f, 0xba, 0xfc, 0x1d, 0x68, 0xd5, 0x83, 0xa3, 0x29, 0x28, 0x4d, + 0x0e, 0x30, 0xfe, 0xc7, 0xab, 0xa2, 0x3a, 0x6a, 0x96, 0x3b, 0x4f, 0x68, 0x2a, 0x42, 0x8d, 0x08, + 0x4d, 0x03, 0xb1, 0x22, 0xf4, 0xd0, 0x0d, 0xc0, 0x72, 0x7b, 0x39, 0x26, 0xd9, 0xc6, 0xf7, 0x12, + 0x60, 0x7f, 0x08, 0x22, 0x18, 0xea, 0xea, 0x5a, 0x1d, 0x35, 0x37, 0x7a, 0xe5, 0xa4, 0xf6, 0x2a, + 0x29, 0x35, 0x3e, 0x23, 0x5c, 0x2f, 0xb6, 0xa3, 0x22, 0x19, 0x2a, 0x20, 0x03, 0xbc, 0x29, 0x72, + 0xed, 0x7e, 0x94, 0xf6, 0xab, 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ab, 0x9d, 0xee, 0xbf, 0xbe, + 0x98, 0x39, 0xe8, 0x72, 0xe6, 0xa0, 0xdf, 0x33, 0x07, 0x7d, 0x99, 0x3b, 0xa5, 0xcb, 0xb9, 0x53, + 0xfa, 0x39, 0x77, 0x4a, 0x6f, 0x9f, 0x07, 0x42, 0x0f, 0xa7, 0x1e, 0xe5, 0x72, 0xcc, 0xec, 0x9d, + 0x22, 0x3c, 0xde, 0x0a, 0x24, 0x8b, 0x77, 0xd8, 0x58, 0xfa, 0xd3, 0x11, 0xa8, 0xd4, 0x74, 0x67, + 0xaf, 0x65, 0x7c, 0xeb, 0xe3, 0x08, 0x94, 0x77, 0x3b, 0xb9, 0x5a, 0x76, 0xfe, 0x06, 0x00, 0x00, + 0xff, 0xff, 0xcd, 0x07, 0x8a, 0x55, 0x40, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -540,18 +540,16 @@ func (m *QueryIncentivizedPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int _ = i var l int _ = l - if m.IncentivizedPacket != nil { - { - size, err := m.IncentivizedPacket.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + { + size, err := m.IncentivizedPacket.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -617,10 +615,8 @@ func (m *QueryIncentivizedPacketResponse) Size() (n int) { } var l int _ = l - if m.IncentivizedPacket != nil { - l = m.IncentivizedPacket.Size() - n += 1 + l + sovQuery(uint64(l)) - } + l = m.IncentivizedPacket.Size() + n += 1 + l + sovQuery(uint64(l)) return n } @@ -793,7 +789,7 @@ func (m *QueryIncentivizedPacketsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IncentivizedPackets = append(m.IncentivizedPackets, &IdentifiedPacketFee{}) + m.IncentivizedPackets = append(m.IncentivizedPackets, IdentifiedPacketFees{}) if err := m.IncentivizedPackets[len(m.IncentivizedPackets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -979,9 +975,6 @@ func (m *QueryIncentivizedPacketResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.IncentivizedPacket == nil { - m.IncentivizedPacket = &IdentifiedPacketFee{} - } if err := m.IncentivizedPacket.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/proto/ibc/applications/fee/v1/query.proto b/proto/ibc/applications/fee/v1/query.proto index 47db939a512..a588240a285 100644 --- a/proto/ibc/applications/fee/v1/query.proto +++ b/proto/ibc/applications/fee/v1/query.proto @@ -37,7 +37,7 @@ message QueryIncentivizedPacketsRequest { // QueryIncentivizedPacketsResponse is the response type for the incentivized packets RPC message QueryIncentivizedPacketsResponse { // Map of all incentivized_packets - repeated ibc.applications.fee.v1.IdentifiedPacketFee incentivized_packets = 1; + repeated ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packets = 1 [(gogoproto.nullable) = false]; } // QueryIncentivizedPacketRequest is the request type for querying for all incentivized packets @@ -51,5 +51,5 @@ message QueryIncentivizedPacketRequest { // QueryIncentivizedPacketsResponse is the response type for the incentivized packet RPC message QueryIncentivizedPacketResponse { // Incentivized_packet - ibc.applications.fee.v1.IdentifiedPacketFee incentivized_packet = 1; + ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packet = 1 [(gogoproto.nullable) = false]; }