From c3d93075779ab5fc7fb8ecc5a98c690d220ff59c Mon Sep 17 00:00:00 2001 From: zale144 Date: Mon, 10 Jun 2024 20:18:24 +0200 Subject: [PATCH] feat(eibc): Expand list-demand-orders query with more parameters (#851) Co-authored-by: Michael Tsitrin --- CHANGELOG.md | 1 + ibctesting/eibc_test.go | 9 +- proto/dymension/eibc/demand_order.proto | 5 +- proto/dymension/eibc/query.proto | 12 +- x/eibc/client/cli/query_command_orders.go | 55 ++++-- x/eibc/keeper/demand_order_test.go | 7 +- x/eibc/keeper/grpc_query.go | 54 +++--- x/eibc/keeper/grpc_query_test.go | 5 +- x/eibc/keeper/invariants.go | 7 +- x/eibc/keeper/keeper.go | 15 +- x/eibc/types/demand_order.go | 6 + x/eibc/types/demand_order.pb.go | 142 ++++++++++++--- x/eibc/types/query.pb.go | 203 +++++++++++++++++----- x/eibc/types/query.pb.gw.go | 29 +++- x/eibc/types/types.go | 3 + 15 files changed, 430 insertions(+), 123 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddbb3b8ad..cd7e9284a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features +- (delayedack) [#849](https://github.com/dymensionxyz/dymension/issues/849) Add demand order filters: type, rollapp id and limit - (delayedack) [#850](https://github.com/dymensionxyz/dymension/issues/850) Add type filter for delayedack - (rollapp) [#829](https://github.com/dymensionxyz/dymension/issues/829) Refactor rollapp cli to be more useful - (delayedack) [#728](https://github.com/dymensionxyz/dymension/issues/728) Create eibc order on err ack from rollapp diff --git a/ibctesting/eibc_test.go b/ibctesting/eibc_test.go index 7e5f3cfec..197819171 100644 --- a/ibctesting/eibc_test.go +++ b/ibctesting/eibc_test.go @@ -16,6 +16,7 @@ import ( clienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types" ibctesting "github.com/cosmos/ibc-go/v6/testing" + commontypes "github.com/dymensionxyz/dymension/v3/x/common/types" eibckeeper "github.com/dymensionxyz/dymension/v3/x/eibc/keeper" eibctypes "github.com/dymensionxyz/dymension/v3/x/eibc/types" @@ -230,9 +231,9 @@ func (suite *EIBCTestSuite) TestEIBCDemandOrderFulfillment() { memo := string(eibcJson) var IBCDenom string { - //// + // // // Transfer initial IBC funds to fulfiller account with ibc memo, to give him some funds to use to fulfill stuff - //// + // // packet := suite.TransferRollappToHub(path, IBCSenderAccount, fulfiller.String(), tc.fulfillerInitialIBCDenomBalance, memo, false) // Finalize rollapp state - at this state no demand order was fulfilled @@ -301,7 +302,7 @@ func (suite *EIBCTestSuite) TestEIBCDemandOrderFulfillment() { rollappPacket, err := delayedAckKeeper.GetRollappPacket(suite.hubChain.GetContext(), lastDemandOrder.TrackingPacketKey) suite.Require().NoError(err) var data transfertypes.FungibleTokenPacketData - err = transfertypes.ModuleCdc.UnmarshalJSON(rollappPacket.Packet.GetData(), &data) + err = eibctypes.ModuleCdc.UnmarshalJSON(rollappPacket.Packet.GetData(), &data) suite.Require().NoError(err) suite.Require().Equal(msgFulfillDemandOrder.FulfillerAddress, data.Receiver) @@ -326,7 +327,7 @@ func (suite *EIBCTestSuite) TestEIBCDemandOrderFulfillment() { suite.Require().True(fulfillerAccountBalanceAfterFinalization.IsEqual(preFulfillmentAccountBalance.Add(sdk.NewCoin(IBCDenom, sdk.NewInt(eibcTransferFeeInt))))) // Validate demand order fulfilled and packet status updated - finalizedDemandOrders, err := eibcKeeper.ListDemandOrdersByStatus(suite.hubChain.GetContext(), commontypes.Status_FINALIZED) + finalizedDemandOrders, err := eibcKeeper.ListDemandOrdersByStatus(suite.hubChain.GetContext(), commontypes.Status_FINALIZED, 0) suite.Require().NoError(err) var finalizedDemandOrder *eibctypes.DemandOrder for _, order := range finalizedDemandOrders { diff --git a/proto/dymension/eibc/demand_order.proto b/proto/dymension/eibc/demand_order.proto index 23436ee15..a4ba103e4 100644 --- a/proto/dymension/eibc/demand_order.proto +++ b/proto/dymension/eibc/demand_order.proto @@ -3,6 +3,7 @@ package dymensionxyz.dymension.eibc; import "gogoproto/gogo.proto"; import "dymension/common/status.proto"; +import "dymension/common/rollapp_packet.proto"; import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/dymensionxyz/dymension/v3/x/eibc/types"; @@ -27,4 +28,6 @@ message DemandOrder { string recipient = 5; bool is_fulfilled = 6; dymensionxyz.dymension.common.Status tracking_packet_status = 8; - } \ No newline at end of file + string rollapp_id = 9; + common.RollappPacket.Type type = 10; +} \ No newline at end of file diff --git a/proto/dymension/eibc/query.proto b/proto/dymension/eibc/query.proto index a4734b05f..ee26ff71e 100644 --- a/proto/dymension/eibc/query.proto +++ b/proto/dymension/eibc/query.proto @@ -6,6 +6,8 @@ import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "dymension/eibc/params.proto"; import "dymension/eibc/demand_order.proto"; +import "dymension/common/status.proto"; +import "dymension/common/rollapp_packet.proto"; option go_package = "github.com/dymensionxyz/dymension/v3/x/eibc/types"; @@ -42,8 +44,14 @@ message QueryGetDemandOrderRequest { // QueryDemandOrdersByStatusRequest is the request type for the Query/GetDemandOrdersByStatus RPC method. message QueryDemandOrdersByStatusRequest { - // id of the demand order to get - string status = 1; + // status of the demand order + common.Status status = 1; + // optional type + common.RollappPacket.Type type = 2; + // optional rollapp_id + string rollapp_id = 3; + // optional limit + int32 limit = 4; } // QueryGetDemandOrderResponse is the response type for the Query/GetDemandOrder RPC method. diff --git a/x/eibc/client/cli/query_command_orders.go b/x/eibc/client/cli/query_command_orders.go index feea7a360..79c545458 100644 --- a/x/eibc/client/cli/query_command_orders.go +++ b/x/eibc/client/cli/query_command_orders.go @@ -1,30 +1,63 @@ package cli import ( - "context" + "fmt" + "strconv" + "strings" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/dymensionxyz/dymension/v3/x/eibc/types" "github.com/spf13/cobra" + + commontypes "github.com/dymensionxyz/dymension/v3/x/common/types" + "github.com/dymensionxyz/dymension/v3/x/eibc/types" ) func CmdListDemandOrdersByStatus() *cobra.Command { cmd := &cobra.Command{ - Use: "list-demand-orders [status]", + Use: "list-demand-orders status [rollapp_id] [type] [limit]", Short: "List all demand orders with a specific status", - Long: `Query demand orders filtered by status. Examples of status include "pending", "finalized", and "reverted".`, - Args: cobra.ExactArgs(1), + Long: `Query demand orders filtered by status. Examples of status include "pending", "finalized", and "reverted". + Optional arguments include rollapp_id, type (recv, timeout, ack), and limit.`, + Args: cobra.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - status := args[0] + status, ok := commontypes.Status_value[strings.ToUpper(args[0])] + if !ok { + return fmt.Errorf("invalid status: %s", args[0]) + } + request := &types.QueryDemandOrdersByStatusRequest{ + Status: commontypes.Status(status), + Type: commontypes.RollappPacket_UNDEFINED, // default to undefined, as '0' is a valid type + } + if len(args) > 1 { + request.RollappId = args[1] + } + if len(args) > 2 { + packetType := strings.ToUpper(args[2]) + if !strings.HasPrefix(packetType, "ON_") { + packetType = "ON_" + packetType + } + ptype, ok := commontypes.RollappPacket_Type_value[packetType] + if !ok { + return fmt.Errorf("invalid packet type: %s", args[2]) + } + request.Type = commontypes.RollappPacket_Type(ptype) + } + if len(args) > 3 { + limit, err := strconv.ParseInt(args[3], 10, 32) + if err != nil { + return fmt.Errorf("limit must be an integer: %s", args[3]) + } + request.Limit = int32(limit) + } + + clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.DemandOrdersByStatus(context.Background(), &types.QueryDemandOrdersByStatusRequest{ - Status: status, - }) + + res, err := queryClient.DemandOrdersByStatus(cmd.Context(), request) if err != nil { - return err + return fmt.Errorf("failed to fetch demand orders: %w", err) } return clientCtx.PrintProto(res) diff --git a/x/eibc/keeper/demand_order_test.go b/x/eibc/keeper/demand_order_test.go index 44bb0c28b..89ecade48 100644 --- a/x/eibc/keeper/demand_order_test.go +++ b/x/eibc/keeper/demand_order_test.go @@ -4,6 +4,7 @@ import ( "strconv" "cosmossdk.io/math" + "github.com/dymensionxyz/dymension/v3/app/apptesting" commontypes "github.com/dymensionxyz/dymension/v3/x/common/types" "github.com/dymensionxyz/dymension/v3/x/eibc/types" @@ -27,7 +28,7 @@ func (suite *KeeperTestSuite) TestListDemandOrdersByStatus() { suite.Require().NoError(err) } // Get the demand orders with status active - demandOrders, err := keeper.ListDemandOrdersByStatus(ctx, commontypes.Status_PENDING) + demandOrders, err := keeper.ListDemandOrdersByStatus(ctx, commontypes.Status_PENDING, 0) suite.Require().NoError(err) suite.Equal(demandOrdersNum, len(demandOrders)) @@ -37,10 +38,10 @@ func (suite *KeeperTestSuite) TestListDemandOrdersByStatus() { suite.Require().NoError(err) } // Retrieve the updated demand orders after status change - updatedDemandOrders, err := keeper.ListDemandOrdersByStatus(ctx, commontypes.Status_FINALIZED) + updatedDemandOrders, err := keeper.ListDemandOrdersByStatus(ctx, commontypes.Status_FINALIZED, 0) suite.Require().NoError(err) // Validate that there are exactly demandOrderNum packets in total - pendingDemandOrders, err := keeper.ListDemandOrdersByStatus(ctx, commontypes.Status_PENDING) + pendingDemandOrders, err := keeper.ListDemandOrdersByStatus(ctx, commontypes.Status_PENDING, 0) suite.Require().NoError(err) totalDemandOrders := len(updatedDemandOrders) + len(pendingDemandOrders) suite.Require().Equal(demandOrdersNum, totalDemandOrders) diff --git a/x/eibc/keeper/grpc_query.go b/x/eibc/keeper/grpc_query.go index d3d945590..bb4640556 100644 --- a/x/eibc/keeper/grpc_query.go +++ b/x/eibc/keeper/grpc_query.go @@ -2,10 +2,9 @@ package keeper import ( "context" - "fmt" - "strings" sdk "github.com/cosmos/cosmos-sdk/types" + commontypes "github.com/dymensionxyz/dymension/v3/x/common/types" "github.com/dymensionxyz/dymension/v3/x/eibc/types" @@ -56,30 +55,41 @@ func (q Querier) DemandOrdersByStatus(goCtx context.Context, req *types.QueryDem if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } - if req.Status == "" { - return nil, status.Error(codes.InvalidArgument, "status must be provided") + // Get the demand orders by status, with optional filters + demandOrders, err := q.ListDemandOrdersByStatus(sdk.UnwrapSDKContext(goCtx), req.Status, int(req.Limit), filterOpts(req)...) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) } + // Construct the response + return &types.QueryDemandOrdersByStatusResponse{DemandOrders: demandOrders}, nil +} - // Convert string status to commontypes.Status - var statusValue commontypes.Status - switch strings.ToUpper(req.Status) { - case "PENDING": - statusValue = commontypes.Status_PENDING - case "FINALIZED": - statusValue = commontypes.Status_FINALIZED - case "REVERTED": - statusValue = commontypes.Status_REVERTED - default: - return nil, fmt.Errorf("invalid demand order status: %s", req.Status) +func filterOpts(req *types.QueryDemandOrdersByStatusRequest) []filterOption { + var opts []filterOption + if req.RollappId != "" { + opts = append(opts, isRollappId(req.RollappId)) } - ctx := sdk.UnwrapSDKContext(goCtx) + if req.Type != commontypes.RollappPacket_UNDEFINED { + opts = append(opts, isOrderType(req.Type)) + } + return opts +} - // Get the demand orders by status - demandOrders, err := q.ListDemandOrdersByStatus(ctx, statusValue) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) +type filterOption func(order types.DemandOrder) bool + +func isRollappId(rollappId string) filterOption { + return func(order types.DemandOrder) bool { + return order.RollappId == rollappId } +} - // Construct the response - return &types.QueryDemandOrdersByStatusResponse{DemandOrders: demandOrders}, nil +func isOrderType(orderType ...commontypes.RollappPacket_Type) filterOption { + return func(order types.DemandOrder) bool { + for _, ot := range orderType { + if order.Type == ot { + return true + } + } + return false + } } diff --git a/x/eibc/keeper/grpc_query_test.go b/x/eibc/keeper/grpc_query_test.go index 98985c95f..1e0066480 100644 --- a/x/eibc/keeper/grpc_query_test.go +++ b/x/eibc/keeper/grpc_query_test.go @@ -6,6 +6,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/dymensionxyz/dymension/v3/app/apptesting" commontypes "github.com/dymensionxyz/dymension/v3/x/common/types" "github.com/dymensionxyz/dymension/v3/x/eibc/types" @@ -76,7 +77,7 @@ func (suite *KeeperTestSuite) TestQueryDemandOrdersByStatus() { suite.Require().NoError(err) // Query demand orders by status - res, err := suite.queryClient.DemandOrdersByStatus(sdk.WrapSDKContext(suite.Ctx), &types.QueryDemandOrdersByStatusRequest{Status: status.String()}) + res, err := suite.queryClient.DemandOrdersByStatus(sdk.WrapSDKContext(suite.Ctx), &types.QueryDemandOrdersByStatusRequest{Status: status}) suite.Require().NoError(err) suite.Require().NotNil(res.DemandOrders) suite.Require().Len(res.DemandOrders, 1, fmt.Sprintf("Expected 1 demand order for status %s, but got %d", status, len(res.DemandOrders))) @@ -84,7 +85,7 @@ func (suite *KeeperTestSuite) TestQueryDemandOrdersByStatus() { } // Query with invalid status should return an error - res, err := suite.queryClient.DemandOrdersByStatus(sdk.WrapSDKContext(suite.Ctx), &types.QueryDemandOrdersByStatusRequest{Status: "INVALID"}) + res, err := suite.queryClient.DemandOrdersByStatus(sdk.WrapSDKContext(suite.Ctx), &types.QueryDemandOrdersByStatusRequest{Status: -1}) suite.Require().Error(err) suite.Require().Nil(res) } diff --git a/x/eibc/keeper/invariants.go b/x/eibc/keeper/invariants.go index 2358e99c1..fca63207c 100644 --- a/x/eibc/keeper/invariants.go +++ b/x/eibc/keeper/invariants.go @@ -4,6 +4,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" + commontypes "github.com/dymensionxyz/dymension/v3/x/common/types" "github.com/dymensionxyz/dymension/v3/x/eibc/types" ) @@ -29,17 +30,17 @@ func DemandOrderCountInvariant(k Keeper) sdk.Invariant { msg += fmt.Sprintf("list all demand orders failed: %v\n", err) broken = true } - pendingDemandOrders, err := k.ListDemandOrdersByStatus(ctx, commontypes.Status_PENDING) + pendingDemandOrders, err := k.ListDemandOrdersByStatus(ctx, commontypes.Status_PENDING, 0) if err != nil { msg += fmt.Sprintf("list pending demand orders failed: %v\n", err) broken = true } - revertedDemandOrders, err := k.ListDemandOrdersByStatus(ctx, commontypes.Status_REVERTED) + revertedDemandOrders, err := k.ListDemandOrdersByStatus(ctx, commontypes.Status_REVERTED, 0) if err != nil { msg += fmt.Sprintf("list reverted demand orders failed: %v\n", err) broken = true } - finalizedDemandOrders, err := k.ListDemandOrdersByStatus(ctx, commontypes.Status_FINALIZED) + finalizedDemandOrders, err := k.ListDemandOrdersByStatus(ctx, commontypes.Status_FINALIZED, 0) if err != nil { msg += fmt.Sprintf("list finalized demand orders failed: %v\n", err) broken = true diff --git a/x/eibc/keeper/keeper.go b/x/eibc/keeper/keeper.go index bdb24ff34..8d8797575 100644 --- a/x/eibc/keeper/keeper.go +++ b/x/eibc/keeper/keeper.go @@ -7,9 +7,10 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - commontypes "github.com/dymensionxyz/dymension/v3/x/common/types" "github.com/tendermint/tendermint/libs/log" + commontypes "github.com/dymensionxyz/dymension/v3/x/common/types" + "github.com/dymensionxyz/dymension/v3/x/eibc/types" ) @@ -156,10 +157,10 @@ func (k Keeper) ListAllDemandOrders( return list, nil } -func (k Keeper) ListDemandOrdersByStatus(ctx sdk.Context, status commontypes.Status) (list []*types.DemandOrder, err error) { +func (k Keeper) ListDemandOrdersByStatus(ctx sdk.Context, status commontypes.Status, limit int, opts ...filterOption) (list []*types.DemandOrder, err error) { store := ctx.KVStore(k.storeKey) - var statusPrefix []byte + var statusPrefix []byte switch status { case commontypes.Status_PENDING: statusPrefix = types.PendingDemandOrderKeyPrefix @@ -175,8 +176,16 @@ func (k Keeper) ListDemandOrdersByStatus(ctx sdk.Context, status commontypes.Sta defer iterator.Close() // nolint: errcheck for ; iterator.Valid(); iterator.Next() { + if limit > 0 && len(list) >= limit { + break + } var val types.DemandOrder k.cdc.MustUnmarshal(iterator.Value(), &val) + for _, opt := range opts { + if !opt(val) { + continue + } + } list = append(list, &val) } diff --git a/x/eibc/types/demand_order.go b/x/eibc/types/demand_order.go index 157849e5a..bef4cd8c0 100644 --- a/x/eibc/types/demand_order.go +++ b/x/eibc/types/demand_order.go @@ -9,6 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ibctransfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types" + commontypes "github.com/dymensionxyz/dymension/v3/x/common/types" ) @@ -25,6 +26,8 @@ func NewDemandOrder(rollappPacket commontypes.RollappPacket, price, fee math.Int Recipient: recipient, IsFulfilled: false, TrackingPacketStatus: commontypes.Status_PENDING, + RollappId: rollappPacket.RollappId, + Type: rollappPacket.Type, } } @@ -69,6 +72,9 @@ func (m *DemandOrder) GetEvents() []sdk.Attribute { sdk.NewAttribute(AttributeKeyFee, m.Fee.String()), sdk.NewAttribute(AttributeKeyIsFulfilled, strconv.FormatBool(m.IsFulfilled)), sdk.NewAttribute(AttributeKeyPacketStatus, m.TrackingPacketStatus.String()), + sdk.NewAttribute(AttributeKeyPacketKey, m.TrackingPacketKey), + sdk.NewAttribute(AttributeKeyRollappId, m.RollappId), + sdk.NewAttribute(AttributeKeyRecipient, m.Recipient), } return eventAttributes } diff --git a/x/eibc/types/demand_order.pb.go b/x/eibc/types/demand_order.pb.go index a4fc03be2..a510b3aef 100644 --- a/x/eibc/types/demand_order.pb.go +++ b/x/eibc/types/demand_order.pb.go @@ -40,6 +40,8 @@ type DemandOrder struct { Recipient string `protobuf:"bytes,5,opt,name=recipient,proto3" json:"recipient,omitempty"` IsFulfilled bool `protobuf:"varint,6,opt,name=is_fulfilled,json=isFulfilled,proto3" json:"is_fulfilled,omitempty"` TrackingPacketStatus types1.Status `protobuf:"varint,8,opt,name=tracking_packet_status,json=trackingPacketStatus,proto3,enum=dymensionxyz.dymension.common.Status" json:"tracking_packet_status,omitempty"` + RollappId string `protobuf:"bytes,9,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` + Type types1.RollappPacket_Type `protobuf:"varint,10,opt,name=type,proto3,enum=dymensionxyz.dymension.common.RollappPacket_Type" json:"type,omitempty"` } func (m *DemandOrder) Reset() { *m = DemandOrder{} } @@ -124,6 +126,20 @@ func (m *DemandOrder) GetTrackingPacketStatus() types1.Status { return types1.Status_PENDING } +func (m *DemandOrder) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *DemandOrder) GetType() types1.RollappPacket_Type { + if m != nil { + return m.Type + } + return types1.RollappPacket_ON_RECV +} + func init() { proto.RegisterType((*DemandOrder)(nil), "dymensionxyz.dymension.eibc.DemandOrder") } @@ -131,32 +147,36 @@ func init() { func init() { proto.RegisterFile("dymension/eibc/demand_order.proto", fileDescriptor_3808f42eed32f331) } var fileDescriptor_3808f42eed32f331 = []byte{ - // 400 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0xcd, 0x6e, 0xd4, 0x30, - 0x10, 0x4e, 0x36, 0xb4, 0x6a, 0xbd, 0xa8, 0x12, 0xa6, 0x42, 0xa1, 0x40, 0x9a, 0x22, 0x21, 0xe5, - 0x82, 0xcd, 0xb6, 0x6f, 0x50, 0x10, 0x97, 0x1e, 0x40, 0xe1, 0x06, 0x42, 0x51, 0x62, 0xcf, 0x06, - 0x2b, 0x1b, 0x3b, 0x8a, 0xbd, 0xd5, 0x86, 0xa7, 0xe0, 0x39, 0x90, 0x78, 0x8f, 0x3d, 0xee, 0x91, - 0x13, 0xa0, 0xdd, 0x17, 0x41, 0xb1, 0xf7, 0x0f, 0x24, 0x6e, 0x9c, 0xec, 0x99, 0xef, 0x9b, 0xf9, - 0xe6, 0x0f, 0x5d, 0xf0, 0xae, 0x06, 0xa9, 0x85, 0x92, 0x14, 0x44, 0xc1, 0x28, 0x87, 0x3a, 0x97, - 0x3c, 0x53, 0x2d, 0x87, 0x96, 0x34, 0xad, 0x32, 0x0a, 0x3f, 0xda, 0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, 0xe0, 0x0b, 0x74, 0x57, 0xe8, 0x6c, 0x3c, 0x9d, 0x8c, 0xc5, 0x64, 0x02, 0x3c, 0x3c, - 0x8c, 0xfd, 0xe4, 0x28, 0x1d, 0x0a, 0xfd, 0x7a, 0xe3, 0xc2, 0x1f, 0xd0, 0x83, 0xbf, 0x47, 0xe6, - 0x56, 0x12, 0x1e, 0xc5, 0x7e, 0x72, 0x72, 0xf9, 0x8c, 0xfc, 0x63, 0xcb, 0x6e, 0x7f, 0xe4, 0x9d, - 0x25, 0xa7, 0xa7, 0x7f, 0x0e, 0xd7, 0x79, 0xaf, 0x6f, 0xe6, 0xcb, 0xc8, 0x5f, 0x2c, 0x23, 0xff, - 0xd7, 0x32, 0xf2, 0xbf, 0xac, 0x22, 0x6f, 0xb1, 0x8a, 0xbc, 0xef, 0xab, 0xc8, 0x7b, 0x3f, 0xda, - 0x6b, 0x73, 0x5f, 0x60, 0x67, 0xd0, 0xdb, 0x2b, 0x3a, 0x73, 0xb7, 0x67, 0xbb, 0x2e, 0x0e, 0xed, - 0x0d, 0x5c, 0xfd, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x67, 0x3c, 0x82, 0x35, 0x9a, 0x02, 0x00, 0x00, + // 452 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xcd, 0x6e, 0x13, 0x31, + 0x10, 0xce, 0x26, 0x69, 0xd5, 0x38, 0xa8, 0x12, 0xa6, 0x42, 0xa6, 0xd0, 0x6d, 0x8a, 0x54, 0x69, + 0x2f, 0xd8, 0xa4, 0x7d, 0x83, 0xf2, 0x23, 0xa1, 0x1e, 0x40, 0x0b, 0x27, 0x10, 0x8a, 0x76, 0xed, + 0x49, 0xb0, 0xf6, 0xc7, 0xd6, 0xda, 0xa9, 0xba, 0x3c, 0x05, 0x12, 0x6f, 0xc1, 0x93, 0xf4, 0xd8, + 0x23, 0x27, 0x40, 0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, 0xff, 0x10, 0x5c, + 0x6f, 0xd3, 0x6d, 0xb7, 0x69, 0xa7, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x18, 0xe7, 0x93, 0xb4, + 0x27, 0x03, 0x00, 0x00, } func (m *DemandOrder) Marshal() (dAtA []byte, err error) { @@ -179,6 +199,18 @@ func (m *DemandOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Type != 0 { + i = encodeVarintDemandOrder(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x50 + } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintDemandOrder(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0x4a + } if m.TrackingPacketStatus != 0 { i = encodeVarintDemandOrder(dAtA, i, uint64(m.TrackingPacketStatus)) i-- @@ -293,6 +325,13 @@ func (m *DemandOrder) Size() (n int) { if m.TrackingPacketStatus != 0 { n += 1 + sovDemandOrder(uint64(m.TrackingPacketStatus)) } + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovDemandOrder(uint64(l)) + } + if m.Type != 0 { + n += 1 + sovDemandOrder(uint64(m.Type)) + } return n } @@ -534,6 +573,57 @@ func (m *DemandOrder) Unmarshal(dAtA []byte) error { break } } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollappId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDemandOrder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDemandOrder + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDemandOrder + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDemandOrder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= types1.RollappPacket_Type(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipDemandOrder(dAtA[iNdEx:]) diff --git a/x/eibc/types/query.pb.go b/x/eibc/types/query.pb.go index 526d8e200..34116b2ec 100644 --- a/x/eibc/types/query.pb.go +++ b/x/eibc/types/query.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-sdk/types/query" + types "github.com/dymensionxyz/dymension/v3/x/common/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -161,8 +162,14 @@ func (m *QueryGetDemandOrderRequest) GetId() string { // QueryDemandOrdersByStatusRequest is the request type for the Query/GetDemandOrdersByStatus RPC method. type QueryDemandOrdersByStatusRequest struct { - // id of the demand order to get - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + // status of the demand order + Status types.Status `protobuf:"varint,1,opt,name=status,proto3,enum=dymensionxyz.dymension.common.Status" json:"status,omitempty"` + // optional type + Type types.RollappPacket_Type `protobuf:"varint,2,opt,name=type,proto3,enum=dymensionxyz.dymension.common.RollappPacket_Type" json:"type,omitempty"` + // optional rollapp_id + RollappId string `protobuf:"bytes,3,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` + // optional limit + Limit int32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` } func (m *QueryDemandOrdersByStatusRequest) Reset() { *m = QueryDemandOrdersByStatusRequest{} } @@ -198,13 +205,34 @@ func (m *QueryDemandOrdersByStatusRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryDemandOrdersByStatusRequest proto.InternalMessageInfo -func (m *QueryDemandOrdersByStatusRequest) GetStatus() string { +func (m *QueryDemandOrdersByStatusRequest) GetStatus() types.Status { if m != nil { return m.Status } + return types.Status_PENDING +} + +func (m *QueryDemandOrdersByStatusRequest) GetType() types.RollappPacket_Type { + if m != nil { + return m.Type + } + return types.RollappPacket_ON_RECV +} + +func (m *QueryDemandOrdersByStatusRequest) GetRollappId() string { + if m != nil { + return m.RollappId + } return "" } +func (m *QueryDemandOrdersByStatusRequest) GetLimit() int32 { + if m != nil { + return m.Limit + } + return 0 +} + // QueryGetDemandOrderResponse is the response type for the Query/GetDemandOrder RPC method. type QueryGetDemandOrderResponse struct { // demand order with the given id @@ -309,39 +337,45 @@ func init() { func init() { proto.RegisterFile("dymension/eibc/query.proto", fileDescriptor_39216408ffc70aa8) } var fileDescriptor_39216408ffc70aa8 = []byte{ - // 503 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcd, 0x6a, 0x14, 0x31, - 0x1c, 0xdf, 0x59, 0xeb, 0x82, 0xff, 0x56, 0x85, 0xb8, 0x88, 0xcc, 0xca, 0xd8, 0x4e, 0x11, 0x8a, - 0xca, 0xa4, 0xdb, 0xc5, 0x0f, 0x14, 0x05, 0x17, 0x41, 0xa4, 0x88, 0xba, 0x5e, 0xc4, 0x8b, 0x64, - 0x36, 0x61, 0x8c, 0x38, 0x93, 0xe9, 0x24, 0x5b, 0x3a, 0x96, 0x5e, 0x7c, 0x02, 0xc1, 0x8b, 0x4f, - 0xe2, 0xc9, 0x07, 0xe8, 0xb1, 0xe8, 0xc5, 0x93, 0xc8, 0xae, 0x0f, 0x22, 0x93, 0xa4, 0x35, 0xd6, - 0x75, 0xfa, 0x71, 0xdb, 0x24, 0xbf, 0xcf, 0xe4, 0xbf, 0x03, 0x3e, 0x2d, 0x53, 0x96, 0x49, 0x2e, - 0x32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, 0x27, 0x41, 0xe3, - 0x65, 0x37, 0xe1, 0xea, 0xf5, 0x28, 0x8e, 0x86, 0x22, 0xfd, 0x9f, 0xf0, 0x7a, 0x0f, 0x6f, 0x18, - 0x75, 0x55, 0xe6, 0x4c, 0xc6, 0x2d, 0xfd, 0x19, 0xe9, 0xfd, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x37, - 0x0c, 0x43, 0xa0, 0x21, 0x05, 0x00, 0x00, + // 602 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4f, 0x6b, 0x13, 0x4f, + 0x18, 0xce, 0xa6, 0x69, 0xa0, 0xd3, 0xfe, 0xfa, 0x83, 0x31, 0x87, 0xb0, 0xb5, 0x6b, 0xba, 0x25, + 0x10, 0x54, 0x76, 0x9a, 0x04, 0xff, 0x80, 0x54, 0x30, 0x28, 0x52, 0x8a, 0x58, 0x57, 0x0f, 0xe2, + 0xa5, 0x4c, 0xb2, 0xc3, 0x3a, 0x9a, 0xdd, 0xd9, 0xee, 0x4c, 0x4a, 0xd7, 0xd2, 0x8b, 0x9f, 0x40, + 0xf0, 0xe2, 0x27, 0xf1, 0xe4, 0x07, 0xe8, 0xb1, 0xe8, 0xc5, 0x8b, 0x22, 0x89, 0x1f, 0x44, 0x76, + 0x66, 0xd2, 0xae, 0x6d, 0xba, 0x69, 0xbd, 0x65, 0xf6, 0x7d, 0x9e, 0xf7, 0x79, 0x9f, 0x67, 0xe6, + 0x0d, 0x30, 0xbd, 0x24, 0x20, 0x21, 0xa7, 0x2c, 0x44, 0x84, 0x76, 0x7b, 0x68, 0x67, 0x40, 0xe2, + 0xc4, 0x89, 0x62, 0x26, 0x18, 0x5c, 0x3a, 0xae, 0xed, 0x25, 0xef, 0x9c, 0xe3, 0x83, 0x93, 0x02, + 0xcd, 0x8a, 0xcf, 0x7c, 0x26, 0x71, 0x28, 0xfd, 0xa5, 0x28, 0xe6, 0x55, 0x9f, 0x31, 0xbf, 0x4f, + 0x10, 0x8e, 0x28, 0xc2, 0x61, 0xc8, 0x04, 0x16, 0x94, 0x85, 0x5c, 0x57, 0xaf, 0xf7, 0x18, 0x0f, + 0x18, 0x47, 0x5d, 0xcc, 0x89, 0x52, 0x42, 0xbb, 0xcd, 0x2e, 0x11, 0xb8, 0x89, 0x22, 0xec, 0xd3, + 0x50, 0x82, 0x35, 0x76, 0xe9, 0xd4, 0x60, 0x11, 0x8e, 0x71, 0x30, 0x6e, 0xb4, 0x72, 0xaa, 0xe8, + 0x91, 0x00, 0x87, 0xde, 0x36, 0x8b, 0x3d, 0x12, 0x6b, 0xc8, 0xf2, 0x09, 0xa4, 0xc7, 0x82, 0x80, + 0x85, 0x88, 0x0b, 0x2c, 0x06, 0xe3, 0x0e, 0xf5, 0x33, 0xe5, 0x98, 0xf5, 0xfb, 0x38, 0x8a, 0xb6, + 0x23, 0xdc, 0x7b, 0x4b, 0x84, 0x82, 0xd9, 0x15, 0x00, 0x9f, 0xa5, 0x73, 0x6e, 0x49, 0x75, 0x97, + 0xec, 0x0c, 0x08, 0x17, 0xf6, 0x4b, 0x70, 0xe5, 0xaf, 0xaf, 0x3c, 0x62, 0x21, 0x27, 0xf0, 0x01, + 0x28, 0xab, 0x29, 0xab, 0x46, 0xcd, 0x68, 0xcc, 0xb7, 0x56, 0x9d, 0x9c, 0x00, 0x1d, 0x45, 0xee, + 0x94, 0x0e, 0x7f, 0x5e, 0x2b, 0xb8, 0x9a, 0x68, 0xdf, 0x04, 0xa6, 0xec, 0xfc, 0x98, 0x88, 0x87, + 0xd2, 0xd3, 0xd3, 0xd4, 0x92, 0xd6, 0x85, 0x8b, 0xa0, 0x48, 0x3d, 0xd9, 0x7c, 0xce, 0x2d, 0x52, + 0xcf, 0xfe, 0x61, 0x80, 0x9a, 0x84, 0x67, 0xb0, 0xbc, 0x93, 0x3c, 0x97, 0x46, 0xc7, 0xa4, 0x75, + 0x50, 0x56, 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fb, 0xd4, 0x3b, 0x80, 0x5f, 0x0d, 0x50, 0x99, + 0x74, 0xa7, 0x70, 0x7d, 0xfa, 0x28, 0x39, 0x6b, 0x65, 0xde, 0xff, 0x57, 0xba, 0xf6, 0x73, 0x4f, + 0xfa, 0xb9, 0x05, 0xdb, 0x17, 0xf6, 0xc3, 0xd1, 0xbe, 0xda, 0xc9, 0x83, 0xce, 0xe6, 0xe1, 0xd0, + 0x32, 0x8e, 0x86, 0x96, 0xf1, 0x6b, 0x68, 0x19, 0x1f, 0x46, 0x56, 0xe1, 0x68, 0x64, 0x15, 0xbe, + 0x8f, 0xac, 0xc2, 0xab, 0xa6, 0x4f, 0xc5, 0xeb, 0x41, 0x37, 0xdd, 0xc7, 0xf3, 0x1a, 0xef, 0xb6, + 0xd1, 0x9e, 0xea, 0x9e, 0x6e, 0x26, 0xef, 0x96, 0xe5, 0x5f, 0x5d, 0xfb, 0x4f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x33, 0xe3, 0x7c, 0xed, 0x0b, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -608,12 +642,27 @@ func (m *QueryDemandOrdersByStatusRequest) MarshalToSizedBuffer(dAtA []byte) (in _ = i var l int _ = l - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Status))) + if m.Limit != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Limit)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x20 + } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0x1a + } + if m.Type != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x10 + } + if m.Status != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -740,10 +789,19 @@ func (m *QueryDemandOrdersByStatusRequest) Size() (n int) { } var l int _ = l - l = len(m.Status) + if m.Status != 0 { + n += 1 + sovQuery(uint64(m.Status)) + } + if m.Type != 0 { + n += 1 + sovQuery(uint64(m.Type)) + } + l = len(m.RollappId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.Limit != 0 { + n += 1 + sovQuery(uint64(m.Limit)) + } return n } @@ -1026,9 +1084,47 @@ func (m *QueryDemandOrdersByStatusRequest) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= types.Status(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= types.RollappPacket_Type(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollappId", wireType) + } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { @@ -1055,8 +1151,27 @@ func (m *QueryDemandOrdersByStatusRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Status = string(dAtA[iNdEx:postIndex]) + m.RollappId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/eibc/types/query.pb.gw.go b/x/eibc/types/query.pb.gw.go index 84dd89804..e99aee2bd 100644 --- a/x/eibc/types/query.pb.gw.go +++ b/x/eibc/types/query.pb.gw.go @@ -13,6 +13,7 @@ import ( "io" "net/http" + types_0 "github.com/dymensionxyz/dymension/v3/x/common/types" "github.com/golang/protobuf/descriptor" "github.com/golang/protobuf/proto" "github.com/grpc-ecosystem/grpc-gateway/runtime" @@ -105,12 +106,17 @@ func local_request_Query_DemandOrderById_0(ctx context.Context, marshaler runtim } +var ( + filter_Query_DemandOrdersByStatus_0 = &utilities.DoubleArray{Encoding: map[string]int{"status": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + func request_Query_DemandOrdersByStatus_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryDemandOrdersByStatusRequest var metadata runtime.ServerMetadata var ( val string + e int32 ok bool err error _ = err @@ -121,12 +127,21 @@ func request_Query_DemandOrdersByStatus_0(ctx context.Context, marshaler runtime return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "status") } - protoReq.Status, err = runtime.String(val) + e, err = runtime.Enum(val, types_0.Status_value) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "status", err) } + protoReq.Status = types_0.Status(e) + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DemandOrdersByStatus_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.DemandOrdersByStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err @@ -138,6 +153,7 @@ func local_request_Query_DemandOrdersByStatus_0(ctx context.Context, marshaler r var ( val string + e int32 ok bool err error _ = err @@ -148,12 +164,21 @@ func local_request_Query_DemandOrdersByStatus_0(ctx context.Context, marshaler r return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "status") } - protoReq.Status, err = runtime.String(val) + e, err = runtime.Enum(val, types_0.Status_value) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "status", err) } + protoReq.Status = types_0.Status(e) + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DemandOrdersByStatus_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.DemandOrdersByStatus(ctx, &protoReq) return msg, metadata, err diff --git a/x/eibc/types/types.go b/x/eibc/types/types.go index 7fae4a2b1..eadc8fe52 100644 --- a/x/eibc/types/types.go +++ b/x/eibc/types/types.go @@ -8,4 +8,7 @@ const ( AttributeKeyFee = "fee" AttributeKeyIsFulfilled = "is_fulfilled" AttributeKeyPacketStatus = "packet_status" + AttributeKeyPacketKey = "packet_key" + AttributeKeyRollappId = "rollapp_id" + AttributeKeyRecipient = "recipient" )