diff --git a/modules/apps/29-fee/ibc_module_test.go b/modules/apps/29-fee/ibc_module_test.go index a12b8ae972f..aaa92855d9d 100644 --- a/modules/apps/29-fee/ibc_module_test.go +++ b/modules/apps/29-fee/ibc_module_test.go @@ -510,7 +510,7 @@ func (suite *FeeTestSuite) TestOnRecvPacket() { func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { var ( ack []byte - identifiedFee *types.IdentifiedPacketFee + identifiedFee types.IdentifiedPacketFee originalBalance sdk.Coins expectedBalance sdk.Coins expectedRelayerBalance sdk.Coins @@ -658,7 +658,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { func (suite *FeeTestSuite) TestOnTimeoutPacket() { var ( relayerAddr sdk.AccAddress - identifiedFee *types.IdentifiedPacketFee + identifiedFee types.IdentifiedPacketFee originalBalance sdk.Coins expectedBalance sdk.Coins ) diff --git a/modules/apps/29-fee/keeper/escrow.go b/modules/apps/29-fee/keeper/escrow.go index 9ba1709a8dc..48ba56e70d7 100644 --- a/modules/apps/29-fee/keeper/escrow.go +++ b/modules/apps/29-fee/keeper/escrow.go @@ -10,7 +10,7 @@ import ( ) // EscrowPacketFee sends the packet fee to the 29-fee module account to hold in escrow -func (k Keeper) EscrowPacketFee(ctx sdk.Context, identifiedFee *types.IdentifiedPacketFee) error { +func (k Keeper) EscrowPacketFee(ctx sdk.Context, identifiedFee types.IdentifiedPacketFee) error { if !k.IsFeeEnabled(ctx, identifiedFee.PacketId.PortId, identifiedFee.PacketId.ChannelId) { // users may not escrow fees on this channel. Must send packets without a fee message return sdkerrors.Wrap(types.ErrFeeNotEnabled, "cannot escrow fee for packet") diff --git a/modules/apps/29-fee/keeper/escrow_test.go b/modules/apps/29-fee/keeper/escrow_test.go index 9c07c79589c..7a5de6919d6 100644 --- a/modules/apps/29-fee/keeper/escrow_test.go +++ b/modules/apps/29-fee/keeper/escrow_test.go @@ -75,7 +75,7 @@ func (suite *KeeperTestSuite) TestEscrowPacketFee() { AckFee: ackFee, TimeoutFee: timeoutFee, } - identifiedPacketFee := &types.IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: refundAcc.String(), Relayers: []string{}} + identifiedPacketFee := types.NewIdentifiedPacketFee(packetId, fee, refundAcc.String(), []string{}) // refundAcc balance before escrow originalBal := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAcc, sdk.DefaultBondDenom) @@ -158,7 +158,7 @@ func (suite *KeeperTestSuite) TestDistributeFee() { // refundAcc balance after escrow refundAccBal := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAcc, sdk.DefaultBondDenom) - suite.chainA.GetSimApp().IBCFeeKeeper.DistributePacketFees(suite.chainA.GetContext(), refundAcc.String(), forwardRelayer, reverseRelayer, *identifiedPacketFee) + suite.chainA.GetSimApp().IBCFeeKeeper.DistributePacketFees(suite.chainA.GetContext(), refundAcc.String(), forwardRelayer, reverseRelayer, identifiedPacketFee) if tc.expPass { // there should no longer be a fee in escrow for this packet @@ -212,14 +212,14 @@ func (suite *KeeperTestSuite) TestDistributeTimeoutFee() { } // escrow the packet fee & store the fee in state - identifiedPacketFee := types.IdentifiedPacketFee{ - PacketId: packetId, - Fee: fee, - RefundAddress: refundAcc.String(), - Relayers: []string{}, - } + identifiedPacketFee := types.NewIdentifiedPacketFee( + packetId, + fee, + refundAcc.String(), + []string{}, + ) - err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), &identifiedPacketFee) + err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) suite.Require().NoError(err) // refundAcc balance after escrow @@ -261,9 +261,9 @@ func (suite *KeeperTestSuite) TestRefundFeesOnChannel() { TimeoutFee: defaultTimeoutFee, } - identifiedPacketFee := types.IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: refundAcc.String(), Relayers: []string{}} + identifiedPacketFee := types.NewIdentifiedPacketFee(packetId, fee, refundAcc.String(), []string{}) suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), transfertypes.PortID, "channel-0") - err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), &identifiedPacketFee) + err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) suite.Require().NoError(err) } @@ -275,9 +275,9 @@ func (suite *KeeperTestSuite) TestRefundFeesOnChannel() { TimeoutFee: defaultTimeoutFee, } - identifiedPacketFee := types.IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: refundAcc.String(), Relayers: []string{}} + identifiedPacketFee := types.NewIdentifiedPacketFee(packetId, fee, refundAcc.String(), []string{}) suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), transfertypes.PortID, "channel-1") - err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), &identifiedPacketFee) + err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) suite.Require().NoError(err) // check that refunding all fees on channel-0 refunds all fees except for fee on channel-1 @@ -291,8 +291,8 @@ func (suite *KeeperTestSuite) TestRefundFeesOnChannel() { // create escrow and then change module account balance to cause error on refund packetId = channeltypes.NewPacketId("channel-0", transfertypes.PortID, uint64(6)) - identifiedPacketFee = types.IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: refundAcc.String(), Relayers: []string{}} - err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), &identifiedPacketFee) + identifiedPacketFee = types.NewIdentifiedPacketFee(packetId, fee, refundAcc.String(), []string{}) + err = suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) suite.Require().NoError(err) suite.chainA.GetSimApp().BankKeeper.SendCoinsFromModuleToAccount(suite.chainA.GetContext(), types.ModuleName, refundAcc, fee.TimeoutFee) diff --git a/modules/apps/29-fee/keeper/genesis_test.go b/modules/apps/29-fee/keeper/genesis_test.go index 58e772ac66c..568335daed1 100644 --- a/modules/apps/29-fee/keeper/genesis_test.go +++ b/modules/apps/29-fee/keeper/genesis_test.go @@ -28,7 +28,7 @@ func (suite *KeeperTestSuite) TestInitGenesis() { counterparty := suite.chainB.SenderAccount.GetAddress().String() genesisState := types.GenesisState{ - IdentifiedFees: []*types.IdentifiedPacketFee{ + IdentifiedFees: []types.IdentifiedPacketFee{ { PacketId: packetId, Fee: fee, @@ -55,7 +55,7 @@ func (suite *KeeperTestSuite) TestInitGenesis() { // check fee identifiedFee, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeInEscrow(suite.chainA.GetContext(), packetId) suite.Require().True(found) - suite.Require().Equal(genesisState.IdentifiedFees[0], &identifiedFee) + suite.Require().Equal(genesisState.IdentifiedFees[0], identifiedFee) // check fee is enabled isEnabled := suite.chainA.GetSimApp().IBCFeeKeeper.IsFeeEnabled(suite.chainA.GetContext(), transfertypes.PortID, ibctesting.FirstChannelID) @@ -84,7 +84,7 @@ func (suite *KeeperTestSuite) TestExportGenesis() { defaultAckFee, defaultTimeoutFee, } - identifiedPacketFee := &types.IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: refundAcc.String(), Relayers: []string{}} + identifiedPacketFee := types.NewIdentifiedPacketFee(packetId, fee, refundAcc.String(), []string{}) err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) suite.Require().NoError(err) diff --git a/modules/apps/29-fee/keeper/grpc_query_test.go b/modules/apps/29-fee/keeper/grpc_query_test.go index bef02669b04..37aabd3588f 100644 --- a/modules/apps/29-fee/keeper/grpc_query_test.go +++ b/modules/apps/29-fee/keeper/grpc_query_test.go @@ -78,7 +78,7 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacketI() { if tc.expPass { suite.Require().NoError(err) suite.Require().NotNil(res) - suite.Require().Equal(identifiedPacketFee, res.IncentivizedPacket) + suite.Require().Equal(&identifiedPacketFee, res.IncentivizedPacket) } else { suite.Require().Error(err) } @@ -120,11 +120,11 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPackets() { fee3 := types.NewIdentifiedPacketFee(channeltypes.NewPacketId(ibctesting.FirstChannelID, transfertypes.PortID, 3), fee, refundAcc.String(), []string(nil)) expPackets = []*types.IdentifiedPacketFee{} - expPackets = append(expPackets, fee1, fee2, fee3) + expPackets = append(expPackets, &fee1, &fee2, &fee3) suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), transfertypes.PortID, ibctesting.FirstChannelID) for _, p := range expPackets { - suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), p) + suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), *p) } req = &types.QueryIncentivizedPacketsRequest{ diff --git a/modules/apps/29-fee/keeper/keeper.go b/modules/apps/29-fee/keeper/keeper.go index 8aa8862d947..441aaf57a2c 100644 --- a/modules/apps/29-fee/keeper/keeper.go +++ b/modules/apps/29-fee/keeper/keeper.go @@ -228,9 +228,9 @@ func (k Keeper) DeleteForwardRelayerAddress(ctx sdk.Context, packetId channeltyp } // Stores a Fee for a given packet in state -func (k Keeper) SetFeeInEscrow(ctx sdk.Context, fee *types.IdentifiedPacketFee) { +func (k Keeper) SetFeeInEscrow(ctx sdk.Context, fee types.IdentifiedPacketFee) { store := ctx.KVStore(k.storeKey) - bz := k.MustMarshalFee(fee) + bz := k.MustMarshalFee(&fee) store.Set(types.KeyFeeInEscrow(fee.PacketId), bz) } @@ -278,15 +278,15 @@ 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.IdentifiedPacketFee { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, []byte(types.FeeInEscrowPrefix)) defer iterator.Close() - var identifiedFees []*types.IdentifiedPacketFee + var identifiedFees []types.IdentifiedPacketFee for ; iterator.Valid(); iterator.Next() { fee := k.MustUnmarshalFee(iterator.Value()) - identifiedFees = append(identifiedFees, &fee) + identifiedFees = append(identifiedFees, fee) } return identifiedFees diff --git a/modules/apps/29-fee/keeper/keeper_test.go b/modules/apps/29-fee/keeper/keeper_test.go index ad19cfac072..a0c1ae319aa 100644 --- a/modules/apps/29-fee/keeper/keeper_test.go +++ b/modules/apps/29-fee/keeper/keeper_test.go @@ -103,13 +103,13 @@ func (suite *KeeperTestSuite) TestGetAllIdentifiedPacketFees() { refundAcc := suite.chainA.SenderAccount.GetAddress() packetId := channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, transfertypes.PortID, uint64(1)) fee := types.Fee{defaultAckFee, defaultReceiveFee, defaultTimeoutFee} - identifiedPacketFee := &types.IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: refundAcc.String(), Relayers: []string{}} + identifiedPacketFee := types.NewIdentifiedPacketFee(packetId, fee, refundAcc.String(), []string{}) // escrow the packet fee err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedPacketFee) suite.Require().NoError(err) - expectedFees := []*types.IdentifiedPacketFee{ + expectedFees := []types.IdentifiedPacketFee{ { PacketId: packetId, Fee: fee, diff --git a/modules/apps/29-fee/keeper/msg_server.go b/modules/apps/29-fee/keeper/msg_server.go index d8eda8b3fdd..23ae8efcf62 100644 --- a/modules/apps/29-fee/keeper/msg_server.go +++ b/modules/apps/29-fee/keeper/msg_server.go @@ -58,7 +58,7 @@ func (k Keeper) PayPacketFee(goCtx context.Context, msg *types.MsgPayPacketFee) func (k Keeper) PayPacketFeeAsync(goCtx context.Context, msg *types.MsgPayPacketFeeAsync) (*types.MsgPayPacketFeeAsyncResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - err := k.EscrowPacketFee(ctx, &msg.IdentifiedPacketFee) + err := k.EscrowPacketFee(ctx, msg.IdentifiedPacketFee) if err != nil { return nil, err } diff --git a/modules/apps/29-fee/types/genesis.go b/modules/apps/29-fee/types/genesis.go index e1eea3b7fac..c0a84516291 100644 --- a/modules/apps/29-fee/types/genesis.go +++ b/modules/apps/29-fee/types/genesis.go @@ -8,7 +8,7 @@ import ( ) // NewGenesisState creates a 29-fee GenesisState instance. -func NewGenesisState(identifiedFees []*IdentifiedPacketFee, feeEnabledChannels []*FeeEnabledChannel, registeredRelayers []*RegisteredRelayerAddress) *GenesisState { +func NewGenesisState(identifiedFees []IdentifiedPacketFee, feeEnabledChannels []*FeeEnabledChannel, registeredRelayers []*RegisteredRelayerAddress) *GenesisState { return &GenesisState{ IdentifiedFees: identifiedFees, FeeEnabledChannels: feeEnabledChannels, @@ -19,7 +19,7 @@ func NewGenesisState(identifiedFees []*IdentifiedPacketFee, feeEnabledChannels [ // DefaultGenesisState returns a GenesisState with "transfer" as the default PortID. func DefaultGenesisState() *GenesisState { return &GenesisState{ - IdentifiedFees: []*IdentifiedPacketFee{}, + IdentifiedFees: []IdentifiedPacketFee{}, FeeEnabledChannels: []*FeeEnabledChannel{}, RegisteredRelayers: []*RegisteredRelayerAddress{}, } diff --git a/modules/apps/29-fee/types/genesis.pb.go b/modules/apps/29-fee/types/genesis.pb.go index 3c04f55b305..6bcc498ac87 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,omitempty" yaml:"identified_fees"` + IdentifiedFees []IdentifiedPacketFee `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,omitempty" yaml:"fee_enabled_channels"` RegisteredRelayers []*RegisteredRelayerAddress `protobuf:"bytes,3,rep,name=registered_relayers,json=registeredRelayers,proto3" json:"registered_relayers,omitempty" yaml:"registered_relayers"` ForwardRelayers []*ForwardRelayerAddress `protobuf:"bytes,4,rep,name=forward_relayers,json=forwardRelayers,proto3" json:"forward_relayers,omitempty" 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() []IdentifiedPacketFee { if m != nil { return m.IdentifiedFees } @@ -266,41 +266,41 @@ func init() { var fileDescriptor_7191992e856dff95 = []byte{ // 572 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xbf, 0x6f, 0xd4, 0x30, - 0x18, 0xbd, 0xb4, 0xa8, 0xa5, 0x2e, 0xea, 0x0f, 0xb7, 0xa5, 0xd1, 0x55, 0x24, 0xc5, 0x12, 0x52, + 0x18, 0xbd, 0xb4, 0x55, 0x4b, 0x5d, 0xd4, 0x1f, 0x6e, 0x4b, 0xa3, 0x56, 0x24, 0xc5, 0x12, 0x52, 0x05, 0x34, 0xd1, 0xb5, 0x30, 0xc0, 0xc6, 0x21, 0x8a, 0x6e, 0x02, 0x19, 0x26, 0x96, 0x53, 0x2e, - 0xf9, 0x92, 0x5a, 0xe4, 0xe2, 0x60, 0xbb, 0x41, 0x37, 0xb0, 0xb0, 0xc0, 0xc8, 0x9f, 0xd5, 0xb1, - 0x23, 0x53, 0x84, 0xda, 0xff, 0x20, 0x3b, 0x12, 0x4a, 0x9c, 0xb4, 0xc7, 0x71, 0x61, 0xfb, 0x62, - 0xbf, 0xf7, 0xbd, 0xe7, 0xe7, 0x7c, 0x46, 0x0f, 0xd8, 0xc8, 0x77, 0xbd, 0x34, 0x8d, 0x99, 0xef, - 0x29, 0xc6, 0x13, 0xe9, 0x86, 0x00, 0x6e, 0xd6, 0x73, 0x23, 0x48, 0x40, 0x32, 0xe9, 0xa4, 0x82, - 0x2b, 0x8e, 0x77, 0xd9, 0xc8, 0x77, 0xa6, 0x61, 0x4e, 0x08, 0xe0, 0x64, 0xbd, 0xee, 0x76, 0xc4, - 0x23, 0x5e, 0x61, 0xdc, 0xb2, 0xd2, 0xf0, 0xee, 0xfd, 0xb6, 0xae, 0x25, 0x6b, 0x0a, 0xe2, 0x73, - 0x01, 0xae, 0x7f, 0xea, 0x25, 0x09, 0xc4, 0xe5, 0x76, 0x5d, 0x6a, 0x08, 0xf9, 0xbd, 0x88, 0xee, - 0xbc, 0xd6, 0x36, 0xde, 0x29, 0x4f, 0x01, 0xfe, 0x84, 0xd6, 0x59, 0x00, 0x89, 0x62, 0x21, 0x83, - 0x60, 0x18, 0x02, 0x48, 0xd3, 0xd8, 0x5f, 0x3c, 0x58, 0x3d, 0x7a, 0xec, 0xb4, 0xf8, 0x73, 0x06, - 0xd7, 0xf8, 0xb7, 0x9e, 0xff, 0x11, 0xd4, 0x09, 0x40, 0xbf, 0x5b, 0xe4, 0xf6, 0xdd, 0x89, 0x37, - 0x8e, 0x9f, 0x93, 0x99, 0x76, 0x84, 0xae, 0xdd, 0xac, 0x9c, 0x00, 0x48, 0xfc, 0x05, 0x6d, 0x87, - 0x00, 0x43, 0x48, 0xbc, 0x51, 0x0c, 0xc1, 0xb0, 0x36, 0x28, 0xcd, 0x85, 0x4a, 0xf7, 0x61, 0xab, - 0xee, 0x09, 0xc0, 0x2b, 0xcd, 0x79, 0xa9, 0x29, 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0x80, 0x88, + 0x49, 0x05, 0x02, 0x82, 0x81, 0x80, 0xd8, 0x9b, 0x80, 0x90, 0xe6, 0x62, 0x25, 0xdf, 0x6d, 0x95, + 0xa7, 0x37, 0x1c, 0xaa, 0x29, 0x2f, 0x83, 0x40, 0x80, 0x94, 0x3d, 0xab, 0xc8, 0xed, 0x7d, 0xed, + 0x62, 0x4e, 0x5f, 0x42, 0xb1, 0x98, 0x65, 0x4a, 0x9c, 0xa1, 0xcd, 0x90, 0x8b, 0xcf, 0x9e, 0x98, + 0x32, 0xb0, 0x54, 0x19, 0x70, 0xda, 0xcf, 0xaf, 0x09, 0x33, 0xea, 0x07, 0x45, 0x6e, 0xef, 0xd5, + 0x19, 0xcc, 0x74, 0x24, 0x74, 0x23, 0xfc, 0x8b, 0x23, 0x49, 0x86, 0xb6, 0xfe, 0x89, 0x11, 0x3f, + 0x46, 0x2b, 0x29, 0x17, 0x6a, 0xc0, 0x02, 0xd3, 0x38, 0x34, 0x8e, 0x56, 0x7b, 0xb8, 0xc8, 0xed, + 0x75, 0xdd, 0xb3, 0xde, 0x20, 0x74, 0xb9, 0xac, 0xfa, 0x01, 0x7e, 0x8a, 0x50, 0x9d, 0x6f, 0x89, + 0x5f, 0xa8, 0xf0, 0xbb, 0x45, 0x6e, 0x6f, 0x69, 0xfc, 0xed, 0x1e, 0xa1, 0xab, 0xf5, 0x47, 0x3f, + 0x20, 0x3f, 0x0c, 0x64, 0xb6, 0x05, 0x88, 0x4d, 0xb4, 0xe2, 0xe9, 0x52, 0xeb, 0xd3, 0xe6, 0x13, + 0x53, 0xb4, 0xe3, 0xf3, 0x71, 0xa2, 0x40, 0xa4, 0x9e, 0x50, 0x93, 0x41, 0x03, 0xd3, 0xb2, 0x53, + 0xd7, 0x3f, 0x0f, 0x45, 0xe8, 0xf6, 0xf4, 0x72, 0xad, 0x46, 0xbe, 0x1b, 0x68, 0x77, 0x6e, 0x94, + 0xff, 0xf1, 0xf1, 0x01, 0xad, 0xa6, 0xd5, 0xff, 0xde, 0x9c, 0x79, 0xed, 0xe4, 0x7e, 0x75, 0x4f, + 0xe5, 0xc4, 0x39, 0xcd, 0x98, 0x65, 0x5d, 0x47, 0x4f, 0x45, 0x3f, 0xe8, 0x99, 0xf5, 0x50, 0x6c, + 0xd6, 0x31, 0x36, 0x6c, 0x42, 0xef, 0xa4, 0x0d, 0xe6, 0xed, 0xc5, 0x95, 0x65, 0x5c, 0x5e, 0x59, + 0xc6, 0xef, 0x2b, 0xcb, 0xf8, 0x79, 0x6d, 0x75, 0x2e, 0xaf, 0xad, 0xce, 0xaf, 0x6b, 0xab, 0xf3, + 0xf1, 0x59, 0xc4, 0xd4, 0xf9, 0x78, 0xe8, 0xf8, 0x7c, 0xe4, 0xfa, 0x5c, 0x8e, 0xb8, 0x74, 0xd9, + 0xd0, 0x3f, 0x8e, 0xb8, 0x9b, 0x9d, 0xba, 0x23, 0x1e, 0x8c, 0x63, 0x90, 0xe5, 0x83, 0x20, 0xdd, + 0x93, 0xe7, 0xc7, 0xe5, 0x5b, 0xa0, 0x26, 0x29, 0xc8, 0xe1, 0x72, 0x35, 0xe8, 0xa7, 0x7f, 0x02, + 0x00, 0x00, 0xff, 0xff, 0x8b, 0x17, 0xa1, 0x66, 0x86, 0x04, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -653,7 +653,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, IdentifiedPacketFee{}) 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 94e2824a265..c41fd8f7469 100644 --- a/modules/apps/29-fee/types/genesis_test.go +++ b/modules/apps/29-fee/types/genesis_test.go @@ -150,7 +150,7 @@ func TestValidateGenesis(t *testing.T) { tc.malleate() genState := types.GenesisState{ - IdentifiedFees: []*types.IdentifiedPacketFee{ + IdentifiedFees: []types.IdentifiedPacketFee{ { PacketId: packetId, Fee: fee, diff --git a/modules/apps/29-fee/types/msgs.go b/modules/apps/29-fee/types/msgs.go index 7138706cf80..bc855876e3c 100644 --- a/modules/apps/29-fee/types/msgs.go +++ b/modules/apps/29-fee/types/msgs.go @@ -135,8 +135,8 @@ func (msg MsgPayPacketFeeAsync) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{signer} } -func NewIdentifiedPacketFee(packetId channeltypes.PacketId, fee Fee, refundAddr string, relayers []string) *IdentifiedPacketFee { - return &IdentifiedPacketFee{ +func NewIdentifiedPacketFee(packetId channeltypes.PacketId, fee Fee, refundAddr string, relayers []string) IdentifiedPacketFee { + return IdentifiedPacketFee{ PacketId: packetId, Fee: fee, RefundAddress: refundAddr, diff --git a/proto/ibc/applications/fee/v1/genesis.proto b/proto/ibc/applications/fee/v1/genesis.proto index 1aeac5f1d05..b7f692e7c2c 100644 --- a/proto/ibc/applications/fee/v1/genesis.proto +++ b/proto/ibc/applications/fee/v1/genesis.proto @@ -9,7 +9,7 @@ option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types"; // GenesisState defines the fee middleware genesis state message GenesisState { - repeated IdentifiedPacketFee identified_fees = 1 [(gogoproto.moretags) = "yaml:\"identified_fees\""]; + repeated IdentifiedPacketFee identified_fees = 1 [(gogoproto.moretags) = "yaml:\"identified_fees\"", (gogoproto.nullable) = false]; repeated FeeEnabledChannel fee_enabled_channels = 2 [(gogoproto.moretags) = "yaml:\"fee_enabled_channels\""]; repeated RegisteredRelayerAddress registered_relayers = 3 [(gogoproto.moretags) = "yaml:\"registered_relayers\""]; repeated ForwardRelayerAddress forward_relayers = 4 [(gogoproto.moretags) = "yaml:\"forward_relayers\""];