From 15fa37bd65ff49c9e5013db580b5b26e2d36606f Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Wed, 23 Feb 2022 14:26:40 +0000 Subject: [PATCH] chore: update ics29 genesis state to support multiple packet fees (#957) * adding new proto types and codegen * refactoring ics29 fees for more efficient storage * updating tests * updating genesis protos to use IdentifiedPacketFees * updating init/export genesis state functionality and tests --- docs/ibc/proto-docs.md | 2 +- modules/apps/29-fee/keeper/genesis.go | 4 +- modules/apps/29-fee/keeper/genesis_test.go | 34 ++++----- modules/apps/29-fee/keeper/keeper.go | 24 ++++-- modules/apps/29-fee/keeper/keeper_test.go | 24 +++--- modules/apps/29-fee/types/fee.go | 19 +++++ modules/apps/29-fee/types/genesis.go | 15 ++-- modules/apps/29-fee/types/genesis.pb.go | 82 ++++++++++----------- modules/apps/29-fee/types/genesis_test.go | 14 ++-- proto/ibc/applications/fee/v1/ack.proto | 2 +- proto/ibc/applications/fee/v1/genesis.proto | 4 +- proto/ibc/applications/fee/v1/tx.proto | 2 +- 12 files changed, 136 insertions(+), 90 deletions(-) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 9bf131b1b56..ddeba3e5cb6 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -846,7 +846,7 @@ GenesisState defines the fee middleware genesis state | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `identified_fees` | [IdentifiedPacketFee](#ibc.applications.fee.v1.IdentifiedPacketFee) | repeated | | +| `identified_fees` | [IdentifiedPacketFees](#ibc.applications.fee.v1.IdentifiedPacketFees) | repeated | | | `fee_enabled_channels` | [FeeEnabledChannel](#ibc.applications.fee.v1.FeeEnabledChannel) | repeated | | | `registered_relayers` | [RegisteredRelayerAddress](#ibc.applications.fee.v1.RegisteredRelayerAddress) | repeated | | | `forward_relayers` | [ForwardRelayerAddress](#ibc.applications.fee.v1.ForwardRelayerAddress) | repeated | | diff --git a/modules/apps/29-fee/keeper/genesis.go b/modules/apps/29-fee/keeper/genesis.go index 5cf26a52ac3..70b6a5012a2 100644 --- a/modules/apps/29-fee/keeper/genesis.go +++ b/modules/apps/29-fee/keeper/genesis.go @@ -8,8 +8,8 @@ import ( // InitGenesis initializes the fee middleware application state from a provided genesis state func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState) { - for _, fee := range state.IdentifiedFees { - k.SetFeeInEscrow(ctx, fee) + for _, identifiedFees := range state.IdentifiedFees { + k.SetFeesInEscrow(ctx, identifiedFees.PacketId, types.NewPacketFees(identifiedFees.PacketFees)) } for _, relayer := range state.RegisteredRelayers { diff --git a/modules/apps/29-fee/keeper/genesis_test.go b/modules/apps/29-fee/keeper/genesis_test.go index 0b3dcb4bad6..f2824120a82 100644 --- a/modules/apps/29-fee/keeper/genesis_test.go +++ b/modules/apps/29-fee/keeper/genesis_test.go @@ -9,11 +9,7 @@ import ( func (suite *KeeperTestSuite) TestInitGenesis() { // build PacketId & Fee refundAcc := suite.chainA.SenderAccount.GetAddress() - packetId := channeltypes.NewPacketId( - ibctesting.FirstChannelID, - ibctesting.MockFeePort, - uint64(1), - ) + packetID := channeltypes.NewPacketId(ibctesting.FirstChannelID, ibctesting.MockFeePort, 1) fee := types.Fee{ RecvFee: defaultReceiveFee, AckFee: defaultAckFee, @@ -25,12 +21,16 @@ func (suite *KeeperTestSuite) TestInitGenesis() { counterparty := suite.chainB.SenderAccount.GetAddress().String() genesisState := types.GenesisState{ - IdentifiedFees: []types.IdentifiedPacketFee{ + IdentifiedFees: []types.IdentifiedPacketFees{ { - PacketId: packetId, - Fee: fee, - RefundAddress: refundAcc.String(), - Relayers: nil, + PacketId: packetID, + PacketFees: []types.PacketFee{ + { + Fee: fee, + RefundAddress: refundAcc.String(), + Relayers: nil, + }, + }, }, }, FeeEnabledChannels: []types.FeeEnabledChannel{ @@ -51,9 +51,9 @@ func (suite *KeeperTestSuite) TestInitGenesis() { suite.chainA.GetSimApp().IBCFeeKeeper.InitGenesis(suite.chainA.GetContext(), genesisState) // check fee - identifiedFee, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeInEscrow(suite.chainA.GetContext(), packetId) + feesInEscrow, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetFeesInEscrow(suite.chainA.GetContext(), packetID) suite.Require().True(found) - suite.Require().Equal(genesisState.IdentifiedFees[0], identifiedFee) + suite.Require().Equal(genesisState.IdentifiedFees[0].PacketFees, feesInEscrow.PacketFees) // check fee is enabled isEnabled := suite.chainA.GetSimApp().IBCFeeKeeper.IsFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, ibctesting.FirstChannelID) @@ -78,8 +78,8 @@ func (suite *KeeperTestSuite) TestExportGenesis() { TimeoutFee: defaultTimeoutFee, } - identifiedPacketFee := types.NewIdentifiedPacketFee(packetID, fee, refundAcc.String(), []string{}) - suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeInEscrow(suite.chainA.GetContext(), identifiedPacketFee) + packetFee := types.NewPacketFee(fee, refundAcc.String(), []string{}) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees([]types.PacketFee{packetFee})) // relayer addresses sender := suite.chainA.SenderAccount.GetAddress().String() @@ -99,9 +99,9 @@ func (suite *KeeperTestSuite) TestExportGenesis() { // check fee suite.Require().Equal(packetID, genesisState.IdentifiedFees[0].PacketId) - suite.Require().Equal(fee, genesisState.IdentifiedFees[0].Fee) - suite.Require().Equal(refundAcc.String(), genesisState.IdentifiedFees[0].RefundAddress) - suite.Require().Equal([]string(nil), genesisState.IdentifiedFees[0].Relayers) + suite.Require().Equal(fee, genesisState.IdentifiedFees[0].PacketFees[0].Fee) + suite.Require().Equal(refundAcc.String(), genesisState.IdentifiedFees[0].PacketFees[0].RefundAddress) + suite.Require().Equal([]string(nil), genesisState.IdentifiedFees[0].PacketFees[0].Relayers) // check registered relayer addresses suite.Require().Equal(sender, genesisState.RegisteredRelayers[0].Address) diff --git a/modules/apps/29-fee/keeper/keeper.go b/modules/apps/29-fee/keeper/keeper.go index cc7bff64bdb..48ff7c935b0 100644 --- a/modules/apps/29-fee/keeper/keeper.go +++ b/modules/apps/29-fee/keeper/keeper.go @@ -328,15 +328,29 @@ func (k Keeper) HasFeeInEscrow(ctx sdk.Context, packetId channeltypes.PacketId) } // GetAllIdentifiedPacketFees returns a list of all IdentifiedPacketFees that are stored in state -func (k Keeper) GetAllIdentifiedPacketFees(ctx sdk.Context) []types.IdentifiedPacketFee { +func (k Keeper) GetAllIdentifiedPacketFees(ctx sdk.Context) []types.IdentifiedPacketFees { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, []byte(types.FeeInEscrowPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte(types.FeesInEscrowPrefix)) defer iterator.Close() - var identifiedFees []types.IdentifiedPacketFee + var identifiedFees []types.IdentifiedPacketFees for ; iterator.Valid(); iterator.Next() { - fee := k.MustUnmarshalFee(iterator.Value()) - identifiedFees = append(identifiedFees, fee) + keySplit := strings.Split(string(iterator.Key()), "/") + + feesInEscrow := k.MustUnmarshalFees(iterator.Value()) + + channelID, portID := keySplit[2], keySplit[1] + seq, err := strconv.ParseUint(keySplit[3], 10, 64) + if err != nil { + panic(err) + } + + identifiedFee := types.IdentifiedPacketFees{ + PacketId: channeltypes.NewPacketId(channelID, portID, seq), + PacketFees: feesInEscrow.PacketFees, + } + + identifiedFees = append(identifiedFees, identifiedFee) } return identifiedFees diff --git a/modules/apps/29-fee/keeper/keeper_test.go b/modules/apps/29-fee/keeper/keeper_test.go index 103fad7968c..65132c243e1 100644 --- a/modules/apps/29-fee/keeper/keeper_test.go +++ b/modules/apps/29-fee/keeper/keeper_test.go @@ -109,21 +109,25 @@ func (suite *KeeperTestSuite) TestGetAllIdentifiedPacketFees() { } // escrow the packet fee - identifiedPacketFee := types.NewIdentifiedPacketFee(packetID, fee, refundAcc.String(), []string{}) - suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeInEscrow(suite.chainA.GetContext(), identifiedPacketFee) + packetFee := types.NewPacketFee(fee, refundAcc.String(), []string{}) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees([]types.PacketFee{packetFee})) - expectedFees := []types.IdentifiedPacketFee{ + expectedFees := []types.IdentifiedPacketFees{ { - PacketId: packetID, - Fee: fee, - RefundAddress: refundAcc.String(), - Relayers: nil, + PacketId: packetID, + PacketFees: []types.PacketFee{ + { + Fee: fee, + RefundAddress: refundAcc.String(), + Relayers: nil, + }, + }, }, } - fees := suite.chainA.GetSimApp().IBCFeeKeeper.GetAllIdentifiedPacketFees(suite.chainA.GetContext()) - suite.Require().Len(fees, len(expectedFees)) - suite.Require().Equal(fees, expectedFees) + identifiedFees := suite.chainA.GetSimApp().IBCFeeKeeper.GetAllIdentifiedPacketFees(suite.chainA.GetContext()) + suite.Require().Len(identifiedFees, len(expectedFees)) + suite.Require().Equal(identifiedFees, expectedFees) } func (suite *KeeperTestSuite) TestGetAllFeeEnabledChannels() { diff --git a/modules/apps/29-fee/types/fee.go b/modules/apps/29-fee/types/fee.go index 54dd9ee1435..4dd73893888 100644 --- a/modules/apps/29-fee/types/fee.go +++ b/modules/apps/29-fee/types/fee.go @@ -16,6 +16,25 @@ func NewPacketFee(fee Fee, refundAddr string, relayers []string) PacketFee { } } +// Validate performs basic stateless validation of the associated PacketFee +func (p PacketFee) Validate() error { + _, err := sdk.AccAddressFromBech32(p.RefundAddress) + if err != nil { + return sdkerrors.Wrap(err, "failed to convert RefundAddress into sdk.AccAddress") + } + + // enforce relayer is nil + if p.Relayers != nil { + return ErrRelayersNotNil + } + + if err := p.Fee.Validate(); err != nil { + return err + } + + return nil +} + // NewPacketFees creates and returns a new PacketFees struct including a list of type PacketFee func NewPacketFees(packetFees []PacketFee) PacketFees { return PacketFees{ diff --git a/modules/apps/29-fee/types/genesis.go b/modules/apps/29-fee/types/genesis.go index 33319feb984..be9299fcd94 100644 --- a/modules/apps/29-fee/types/genesis.go +++ b/modules/apps/29-fee/types/genesis.go @@ -10,7 +10,7 @@ import ( ) // NewGenesisState creates a 29-fee GenesisState instance. -func NewGenesisState(identifiedFees []IdentifiedPacketFee, feeEnabledChannels []FeeEnabledChannel, registeredRelayers []RegisteredRelayerAddress, forwardRelayers []ForwardRelayerAddress) *GenesisState { +func NewGenesisState(identifiedFees []IdentifiedPacketFees, feeEnabledChannels []FeeEnabledChannel, registeredRelayers []RegisteredRelayerAddress, forwardRelayers []ForwardRelayerAddress) *GenesisState { return &GenesisState{ IdentifiedFees: identifiedFees, FeeEnabledChannels: feeEnabledChannels, @@ -22,7 +22,7 @@ func NewGenesisState(identifiedFees []IdentifiedPacketFee, feeEnabledChannels [] // DefaultGenesisState returns a GenesisState with "transfer" as the default PortID. func DefaultGenesisState() *GenesisState { return &GenesisState{ - IdentifiedFees: []IdentifiedPacketFee{}, + IdentifiedFees: []IdentifiedPacketFees{}, ForwardRelayers: []ForwardRelayerAddress{}, FeeEnabledChannels: []FeeEnabledChannel{}, RegisteredRelayers: []RegisteredRelayerAddress{}, @@ -33,11 +33,16 @@ func DefaultGenesisState() *GenesisState { // failure. func (gs GenesisState) Validate() error { // Validate IdentifiedPacketFees - for _, fee := range gs.IdentifiedFees { - err := fee.Validate() - if err != nil { + for _, identifiedFees := range gs.IdentifiedFees { + if err := identifiedFees.PacketId.Validate(); err != nil { return err } + + for _, packetFee := range identifiedFees.PacketFees { + if err := packetFee.Validate(); err != nil { + return err + } + } } // Validate FeeEnabledChannels diff --git a/modules/apps/29-fee/types/genesis.pb.go b/modules/apps/29-fee/types/genesis.pb.go index 1ae5e9b195d..84a946a6d43 100644 --- a/modules/apps/29-fee/types/genesis.pb.go +++ b/modules/apps/29-fee/types/genesis.pb.go @@ -26,7 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the fee middleware genesis state type GenesisState struct { - IdentifiedFees []IdentifiedPacketFee `protobuf:"bytes,1,rep,name=identified_fees,json=identifiedFees,proto3" json:"identified_fees" yaml:"identified_fees"` + IdentifiedFees []IdentifiedPacketFees `protobuf:"bytes,1,rep,name=identified_fees,json=identifiedFees,proto3" json:"identified_fees" yaml:"identified_fees"` FeeEnabledChannels []FeeEnabledChannel `protobuf:"bytes,2,rep,name=fee_enabled_channels,json=feeEnabledChannels,proto3" json:"fee_enabled_channels" yaml:"fee_enabled_channels"` RegisteredRelayers []RegisteredRelayerAddress `protobuf:"bytes,3,rep,name=registered_relayers,json=registeredRelayers,proto3" json:"registered_relayers" yaml:"registered_relayers"` ForwardRelayers []ForwardRelayerAddress `protobuf:"bytes,4,rep,name=forward_relayers,json=forwardRelayers,proto3" json:"forward_relayers" yaml:"forward_relayers"` @@ -65,7 +65,7 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetIdentifiedFees() []IdentifiedPacketFee { +func (m *GenesisState) GetIdentifiedFees() []IdentifiedPacketFees { if m != nil { return m.IdentifiedFees } @@ -272,44 +272,44 @@ func init() { } var fileDescriptor_7191992e856dff95 = []byte{ - // 581 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd4, 0x3c, - 0x14, 0x9d, 0xb4, 0x55, 0xfb, 0xd5, 0xfd, 0xd4, 0x1f, 0xb7, 0xa5, 0x51, 0x11, 0x49, 0x31, 0x42, - 0xaa, 0x80, 0x26, 0x9a, 0x16, 0x16, 0xb0, 0x63, 0x10, 0x45, 0xb3, 0x02, 0x19, 0x56, 0x6c, 0xa2, - 0xfc, 0xdc, 0xa4, 0x16, 0x99, 0x38, 0xb2, 0x3d, 0x83, 0x86, 0x1d, 0x1b, 0xd8, 0x21, 0x9e, 0x88, - 0x75, 0x97, 0x5d, 0xb2, 0x1a, 0xa1, 0xf6, 0x0d, 0xe6, 0x09, 0x50, 0x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, 0x2f, 0xd7, 0x6a, 0x37, 0x0f, 0xb0, - 0xf8, 0x8f, 0x07, 0xf8, 0x6a, 0xa0, 0xdd, 0xb9, 0x97, 0xf0, 0x17, 0xf7, 0xef, 0xd0, 0x6a, 0x5e, - 0x8e, 0x4c, 0x9d, 0xd4, 0xda, 0xf1, 0x9d, 0xf2, 0x86, 0x8b, 0xa1, 0x75, 0xea, 0x49, 0x1d, 0xb4, - 0x1d, 0x3d, 0x58, 0xdd, 0xa8, 0x63, 0x56, 0x17, 0xba, 0x59, 0x85, 0x5f, 0xb3, 0x09, 0xfd, 0x2f, - 0xaf, 0x31, 0xaf, 0xcf, 0x2f, 0x2d, 0xe3, 0xe2, 0xd2, 0x32, 0x7e, 0x5d, 0x5a, 0xc6, 0xf7, 0x2b, - 0xab, 0x75, 0x71, 0x65, 0xb5, 0x7e, 0x5e, 0x59, 0xad, 0xf7, 0x4f, 0x12, 0xa6, 0xce, 0xfa, 0x81, - 0x13, 0xf2, 0x9e, 0x1b, 0x72, 0xd9, 0xe3, 0xd2, 0x65, 0x41, 0x78, 0x94, 0x70, 0x77, 0x70, 0xe2, - 0xf6, 0x78, 0xd4, 0x4f, 0x41, 0x16, 0x6f, 0x8a, 0x74, 0x8f, 0x9f, 0x1e, 0x15, 0xcf, 0x89, 0x1a, - 0xe6, 0x20, 0x83, 0xe5, 0xf2, 0xad, 0x38, 0xf9, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x19, 0xed, 0x5e, - 0x39, 0xc9, 0x04, 0x00, 0x00, + // 579 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4d, 0x6f, 0xd4, 0x30, + 0x14, 0xdc, 0xb4, 0x55, 0x4b, 0x5d, 0xd4, 0x0f, 0xb7, 0xa5, 0x51, 0x11, 0x49, 0x31, 0x42, 0xaa, + 0x40, 0x4d, 0xb4, 0x2d, 0x1c, 0xe0, 0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c8, 0x6c, 0x0b, 0x12, 0x9b, 0x68, 0xc9, 0xd7, 0xa5, 0xd6, 0xa7, 0xcd, 0x27, + 0xa6, 0x68, 0x2b, 0xe4, 0xa7, 0x99, 0x02, 0x91, 0xfb, 0x42, 0x0d, 0xbd, 0x06, 0xa6, 0x65, 0xed, + 0xf1, 0x6f, 0x30, 0x0b, 0x45, 0xe8, 0xe6, 0xe4, 0x72, 0xa3, 0x76, 0xf3, 0x00, 0xf3, 0xff, 0x79, + 0x80, 0x6f, 0x06, 0xda, 0x9e, 0x79, 0x09, 0xff, 0x70, 0xff, 0x1e, 0x2d, 0xe7, 0xd5, 0xcc, 0x34, + 0x49, 0xad, 0x1c, 0xde, 0xab, 0x6e, 0xb8, 0x9c, 0x5a, 0xa7, 0x19, 0xd5, 0xa2, 0xeb, 0xe8, 0xc9, + 0xea, 0x47, 0x3d, 0xb3, 0xbe, 0xd0, 0xf5, 0x3a, 0xfc, 0x86, 0x4d, 0xe8, 0xad, 0xbc, 0xc1, 0xbc, + 0x39, 0xbb, 0xb0, 0x8c, 0xf3, 0x0b, 0xcb, 0xf8, 0x7d, 0x61, 0x19, 0x3f, 0x2e, 0xad, 0xce, 0xf9, + 0xa5, 0xd5, 0xf9, 0x75, 0x69, 0x75, 0x3e, 0x3c, 0x4d, 0x98, 0x3a, 0x39, 0x0d, 0x9c, 0x90, 0x0f, + 0xdc, 0x90, 0xcb, 0x01, 0x97, 0x2e, 0x0b, 0xc2, 0x83, 0x84, 0xbb, 0xc5, 0x91, 0x3b, 0xe0, 0xd1, + 0x69, 0x0a, 0xb2, 0x7c, 0x54, 0xa4, 0x7b, 0xf8, 0xec, 0xa0, 0x7c, 0x4f, 0xd4, 0x30, 0x07, 0x19, + 0x2c, 0x56, 0x8f, 0xc5, 0xd1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x33, 0x0f, 0x78, 0xca, + 0x04, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -673,7 +673,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IdentifiedFees = append(m.IdentifiedFees, IdentifiedPacketFee{}) + m.IdentifiedFees = append(m.IdentifiedFees, IdentifiedPacketFees{}) if err := m.IdentifiedFees[len(m.IdentifiedFees)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/modules/apps/29-fee/types/genesis_test.go b/modules/apps/29-fee/types/genesis_test.go index 711e9ebb142..75c754cc7c9 100644 --- a/modules/apps/29-fee/types/genesis_test.go +++ b/modules/apps/29-fee/types/genesis_test.go @@ -168,12 +168,16 @@ func TestValidateGenesis(t *testing.T) { tc.malleate() genState := types.GenesisState{ - IdentifiedFees: []types.IdentifiedPacketFee{ + IdentifiedFees: []types.IdentifiedPacketFees{ { - PacketId: packetId, - Fee: fee, - RefundAddress: refundAcc, - Relayers: nil, + PacketId: packetId, + PacketFees: []types.PacketFee{ + { + Fee: fee, + RefundAddress: refundAcc, + Relayers: nil, + }, + }, }, }, FeeEnabledChannels: []types.FeeEnabledChannel{ diff --git a/proto/ibc/applications/fee/v1/ack.proto b/proto/ibc/applications/fee/v1/ack.proto index 1a0c5e3f404..6a77e4fce45 100644 --- a/proto/ibc/applications/fee/v1/ack.proto +++ b/proto/ibc/applications/fee/v1/ack.proto @@ -11,5 +11,5 @@ import "gogoproto/gogo.proto"; message IncentivizedAcknowledgement { bytes result = 1; string forward_relayer_address = 2 [(gogoproto.moretags) = "yaml:\"forward_relayer_address\""]; - bool underlying_app_success = 3 [(gogoproto.moretags) = "yaml:\"underlying_app_successl\""]; + bool underlying_app_success = 3 [(gogoproto.moretags) = "yaml:\"underlying_app_successl\""]; } diff --git a/proto/ibc/applications/fee/v1/genesis.proto b/proto/ibc/applications/fee/v1/genesis.proto index b832a4bcd4a..0e76fa3a168 100644 --- a/proto/ibc/applications/fee/v1/genesis.proto +++ b/proto/ibc/applications/fee/v1/genesis.proto @@ -10,7 +10,7 @@ import "ibc/core/channel/v1/channel.proto"; // GenesisState defines the fee middleware genesis state message GenesisState { - repeated IdentifiedPacketFee identified_fees = 1 + repeated IdentifiedPacketFees identified_fees = 1 [(gogoproto.moretags) = "yaml:\"identified_fees\"", (gogoproto.nullable) = false]; repeated FeeEnabledChannel fee_enabled_channels = 2 [(gogoproto.moretags) = "yaml:\"fee_enabled_channels\"", (gogoproto.nullable) = false]; @@ -30,7 +30,7 @@ message FeeEnabledChannel { message RegisteredRelayerAddress { string address = 1; string counterparty_address = 2 [(gogoproto.moretags) = "yaml:\"counterparty_address\""]; - string channel_id = 3 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 3 [(gogoproto.moretags) = "yaml:\"channel_id\""]; } // ForwardRelayerAddress contains the forward relayer address and packetId used for async acknowledgements diff --git a/proto/ibc/applications/fee/v1/tx.proto b/proto/ibc/applications/fee/v1/tx.proto index 532524cd4b2..8209e14d531 100644 --- a/proto/ibc/applications/fee/v1/tx.proto +++ b/proto/ibc/applications/fee/v1/tx.proto @@ -32,7 +32,7 @@ message MsgRegisterCounterpartyAddress { string address = 1; string counterparty_address = 2 [(gogoproto.moretags) = "yaml:\"counterparty_address\""]; - string channel_id = 3 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 3 [(gogoproto.moretags) = "yaml:\"channel_id\""]; } // MsgRegisterCounterpartyAddressResponse defines the Msg/RegisterCounterypartyAddress response type