From d6e9c80819cdeb3124aed0917922660d749603c1 Mon Sep 17 00:00:00 2001 From: Sean King Date: Mon, 17 Jan 2022 12:50:24 +0100 Subject: [PATCH] chore: making PacketId non nullable --- go.mod | 9 +- modules/apps/29-fee/ibc_module_test.go | 18 +-- modules/apps/29-fee/keeper/escrow_test.go | 22 ++-- modules/apps/29-fee/keeper/keeper.go | 12 +- modules/apps/29-fee/keeper/keeper_test.go | 2 +- modules/apps/29-fee/keeper/msg_server.go | 10 +- modules/apps/29-fee/keeper/msg_server_test.go | 2 +- modules/apps/29-fee/types/fee.pb.go | 101 ++++++++-------- modules/apps/29-fee/types/genesis.pb.go | 109 ++++++++---------- modules/apps/29-fee/types/genesis_test.go | 2 +- modules/apps/29-fee/types/keys.go | 4 +- modules/apps/29-fee/types/msgs.go | 2 +- modules/apps/29-fee/types/msgs_test.go | 4 +- modules/apps/29-fee/types/query.pb.go | 104 ++++++++--------- modules/core/04-channel/types/packet.go | 4 +- proto/ibc/applications/fee/v1/fee.proto | 2 +- proto/ibc/applications/fee/v1/genesis.proto | 2 +- proto/ibc/applications/fee/v1/query.proto | 2 +- 18 files changed, 194 insertions(+), 217 deletions(-) diff --git a/go.mod b/go.mod index 2a8ed9f82c6..3e5f606755d 100644 --- a/go.mod +++ b/go.mod @@ -27,12 +27,6 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) -require ( - github.com/gin-gonic/gin v1.7.0 // indirect - github.com/opencontainers/image-spec v1.0.2 // indirect - github.com/opencontainers/runc v1.0.3 // indirect -) - require ( filippo.io/edwards25519 v1.0.0-beta.2 // indirect github.com/99designs/keyring v1.1.6 // indirect @@ -60,6 +54,7 @@ require ( github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect + github.com/gin-gonic/gin v1.7.0 // indirect github.com/go-kit/kit v0.10.0 // indirect github.com/go-logfmt/logfmt v0.5.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect @@ -92,6 +87,8 @@ require ( github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/opencontainers/image-spec v1.0.2 // indirect + github.com/opencontainers/runc v1.0.3 // indirect github.com/pelletier/go-toml v1.9.4 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/modules/apps/29-fee/ibc_module_test.go b/modules/apps/29-fee/ibc_module_test.go index 41234d7468a..a12b8ae972f 100644 --- a/modules/apps/29-fee/ibc_module_test.go +++ b/modules/apps/29-fee/ibc_module_test.go @@ -271,13 +271,13 @@ func (suite *FeeTestSuite) TestOnChanCloseInit() { { "success", func(suite *FeeTestSuite) { - packetId := channeltypes.PacketId{ - PortId: suite.path.EndpointA.ChannelConfig.PortID, - ChannelId: suite.path.EndpointA.ChannelID, - Sequence: 1, - } + packetId := channeltypes.NewPacketId( + suite.path.EndpointA.ChannelID, + suite.path.EndpointA.ChannelConfig.PortID, + 1, + ) refundAcc := suite.chainA.SenderAccount.GetAddress() - identifiedFee := types.NewIdentifiedPacketFee(&packetId, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) + identifiedFee := types.NewIdentifiedPacketFee(packetId, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedFee) suite.Require().NoError(err) }, @@ -292,7 +292,7 @@ func (suite *FeeTestSuite) TestOnChanCloseInit() { Sequence: 1, } refundAcc := suite.chainA.SenderAccount.GetAddress() - identifiedFee := types.NewIdentifiedPacketFee(&packetId, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) + identifiedFee := types.NewIdentifiedPacketFee(packetId, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedFee) suite.Require().NoError(err) @@ -357,7 +357,7 @@ func (suite *FeeTestSuite) TestOnChanCloseConfirm() { Sequence: 1, } refundAcc := suite.chainA.SenderAccount.GetAddress() - identifiedFee := types.NewIdentifiedPacketFee(&packetId, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) + identifiedFee := types.NewIdentifiedPacketFee(packetId, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedFee) suite.Require().NoError(err) }, @@ -372,7 +372,7 @@ func (suite *FeeTestSuite) TestOnChanCloseConfirm() { Sequence: 1, } refundAcc := suite.chainA.SenderAccount.GetAddress() - identifiedFee := types.NewIdentifiedPacketFee(&packetId, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) + identifiedFee := types.NewIdentifiedPacketFee(packetId, types.Fee{validCoins, validCoins2, validCoins3}, refundAcc.String(), []string{}) err := suite.chainA.GetSimApp().IBCFeeKeeper.EscrowPacketFee(suite.chainA.GetContext(), identifiedFee) suite.Require().NoError(err) diff --git a/modules/apps/29-fee/keeper/escrow_test.go b/modules/apps/29-fee/keeper/escrow_test.go index 3b25f03d101..9c07c79589c 100644 --- a/modules/apps/29-fee/keeper/escrow_test.go +++ b/modules/apps/29-fee/keeper/escrow_test.go @@ -16,7 +16,7 @@ func (suite *KeeperTestSuite) TestEscrowPacketFee() { ackFee sdk.Coins receiveFee sdk.Coins timeoutFee sdk.Coins - packetId *channeltypes.PacketId + packetId channeltypes.PacketId ) testCases := []struct { @@ -67,7 +67,7 @@ func (suite *KeeperTestSuite) TestEscrowPacketFee() { receiveFee = defaultReceiveFee ackFee = defaultAckFee timeoutFee = defaultTimeoutFee - packetId = &channeltypes.PacketId{ChannelId: suite.path.EndpointA.ChannelID, PortId: transfertypes.PortID, Sequence: uint64(1)} + packetId = channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, transfertypes.PortID, uint64(1)) tc.malleate() fee := types.Fee{ @@ -140,7 +140,7 @@ func (suite *KeeperTestSuite) TestDistributeFee() { reverseRelayer = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) forwardRelayer = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String() - packetId := &channeltypes.PacketId{ChannelId: suite.path.EndpointA.ChannelID, PortId: transfertypes.PortID, Sequence: validSeq} + packetId := channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, transfertypes.PortID, validSeq) fee := types.Fee{ ReceiveFee: defaultReceiveFee, AckFee: defaultAckFee, @@ -199,11 +199,11 @@ func (suite *KeeperTestSuite) TestDistributeTimeoutFee() { refundAcc := suite.chainA.SenderAccount.GetAddress() timeoutRelayer := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) - packetId := &channeltypes.PacketId{ - ChannelId: suite.path.EndpointA.ChannelID, - PortId: transfertypes.PortID, - Sequence: 1, - } + packetId := channeltypes.NewPacketId( + suite.path.EndpointA.ChannelID, + transfertypes.PortID, + 1, + ) fee := types.Fee{ ReceiveFee: defaultReceiveFee, @@ -254,7 +254,7 @@ func (suite *KeeperTestSuite) TestRefundFeesOnChannel() { prevBal := suite.chainA.GetSimApp().BankKeeper.GetAllBalances(suite.chainA.GetContext(), refundAcc) for i := 0; i < 5; i++ { - packetId := &channeltypes.PacketId{ChannelId: "channel-0", PortId: transfertypes.PortID, Sequence: uint64(i)} + packetId := channeltypes.NewPacketId("channel-0", transfertypes.PortID, uint64(i)) fee := types.Fee{ ReceiveFee: defaultReceiveFee, AckFee: defaultAckFee, @@ -268,7 +268,7 @@ func (suite *KeeperTestSuite) TestRefundFeesOnChannel() { } // send a packet over a different channel to ensure this fee is not refunded - packetId := &channeltypes.PacketId{ChannelId: "channel-1", PortId: transfertypes.PortID, Sequence: 1} + packetId := channeltypes.NewPacketId("channel-1", transfertypes.PortID, 1) fee := types.Fee{ ReceiveFee: defaultReceiveFee, AckFee: defaultAckFee, @@ -289,7 +289,7 @@ func (suite *KeeperTestSuite) TestRefundFeesOnChannel() { suite.Require().Equal(prevBal, afterBal.Add(fee.ReceiveFee...).Add(fee.AckFee...).Add(fee.TimeoutFee...), "refund account not back to original balance after refunding all tokens") // create escrow and then change module account balance to cause error on refund - packetId = &channeltypes.PacketId{ChannelId: "channel-0", PortId: transfertypes.PortID, Sequence: uint64(6)} + 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) diff --git a/modules/apps/29-fee/keeper/keeper.go b/modules/apps/29-fee/keeper/keeper.go index 53f9c9c091b..8aa8862d947 100644 --- a/modules/apps/29-fee/keeper/keeper.go +++ b/modules/apps/29-fee/keeper/keeper.go @@ -175,13 +175,13 @@ func (k Keeper) GetAllRelayerAddresses(ctx sdk.Context) []*types.RegisteredRelay } // SetForwardRelayerAddress sets the forward relayer address during OnRecvPacket in case of async acknowledgement -func (k Keeper) SetForwardRelayerAddress(ctx sdk.Context, packetId *channeltypes.PacketId, address string) { +func (k Keeper) SetForwardRelayerAddress(ctx sdk.Context, packetId channeltypes.PacketId, address string) { store := ctx.KVStore(k.storeKey) store.Set(types.KeyForwardRelayerAddress(packetId), []byte(address)) } // GetForwardRelayerAddress gets forward relayer address for a particular packet -func (k Keeper) GetForwardRelayerAddress(ctx sdk.Context, packetId *channeltypes.PacketId) (string, bool) { +func (k Keeper) GetForwardRelayerAddress(ctx sdk.Context, packetId channeltypes.PacketId) (string, bool) { store := ctx.KVStore(k.storeKey) key := types.KeyForwardRelayerAddress(packetId) if !store.Has(key) { @@ -221,7 +221,7 @@ func (k Keeper) GetAllForwardRelayerAddresses(ctx sdk.Context) []*types.ForwardR } // Deletes the forwardRelayerAddr associated with the packetId -func (k Keeper) DeleteForwardRelayerAddress(ctx sdk.Context, packetId *channeltypes.PacketId) { +func (k Keeper) DeleteForwardRelayerAddress(ctx sdk.Context, packetId channeltypes.PacketId) { store := ctx.KVStore(k.storeKey) key := types.KeyForwardRelayerAddress(packetId) store.Delete(key) @@ -235,7 +235,7 @@ func (k Keeper) SetFeeInEscrow(ctx sdk.Context, fee *types.IdentifiedPacketFee) } // Gets a Fee for a given packet -func (k Keeper) GetFeeInEscrow(ctx sdk.Context, packetId *channeltypes.PacketId) (types.IdentifiedPacketFee, bool) { +func (k Keeper) GetFeeInEscrow(ctx sdk.Context, packetId channeltypes.PacketId) (types.IdentifiedPacketFee, bool) { store := ctx.KVStore(k.storeKey) key := types.KeyFeeInEscrow(packetId) bz := store.Get(key) @@ -263,14 +263,14 @@ func (k Keeper) IterateChannelFeesInEscrow(ctx sdk.Context, portID, channelID st } // Deletes the fee associated with the given packetId -func (k Keeper) DeleteFeeInEscrow(ctx sdk.Context, packetId *channeltypes.PacketId) { +func (k Keeper) DeleteFeeInEscrow(ctx sdk.Context, packetId channeltypes.PacketId) { store := ctx.KVStore(k.storeKey) key := types.KeyFeeInEscrow(packetId) store.Delete(key) } // HasFeeInEscrow returns true if there is a Fee still to be escrowed for a given packet -func (k Keeper) HasFeeInEscrow(ctx sdk.Context, packetId *channeltypes.PacketId) bool { +func (k Keeper) HasFeeInEscrow(ctx sdk.Context, packetId channeltypes.PacketId) bool { store := ctx.KVStore(k.storeKey) key := types.KeyFeeInEscrow(packetId) diff --git a/modules/apps/29-fee/keeper/keeper_test.go b/modules/apps/29-fee/keeper/keeper_test.go index 267190fa080..ad19cfac072 100644 --- a/modules/apps/29-fee/keeper/keeper_test.go +++ b/modules/apps/29-fee/keeper/keeper_test.go @@ -101,7 +101,7 @@ func (suite *KeeperTestSuite) TestGetAllIdentifiedPacketFees() { // escrow a fee refundAcc := suite.chainA.SenderAccount.GetAddress() - packetId := &channeltypes.PacketId{ChannelId: suite.path.EndpointA.ChannelID, PortId: transfertypes.PortID, Sequence: uint64(1)} + 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{}} diff --git a/modules/apps/29-fee/keeper/msg_server.go b/modules/apps/29-fee/keeper/msg_server.go index dec2f27e928..d8eda8b3fdd 100644 --- a/modules/apps/29-fee/keeper/msg_server.go +++ b/modules/apps/29-fee/keeper/msg_server.go @@ -37,11 +37,11 @@ func (k Keeper) PayPacketFee(goCtx context.Context, msg *types.MsgPayPacketFee) return nil, channeltypes.ErrSequenceSendNotFound } - packetId := &channeltypes.PacketId{ - PortId: msg.SourcePortId, - ChannelId: msg.SourceChannelId, - Sequence: sequence, - } + packetId := channeltypes.NewPacketId( + msg.SourceChannelId, + msg.SourcePortId, + sequence, + ) identifiedPacket := types.NewIdentifiedPacketFee(packetId, msg.Fee, msg.Signer, msg.Relayers) err := k.EscrowPacketFee(ctx, identifiedPacket) diff --git a/modules/apps/29-fee/keeper/msg_server_test.go b/modules/apps/29-fee/keeper/msg_server_test.go index 0664b4e7fd9..26a62830035 100644 --- a/modules/apps/29-fee/keeper/msg_server_test.go +++ b/modules/apps/29-fee/keeper/msg_server_test.go @@ -118,7 +118,7 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { seq, _ := suite.chainA.App.GetIBCKeeper().ChannelKeeper.GetNextSequenceSend(ctxA, suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) // build fee - packetId := &channeltypes.PacketId{ChannelId: channelID, PortId: suite.path.EndpointA.ChannelConfig.PortID, Sequence: seq} + packetId := channeltypes.NewPacketId(channelID, suite.path.EndpointA.ChannelConfig.PortID, seq) identifiedPacketFee := types.IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: refundAcc.String(), Relayers: []string{}} tc.malleate() diff --git a/modules/apps/29-fee/types/fee.pb.go b/modules/apps/29-fee/types/fee.pb.go index 0f50271f0f0..1db63e62f8a 100644 --- a/modules/apps/29-fee/types/fee.pb.go +++ b/modules/apps/29-fee/types/fee.pb.go @@ -94,10 +94,10 @@ func (m *Fee) GetTimeoutFee() github_com_cosmos_cosmos_sdk_types.Coins { // the refund address to which any unused funds are refunded, // and an optional list of relayers that are permitted to receive the fee. type IdentifiedPacketFee struct { - PacketId *types1.PacketId `protobuf:"bytes,1,opt,name=packet_id,json=packetId,proto3" json:"packet_id,omitempty" yaml:"packet_id"` - Fee Fee `protobuf:"bytes,2,opt,name=fee,proto3" json:"fee"` - RefundAddress string `protobuf:"bytes,3,opt,name=refund_address,json=refundAddress,proto3" json:"refund_address,omitempty" yaml:"refund_address"` - Relayers []string `protobuf:"bytes,4,rep,name=relayers,proto3" json:"relayers,omitempty"` + PacketId types1.PacketId `protobuf:"bytes,1,opt,name=packet_id,json=packetId,proto3" json:"packet_id" yaml:"packet_id"` + Fee Fee `protobuf:"bytes,2,opt,name=fee,proto3" json:"fee"` + RefundAddress string `protobuf:"bytes,3,opt,name=refund_address,json=refundAddress,proto3" json:"refund_address,omitempty" yaml:"refund_address"` + Relayers []string `protobuf:"bytes,4,rep,name=relayers,proto3" json:"relayers,omitempty"` } func (m *IdentifiedPacketFee) Reset() { *m = IdentifiedPacketFee{} } @@ -133,11 +133,11 @@ func (m *IdentifiedPacketFee) XXX_DiscardUnknown() { var xxx_messageInfo_IdentifiedPacketFee proto.InternalMessageInfo -func (m *IdentifiedPacketFee) GetPacketId() *types1.PacketId { +func (m *IdentifiedPacketFee) GetPacketId() types1.PacketId { if m != nil { return m.PacketId } - return nil + return types1.PacketId{} } func (m *IdentifiedPacketFee) GetFee() Fee { @@ -169,38 +169,38 @@ func init() { func init() { proto.RegisterFile("ibc/applications/fee/v1/fee.proto", fileDescriptor_cb3319f1af2a53e5) } var fileDescriptor_cb3319f1af2a53e5 = []byte{ - // 483 bytes of a gzipped FileDescriptorProto + // 482 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x31, 0x8f, 0xd3, 0x30, - 0x14, 0xc7, 0x1b, 0x72, 0x3a, 0xae, 0xae, 0x38, 0xa1, 0x70, 0x88, 0x5e, 0x05, 0x49, 0xc9, 0x94, - 0xa5, 0xb6, 0xda, 0x83, 0x01, 0x26, 0x08, 0x52, 0xa5, 0x9b, 0x38, 0x65, 0x64, 0xa9, 0x1c, 0xe7, - 0xb5, 0x67, 0x35, 0x89, 0xa3, 0x38, 0x8d, 0xd4, 0x95, 0x85, 0x95, 0xcf, 0xc1, 0x27, 0xb9, 0xf1, - 0x46, 0xa6, 0x82, 0xda, 0x6f, 0xd0, 0x95, 0x05, 0x39, 0x76, 0xab, 0x4a, 0x08, 0x9d, 0x3a, 0xd9, - 0x7e, 0xef, 0xfd, 0xfd, 0x7b, 0xef, 0xf9, 0x19, 0xbd, 0xe6, 0x31, 0x23, 0xb4, 0x28, 0x52, 0xce, - 0x68, 0xc5, 0x45, 0x2e, 0xc9, 0x14, 0x80, 0xd4, 0x43, 0xb5, 0xe0, 0xa2, 0x14, 0x95, 0x70, 0x5e, - 0xf0, 0x98, 0xe1, 0xc3, 0x10, 0xac, 0x7c, 0xf5, 0xb0, 0xe7, 0x32, 0x21, 0x33, 0x21, 0x49, 0x4c, - 0xa5, 0x92, 0xc4, 0x50, 0xd1, 0x21, 0x61, 0x82, 0xe7, 0x5a, 0xd8, 0xbb, 0x98, 0x89, 0x99, 0x68, - 0xb6, 0x44, 0xed, 0x8c, 0xb5, 0x21, 0x32, 0x51, 0x02, 0x61, 0xb7, 0x34, 0xcf, 0x21, 0x55, 0x34, - 0xb3, 0xd5, 0x21, 0xfe, 0x37, 0x1b, 0xd9, 0x63, 0x00, 0xe7, 0xab, 0x85, 0x3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0xb6, 0x41, 0xe7, 0xf3, 0xab, 0xbf, 0x3b, 0x2a, 0x52, 0x36, 0x9c, 0x4b, 0xd2, 0x5c, 0x90, + 0x5c, 0xf2, 0x65, 0x06, 0x4a, 0x7f, 0x2d, 0x45, 0xc6, 0xaf, 0x87, 0xfa, 0x57, 0xb5, 0x4d, 0x4e, + 0x8f, 0xdb, 0x19, 0xbf, 0xf8, 0x13, 0x00, 0x00, 0xff, 0xff, 0x76, 0xdd, 0x8f, 0x88, 0x7a, 0x03, + 0x00, 0x00, } func (m *Fee) Marshal() (dAtA []byte, err error) { @@ -314,18 +314,16 @@ func (m *IdentifiedPacketFee) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x12 - if m.PacketId != nil { - { - size, err := m.PacketId.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFee(dAtA, i, uint64(size)) + { + size, err := m.PacketId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintFee(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -373,10 +371,8 @@ func (m *IdentifiedPacketFee) Size() (n int) { } var l int _ = l - if m.PacketId != nil { - l = m.PacketId.Size() - n += 1 + l + sovFee(uint64(l)) - } + l = m.PacketId.Size() + n += 1 + l + sovFee(uint64(l)) l = m.Fee.Size() n += 1 + l + sovFee(uint64(l)) l = len(m.RefundAddress) @@ -608,9 +604,6 @@ func (m *IdentifiedPacketFee) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.PacketId == nil { - m.PacketId = &types1.PacketId{} - } if err := m.PacketId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/modules/apps/29-fee/types/genesis.pb.go b/modules/apps/29-fee/types/genesis.pb.go index c1c6750597f..3c04f55b305 100644 --- a/modules/apps/29-fee/types/genesis.pb.go +++ b/modules/apps/29-fee/types/genesis.pb.go @@ -201,8 +201,8 @@ func (m *RegisteredRelayerAddress) GetCounterpartyAddress() string { // ForwardRelayerAddress contains the forward relayer address and packetId used for async acknowledgements type ForwardRelayerAddress struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - PacketId *types.PacketId `protobuf:"bytes,2,opt,name=packet_id,json=packetId,proto3" json:"packet_id,omitempty" yaml:"packet_id"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + PacketId types.PacketId `protobuf:"bytes,2,opt,name=packet_id,json=packetId,proto3" json:"packet_id" yaml:"packet_id"` } func (m *ForwardRelayerAddress) Reset() { *m = ForwardRelayerAddress{} } @@ -245,11 +245,11 @@ func (m *ForwardRelayerAddress) GetAddress() string { return "" } -func (m *ForwardRelayerAddress) GetPacketId() *types.PacketId { +func (m *ForwardRelayerAddress) GetPacketId() types.PacketId { if m != nil { return m.PacketId } - return nil + return types.PacketId{} } func init() { @@ -264,43 +264,43 @@ func init() { } var fileDescriptor_7191992e856dff95 = []byte{ - // 570 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0x4f, 0x6f, 0xd4, 0x3e, - 0x10, 0x6d, 0xda, 0x9f, 0xda, 0x5f, 0x5d, 0xd4, 0x3f, 0xee, 0x96, 0xae, 0xb6, 0x22, 0x29, 0x96, - 0x90, 0x2a, 0xa0, 0x89, 0xb6, 0x85, 0x03, 0xdc, 0x58, 0x44, 0xd1, 0x9e, 0xa8, 0xcc, 0x8d, 0xcb, - 0x2a, 0x7f, 0x26, 0xa9, 0x45, 0x36, 0x0e, 0xb6, 0x1b, 0xb4, 0x07, 0x2e, 0x70, 0xe1, 0xc8, 0xc7, - 0xe2, 0xd8, 0x23, 0xa7, 0x08, 0x75, 0xbf, 0x41, 0xee, 0x48, 0x28, 0x71, 0xd2, 0x2e, 0xcb, 0x86, - 0x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- 0x71, 0x8e, 0xd6, 0xd3, 0xea, 0xad, 0x37, 0x67, 0xde, 0x38, 0xb9, 0x57, 0xdd, 0x53, 0x39, 0x6d, - 0x76, 0x33, 0x62, 0x59, 0xdf, 0xd6, 0x13, 0x31, 0x0c, 0x06, 0x9d, 0x22, 0xb7, 0xb6, 0xeb, 0x16, - 0x36, 0x4c, 0x42, 0xff, 0x4f, 0x9b, 0xfc, 0x9b, 0xef, 0xd7, 0xa6, 0x71, 0x75, 0x6d, 0x1a, 0x3f, - 0xaf, 0x4d, 0xe3, 0xdb, 0xd4, 0x5c, 0xba, 0x9a, 0x9a, 0x4b, 0x3f, 0xa6, 0xe6, 0xd2, 0xbb, 0xa7, - 0x11, 0x53, 0x17, 0x97, 0x9e, 0xed, 0xf3, 0xb1, 0xe3, 0x73, 0x39, 0xe6, 0xd2, 0x61, 0x9e, 0x7f, - 0x1c, 0x71, 0x27, 0x3b, 0x75, 0xc6, 0x3c, 0xb8, 0x8c, 0x41, 0x96, 0x1f, 0x81, 0x74, 0x4e, 0x9e, - 0x1d, 0x97, 0x7f, 0x80, 0x9a, 0xa4, 0x20, 0xbd, 0xd5, 0x6a, 0xc0, 0x4f, 0x7f, 0x07, 0x00, 0x00, - 0xff, 0xff, 0x3f, 0xe2, 0x1d, 0x20, 0x7e, 0x04, 0x00, 0x00, + // 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, + 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, + 0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x0c, 0x1b, 0x98, 0x96, 0x9d, 0xba, 0xfe, 0x79, 0x28, + 0x42, 0xb7, 0xa6, 0x97, 0x6b, 0x35, 0xf2, 0xcd, 0x40, 0x3b, 0x73, 0xa3, 0xfc, 0x8f, 0x8f, 0xf7, + 0x68, 0x25, 0xad, 0xfe, 0xf5, 0xe6, 0xcc, 0xab, 0x47, 0xf7, 0xaa, 0x7b, 0x2a, 0xa7, 0xcd, 0x69, + 0x46, 0x2c, 0xeb, 0x39, 0x7a, 0x22, 0x06, 0x41, 0xdf, 0x3c, 0xcf, 0xed, 0x4e, 0x91, 0xdb, 0x1b, + 0x75, 0x8c, 0x0d, 0x9b, 0xd0, 0xdb, 0x69, 0x83, 0x79, 0x73, 0x7e, 0x69, 0x19, 0x17, 0x97, 0x96, + 0xf1, 0xeb, 0xd2, 0x32, 0x7e, 0x5c, 0x59, 0x9d, 0x8b, 0x2b, 0xab, 0xf3, 0xf3, 0xca, 0xea, 0x7c, + 0x78, 0x1a, 0x31, 0x75, 0x7a, 0x36, 0x72, 0x7c, 0x3e, 0x76, 0x7d, 0x2e, 0xc7, 0x5c, 0xba, 0x6c, + 0xe4, 0x1f, 0x46, 0xdc, 0xcd, 0x8e, 0xdd, 0x31, 0x0f, 0xce, 0x62, 0x90, 0xe5, 0x63, 0x20, 0xdd, + 0xa3, 0x67, 0x87, 0xe5, 0x3b, 0xa0, 0x26, 0x29, 0xc8, 0xd1, 0x52, 0x35, 0xe4, 0xc7, 0x7f, 0x02, + 0x00, 0x00, 0xff, 0xff, 0x5f, 0x63, 0x48, 0xc9, 0x82, 0x04, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -476,18 +476,16 @@ func (m *ForwardRelayerAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.PacketId != nil { - { - size, err := m.PacketId.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) + { + size, err := m.PacketId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) @@ -586,10 +584,8 @@ func (m *ForwardRelayerAddress) Size() (n int) { if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } - if m.PacketId != nil { - l = m.PacketId.Size() - n += 1 + l + sovGenesis(uint64(l)) - } + l = m.PacketId.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } @@ -1103,9 +1099,6 @@ func (m *ForwardRelayerAddress) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.PacketId == nil { - m.PacketId = &types.PacketId{} - } if err := m.PacketId.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 190edaab220..94e2824a265 100644 --- a/modules/apps/29-fee/types/genesis_test.go +++ b/modules/apps/29-fee/types/genesis_test.go @@ -23,7 +23,7 @@ var ( func TestValidateGenesis(t *testing.T) { var ( - packetId *channeltypes.PacketId + packetId channeltypes.PacketId fee types.Fee refundAcc string sender string diff --git a/modules/apps/29-fee/types/keys.go b/modules/apps/29-fee/types/keys.go index 15b33f67a33..2f26b859afc 100644 --- a/modules/apps/29-fee/types/keys.go +++ b/modules/apps/29-fee/types/keys.go @@ -46,12 +46,12 @@ func KeyRelayerAddress(address string) []byte { } // KeyForwardRelayerAddress returns the key for packetID -> forwardAddress mapping -func KeyForwardRelayerAddress(packetId *channeltypes.PacketId) []byte { +func KeyForwardRelayerAddress(packetId channeltypes.PacketId) []byte { return []byte(fmt.Sprintf("%s/%s/%s/%d/", ForwardRelayerPrefix, packetId.PortId, packetId.ChannelId, packetId.Sequence)) } // KeyFeeInEscrow returns the key for escrowed fees -func KeyFeeInEscrow(packetID *channeltypes.PacketId) []byte { +func KeyFeeInEscrow(packetID channeltypes.PacketId) []byte { return []byte(fmt.Sprintf("%s/%d", KeyFeeInEscrowChannelPrefix(packetID.PortId, packetID.ChannelId), packetID.Sequence)) } diff --git a/modules/apps/29-fee/types/msgs.go b/modules/apps/29-fee/types/msgs.go index 926da90de4e..7138706cf80 100644 --- a/modules/apps/29-fee/types/msgs.go +++ b/modules/apps/29-fee/types/msgs.go @@ -135,7 +135,7 @@ func (msg MsgPayPacketFeeAsync) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{signer} } -func NewIdentifiedPacketFee(packetId *channeltypes.PacketId, fee Fee, refundAddr string, relayers []string) *IdentifiedPacketFee { +func NewIdentifiedPacketFee(packetId channeltypes.PacketId, fee Fee, refundAddr string, relayers []string) *IdentifiedPacketFee { return &IdentifiedPacketFee{ PacketId: packetId, Fee: fee, diff --git a/modules/apps/29-fee/types/msgs_test.go b/modules/apps/29-fee/types/msgs_test.go index e6386dc91d4..8671694bca0 100644 --- a/modules/apps/29-fee/types/msgs_test.go +++ b/modules/apps/29-fee/types/msgs_test.go @@ -319,7 +319,7 @@ func TestMsgPayPacketFeeAsyncValidation(t *testing.T) { tc.malleate() fee = Fee{receiveFee, ackFee, timeoutFee} - packetId := &channeltypes.PacketId{ChannelId: channelID, PortId: portID, Sequence: seq} + packetId := channeltypes.NewPacketId(channelID, portID, seq) identifiedPacketFee := IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: signer, Relayers: relayers} msg := NewMsgPayPacketFeeAsync(identifiedPacketFee) @@ -341,7 +341,7 @@ func TestPayPacketFeeAsyncGetSigners(t *testing.T) { portID := validPortID fee := Fee{validCoins, validCoins, validCoins} seq := uint64(1) - packetId := &channeltypes.PacketId{ChannelId: channelID, PortId: portID, Sequence: seq} + packetId := channeltypes.NewPacketId(channelID, portID, seq) identifiedPacketFee := IdentifiedPacketFee{PacketId: packetId, Fee: fee, RefundAddress: addr.String(), Relayers: nil} msg := NewMsgPayPacketFeeAsync(identifiedPacketFee) diff --git a/modules/apps/29-fee/types/query.pb.go b/modules/apps/29-fee/types/query.pb.go index 421dec212f8..3bbbbee7b17 100644 --- a/modules/apps/29-fee/types/query.pb.go +++ b/modules/apps/29-fee/types/query.pb.go @@ -135,7 +135,7 @@ func (m *QueryIncentivizedPacketsResponse) GetIncentivizedPackets() []*Identifie // QueryIncentivizedPacketRequest is the request type for querying for all incentivized packets type QueryIncentivizedPacketRequest struct { // PacketID - PacketId *types.PacketId `protobuf:"bytes,1,opt,name=packet_id,json=packetId,proto3" json:"packet_id,omitempty"` + PacketId types.PacketId `protobuf:"bytes,1,opt,name=packet_id,json=packetId,proto3" json:"packet_id"` // Height to query at QueryHeight uint64 `protobuf:"varint,2,opt,name=query_height,json=queryHeight,proto3" json:"query_height,omitempty"` } @@ -173,11 +173,11 @@ func (m *QueryIncentivizedPacketRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryIncentivizedPacketRequest proto.InternalMessageInfo -func (m *QueryIncentivizedPacketRequest) GetPacketId() *types.PacketId { +func (m *QueryIncentivizedPacketRequest) GetPacketId() types.PacketId { if m != nil { return m.PacketId } - return nil + return types.PacketId{} } func (m *QueryIncentivizedPacketRequest) GetQueryHeight() uint64 { @@ -245,41 +245,42 @@ func init() { } var fileDescriptor_0638a8a78ca2503c = []byte{ - // 544 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x41, 0x6f, 0x12, 0x41, - 0x14, 0x66, 0xa8, 0x1a, 0x1d, 0x3c, 0x0d, 0x4d, 0x24, 0x44, 0x57, 0x8a, 0x51, 0x89, 0x91, 0x99, - 0x40, 0x63, 0x6c, 0x3d, 0x7a, 0x68, 0xe4, 0x64, 0xe5, 0x68, 0x62, 0xc8, 0xee, 0xec, 0x63, 0x99, - 0x08, 0x3b, 0x5b, 0x66, 0xd8, 0xa4, 0xd5, 0x46, 0x53, 0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 0x73, 0xbe, 0xb7, 0x39, 0xd1, 0x1a, 0x3f, 0x43, 0x89, 0xf3, - 0xf7, 0xe4, 0xe4, 0x32, 0xce, 0x59, 0x24, 0xa7, 0x9a, 0xbd, 0x5b, 0xde, 0x31, 0x6a, 0x7e, 0x0f, - 0x84, 0x7f, 0xba, 0x7c, 0xf5, 0xb9, 0x9e, 0x2d, 0x25, 0x6d, 0x65, 0x8c, 0x86, 0x1c, 0xf2, 0xfd, - 0xac, 0x76, 0xfa, 0xfc, 0xe5, 0xb7, 0xb9, 0x83, 0x2e, 0xe6, 0x0e, 0xfa, 0x35, 0x77, 0xd0, 0xe7, - 0x85, 0x53, 0xba, 0x58, 0x38, 0xa5, 0x9f, 0x0b, 0xa7, 0xf4, 0xfa, 0x49, 0x20, 0xf4, 0x68, 0xe6, - 0x51, 0x2e, 0x27, 0xcc, 0x7e, 0x3e, 0x84, 0xc7, 0xdb, 0x81, 0x64, 0xf1, 0x2e, 0x9b, 0x48, 0x7f, - 0x36, 0x06, 0x95, 0x9a, 0xee, 0xee, 0xb7, 0x8d, 0x6f, 0x7d, 0x1c, 0x81, 0xf2, 0xae, 0x25, 0x5f, - 0x91, 0xdd, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4f, 0xd8, 0x1b, 0x4b, 0x2b, 0x05, 0x00, 0x00, + // 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, 0x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 0x64, 0x90, 0x8b, 0x22, 0x26, 0xcb, 0xe3, 0xc8, 0xd3, 0x75, 0x0d, + 0xcc, 0x9d, 0xef, 0xad, 0x4f, 0xb4, 0xc6, 0xcf, 0x51, 0xe2, 0xfc, 0x1d, 0x39, 0xbd, 0x8e, 0x73, + 0x16, 0xc9, 0xb1, 0x66, 0x6f, 0x17, 0x27, 0x8d, 0x9a, 0xf7, 0x9e, 0xf0, 0xcf, 0x16, 0x97, 0x3f, + 0xd3, 0xb3, 0xa5, 0xa4, 0xad, 0x8c, 0xd1, 0x90, 0x43, 0xb6, 0x3f, 0xaf, 0x9d, 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, } // Reference imports to suppress errors if they are not otherwise used. @@ -506,18 +507,16 @@ func (m *QueryIncentivizedPacketRequest) MarshalToSizedBuffer(dAtA []byte) (int, i-- dAtA[i] = 0x10 } - if m.PacketId != nil { - { - size, err := m.PacketId.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + { + size, err := m.PacketId.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 } @@ -604,10 +603,8 @@ func (m *QueryIncentivizedPacketRequest) Size() (n int) { } var l int _ = l - if m.PacketId != nil { - l = m.PacketId.Size() - n += 1 + l + sovQuery(uint64(l)) - } + l = m.PacketId.Size() + n += 1 + l + sovQuery(uint64(l)) if m.QueryHeight != 0 { n += 1 + sovQuery(uint64(m.QueryHeight)) } @@ -880,9 +877,6 @@ func (m *QueryIncentivizedPacketRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.PacketId == nil { - m.PacketId = &types.PacketId{} - } if err := m.PacketId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/modules/core/04-channel/types/packet.go b/modules/core/04-channel/types/packet.go index 32f6b343fb3..1b69dafa758 100644 --- a/modules/core/04-channel/types/packet.go +++ b/modules/core/04-channel/types/packet.go @@ -13,8 +13,8 @@ import ( ) // NewPacketId returns a new instance of PacketId -func NewPacketId(channelId, portId string, seq uint64) *PacketId { - return &PacketId{ChannelId: channelId, PortId: portId, Sequence: seq} +func NewPacketId(channelId, portId string, seq uint64) PacketId { + return PacketId{ChannelId: channelId, PortId: portId, Sequence: seq} } // CommitPacket returns the packet commitment bytes. The commitment consists of: diff --git a/proto/ibc/applications/fee/v1/fee.proto b/proto/ibc/applications/fee/v1/fee.proto index 1f5d9c0d05c..a942d3c8fe5 100644 --- a/proto/ibc/applications/fee/v1/fee.proto +++ b/proto/ibc/applications/fee/v1/fee.proto @@ -32,7 +32,7 @@ message Fee { // the refund address to which any unused funds are refunded, // and an optional list of relayers that are permitted to receive the fee. message IdentifiedPacketFee { - ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.moretags) = "yaml:\"packet_id\""]; + ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"packet_id\""]; Fee fee = 2 [(gogoproto.nullable) = false]; string refund_address = 3 [(gogoproto.moretags) = "yaml:\"refund_address\""]; repeated string relayers = 4; diff --git a/proto/ibc/applications/fee/v1/genesis.proto b/proto/ibc/applications/fee/v1/genesis.proto index 632693e808c..1aeac5f1d05 100644 --- a/proto/ibc/applications/fee/v1/genesis.proto +++ b/proto/ibc/applications/fee/v1/genesis.proto @@ -30,5 +30,5 @@ message RegisteredRelayerAddress { // ForwardRelayerAddress contains the forward relayer address and packetId used for async acknowledgements message ForwardRelayerAddress { string address = 1; - ibc.core.channel.v1.PacketId packet_id = 2 [(gogoproto.moretags) = "yaml:\"packet_id\""]; + ibc.core.channel.v1.PacketId packet_id = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"packet_id\""]; } diff --git a/proto/ibc/applications/fee/v1/query.proto b/proto/ibc/applications/fee/v1/query.proto index 75a7d3c0491..ad7d56f5b2b 100644 --- a/proto/ibc/applications/fee/v1/query.proto +++ b/proto/ibc/applications/fee/v1/query.proto @@ -43,7 +43,7 @@ message QueryIncentivizedPacketsResponse { // QueryIncentivizedPacketRequest is the request type for querying for all incentivized packets message QueryIncentivizedPacketRequest { // PacketID - ibc.core.channel.v1.PacketId packet_id = 1; + ibc.core.channel.v1.PacketId packet_id = 1[(gogoproto.nullable) = false]; // Height to query at uint64 query_height = 2; }