From df84e79bb8e0b99500053db1a31d08c7234b8633 Mon Sep 17 00:00:00 2001 From: nkitlabs Date: Mon, 6 Jan 2025 16:00:06 +0700 Subject: [PATCH 1/3] deactivate if fail to produce packet --- x/tunnel/keeper/keeper_packet.go | 46 +++++++-------------- x/tunnel/keeper/keeper_packet_test.go | 15 +++---- x/tunnel/keeper/keeper_tunnel.go | 31 +------------- x/tunnel/keeper/msg_server.go | 9 ---- x/tunnel/keeper/msg_server_test.go | 5 +-- x/tunnel/testutil/expected_keepers_mocks.go | 22 ++++------ x/tunnel/types/errors.go | 17 ++++---- x/tunnel/types/expected_keepers.go | 1 - 8 files changed, 39 insertions(+), 107 deletions(-) diff --git a/x/tunnel/keeper/keeper_packet.go b/x/tunnel/keeper/keeper_packet.go index 784b23ac1..4e094ff33 100644 --- a/x/tunnel/keeper/keeper_packet.go +++ b/x/tunnel/keeper/keeper_packet.go @@ -53,41 +53,25 @@ func (k Keeper) ProduceActiveTunnelPackets(ctx sdk.Context) error { // create new packet. If failed to produce packet, emit an event. for _, id := range ids { - if err := k.ProduceActiveTunnelPacket(ctx, id, pricesMap); err != nil { - ctx.EventManager().EmitEvent(sdk.NewEvent( - types.EventTypeProducePacketFail, - sdk.NewAttribute(types.AttributeKeyTunnelID, fmt.Sprintf("%d", id)), - sdk.NewAttribute(types.AttributeKeyReason, err.Error()), - )) + // Produce a packet. If produce packet successfully, update the context state. + cacheCtx, writeFn := ctx.CacheContext() + err := k.ProducePacket(cacheCtx, id, pricesMap) + if err == nil { + writeFn() + continue } - } - - return nil -} -// ProduceActiveTunnelPacket generates a packet and sends it to the destination route for the given tunnel ID. -// If not enough fund, deactivate the tunnel. -func (k Keeper) ProduceActiveTunnelPacket( - ctx sdk.Context, - tunnelID uint64, - pricesMap map[string]feedstypes.Price, -) (err error) { - // Check if the tunnel has enough fund to create a packet and deactivate the tunnel if not - // enough fund. Error should not happen here since the tunnel is already validated. - ok, err := k.HasEnoughFundToCreatePacket(ctx, tunnelID) - if err != nil { - return err - } - if !ok { - return k.DeactivateTunnel(ctx, tunnelID) - } + // emit an event if failed to produce packet and deactivate the tunnel + ctx.EventManager().EmitEvent(sdk.NewEvent( + types.EventTypeProducePacketFail, + sdk.NewAttribute(types.AttributeKeyTunnelID, fmt.Sprintf("%d", id)), + sdk.NewAttribute(types.AttributeKeyReason, err.Error()), + )) - // Produce a packet. If produce packet successfully, update the context state. - cacheCtx, writeFn := ctx.CacheContext() - if err := k.ProducePacket(cacheCtx, tunnelID, pricesMap); err != nil { - return err + if err := k.DeactivateTunnel(ctx, id); err != nil { + return err + } } - writeFn() return nil } diff --git a/x/tunnel/keeper/keeper_packet_test.go b/x/tunnel/keeper/keeper_packet_test.go index eb8629534..594a9c1df 100644 --- a/x/tunnel/keeper/keeper_packet_test.go +++ b/x/tunnel/keeper/keeper_packet_test.go @@ -6,6 +6,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" bandtsstypes "github.com/bandprotocol/chain/v3/x/bandtss/types" feedstypes "github.com/bandprotocol/chain/v3/x/feeds/types" @@ -191,14 +192,12 @@ func (s *KeeperTestSuite) TestProduceActiveTunnelPackets() { s.bandtssKeeper.EXPECT().GetSigningFee(gomock.Any()).Return( sdk.NewCoins(sdk.NewCoin("uband", sdkmath.NewInt(20))), nil, - ).Times(2) + ) s.feedsKeeper.EXPECT().GetAllPrices(gomock.Any()).Return([]feedstypes.Price{ {Status: feedstypes.PRICE_STATUS_AVAILABLE, SignalID: "CS:BAND-USD", Price: 50000, Timestamp: 1733000000}, }) - spendableCoins := types.DefaultBasePacketFee.Add(sdk.NewCoin("uband", sdkmath.NewInt(20))) - s.bankKeeper.EXPECT().SpendableCoins(gomock.Any(), feePayer).Return(spendableCoins) s.bankKeeper.EXPECT(). SendCoinsFromAccountToModule(gomock.Any(), feePayer, types.ModuleName, types.DefaultBasePacketFee). Return(nil) @@ -259,15 +258,13 @@ func (s *KeeperTestSuite) TestProduceActiveTunnelPacketsNotEnoughMoney() { DestinationContractAddress: "0x", } - s.bandtssKeeper.EXPECT().GetSigningFee(gomock.Any()).Return( - sdk.NewCoins(sdk.NewCoin("uband", sdkmath.NewInt(20))), nil, - ) - s.feedsKeeper.EXPECT().GetAllPrices(gomock.Any()).Return([]feedstypes.Price{ {Status: feedstypes.PRICE_STATUS_AVAILABLE, SignalID: "CS:BAND-USD", Price: 50000, Timestamp: 1733000000}, }) - s.bankKeeper.EXPECT().SpendableCoins(gomock.Any(), feePayer). - Return(sdk.Coins{sdk.NewInt64Coin("uband", 1)}) + + s.bankKeeper.EXPECT(). + SendCoinsFromAccountToModule(gomock.Any(), feePayer, types.ModuleName, types.DefaultBasePacketFee). + Return(sdkerrors.ErrInsufficientFunds) err := tunnel.SetRoute(route) s.Require().NoError(err) diff --git a/x/tunnel/keeper/keeper_tunnel.go b/x/tunnel/keeper/keeper_tunnel.go index f5c09dfae..4493d39d1 100644 --- a/x/tunnel/keeper/keeper_tunnel.go +++ b/x/tunnel/keeper/keeper_tunnel.go @@ -255,36 +255,7 @@ func (k Keeper) GetTotalFees(ctx sdk.Context) types.TotalFees { return totalFee } -// HasEnoughFundToCreatePacket checks if the fee payer has enough balance to create a packet -func (k Keeper) HasEnoughFundToCreatePacket(ctx sdk.Context, tunnelID uint64) (bool, error) { - tunnel, err := k.GetTunnel(ctx, tunnelID) - if err != nil { - return false, err - } - - // get the route fee from the tunnel - route, err := tunnel.GetRouteValue() - if err != nil { - return false, err - } - routeFee, err := k.GetRouteFee(ctx, route) - if err != nil { - return false, err - } - - // get the base packet fee and calculate total fee - basePacketFee := k.GetParams(ctx).BasePacketFee - totalFee := basePacketFee.Add(routeFee...) - - // compare the fee payer's balance with the total fee - feePayer, err := sdk.AccAddressFromBech32(tunnel.FeePayer) - if err != nil { - return false, err - } - balances := k.bankKeeper.SpendableCoins(ctx, feePayer) - return balances.IsAllGTE(totalFee), nil -} - +// GenerateTunnelAccount generates a new tunnel account for the given key func (k Keeper) GenerateTunnelAccount(ctx sdk.Context, key string) (sdk.AccAddress, error) { header := ctx.BlockHeader() diff --git a/x/tunnel/keeper/msg_server.go b/x/tunnel/keeper/msg_server.go index 72e5203e3..d525ac4e9 100644 --- a/x/tunnel/keeper/msg_server.go +++ b/x/tunnel/keeper/msg_server.go @@ -289,15 +289,6 @@ func (k msgServer) TriggerTunnel( return nil, types.ErrInactiveTunnel.Wrapf("tunnelID %d", msg.TunnelID) } - ok, err := k.Keeper.HasEnoughFundToCreatePacket(ctx, tunnel.ID) - if err != nil { - return nil, err - } - - if !ok { - return nil, types.ErrInsufficientFund.Wrapf("tunnelID %d", msg.TunnelID) - } - signalIDs := tunnel.GetSignalIDs() prices := k.Keeper.feedsKeeper.GetPrices(ctx, signalIDs) diff --git a/x/tunnel/keeper/msg_server_test.go b/x/tunnel/keeper/msg_server_test.go index 842a293b9..3a2d995e8 100644 --- a/x/tunnel/keeper/msg_server_test.go +++ b/x/tunnel/keeper/msg_server_test.go @@ -694,7 +694,7 @@ func (s *KeeperTestSuite) TestMsgTriggerTunnel() { s.bandtssKeeper.EXPECT().GetSigningFee(gomock.Any()).Return( sdk.NewCoins(sdk.NewCoin("uband", sdkmath.NewInt(20))), nil, - ).Times(2) + ) s.bandtssKeeper.EXPECT().CreateTunnelSigningRequest( gomock.Any(), @@ -720,9 +720,6 @@ func (s *KeeperTestSuite) TestMsgTriggerTunnel() { SendCoinsFromAccountToModule(gomock.Any(), feePayer, types.ModuleName, types.DefaultBasePacketFee). Return(nil) - spendableCoins := types.DefaultBasePacketFee.Add(sdk.NewCoin("uband", sdkmath.NewInt(20))) - s.bankKeeper.EXPECT().SpendableCoins(gomock.Any(), feePayer).Return(spendableCoins) - return types.NewMsgTriggerTunnel(1, sdk.AccAddress([]byte("creator_address")).String()) }, expErr: false, diff --git a/x/tunnel/testutil/expected_keepers_mocks.go b/x/tunnel/testutil/expected_keepers_mocks.go index 6965a25c1..4d9b090bf 100644 --- a/x/tunnel/testutil/expected_keepers_mocks.go +++ b/x/tunnel/testutil/expected_keepers_mocks.go @@ -27,6 +27,7 @@ import ( type MockAccountKeeper struct { ctrl *gomock.Controller recorder *MockAccountKeeperMockRecorder + isgomock struct{} } // MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. @@ -130,6 +131,7 @@ func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(ctx, moduleAccount any type MockBankKeeper struct { ctrl *gomock.Controller recorder *MockBankKeeperMockRecorder + isgomock struct{} } // MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. @@ -205,24 +207,11 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderMo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } -// SpendableCoins mocks base method. -func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types2.AccAddress) types2.Coins { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SpendableCoins", ctx, addr) - ret0, _ := ret[0].(types2.Coins) - return ret0 -} - -// SpendableCoins indicates an expected call of SpendableCoins. -func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) -} - // MockICS4Wrapper is a mock of ICS4Wrapper interface. type MockICS4Wrapper struct { ctrl *gomock.Controller recorder *MockICS4WrapperMockRecorder + isgomock struct{} } // MockICS4WrapperMockRecorder is the mock recorder for MockICS4Wrapper. @@ -261,6 +250,7 @@ func (mr *MockICS4WrapperMockRecorder) SendPacket(ctx, chanCap, sourcePort, sour type MockChannelKeeper struct { ctrl *gomock.Controller recorder *MockChannelKeeperMockRecorder + isgomock struct{} } // MockChannelKeeperMockRecorder is the mock recorder for MockChannelKeeper. @@ -299,6 +289,7 @@ func (mr *MockChannelKeeperMockRecorder) GetChannel(ctx, srcPort, srcChan any) * type MockPortKeeper struct { ctrl *gomock.Controller recorder *MockPortKeeperMockRecorder + isgomock struct{} } // MockPortKeeperMockRecorder is the mock recorder for MockPortKeeper. @@ -336,6 +327,7 @@ func (mr *MockPortKeeperMockRecorder) BindPort(ctx, portID any) *gomock.Call { type MockScopedKeeper struct { ctrl *gomock.Controller recorder *MockScopedKeeperMockRecorder + isgomock struct{} } // MockScopedKeeperMockRecorder is the mock recorder for MockScopedKeeper. @@ -402,6 +394,7 @@ func (mr *MockScopedKeeperMockRecorder) GetCapability(ctx, name any) *gomock.Cal type MockFeedsKeeper struct { ctrl *gomock.Controller recorder *MockFeedsKeeperMockRecorder + isgomock struct{} } // MockFeedsKeeperMockRecorder is the mock recorder for MockFeedsKeeper. @@ -453,6 +446,7 @@ func (mr *MockFeedsKeeperMockRecorder) GetPrices(ctx, signalIDs any) *gomock.Cal type MockBandtssKeeper struct { ctrl *gomock.Controller recorder *MockBandtssKeeperMockRecorder + isgomock struct{} } // MockBandtssKeeperMockRecorder is the mock recorder for MockBandtssKeeper. diff --git a/x/tunnel/types/errors.go b/x/tunnel/types/errors.go index bfde73718..db8d56a5a 100644 --- a/x/tunnel/types/errors.go +++ b/x/tunnel/types/errors.go @@ -23,13 +23,12 @@ var ( ErrInvalidDepositDenom = errorsmod.Register(ModuleName, 16, "invalid deposit denom") ErrDepositNotFound = errorsmod.Register(ModuleName, 17, "deposit not found") ErrInsufficientDeposit = errorsmod.Register(ModuleName, 18, "insufficient deposit") - ErrInsufficientFund = errorsmod.Register(ModuleName, 19, "insufficient fund") - ErrDeviationNotFound = errorsmod.Register(ModuleName, 20, "deviation not found") - ErrInvalidVersion = errorsmod.Register(ModuleName, 21, "invalid version") - ErrChannelCapabilityNotFound = errorsmod.Register(ModuleName, 22, "channel capability not found") - ErrMaxTunnelChannels = errorsmod.Register(ModuleName, 23, "max tunnel channels exceeded") - ErrInvalidEncoder = errorsmod.Register(ModuleName, 24, "invalid encoder") - ErrSendPacketPanic = errorsmod.Register(ModuleName, 25, "panic in sending packet") - ErrInvalidChannelID = errorsmod.Register(ModuleName, 26, "invalid channel id") - ErrInvalidPortID = errorsmod.Register(ModuleName, 27, "invalid port id") + ErrDeviationNotFound = errorsmod.Register(ModuleName, 19, "deviation not found") + ErrInvalidVersion = errorsmod.Register(ModuleName, 20, "invalid version") + ErrChannelCapabilityNotFound = errorsmod.Register(ModuleName, 21, "channel capability not found") + ErrMaxTunnelChannels = errorsmod.Register(ModuleName, 22, "max tunnel channels exceeded") + ErrInvalidEncoder = errorsmod.Register(ModuleName, 23, "invalid encoder") + ErrSendPacketPanic = errorsmod.Register(ModuleName, 24, "panic in sending packet") + ErrInvalidChannelID = errorsmod.Register(ModuleName, 25, "invalid channel id") + ErrInvalidPortID = errorsmod.Register(ModuleName, 26, "invalid port id") ) diff --git a/x/tunnel/types/expected_keepers.go b/x/tunnel/types/expected_keepers.go index 5452e7267..407068237 100644 --- a/x/tunnel/types/expected_keepers.go +++ b/x/tunnel/types/expected_keepers.go @@ -28,7 +28,6 @@ type AccountKeeper interface { type BankKeeper interface { SendCoins(ctx context.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins - SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins SendCoinsFromModuleToAccount( ctx context.Context, senderModule string, From 833f448723ff610d78fa38216ab9dbf49033a68d Mon Sep 17 00:00:00 2001 From: nkitlabs Date: Tue, 7 Jan 2025 10:56:03 +0700 Subject: [PATCH 2/3] refactor code --- x/tunnel/keeper/keeper_packet.go | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/x/tunnel/keeper/keeper_packet.go b/x/tunnel/keeper/keeper_packet.go index 4e094ff33..c30779a35 100644 --- a/x/tunnel/keeper/keeper_packet.go +++ b/x/tunnel/keeper/keeper_packet.go @@ -53,23 +53,22 @@ func (k Keeper) ProduceActiveTunnelPackets(ctx sdk.Context) error { // create new packet. If failed to produce packet, emit an event. for _, id := range ids { - // Produce a packet. If produce packet successfully, update the context state. cacheCtx, writeFn := ctx.CacheContext() - err := k.ProducePacket(cacheCtx, id, pricesMap) - if err == nil { - writeFn() - continue - } - // emit an event if failed to produce packet and deactivate the tunnel - ctx.EventManager().EmitEvent(sdk.NewEvent( - types.EventTypeProducePacketFail, - sdk.NewAttribute(types.AttributeKeyTunnelID, fmt.Sprintf("%d", id)), - sdk.NewAttribute(types.AttributeKeyReason, err.Error()), - )) - - if err := k.DeactivateTunnel(ctx, id); err != nil { - return err + // Produce a packet. If produce packet successfully, update the context state. + // if not, emit an event and deactivate the tunnel. + if err := k.ProducePacket(cacheCtx, id, pricesMap); err != nil { + ctx.EventManager().EmitEvent(sdk.NewEvent( + types.EventTypeProducePacketFail, + sdk.NewAttribute(types.AttributeKeyTunnelID, fmt.Sprintf("%d", id)), + sdk.NewAttribute(types.AttributeKeyReason, err.Error()), + )) + + if err := k.DeactivateTunnel(ctx, id); err != nil { + return err + } + } else { + writeFn() } } From 8d87db381ffdf11414fbf7afe52d8c304414c282 Mon Sep 17 00:00:00 2001 From: nkitlabs Date: Tue, 7 Jan 2025 17:35:02 +0700 Subject: [PATCH 3/3] remove packet fee --- api/band/tunnel/v1beta1/tunnel.pulsar.go | 445 ++++------------------ proto/band/tunnel/v1beta1/tunnel.proto | 8 +- x/tunnel/keeper/keeper_packet.go | 17 - x/tunnel/keeper/keeper_packet_test.go | 8 - x/tunnel/keeper/keeper_packet_tss.go | 7 +- x/tunnel/keeper/keeper_packet_tss_test.go | 4 +- x/tunnel/keeper/keeper_tunnel.go | 12 - x/tunnel/types/packet.go | 5 - x/tunnel/types/packet_test.go | 4 +- x/tunnel/types/tunnel.pb.go | 262 +++---------- 10 files changed, 138 insertions(+), 634 deletions(-) diff --git a/api/band/tunnel/v1beta1/tunnel.pulsar.go b/api/band/tunnel/v1beta1/tunnel.pulsar.go index ff36e28a5..a6b49b57c 100644 --- a/api/band/tunnel/v1beta1/tunnel.pulsar.go +++ b/api/band/tunnel/v1beta1/tunnel.pulsar.go @@ -2238,116 +2238,12 @@ func (x *_Packet_3_list) IsValid() bool { return x.list != nil } -var _ protoreflect.List = (*_Packet_5_list)(nil) - -type _Packet_5_list struct { - list *[]*v1beta1.Coin -} - -func (x *_Packet_5_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Packet_5_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_Packet_5_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_Packet_5_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Packet_5_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Packet_5_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_Packet_5_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Packet_5_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_Packet_6_list)(nil) - -type _Packet_6_list struct { - list *[]*v1beta1.Coin -} - -func (x *_Packet_6_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Packet_6_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_Packet_6_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_Packet_6_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Packet_6_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Packet_6_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_Packet_6_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Packet_6_list) IsValid() bool { - return x.list != nil -} - var ( md_Packet protoreflect.MessageDescriptor fd_Packet_tunnel_id protoreflect.FieldDescriptor fd_Packet_sequence protoreflect.FieldDescriptor fd_Packet_prices protoreflect.FieldDescriptor fd_Packet_receipt protoreflect.FieldDescriptor - fd_Packet_base_fee protoreflect.FieldDescriptor - fd_Packet_route_fee protoreflect.FieldDescriptor fd_Packet_created_at protoreflect.FieldDescriptor ) @@ -2358,8 +2254,6 @@ func init() { fd_Packet_sequence = md_Packet.Fields().ByName("sequence") fd_Packet_prices = md_Packet.Fields().ByName("prices") fd_Packet_receipt = md_Packet.Fields().ByName("receipt") - fd_Packet_base_fee = md_Packet.Fields().ByName("base_fee") - fd_Packet_route_fee = md_Packet.Fields().ByName("route_fee") fd_Packet_created_at = md_Packet.Fields().ByName("created_at") } @@ -2452,18 +2346,6 @@ func (x *fastReflection_Packet) Range(f func(protoreflect.FieldDescriptor, proto return } } - if len(x.BaseFee) != 0 { - value := protoreflect.ValueOfList(&_Packet_5_list{list: &x.BaseFee}) - if !f(fd_Packet_base_fee, value) { - return - } - } - if len(x.RouteFee) != 0 { - value := protoreflect.ValueOfList(&_Packet_6_list{list: &x.RouteFee}) - if !f(fd_Packet_route_fee, value) { - return - } - } if x.CreatedAt != int64(0) { value := protoreflect.ValueOfInt64(x.CreatedAt) if !f(fd_Packet_created_at, value) { @@ -2493,10 +2375,6 @@ func (x *fastReflection_Packet) Has(fd protoreflect.FieldDescriptor) bool { return len(x.Prices) != 0 case "band.tunnel.v1beta1.Packet.receipt": return x.Receipt != nil - case "band.tunnel.v1beta1.Packet.base_fee": - return len(x.BaseFee) != 0 - case "band.tunnel.v1beta1.Packet.route_fee": - return len(x.RouteFee) != 0 case "band.tunnel.v1beta1.Packet.created_at": return x.CreatedAt != int64(0) default: @@ -2523,10 +2401,6 @@ func (x *fastReflection_Packet) Clear(fd protoreflect.FieldDescriptor) { x.Prices = nil case "band.tunnel.v1beta1.Packet.receipt": x.Receipt = nil - case "band.tunnel.v1beta1.Packet.base_fee": - x.BaseFee = nil - case "band.tunnel.v1beta1.Packet.route_fee": - x.RouteFee = nil case "band.tunnel.v1beta1.Packet.created_at": x.CreatedAt = int64(0) default: @@ -2560,18 +2434,6 @@ func (x *fastReflection_Packet) Get(descriptor protoreflect.FieldDescriptor) pro case "band.tunnel.v1beta1.Packet.receipt": value := x.Receipt return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "band.tunnel.v1beta1.Packet.base_fee": - if len(x.BaseFee) == 0 { - return protoreflect.ValueOfList(&_Packet_5_list{}) - } - listValue := &_Packet_5_list{list: &x.BaseFee} - return protoreflect.ValueOfList(listValue) - case "band.tunnel.v1beta1.Packet.route_fee": - if len(x.RouteFee) == 0 { - return protoreflect.ValueOfList(&_Packet_6_list{}) - } - listValue := &_Packet_6_list{list: &x.RouteFee} - return protoreflect.ValueOfList(listValue) case "band.tunnel.v1beta1.Packet.created_at": value := x.CreatedAt return protoreflect.ValueOfInt64(value) @@ -2605,14 +2467,6 @@ func (x *fastReflection_Packet) Set(fd protoreflect.FieldDescriptor, value proto x.Prices = *clv.list case "band.tunnel.v1beta1.Packet.receipt": x.Receipt = value.Message().Interface().(*anypb.Any) - case "band.tunnel.v1beta1.Packet.base_fee": - lv := value.List() - clv := lv.(*_Packet_5_list) - x.BaseFee = *clv.list - case "band.tunnel.v1beta1.Packet.route_fee": - lv := value.List() - clv := lv.(*_Packet_6_list) - x.RouteFee = *clv.list case "band.tunnel.v1beta1.Packet.created_at": x.CreatedAt = value.Int() default: @@ -2646,18 +2500,6 @@ func (x *fastReflection_Packet) Mutable(fd protoreflect.FieldDescriptor) protore x.Receipt = new(anypb.Any) } return protoreflect.ValueOfMessage(x.Receipt.ProtoReflect()) - case "band.tunnel.v1beta1.Packet.base_fee": - if x.BaseFee == nil { - x.BaseFee = []*v1beta1.Coin{} - } - value := &_Packet_5_list{list: &x.BaseFee} - return protoreflect.ValueOfList(value) - case "band.tunnel.v1beta1.Packet.route_fee": - if x.RouteFee == nil { - x.RouteFee = []*v1beta1.Coin{} - } - value := &_Packet_6_list{list: &x.RouteFee} - return protoreflect.ValueOfList(value) case "band.tunnel.v1beta1.Packet.tunnel_id": panic(fmt.Errorf("field tunnel_id of message band.tunnel.v1beta1.Packet is not mutable")) case "band.tunnel.v1beta1.Packet.sequence": @@ -2687,12 +2529,6 @@ func (x *fastReflection_Packet) NewField(fd protoreflect.FieldDescriptor) protor case "band.tunnel.v1beta1.Packet.receipt": m := new(anypb.Any) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "band.tunnel.v1beta1.Packet.base_fee": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_Packet_5_list{list: &list}) - case "band.tunnel.v1beta1.Packet.route_fee": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_Packet_6_list{list: &list}) case "band.tunnel.v1beta1.Packet.created_at": return protoreflect.ValueOfInt64(int64(0)) default: @@ -2780,18 +2616,6 @@ func (x *fastReflection_Packet) ProtoMethods() *protoiface.Methods { l = options.Size(x.Receipt) n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.BaseFee) > 0 { - for _, e := range x.BaseFee { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.RouteFee) > 0 { - for _, e := range x.RouteFee { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } if x.CreatedAt != 0 { n += 1 + runtime.Sov(uint64(x.CreatedAt)) } @@ -2827,39 +2651,7 @@ func (x *fastReflection_Packet) ProtoMethods() *protoiface.Methods { if x.CreatedAt != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.CreatedAt)) i-- - dAtA[i] = 0x38 - } - if len(x.RouteFee) > 0 { - for iNdEx := len(x.RouteFee) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.RouteFee[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x32 - } - } - if len(x.BaseFee) > 0 { - for iNdEx := len(x.BaseFee) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.BaseFee[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x2a - } + dAtA[i] = 0x28 } if x.Receipt != nil { encoded, err := options.Marshal(x.Receipt) @@ -3059,74 +2851,6 @@ func (x *fastReflection_Packet) ProtoMethods() *protoiface.Methods { } iNdEx = postIndex case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BaseFee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.BaseFee = append(x.BaseFee, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BaseFee[len(x.BaseFee)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RouteFee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.RouteFee = append(x.RouteFee, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RouteFee[len(x.RouteFee)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 7: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) } @@ -5177,12 +4901,8 @@ type Packet struct { Prices []*v1beta11.Price `protobuf:"bytes,3,rep,name=prices,proto3" json:"prices,omitempty"` // receipt represents the confirmation of the packet delivery to the destination via the specified route. Receipt *anypb.Any `protobuf:"bytes,4,opt,name=receipt,proto3" json:"receipt,omitempty"` - // base_fee is the base fee of the packet - BaseFee []*v1beta1.Coin `protobuf:"bytes,5,rep,name=base_fee,json=baseFee,proto3" json:"base_fee,omitempty"` - // route_fee is the route fee of the packet - RouteFee []*v1beta1.Coin `protobuf:"bytes,6,rep,name=route_fee,json=routeFee,proto3" json:"route_fee,omitempty"` // created_at is the timestamp when the packet is created - CreatedAt int64 `protobuf:"varint,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` } func (x *Packet) Reset() { @@ -5233,20 +4953,6 @@ func (x *Packet) GetReceipt() *anypb.Any { return nil } -func (x *Packet) GetBaseFee() []*v1beta1.Coin { - if x != nil { - return x.BaseFee - } - return nil -} - -func (x *Packet) GetRouteFee() []*v1beta1.Coin { - if x != nil { - return x.RouteFee - } - return nil -} - func (x *Packet) GetCreatedAt() int64 { if x != nil { return x.CreatedAt @@ -5498,7 +5204,7 @@ var file_band_tunnel_v1beta1_tunnel_proto_rawDesc = []byte{ 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x63, - 0x6b, 0x65, 0x74, 0x46, 0x65, 0x65, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xbd, 0x03, 0x0a, + 0x6b, 0x65, 0x74, 0x46, 0x65, 0x65, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xeb, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x29, 0x0a, 0x09, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0c, 0xe2, 0xde, 0x1f, 0x08, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x44, 0x52, 0x08, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, @@ -5511,76 +5217,63 @@ var file_band_tunnel_v1beta1_tunnel_proto_rawDesc = []byte{ 0x70, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x12, 0xca, 0xb4, 0x2d, 0x0e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, - 0x74, 0x49, 0x52, 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x66, 0x0a, 0x08, 0x62, - 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, - 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x07, 0x62, 0x61, 0x73, 0x65, - 0x46, 0x65, 0x65, 0x12, 0x68, 0x0a, 0x09, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x66, 0x65, 0x65, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, - 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, - 0x69, 0x6e, 0x73, 0x52, 0x08, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x46, 0x65, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xdc, 0x01, 0x0a, - 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x29, 0x0a, 0x09, 0x74, 0x75, 0x6e, 0x6e, - 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0c, 0xe2, 0xde, 0x1f, - 0x08, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x44, 0x52, 0x08, 0x74, 0x75, 0x6e, 0x6e, 0x65, - 0x6c, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x52, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x68, 0x0a, 0x06, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x35, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xca, 0x01, 0x0a, 0x0f, - 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x29, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x0c, 0xe2, 0xde, 0x1f, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x44, - 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x12, 0x73, 0x6f, - 0x66, 0x74, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x70, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xe2, 0xde, 0x1f, 0x10, 0x53, 0x6f, 0x66, 0x74, - 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x50, 0x53, 0x52, 0x10, 0x73, 0x6f, - 0x66, 0x74, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x70, 0x73, 0x12, 0x42, - 0x0a, 0x12, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x62, 0x70, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xe2, 0xde, 0x1f, 0x10, - 0x48, 0x61, 0x72, 0x64, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x50, 0x53, - 0x52, 0x10, 0x68, 0x61, 0x72, 0x64, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x70, 0x73, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xc7, 0x01, 0x0a, 0x14, 0x54, 0x75, 0x6e, - 0x6e, 0x65, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x4f, 0x72, 0x64, 0x65, - 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x37, 0x0a, - 0x06, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x62, 0x61, 0x6e, 0x64, 0x2e, 0x66, 0x65, 0x65, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x35, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x72, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x2e, 0x66, 0x65, - 0x65, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x45, 0x6e, 0x63, 0x6f, - 0x64, 0x65, 0x72, 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x3a, 0x04, 0x88, 0xa0, - 0x1f, 0x00, 0x42, 0xe0, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x2e, - 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0b, - 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x46, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x54, 0x58, 0xaa, 0x02, 0x13, 0x42, 0x61, - 0x6e, 0x64, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xca, 0x02, 0x13, 0x42, 0x61, 0x6e, 0x64, 0x5c, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x42, 0x61, 0x6e, 0x64, 0x5c, 0x54, - 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x42, 0x61, 0x6e, 0x64, - 0x3a, 0x3a, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x49, 0x52, 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xdc, 0x01, 0x0a, 0x07, 0x44, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x29, 0x0a, 0x09, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0c, 0xe2, 0xde, 0x1f, 0x08, 0x54, + 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x44, 0x52, 0x08, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x49, + 0x64, 0x12, 0x36, 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x68, 0x0a, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x35, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xca, 0x01, 0x0a, 0x0f, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0c, 0xe2, 0xde, 0x1f, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x44, 0x52, 0x08, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x12, 0x73, 0x6f, 0x66, 0x74, + 0x5f, 0x64, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x70, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xe2, 0xde, 0x1f, 0x10, 0x53, 0x6f, 0x66, 0x74, 0x44, 0x65, + 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x50, 0x53, 0x52, 0x10, 0x73, 0x6f, 0x66, 0x74, + 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x70, 0x73, 0x12, 0x42, 0x0a, 0x12, + 0x68, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, + 0x70, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xe2, 0xde, 0x1f, 0x10, 0x48, 0x61, + 0x72, 0x64, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x50, 0x53, 0x52, 0x10, + 0x68, 0x61, 0x72, 0x64, 0x44, 0x65, 0x76, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x70, 0x73, + 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xc7, 0x01, 0x0a, 0x14, 0x54, 0x75, 0x6e, 0x6e, 0x65, + 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, + 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x70, + 0x72, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x61, + 0x6e, 0x64, 0x2e, 0x66, 0x65, 0x65, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x72, + 0x69, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x12, 0x35, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x2e, 0x66, 0x65, 0x65, 0x64, + 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x72, 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, + 0x42, 0xe0, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x61, 0x6e, 0x64, 0x2e, 0x74, 0x75, + 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0b, 0x54, 0x75, + 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x46, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x62, 0x61, 0x6e, 0x64, 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x54, 0x58, 0xaa, 0x02, 0x13, 0x42, 0x61, 0x6e, 0x64, + 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, + 0x02, 0x13, 0x42, 0x61, 0x6e, 0x64, 0x5c, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x5c, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x42, 0x61, 0x6e, 0x64, 0x5c, 0x54, 0x75, 0x6e, + 0x6e, 0x65, 0x6c, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x42, 0x61, 0x6e, 0x64, 0x3a, 0x3a, + 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa8, + 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5617,16 +5310,14 @@ var file_band_tunnel_v1beta1_tunnel_proto_depIdxs = []int32{ 8, // 4: band.tunnel.v1beta1.TotalFees.total_base_packet_fee:type_name -> cosmos.base.v1beta1.Coin 9, // 5: band.tunnel.v1beta1.Packet.prices:type_name -> band.feeds.v1beta1.Price 7, // 6: band.tunnel.v1beta1.Packet.receipt:type_name -> google.protobuf.Any - 8, // 7: band.tunnel.v1beta1.Packet.base_fee:type_name -> cosmos.base.v1beta1.Coin - 8, // 8: band.tunnel.v1beta1.Packet.route_fee:type_name -> cosmos.base.v1beta1.Coin - 8, // 9: band.tunnel.v1beta1.Deposit.amount:type_name -> cosmos.base.v1beta1.Coin - 9, // 10: band.tunnel.v1beta1.TunnelSignatureOrder.prices:type_name -> band.feeds.v1beta1.Price - 10, // 11: band.tunnel.v1beta1.TunnelSignatureOrder.encoder:type_name -> band.feeds.v1beta1.Encoder - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 8, // 7: band.tunnel.v1beta1.Deposit.amount:type_name -> cosmos.base.v1beta1.Coin + 9, // 8: band.tunnel.v1beta1.TunnelSignatureOrder.prices:type_name -> band.feeds.v1beta1.Price + 10, // 9: band.tunnel.v1beta1.TunnelSignatureOrder.encoder:type_name -> band.feeds.v1beta1.Encoder + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_band_tunnel_v1beta1_tunnel_proto_init() } diff --git a/proto/band/tunnel/v1beta1/tunnel.proto b/proto/band/tunnel/v1beta1/tunnel.proto index 10fa073f5..d47c95831 100644 --- a/proto/band/tunnel/v1beta1/tunnel.proto +++ b/proto/band/tunnel/v1beta1/tunnel.proto @@ -74,14 +74,8 @@ message Packet { repeated band.feeds.v1beta1.Price prices = 3 [(gogoproto.nullable) = false]; // receipt represents the confirmation of the packet delivery to the destination via the specified route. google.protobuf.Any receipt = 4 [(cosmos_proto.accepts_interface) = "PacketReceiptI"]; - // base_fee is the base fee of the packet - repeated cosmos.base.v1beta1.Coin base_fee = 5 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - // route_fee is the route fee of the packet - repeated cosmos.base.v1beta1.Coin route_fee = 6 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; // created_at is the timestamp when the packet is created - int64 created_at = 7; + int64 created_at = 5; } // Deposit defines an amount deposited by an account address to the tunnel. diff --git a/x/tunnel/keeper/keeper_packet.go b/x/tunnel/keeper/keeper_packet.go index c30779a35..1bb8f1389 100644 --- a/x/tunnel/keeper/keeper_packet.go +++ b/x/tunnel/keeper/keeper_packet.go @@ -145,9 +145,6 @@ func (k Keeper) CreatePacket( tunnelID uint64, prices []feedstypes.Price, ) (types.Packet, error) { - // get tunnel and prices info - params := k.GetParams(ctx) - tunnel, err := k.GetTunnel(ctx, tunnelID) if err != nil { return types.Packet{}, err @@ -159,25 +156,11 @@ func (k Keeper) CreatePacket( return types.Packet{}, sdkerrors.Wrapf(err, "failed to deduct base packet fee for tunnel %d", tunnel.ID) } - // get the route - route, err := tunnel.GetRouteValue() - if err != nil { - return types.Packet{}, err - } - - // get the route fee - routeFee, err := k.GetRouteFee(ctx, route) - if err != nil { - return types.Packet{}, err - } - tunnel.Sequence++ packet := types.NewPacket( tunnelID, tunnel.Sequence, prices, - params.BasePacketFee, - routeFee, ctx.BlockTime().Unix(), ) diff --git a/x/tunnel/keeper/keeper_packet_test.go b/x/tunnel/keeper/keeper_packet_test.go index 594a9c1df..8cd28b3e9 100644 --- a/x/tunnel/keeper/keeper_packet_test.go +++ b/x/tunnel/keeper/keeper_packet_test.go @@ -55,8 +55,6 @@ func (s *KeeperTestSuite) TestGetSetPacket() { func (s *KeeperTestSuite) TestCreatePacket() { ctx, k := s.ctx, s.keeper - params := k.GetParams(ctx) - feePayer := sdk.AccAddress([]byte("fee_payer_address")) tunnel := types.Tunnel{ ID: 1, @@ -75,10 +73,6 @@ func (s *KeeperTestSuite) TestCreatePacket() { {Status: feedstypes.PRICE_STATUS_AVAILABLE, SignalID: "CS:BAND-USD", Price: 5000000, Timestamp: 1733000000}, } - s.bandtssKeeper.EXPECT().GetSigningFee(gomock.Any()).Return( - sdk.NewCoins(sdk.NewCoin("uband", sdkmath.NewInt(20))), nil, - ) - s.bankKeeper.EXPECT(). SendCoinsFromAccountToModule(ctx, feePayer, types.ModuleName, k.GetParams(ctx).BasePacketFee). Return(nil) @@ -93,8 +87,6 @@ func (s *KeeperTestSuite) TestCreatePacket() { TunnelID: 1, Sequence: 1, Prices: prices, - BaseFee: params.BasePacketFee, - RouteFee: sdk.NewCoins(sdk.NewCoin("uband", sdkmath.NewInt(20))), CreatedAt: ctx.BlockTime().Unix(), } diff --git a/x/tunnel/keeper/keeper_packet_tss.go b/x/tunnel/keeper/keeper_packet_tss.go index 9e671f878..0c82c207b 100644 --- a/x/tunnel/keeper/keeper_packet_tss.go +++ b/x/tunnel/keeper/keeper_packet_tss.go @@ -20,6 +20,11 @@ func (k Keeper) SendTSSPacket( route.Encoder, ) + tssFee, err := k.bandtssKeeper.GetSigningFee(ctx) + if err != nil { + return nil, err + } + // try signing TSS packet, if success, write the context. signingID, err := k.bandtssKeeper.CreateTunnelSigningRequest( ctx, @@ -28,7 +33,7 @@ func (k Keeper) SendTSSPacket( route.DestinationContractAddress, content, feePayer, - packet.RouteFee, + tssFee, ) if err != nil { return nil, err diff --git a/x/tunnel/keeper/keeper_packet_tss_test.go b/x/tunnel/keeper/keeper_packet_tss_test.go index 26f9b83d4..27704161e 100644 --- a/x/tunnel/keeper/keeper_packet_tss_test.go +++ b/x/tunnel/keeper/keeper_packet_tss_test.go @@ -27,11 +27,11 @@ func (s *KeeperTestSuite) TestSendTSSPacket() { 1, // tunnelID 1, // sequence []feedstypes.Price{}, // priceInfos[] - sdk.NewCoins(), // baseFee - sdk.NewCoins(sdk.NewCoin("uband", sdkmath.NewInt(20))), // routeFee time.Now().Unix(), ) + s.bandtssKeeper.EXPECT().GetSigningFee(ctx).Return(sdk.NewCoins(sdk.NewCoin("uband", sdkmath.NewInt(20))), nil) + // Mock the TSS keeper and set the state for checking later s.bandtssKeeper.EXPECT().CreateTunnelSigningRequest( gomock.Any(), diff --git a/x/tunnel/keeper/keeper_tunnel.go b/x/tunnel/keeper/keeper_tunnel.go index 4493d39d1..462e6fd6a 100644 --- a/x/tunnel/keeper/keeper_tunnel.go +++ b/x/tunnel/keeper/keeper_tunnel.go @@ -288,15 +288,3 @@ func (k Keeper) GenerateTunnelAccount(ctx sdk.Context, key string) (sdk.AccAddre return tunnelAccAddr, nil } - -// GetRouteFee returns the fee of the given route -func (k Keeper) GetRouteFee(ctx sdk.Context, route types.RouteI) (sdk.Coins, error) { - switch route.(type) { - case *types.TSSRoute: - return k.bandtssKeeper.GetSigningFee(ctx) - case *types.IBCRoute: - return sdk.Coins{}, nil - default: - return sdk.Coins{}, types.ErrInvalidRoute - } -} diff --git a/x/tunnel/types/packet.go b/x/tunnel/types/packet.go index 066243c58..dedfb8b4c 100644 --- a/x/tunnel/types/packet.go +++ b/x/tunnel/types/packet.go @@ -6,7 +6,6 @@ import ( proto "github.com/cosmos/gogoproto/proto" "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" feedstypes "github.com/bandprotocol/chain/v3/x/feeds/types" @@ -18,8 +17,6 @@ func NewPacket( tunnelID uint64, sequence uint64, prices []feedstypes.Price, - baseFee sdk.Coins, - routeFee sdk.Coins, createdAt int64, ) Packet { return Packet{ @@ -27,8 +24,6 @@ func NewPacket( Sequence: sequence, Prices: prices, Receipt: nil, - BaseFee: baseFee, - RouteFee: routeFee, CreatedAt: createdAt, } } diff --git a/x/tunnel/types/packet_test.go b/x/tunnel/types/packet_test.go index 6dad984e3..e7f1b8ebb 100644 --- a/x/tunnel/types/packet_test.go +++ b/x/tunnel/types/packet_test.go @@ -11,7 +11,7 @@ import ( ) func TestGetSetPacketReceipt(t *testing.T) { - packet := types.NewPacket(1, 1, nil, nil, nil, 0) + packet := types.NewPacket(1, 1, nil, 0) receipt := &types.TSSPacketReceipt{SigningID: 1} err := packet.SetReceipt(receipt) @@ -23,7 +23,7 @@ func TestGetSetPacketReceipt(t *testing.T) { } func TestPacketUnpackInterfaces(t *testing.T) { - packet := types.NewPacket(1, 1, nil, nil, nil, 0) + packet := types.NewPacket(1, 1, nil, 0) packetResult := &types.TSSPacketReceipt{SigningID: 1} err := packet.SetReceipt(packetResult) diff --git a/x/tunnel/types/tunnel.pb.go b/x/tunnel/types/tunnel.pb.go index fb7506280..9521cb16f 100644 --- a/x/tunnel/types/tunnel.pb.go +++ b/x/tunnel/types/tunnel.pb.go @@ -276,12 +276,8 @@ type Packet struct { Prices []types2.Price `protobuf:"bytes,3,rep,name=prices,proto3" json:"prices"` // receipt represents the confirmation of the packet delivery to the destination via the specified route. Receipt *types.Any `protobuf:"bytes,4,opt,name=receipt,proto3" json:"receipt,omitempty"` - // base_fee is the base fee of the packet - BaseFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,5,rep,name=base_fee,json=baseFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"base_fee"` - // route_fee is the route fee of the packet - RouteFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=route_fee,json=routeFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"route_fee"` // created_at is the timestamp when the packet is created - CreatedAt int64 `protobuf:"varint,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` } func (m *Packet) Reset() { *m = Packet{} } @@ -345,20 +341,6 @@ func (m *Packet) GetReceipt() *types.Any { return nil } -func (m *Packet) GetBaseFee() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.BaseFee - } - return nil -} - -func (m *Packet) GetRouteFee() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.RouteFee - } - return nil -} - func (m *Packet) GetCreatedAt() int64 { if m != nil { return m.CreatedAt @@ -552,66 +534,64 @@ func init() { func init() { proto.RegisterFile("band/tunnel/v1beta1/tunnel.proto", fileDescriptor_6bb6151451ba2f25) } var fileDescriptor_6bb6151451ba2f25 = []byte{ - // 929 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x6f, 0x1b, 0x45, + // 898 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6f, 0x1b, 0x45, 0x14, 0xf7, 0xd8, 0x8e, 0xed, 0x9d, 0xa6, 0x25, 0x1d, 0x0c, 0xda, 0xa6, 0xc2, 0xb6, 0x02, 0x07, - 0x83, 0x94, 0x5d, 0x9a, 0x2a, 0x45, 0xea, 0x2d, 0x4b, 0x88, 0xb0, 0x04, 0x22, 0xda, 0x54, 0x42, - 0xe2, 0xb2, 0x1a, 0xef, 0x3e, 0xdb, 0xa3, 0x3a, 0x3b, 0xcb, 0xce, 0xd8, 0x22, 0x17, 0xce, 0x5c, - 0x90, 0xe0, 0x03, 0x20, 0xf5, 0x58, 0x71, 0xe2, 0x90, 0x2b, 0x67, 0xaa, 0x9c, 0x2a, 0x4e, 0x1c, - 0x50, 0x40, 0xce, 0x01, 0x3e, 0x06, 0x9a, 0x3f, 0x6b, 0xe3, 0x28, 0x6d, 0x64, 0x29, 0x97, 0xc4, - 0xef, 0xbd, 0xdf, 0xbc, 0x7f, 0xbf, 0xf7, 0x9e, 0x8d, 0x3b, 0x7d, 0x9a, 0x26, 0xbe, 0x9c, 0xa4, - 0x29, 0x8c, 0xfd, 0xe9, 0x83, 0x3e, 0x48, 0xfa, 0xc0, 0x8a, 0x5e, 0x96, 0x73, 0xc9, 0xc9, 0x9b, - 0x0a, 0xe1, 0x59, 0x95, 0x45, 0x6c, 0xde, 0xa5, 0xc7, 0x2c, 0xe5, 0xbe, 0xfe, 0x6b, 0x70, 0x9b, - 0xad, 0x98, 0x8b, 0x63, 0x2e, 0xfc, 0x3e, 0x15, 0x30, 0xf7, 0x14, 0x73, 0x96, 0x5a, 0xfb, 0x3d, - 0x63, 0x8f, 0xb4, 0xe4, 0x1b, 0xc1, 0x9a, 0x9a, 0x43, 0x3e, 0xe4, 0x46, 0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c, 0x4f, 0x51, 0x3f, 0x93, 0x86, 0xdf, 0xa0, + 0x39, 0xbb, 0x68, 0x6f, 0x1d, 0xf3, 0x81, 0x5a, 0xbc, 0x47, 0x47, 0xc7, 0xe1, 0x96, 0x5c, 0xf2, + 0x64, 0x39, 0x89, 0x64, 0x44, 0x45, 0xb2, 0x92, 0xa3, 0xb2, 0xc8, 0xf1, 0x29, 0x15, 0xc9, 0x72, + 0x8e, 0xd1, 0x92, 0x27, 0x93, 0x76, 0x98, 0x5f, 0x11, 0x6e, 0x1a, 0x2e, 0x74, 0xab, 0x6a, 0x22, + 0xe0, 0x0b, 0x91, 0x80, 0x58, 0x12, 0x1f, 0x7a, 0xa9, 0xf8, 0xd6, 0xbc, 0xc6, 0xcb, 0xc2, 0xa9, + 0xac, 0x3e, 0x4a, 0xfb, 0xb8, 0x6e, 0xbf, 0x4d, 0x5a, 0x9b, 0xb7, 0xf6, 0xee, 0x5e, 0x95, 0xf8, + 0x13, 0x03, 0x09, 0x0b, 0xec, 0xc3, 0xea, 0x77, 0x4f, 0xdb, 0xa5, 0xe0, 0xf3, 0x67, 0xb3, 0x16, + 0x7a, 0x3e, 0x6b, 0xa1, 0x17, 0xb3, 0x16, 0xfa, 0x6b, 0xd6, 0x42, 0x3f, 0x5c, 0xb6, 0x4a, 0x2f, + 0x2e, 0x5b, 0xa5, 0xdf, 0x2f, 0x5b, 0xa5, 0xaf, 0xfc, 0xff, 0x31, 0x9e, 0xe7, 0xd4, 0x62, 0x8f, + 0xf9, 0xd8, 0x8f, 0x47, 0x94, 0xa5, 0xfe, 0xf4, 0xbe, 0xff, 0x4d, 0xf1, 0x6d, 0xd7, 0xf4, 0xf7, + 0x6b, 0x1a, 0x71, 0xff, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x38, 0x1b, 0xc5, 0xfa, 0xf7, 0x07, + 0x00, 0x00, } func (this *Tunnel) Equal(that interface{}) bool { @@ -775,22 +755,6 @@ func (this *Packet) Equal(that interface{}) bool { if !this.Receipt.Equal(that1.Receipt) { return false } - if len(this.BaseFee) != len(that1.BaseFee) { - return false - } - for i := range this.BaseFee { - if !this.BaseFee[i].Equal(&that1.BaseFee[i]) { - return false - } - } - if len(this.RouteFee) != len(that1.RouteFee) { - return false - } - for i := range this.RouteFee { - if !this.RouteFee[i].Equal(&that1.RouteFee[i]) { - return false - } - } if this.CreatedAt != that1.CreatedAt { return false } @@ -1113,35 +1077,7 @@ func (m *Packet) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.CreatedAt != 0 { i = encodeVarintTunnel(dAtA, i, uint64(m.CreatedAt)) i-- - dAtA[i] = 0x38 - } - if len(m.RouteFee) > 0 { - for iNdEx := len(m.RouteFee) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RouteFee[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTunnel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if len(m.BaseFee) > 0 { - for iNdEx := len(m.BaseFee) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BaseFee[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTunnel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } + dAtA[i] = 0x28 } if m.Receipt != nil { { @@ -1440,18 +1376,6 @@ func (m *Packet) Size() (n int) { l = m.Receipt.Size() n += 1 + l + sovTunnel(uint64(l)) } - if len(m.BaseFee) > 0 { - for _, e := range m.BaseFee { - l = e.Size() - n += 1 + l + sovTunnel(uint64(l)) - } - } - if len(m.RouteFee) > 0 { - for _, e := range m.RouteFee { - l = e.Size() - n += 1 + l + sovTunnel(uint64(l)) - } - } if m.CreatedAt != 0 { n += 1 + sovTunnel(uint64(m.CreatedAt)) } @@ -2187,74 +2111,6 @@ func (m *Packet) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseFee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTunnel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTunnel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTunnel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BaseFee = append(m.BaseFee, types1.Coin{}) - if err := m.BaseFee[len(m.BaseFee)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RouteFee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTunnel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTunnel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTunnel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RouteFee = append(m.RouteFee, types1.Coin{}) - if err := m.RouteFee[len(m.RouteFee)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) }