From 49b17e0de5e4d2fa5d13623e78630d3f5bd7b0ae Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 29 Mar 2023 16:52:47 +0530 Subject: [PATCH 001/155] adding modules --- app/app.go | 37 ++ proto/comdex/newauc/v1beta1/genesis.proto | 11 + proto/comdex/newauc/v1beta1/params.proto | 11 + proto/comdex/newauc/v1beta1/query.proto | 22 + proto/comdex/newauc/v1beta1/tx.proto | 8 + proto/comdex/newliq/v1beta1/genesis.proto | 11 + proto/comdex/newliq/v1beta1/params.proto | 11 + proto/comdex/newliq/v1beta1/query.proto | 22 + proto/comdex/newliq/v1beta1/tx.proto | 8 + testutil/keeper/newauc.go | 53 +++ testutil/keeper/newliq.go | 53 +++ x/newauc/client/cli/query.go | 32 ++ x/newauc/client/cli/query_params.go | 34 ++ x/newauc/client/cli/tx.go | 36 ++ x/newauc/genesis.go | 24 + x/newauc/handler.go | 26 ++ x/newauc/keeper/grpc_query.go | 7 + x/newauc/keeper/grpc_query_params.go | 19 + x/newauc/keeper/grpc_query_params_test.go | 21 + x/newauc/keeper/keeper.go | 50 ++ x/newauc/keeper/msg_server.go | 17 + x/newauc/keeper/msg_server_test.go | 16 + x/newauc/keeper/params.go | 18 + x/newauc/keeper/params_test.go | 18 + x/newauc/module.go | 177 +++++++ x/newauc/module_simulation.go | 65 +++ x/newauc/simulation/simap.go | 15 + x/newauc/types/codec.go | 23 + x/newauc/types/errors.go | 13 + x/newauc/types/expected_keepers.go | 22 + x/newauc/types/genesis.go | 24 + x/newauc/types/genesis.pb.go | 322 +++++++++++++ x/newauc/types/genesis_test.go | 40 ++ x/newauc/types/keys.go | 26 ++ x/newauc/types/params.go | 47 ++ x/newauc/types/params.pb.go | 266 +++++++++++ x/newauc/types/query.pb.go | 533 ++++++++++++++++++++++ x/newauc/types/query.pb.gw.go | 153 +++++++ x/newauc/types/tx.pb.go | 81 ++++ x/newauc/types/types.go | 1 + x/newliq/client/cli/query.go | 32 ++ x/newliq/client/cli/query_params.go | 34 ++ x/newliq/client/cli/tx.go | 36 ++ x/newliq/genesis.go | 24 + x/newliq/handler.go | 26 ++ x/newliq/keeper/grpc_query.go | 7 + x/newliq/keeper/grpc_query_params.go | 19 + x/newliq/keeper/grpc_query_params_test.go | 21 + x/newliq/keeper/keeper.go | 50 ++ x/newliq/keeper/msg_server.go | 17 + x/newliq/keeper/msg_server_test.go | 16 + x/newliq/keeper/params.go | 18 + x/newliq/keeper/params_test.go | 18 + x/newliq/module.go | 177 +++++++ x/newliq/module_simulation.go | 65 +++ x/newliq/simulation/simap.go | 15 + x/newliq/types/codec.go | 23 + x/newliq/types/errors.go | 13 + x/newliq/types/expected_keepers.go | 22 + x/newliq/types/genesis.go | 24 + x/newliq/types/genesis.pb.go | 322 +++++++++++++ x/newliq/types/genesis_test.go | 40 ++ x/newliq/types/keys.go | 26 ++ x/newliq/types/params.go | 47 ++ x/newliq/types/params.pb.go | 266 +++++++++++ x/newliq/types/query.pb.go | 533 ++++++++++++++++++++++ x/newliq/types/query.pb.gw.go | 153 +++++++ x/newliq/types/tx.pb.go | 81 ++++ x/newliq/types/types.go | 1 + 69 files changed, 4499 insertions(+) create mode 100644 proto/comdex/newauc/v1beta1/genesis.proto create mode 100644 proto/comdex/newauc/v1beta1/params.proto create mode 100644 proto/comdex/newauc/v1beta1/query.proto create mode 100644 proto/comdex/newauc/v1beta1/tx.proto create mode 100644 proto/comdex/newliq/v1beta1/genesis.proto create mode 100644 proto/comdex/newliq/v1beta1/params.proto create mode 100644 proto/comdex/newliq/v1beta1/query.proto create mode 100644 proto/comdex/newliq/v1beta1/tx.proto create mode 100644 testutil/keeper/newauc.go create mode 100644 testutil/keeper/newliq.go create mode 100644 x/newauc/client/cli/query.go create mode 100644 x/newauc/client/cli/query_params.go create mode 100644 x/newauc/client/cli/tx.go create mode 100644 x/newauc/genesis.go create mode 100644 x/newauc/handler.go create mode 100644 x/newauc/keeper/grpc_query.go create mode 100644 x/newauc/keeper/grpc_query_params.go create mode 100644 x/newauc/keeper/grpc_query_params_test.go create mode 100644 x/newauc/keeper/keeper.go create mode 100644 x/newauc/keeper/msg_server.go create mode 100644 x/newauc/keeper/msg_server_test.go create mode 100644 x/newauc/keeper/params.go create mode 100644 x/newauc/keeper/params_test.go create mode 100644 x/newauc/module.go create mode 100644 x/newauc/module_simulation.go create mode 100644 x/newauc/simulation/simap.go create mode 100644 x/newauc/types/codec.go create mode 100644 x/newauc/types/errors.go create mode 100644 x/newauc/types/expected_keepers.go create mode 100644 x/newauc/types/genesis.go create mode 100644 x/newauc/types/genesis.pb.go create mode 100644 x/newauc/types/genesis_test.go create mode 100644 x/newauc/types/keys.go create mode 100644 x/newauc/types/params.go create mode 100644 x/newauc/types/params.pb.go create mode 100644 x/newauc/types/query.pb.go create mode 100644 x/newauc/types/query.pb.gw.go create mode 100644 x/newauc/types/tx.pb.go create mode 100644 x/newauc/types/types.go create mode 100644 x/newliq/client/cli/query.go create mode 100644 x/newliq/client/cli/query_params.go create mode 100644 x/newliq/client/cli/tx.go create mode 100644 x/newliq/genesis.go create mode 100644 x/newliq/handler.go create mode 100644 x/newliq/keeper/grpc_query.go create mode 100644 x/newliq/keeper/grpc_query_params.go create mode 100644 x/newliq/keeper/grpc_query_params_test.go create mode 100644 x/newliq/keeper/keeper.go create mode 100644 x/newliq/keeper/msg_server.go create mode 100644 x/newliq/keeper/msg_server_test.go create mode 100644 x/newliq/keeper/params.go create mode 100644 x/newliq/keeper/params_test.go create mode 100644 x/newliq/module.go create mode 100644 x/newliq/module_simulation.go create mode 100644 x/newliq/simulation/simap.go create mode 100644 x/newliq/types/codec.go create mode 100644 x/newliq/types/errors.go create mode 100644 x/newliq/types/expected_keepers.go create mode 100644 x/newliq/types/genesis.go create mode 100644 x/newliq/types/genesis.pb.go create mode 100644 x/newliq/types/genesis_test.go create mode 100644 x/newliq/types/keys.go create mode 100644 x/newliq/types/params.go create mode 100644 x/newliq/types/params.pb.go create mode 100644 x/newliq/types/query.pb.go create mode 100644 x/newliq/types/query.pb.gw.go create mode 100644 x/newliq/types/tx.pb.go create mode 100644 x/newliq/types/types.go diff --git a/app/app.go b/app/app.go index c4a7064e3..b650cc710 100644 --- a/app/app.go +++ b/app/app.go @@ -164,6 +164,14 @@ import ( liquiditykeeper "github.com/comdex-official/comdex/x/liquidity/keeper" liquiditytypes "github.com/comdex-official/comdex/x/liquidity/types" + "github.com/comdex-official/comdex/x/newliq" + newliqkeeper "github.com/comdex-official/comdex/x/newliq/keeper" + newliqtypes "github.com/comdex-official/comdex/x/newliq/types" + + "github.com/comdex-official/comdex/x/newauc" + newauckeeper "github.com/comdex-official/comdex/x/newauc/keeper" + newauctypes "github.com/comdex-official/comdex/x/newauc/types" + cwasm "github.com/comdex-official/comdex/app/wasm" mv10 "github.com/comdex-official/comdex/app/upgrades/mainnet/v10" @@ -270,6 +278,8 @@ var ( liquidity.AppModuleBasic{}, rewards.AppModuleBasic{}, ica.AppModuleBasic{}, + newliq.AppModuleBasic{}, + newauc.AppModuleBasic{}, ) ) @@ -343,6 +353,8 @@ type App struct { TokenmintKeeper tokenmintkeeper.Keeper LiquidityKeeper liquiditykeeper.Keeper Rewardskeeper rewardskeeper.Keeper + NewliqKeeper newliqkeeper.Keeper + NewaucKeeper newauckeeper.Keeper WasmKeeper wasm.Keeper // the module manager @@ -379,6 +391,7 @@ func New( markettypes.StoreKey, bandoraclemoduletypes.StoreKey, lockertypes.StoreKey, wasm.StoreKey, authzkeeper.StoreKey, auctiontypes.StoreKey, tokenminttypes.StoreKey, rewardstypes.StoreKey, feegrant.StoreKey, liquiditytypes.StoreKey, esmtypes.ModuleName, lendtypes.StoreKey, + newliqtypes.StoreKey, newauctypes.StoreKey, ) ) @@ -432,6 +445,8 @@ func New( app.ParamsKeeper.Subspace(tokenminttypes.ModuleName) app.ParamsKeeper.Subspace(liquiditytypes.ModuleName) app.ParamsKeeper.Subspace(rewardstypes.ModuleName) + app.ParamsKeeper.Subspace(newliqtypes.ModuleName) + app.ParamsKeeper.Subspace(newauctypes.ModuleName) // set the BaseApp's parameter store baseApp.SetParamStore( @@ -735,7 +750,21 @@ func New( &app.EsmKeeper, &app.LendKeeper, ) + app.NewliqKeeper = newliqkeeper.NewKeeper( + app.cdc, + app.keys[lendtypes.StoreKey], + app.keys[lendtypes.StoreKey], + app.GetSubspace(lendtypes.ModuleName), + app.BankKeeper, + ) + app.NewaucKeeper = newauckeeper.NewKeeper( + app.cdc, + app.keys[lendtypes.StoreKey], + app.keys[lendtypes.StoreKey], + app.GetSubspace(lendtypes.ModuleName), + app.BankKeeper, + ) wasmDir := filepath.Join(homePath, "wasm") wasmConfig, err := wasm.ReadWasmConfig(appOptions) if err != nil { @@ -857,6 +886,8 @@ func New( tokenmint.NewAppModule(app.cdc, app.TokenmintKeeper, app.AccountKeeper, app.BankKeeper), liquidity.NewAppModule(app.cdc, app.LiquidityKeeper, app.AccountKeeper, app.BankKeeper, app.AssetKeeper), rewards.NewAppModule(app.cdc, app.Rewardskeeper, app.AccountKeeper, app.BankKeeper), + newliq.NewAppModule(app.cdc, app.NewliqKeeper, app.AccountKeeper, app.BankKeeper), + newauc.NewAppModule(app.cdc, app.NewaucKeeper, app.AccountKeeper, app.BankKeeper), ) // During begin block slashing happens after distr.BeginBlocker so that @@ -897,6 +928,8 @@ func New( liquiditytypes.ModuleName, lendtypes.ModuleName, esmtypes.ModuleName, + newliqtypes.ModuleName, + newauctypes.ModuleName, ) app.mm.SetOrderEndBlockers( @@ -933,6 +966,8 @@ func New( rewardstypes.ModuleName, liquiditytypes.ModuleName, esmtypes.ModuleName, + newliqtypes.ModuleName, + newauctypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -973,6 +1008,8 @@ func New( liquiditytypes.ModuleName, rewardstypes.ModuleName, crisistypes.ModuleName, + newliqtypes.ModuleName, + newauctypes.ModuleName, ) app.mm.RegisterInvariants(&app.CrisisKeeper) diff --git a/proto/comdex/newauc/v1beta1/genesis.proto b/proto/comdex/newauc/v1beta1/genesis.proto new file mode 100644 index 000000000..6c302fc29 --- /dev/null +++ b/proto/comdex/newauc/v1beta1/genesis.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package comdex.newauc.v1beta1; + +import "gogoproto/gogo.proto"; +import "comdex/newauc/v1beta1/params.proto"; + +option go_package = "github.com/comdex-official/comdex/x/newauc/types"; + +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/comdex/newauc/v1beta1/params.proto b/proto/comdex/newauc/v1beta1/params.proto new file mode 100644 index 000000000..61676fd84 --- /dev/null +++ b/proto/comdex/newauc/v1beta1/params.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package comdex.newauc.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/comdex-official/comdex/x/newauc/types"; + +message Params { + option (gogoproto.goproto_stringer) = false; + +} diff --git a/proto/comdex/newauc/v1beta1/query.proto b/proto/comdex/newauc/v1beta1/query.proto new file mode 100644 index 000000000..efc1b76de --- /dev/null +++ b/proto/comdex/newauc/v1beta1/query.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package comdex.newauc.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "comdex/newauc/v1beta1/params.proto"; + +option go_package = "github.com/comdex-official/comdex/x/newauc/types"; + +service Query { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/comdex-official/comdex/newauc/params"; + } +} + +message QueryParamsRequest {} + +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false]; +} + diff --git a/proto/comdex/newauc/v1beta1/tx.proto b/proto/comdex/newauc/v1beta1/tx.proto new file mode 100644 index 000000000..849955cf2 --- /dev/null +++ b/proto/comdex/newauc/v1beta1/tx.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package comdex.newauc.v1beta1; + + +option go_package = "github.com/comdex-official/comdex/x/newauc/types"; + +service Msg { +} diff --git a/proto/comdex/newliq/v1beta1/genesis.proto b/proto/comdex/newliq/v1beta1/genesis.proto new file mode 100644 index 000000000..cf5dccccd --- /dev/null +++ b/proto/comdex/newliq/v1beta1/genesis.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package comdex.newliq.v1beta1; + +import "gogoproto/gogo.proto"; +import "comdex/newliq/v1beta1/params.proto"; + +option go_package = "github.com/comdex-official/comdex/x/newliq/types"; + +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/comdex/newliq/v1beta1/params.proto b/proto/comdex/newliq/v1beta1/params.proto new file mode 100644 index 000000000..865f91dbc --- /dev/null +++ b/proto/comdex/newliq/v1beta1/params.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package comdex.newliq.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/comdex-official/comdex/x/newliq/types"; + +message Params { + option (gogoproto.goproto_stringer) = false; + +} diff --git a/proto/comdex/newliq/v1beta1/query.proto b/proto/comdex/newliq/v1beta1/query.proto new file mode 100644 index 000000000..4d9e8dac0 --- /dev/null +++ b/proto/comdex/newliq/v1beta1/query.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package comdex.newliq.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "comdex/newliq/v1beta1/params.proto"; + +option go_package = "github.com/comdex-official/comdex/x/newliq/types"; + +service Query { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/comdex-official/comdex/newliq/params"; + } +} + +message QueryParamsRequest {} + +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false]; +} + diff --git a/proto/comdex/newliq/v1beta1/tx.proto b/proto/comdex/newliq/v1beta1/tx.proto new file mode 100644 index 000000000..7fbf7d0df --- /dev/null +++ b/proto/comdex/newliq/v1beta1/tx.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package comdex.newliq.v1beta1; + + +option go_package = "github.com/comdex-official/comdex/x/newliq/types"; + +service Msg { +} diff --git a/testutil/keeper/newauc.go b/testutil/keeper/newauc.go new file mode 100644 index 000000000..a2207a971 --- /dev/null +++ b/testutil/keeper/newauc.go @@ -0,0 +1,53 @@ +package keeper + +//import ( +// "testing" +// +// "github.com/comdex-official/comdex/x/newauc/keeper" +// "github.com/comdex-official/comdex/x/newauc/types" +// "github.com/cosmos/cosmos-sdk/codec" +// codectypes "github.com/cosmos/cosmos-sdk/codec/types" +// "github.com/cosmos/cosmos-sdk/store" +// storetypes "github.com/cosmos/cosmos-sdk/store/types" +// sdk "github.com/cosmos/cosmos-sdk/types" +// typesparams "github.com/cosmos/cosmos-sdk/x/params/types" +// "github.com/stretchr/testify/require" +// "github.com/tendermint/tendermint/libs/log" +// tmproto "github.com/tendermint/tendermint/proto/tendermint/types" +// tmdb "github.com/tendermint/tm-db" +//) +// +//func NewaucKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { +// storeKey := sdk.NewKVStoreKey(types.StoreKey) +// memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) +// +// db := tmdb.NewMemDB() +// stateStore := store.NewCommitMultiStore(db) +// stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) +// stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) +// require.NoError(t, stateStore.LoadLatestVersion()) +// +// registry := codectypes.NewInterfaceRegistry() +// cdc := codec.NewProtoCodec(registry) +// +// paramsSubspace := typesparams.NewSubspace(cdc, +// types.Amino, +// storeKey, +// memStoreKey, +// "NewaucParams", +// ) +// k := keeper.NewKeeper( +// cdc, +// storeKey, +// memStoreKey, +// paramsSubspace, +// nil, +// ) +// +// ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) +// +// // Initialize params +// k.SetParams(ctx, types.DefaultParams()) +// +// return k, ctx +//} diff --git a/testutil/keeper/newliq.go b/testutil/keeper/newliq.go new file mode 100644 index 000000000..b0b804630 --- /dev/null +++ b/testutil/keeper/newliq.go @@ -0,0 +1,53 @@ +package keeper + +//import ( +// "testing" +// +// "github.com/comdex-official/comdex/x/newliq/keeper" +// "github.com/comdex-official/comdex/x/newliq/types" +// "github.com/cosmos/cosmos-sdk/codec" +// codectypes "github.com/cosmos/cosmos-sdk/codec/types" +// "github.com/cosmos/cosmos-sdk/store" +// storetypes "github.com/cosmos/cosmos-sdk/store/types" +// sdk "github.com/cosmos/cosmos-sdk/types" +// typesparams "github.com/cosmos/cosmos-sdk/x/params/types" +// "github.com/stretchr/testify/require" +// "github.com/tendermint/tendermint/libs/log" +// tmproto "github.com/tendermint/tendermint/proto/tendermint/types" +// tmdb "github.com/tendermint/tm-db" +//) +// +//func NewliqKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { +// storeKey := sdk.NewKVStoreKey(types.StoreKey) +// memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) +// +// db := tmdb.NewMemDB() +// stateStore := store.NewCommitMultiStore(db) +// stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) +// stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) +// require.NoError(t, stateStore.LoadLatestVersion()) +// +// registry := codectypes.NewInterfaceRegistry() +// cdc := codec.NewProtoCodec(registry) +// +// paramsSubspace := typesparams.NewSubspace(cdc, +// types.Amino, +// storeKey, +// memStoreKey, +// "NewliqParams", +// ) +// k := keeper.NewKeeper( +// cdc, +// storeKey, +// memStoreKey, +// paramsSubspace, +// nil, +// ) +// +// ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) +// +// // Initialize params +// k.SetParams(ctx, types.DefaultParams()) +// +// return k, ctx +//} diff --git a/x/newauc/client/cli/query.go b/x/newauc/client/cli/query.go new file mode 100644 index 000000000..cc97d878f --- /dev/null +++ b/x/newauc/client/cli/query.go @@ -0,0 +1,32 @@ +package cli + +import ( + "fmt" + // "strings" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + // sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/comdex-official/comdex/x/newauc/types" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group newauc queries under a subcommand + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdQueryParams()) + // this line is used by starport scaffolding # 1 + + return cmd +} + diff --git a/x/newauc/client/cli/query_params.go b/x/newauc/client/cli/query_params.go new file mode 100644 index 000000000..60f723740 --- /dev/null +++ b/x/newauc/client/cli/query_params.go @@ -0,0 +1,34 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + "github.com/comdex-official/comdex/x/newauc/types" +) + +func CmdQueryParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Short: "shows the parameters of the module", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/newauc/client/cli/tx.go b/x/newauc/client/cli/tx.go new file mode 100644 index 000000000..a51727b0a --- /dev/null +++ b/x/newauc/client/cli/tx.go @@ -0,0 +1,36 @@ +package cli + +import ( + "fmt" + "time" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/comdex-official/comdex/x/newauc/types" +) + +var ( + DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) +) + +const ( + flagPacketTimeoutTimestamp = "packet-timeout-timestamp" + listSeparator = "," +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/newauc/genesis.go b/x/newauc/genesis.go new file mode 100644 index 000000000..7d2111941 --- /dev/null +++ b/x/newauc/genesis.go @@ -0,0 +1,24 @@ +package newauc + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/comdex-official/comdex/x/newauc/keeper" + "github.com/comdex-official/comdex/x/newauc/types" +) + +// InitGenesis initializes the capability module's state from a provided genesis +// state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + // this line is used by starport scaffolding # genesis/module/init + k.SetParams(ctx, genState.Params) +} + +// ExportGenesis returns the capability module's exported genesis. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + genesis.Params = k.GetParams(ctx) + + // this line is used by starport scaffolding # genesis/module/export + + return genesis +} diff --git a/x/newauc/handler.go b/x/newauc/handler.go new file mode 100644 index 000000000..ca40af610 --- /dev/null +++ b/x/newauc/handler.go @@ -0,0 +1,26 @@ +package newauc + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/comdex-official/comdex/x/newauc/keeper" + "github.com/comdex-official/comdex/x/newauc/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// NewHandler ... +func NewHandler(k keeper.Keeper) sdk.Handler { + // this line is used by starport scaffolding # handler/msgServer + + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { + ctx = ctx.WithEventManager(sdk.NewEventManager()) + + switch msg := msg.(type) { + // this line is used by starport scaffolding # 1 + default: + errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + } + } +} diff --git a/x/newauc/keeper/grpc_query.go b/x/newauc/keeper/grpc_query.go new file mode 100644 index 000000000..f2cd806e0 --- /dev/null +++ b/x/newauc/keeper/grpc_query.go @@ -0,0 +1,7 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/newauc/types" +) + +var _ types.QueryServer = Keeper{} diff --git a/x/newauc/keeper/grpc_query_params.go b/x/newauc/keeper/grpc_query_params.go new file mode 100644 index 000000000..52fb5cbaa --- /dev/null +++ b/x/newauc/keeper/grpc_query_params.go @@ -0,0 +1,19 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/comdex-official/comdex/x/newauc/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} diff --git a/x/newauc/keeper/grpc_query_params_test.go b/x/newauc/keeper/grpc_query_params_test.go new file mode 100644 index 000000000..e4e2fdbac --- /dev/null +++ b/x/newauc/keeper/grpc_query_params_test.go @@ -0,0 +1,21 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + testkeeper "github.com/comdex-official/comdex/testutil/keeper" + "github.com/comdex-official/comdex/x/newauc/types" +) + +func TestParamsQuery(t *testing.T) { + keeper, ctx := testkeeper.NewaucKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + params := types.DefaultParams() + keeper.SetParams(ctx, params) + + response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) + require.NoError(t, err) + require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +} diff --git a/x/newauc/keeper/keeper.go b/x/newauc/keeper/keeper.go new file mode 100644 index 000000000..b97affd10 --- /dev/null +++ b/x/newauc/keeper/keeper.go @@ -0,0 +1,50 @@ +package keeper + +import ( + "fmt" + + "github.com/tendermint/tendermint/libs/log" + + "github.com/comdex-official/comdex/x/newauc/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey + paramstore paramtypes.Subspace + + bankKeeper types.BankKeeper + } +) + +func NewKeeper( + cdc codec.BinaryCodec, + storeKey, + memKey sdk.StoreKey, + ps paramtypes.Subspace, + + bankKeeper types.BankKeeper, +) Keeper { + // set KeyTable if it has not already been set + if !ps.HasKeyTable() { + ps = ps.WithKeyTable(types.ParamKeyTable()) + } + + return Keeper{ + + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + paramstore: ps, + bankKeeper: bankKeeper, + } +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} diff --git a/x/newauc/keeper/msg_server.go b/x/newauc/keeper/msg_server.go new file mode 100644 index 000000000..d68a408cf --- /dev/null +++ b/x/newauc/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/newauc/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} diff --git a/x/newauc/keeper/msg_server_test.go b/x/newauc/keeper/msg_server_test.go new file mode 100644 index 000000000..b3c9ed430 --- /dev/null +++ b/x/newauc/keeper/msg_server_test.go @@ -0,0 +1,16 @@ +package keeper_test + +import ( + "context" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/comdex-official/comdex/x/newauc/types" + "github.com/comdex-official/comdex/x/newauc/keeper" + keepertest "github.com/comdex-official/comdex/testutil/keeper" +) + +func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { + k, ctx := keepertest.NewaucKeeper(t) + return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) +} diff --git a/x/newauc/keeper/params.go b/x/newauc/keeper/params.go new file mode 100644 index 000000000..1f799daba --- /dev/null +++ b/x/newauc/keeper/params.go @@ -0,0 +1,18 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/newauc/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// GetParams get all parameters as types.Params +func (k Keeper) GetParams(ctx sdk.Context) types.Params { + return types.NewParams( + ) +} + +// SetParams set the params +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + k.paramstore.SetParamSet(ctx, ¶ms) +} + diff --git a/x/newauc/keeper/params_test.go b/x/newauc/keeper/params_test.go new file mode 100644 index 000000000..1feeec6cc --- /dev/null +++ b/x/newauc/keeper/params_test.go @@ -0,0 +1,18 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + testkeeper "github.com/comdex-official/comdex/testutil/keeper" + "github.com/comdex-official/comdex/x/newauc/types" +) + +func TestGetParams(t *testing.T) { + k, ctx := testkeeper.NewaucKeeper(t) + params := types.DefaultParams() + + k.SetParams(ctx, params) + + require.EqualValues(t, params, k.GetParams(ctx)) +} diff --git a/x/newauc/module.go b/x/newauc/module.go new file mode 100644 index 000000000..c46c86b03 --- /dev/null +++ b/x/newauc/module.go @@ -0,0 +1,177 @@ +package newauc + +import ( + "encoding/json" + "fmt" + // this line is used by starport scaffolding # 1 + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/tendermint/tendermint/abci/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/comdex-official/comdex/x/newauc/keeper" + "github.com/comdex-official/comdex/x/newauc/types" + "github.com/comdex-official/comdex/x/newauc/client/cli" + +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface for the capability module. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the capability module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +// RegisterInterfaces registers the module's interface types +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns the capability module's default genesis state. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis performs genesis state validation for the capability module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterRESTRoutes registers the capability module's REST service handlers. +func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + // this line is used by starport scaffolding # 2 +} + +// GetTxCmd returns the capability module's root tx command. +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the capability module's root query command. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface for the capability module. +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// Name returns the capability module's name. +func (am AppModule) Name() string { + return am.AppModuleBasic.Name() +} + +// Route returns the capability module's message routing key. +func (am AppModule) Route() sdk.Route { + return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) +} + +// QuerierRoute returns the capability module's query routing key. +func (AppModule) QuerierRoute() string { return types.QuerierRoute } + +// LegacyQuerierHandler returns the capability module's Querier. +func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { + return nil +} + +// RegisterServices registers a GRPC query service to respond to the +// module-specific GRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the capability module's invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the capability module's genesis initialization It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the capability module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion implements ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 2 } + +// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. +func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +// EndBlock executes all ABCI EndBlock logic respective to the capability module. It +// returns no validator updates. +func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} diff --git a/x/newauc/module_simulation.go b/x/newauc/module_simulation.go new file mode 100644 index 000000000..414448afb --- /dev/null +++ b/x/newauc/module_simulation.go @@ -0,0 +1,65 @@ +package newauc + +import ( + "math/rand" + + "github.com/comdex-official/comdex/testutil/sample" + newaucsimulation "github.com/comdex-official/comdex/x/newauc/simulation" + "github.com/comdex-official/comdex/x/newauc/types" + "github.com/cosmos/cosmos-sdk/baseapp" + simappparams "github.com/cosmos/cosmos-sdk/simapp/params" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" +) + +// avoid unused import issue +var ( + _ = sample.AccAddress + _ = newaucsimulation.FindAccount + _ = simappparams.StakePerAccount + _ = simulation.MsgEntryKind + _ = baseapp.Paramspace +) + +const ( + // this line is used by starport scaffolding # simapp/module/const +) + +// GenerateGenesisState creates a randomized GenState of the module +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + newaucGenesis := types.GenesisState{ + Params: types.DefaultParams(), + // this line is used by starport scaffolding # simapp/module/genesisState + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&newaucGenesis) +} + +// ProposalContents doesn't return any content functions for governance proposals +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RandomizedParams creates randomized param changes for the simulator +func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { + + return []simtypes.ParamChange{ + } +} + +// RegisterStoreDecoder registers a decoder +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + // this line is used by starport scaffolding # simapp/module/operation + + return operations +} diff --git a/x/newauc/simulation/simap.go b/x/newauc/simulation/simap.go new file mode 100644 index 000000000..92c437c0d --- /dev/null +++ b/x/newauc/simulation/simap.go @@ -0,0 +1,15 @@ +package simulation + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} diff --git a/x/newauc/types/codec.go b/x/newauc/types/codec.go new file mode 100644 index 000000000..fb6871d22 --- /dev/null +++ b/x/newauc/types/codec.go @@ -0,0 +1,23 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + // this line is used by starport scaffolding # 1 + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func RegisterCodec(cdc *codec.LegacyAmino) { + // this line is used by starport scaffolding # 2 +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + // this line is used by starport scaffolding # 3 + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + Amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) +) diff --git a/x/newauc/types/errors.go b/x/newauc/types/errors.go new file mode 100644 index 000000000..06ce9d5d3 --- /dev/null +++ b/x/newauc/types/errors.go @@ -0,0 +1,13 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// x/newauc module sentinel errors +var ( + ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") + +) diff --git a/x/newauc/types/expected_keepers.go b/x/newauc/types/expected_keepers.go new file mode 100644 index 000000000..bcb4371f8 --- /dev/null +++ b/x/newauc/types/expected_keepers.go @@ -0,0 +1,22 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/types" +) + + + + + +// AccountKeeper defines the expected account keeper used for simulations (noalias) +type AccountKeeper interface { + GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + // Methods imported from account should be defined here +} + +// BankKeeper defines the expected interface needed to retrieve account balances. +type BankKeeper interface { + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + // Methods imported from bank should be defined here +} \ No newline at end of file diff --git a/x/newauc/types/genesis.go b/x/newauc/types/genesis.go new file mode 100644 index 000000000..aa82115f8 --- /dev/null +++ b/x/newauc/types/genesis.go @@ -0,0 +1,24 @@ +package types + +import ( +// this line is used by starport scaffolding # genesis/types/import +) + +// DefaultIndex is the default capability global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default Capability genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // this line is used by starport scaffolding # genesis/types/validate + + return gs.Params.Validate() +} diff --git a/x/newauc/types/genesis.pb.go b/x/newauc/types/genesis.pb.go new file mode 100644 index 000000000..8cd0f6121 --- /dev/null +++ b/x/newauc/types/genesis.pb.go @@ -0,0 +1,322 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/newauc/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_a179a8afb1a02afb, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "comdex.newauc.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("comdex/newauc/v1beta1/genesis.proto", fileDescriptor_a179a8afb1a02afb) +} + +var fileDescriptor_a179a8afb1a02afb = []byte{ + // 203 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0xcf, 0x4b, 0x2d, 0x4f, 0x2c, 0x4d, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, + 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x85, 0x28, 0xd2, 0x83, 0x28, 0xd2, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, + 0xab, 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0xa5, 0x94, 0xb0, 0x9b, 0x58, 0x90, 0x58, 0x94, 0x98, 0x0b, + 0x35, 0x50, 0xc9, 0x9b, 0x8b, 0xc7, 0x1d, 0x62, 0x43, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x35, + 0x17, 0x1b, 0x44, 0x5e, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x56, 0x0f, 0xab, 0x8d, 0x7a, + 0x01, 0x60, 0x45, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xb5, 0x38, 0x79, 0x9d, 0x78, + 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, + 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x12, + 0xc8, 0x30, 0x7d, 0x88, 0x81, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, + 0x3e, 0xdc, 0x9d, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xf7, 0x19, 0x03, 0x02, 0x00, + 0x00, 0xff, 0xff, 0x1c, 0x5e, 0x3c, 0xbf, 0x17, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/newauc/types/genesis_test.go b/x/newauc/types/genesis_test.go new file mode 100644 index 000000000..80eeff908 --- /dev/null +++ b/x/newauc/types/genesis_test.go @@ -0,0 +1,40 @@ +package types_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/comdex-official/comdex/x/newauc/types" +) + +func TestGenesisState_Validate(t *testing.T) { + for _, tc := range []struct { + desc string + genState *types.GenesisState + valid bool + } { + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} \ No newline at end of file diff --git a/x/newauc/types/keys.go b/x/newauc/types/keys.go new file mode 100644 index 000000000..1c9f08ad3 --- /dev/null +++ b/x/newauc/types/keys.go @@ -0,0 +1,26 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "newauc" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey is the message route for slashing + RouterKey = ModuleName + + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_newauc" + + +) + + + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/x/newauc/types/params.go b/x/newauc/types/params.go new file mode 100644 index 000000000..52a8a059f --- /dev/null +++ b/x/newauc/types/params.go @@ -0,0 +1,47 @@ +package types + +import ( + + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "gopkg.in/yaml.v2" +) + +var _ paramtypes.ParamSet = (*Params)(nil) + + + +// ParamKeyTable the param key table for launch module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance +func NewParams( +) Params { + return Params{ + } +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams( + ) +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + } +} + +// Validate validates the set of params +func (p Params) Validate() error { + return nil +} + +// String implements the Stringer interface. +func (p Params) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} diff --git a/x/newauc/types/params.pb.go b/x/newauc/types/params.pb.go new file mode 100644 index 000000000..5b329503e --- /dev/null +++ b/x/newauc/types/params.pb.go @@ -0,0 +1,266 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/newauc/v1beta1/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_692928c502ee8249, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "comdex.newauc.v1beta1.Params") +} + +func init() { + proto.RegisterFile("comdex/newauc/v1beta1/params.proto", fileDescriptor_692928c502ee8249) +} + +var fileDescriptor_692928c502ee8249 = []byte{ + // 163 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0xcf, 0x4b, 0x2d, 0x4f, 0x2c, 0x4d, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, + 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x85, 0xa8, 0xd1, 0x83, 0xa8, 0xd1, 0x83, 0xaa, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, + 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0x95, 0xf8, 0xb8, 0xd8, 0x02, 0xc0, 0x9a, 0xad, 0x58, 0x66, 0x2c, + 0x90, 0x67, 0x70, 0xf2, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, + 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x83, + 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, 0x0d, 0xba, 0xf9, 0x69, + 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0xdc, 0x5d, 0x25, 0x95, 0x05, 0xa9, 0xc5, + 0x49, 0x6c, 0x60, 0x2b, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xae, 0x01, 0x45, 0x89, 0xb5, + 0x00, 0x00, 0x00, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/newauc/types/query.pb.go b/x/newauc/types/query.pb.go new file mode 100644 index 000000000..6f244ca78 --- /dev/null +++ b/x/newauc/types/query.pb.go @@ -0,0 +1,533 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/newauc/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_74e5801892b1e918, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +type QueryParamsResponse struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_74e5801892b1e918, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "comdex.newauc.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "comdex.newauc.v1beta1.QueryParamsResponse") +} + +func init() { proto.RegisterFile("comdex/newauc/v1beta1/query.proto", fileDescriptor_74e5801892b1e918) } + +var fileDescriptor_74e5801892b1e918 = []byte{ + // 310 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4b, 0x33, 0x31, + 0x18, 0xc7, 0x2f, 0x2f, 0xaf, 0x1d, 0xe2, 0x16, 0x2b, 0x48, 0xd1, 0xa8, 0x07, 0xa2, 0x16, 0x7a, + 0xb1, 0x75, 0x74, 0xeb, 0xe8, 0xa4, 0x1d, 0xdd, 0x72, 0x67, 0x1a, 0x03, 0x6d, 0x9e, 0xf4, 0x92, + 0x53, 0xbb, 0xfa, 0x01, 0x44, 0x70, 0xf1, 0x23, 0x75, 0x2c, 0xb8, 0x38, 0x89, 0xdc, 0xf9, 0x41, + 0xe4, 0x2e, 0x47, 0xa1, 0xd8, 0x82, 0xdb, 0xf1, 0xdc, 0xef, 0xff, 0x7b, 0xfe, 0x79, 0xf0, 0x61, + 0x02, 0xe3, 0x5b, 0xf1, 0xc8, 0xb4, 0x78, 0xe0, 0x59, 0xc2, 0xee, 0xbb, 0xb1, 0x70, 0xbc, 0xcb, + 0x26, 0x99, 0x48, 0xa7, 0x91, 0x49, 0xc1, 0x01, 0xd9, 0xf6, 0x48, 0xe4, 0x91, 0xa8, 0x46, 0x5a, + 0x4d, 0x09, 0x12, 0x2a, 0x82, 0x95, 0x5f, 0x1e, 0x6e, 0xed, 0x4a, 0x00, 0x39, 0x12, 0x8c, 0x1b, + 0xc5, 0xb8, 0xd6, 0xe0, 0xb8, 0x53, 0xa0, 0x6d, 0xfd, 0xb7, 0x9d, 0x80, 0x1d, 0x83, 0x65, 0x31, + 0xb7, 0xc2, 0xef, 0x58, 0x6c, 0x34, 0x5c, 0x2a, 0x5d, 0xc1, 0x35, 0x1b, 0xae, 0x6e, 0x66, 0x78, + 0xca, 0xc7, 0xb5, 0x2f, 0x6c, 0x62, 0x72, 0x5d, 0x5a, 0xae, 0xaa, 0xe1, 0x40, 0x4c, 0x32, 0x61, + 0x5d, 0x38, 0xc0, 0x5b, 0x4b, 0x53, 0x6b, 0x40, 0x5b, 0x41, 0x2e, 0x70, 0xc3, 0x87, 0x77, 0xd0, + 0x01, 0x3a, 0xd9, 0xec, 0xed, 0x45, 0x2b, 0x1f, 0x16, 0xf9, 0x58, 0xff, 0xff, 0xec, 0x73, 0x3f, + 0x18, 0xd4, 0x91, 0xde, 0x1b, 0xc2, 0x1b, 0x95, 0x94, 0x3c, 0x23, 0xdc, 0xf0, 0x08, 0x39, 0x5d, + 0x63, 0xf8, 0xdd, 0xa9, 0xd5, 0xfe, 0x0b, 0xea, 0x8b, 0x86, 0x9d, 0xa7, 0xf7, 0xef, 0xd7, 0x7f, + 0xc7, 0xe4, 0x88, 0xf9, 0x4c, 0x07, 0x86, 0x43, 0x95, 0x28, 0x3e, 0x62, 0xcb, 0x27, 0xf1, 0xd5, + 0xfa, 0x97, 0xb3, 0x9c, 0xa2, 0x79, 0x4e, 0xd1, 0x57, 0x4e, 0xd1, 0x4b, 0x41, 0x83, 0x79, 0x41, + 0x83, 0x8f, 0x82, 0x06, 0x37, 0x67, 0x52, 0xb9, 0xbb, 0x2c, 0x2e, 0x57, 0xaf, 0x53, 0x2d, 0x64, + 0x6e, 0x6a, 0x84, 0x8d, 0x1b, 0xd5, 0x5d, 0xcf, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x31, 0x47, + 0x1d, 0x4c, 0x17, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/comdex.newauc.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.newauc.v1beta1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "comdex.newauc.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "comdex/newauc/v1beta1/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/newauc/types/query.pb.gw.go b/x/newauc/types/query.pb.gw.go new file mode 100644 index 000000000..7a85e2f0c --- /dev/null +++ b/x/newauc/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: comdex/newauc/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex-official", "comdex", "newauc", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/newauc/types/tx.pb.go b/x/newauc/types/tx.pb.go new file mode 100644 index 000000000..1110bdd85 --- /dev/null +++ b/x/newauc/types/tx.pb.go @@ -0,0 +1,81 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/newauc/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func init() { proto.RegisterFile("comdex/newauc/v1beta1/tx.proto", fileDescriptor_3d36f481f1fa79f9) } + +var fileDescriptor_3d36f481f1fa79f9 = []byte{ + // 139 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0xcf, 0x4b, 0x2d, 0x4f, 0x2c, 0x4d, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, + 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xc8, 0xeb, 0x41, + 0xe4, 0xf5, 0xa0, 0xf2, 0x46, 0xac, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x4e, 0x5e, 0x27, 0x1e, 0xc9, + 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, + 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, + 0x9c, 0x9f, 0xab, 0x0f, 0x31, 0x42, 0x37, 0x3f, 0x2d, 0x2d, 0x33, 0x39, 0x33, 0x31, 0x07, 0xca, + 0xd7, 0x87, 0x5b, 0x5a, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xb6, 0xd0, 0x18, 0x10, 0x00, + 0x00, 0xff, 0xff, 0xf6, 0xd7, 0x6a, 0x18, 0x92, 0x00, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "comdex.newauc.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{}, + Metadata: "comdex/newauc/v1beta1/tx.proto", +} diff --git a/x/newauc/types/types.go b/x/newauc/types/types.go new file mode 100644 index 000000000..ab1254f4c --- /dev/null +++ b/x/newauc/types/types.go @@ -0,0 +1 @@ +package types diff --git a/x/newliq/client/cli/query.go b/x/newliq/client/cli/query.go new file mode 100644 index 000000000..20d88fcc4 --- /dev/null +++ b/x/newliq/client/cli/query.go @@ -0,0 +1,32 @@ +package cli + +import ( + "fmt" + // "strings" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + // sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/comdex-official/comdex/x/newliq/types" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group newliq queries under a subcommand + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdQueryParams()) + // this line is used by starport scaffolding # 1 + + return cmd +} + diff --git a/x/newliq/client/cli/query_params.go b/x/newliq/client/cli/query_params.go new file mode 100644 index 000000000..65ec10df5 --- /dev/null +++ b/x/newliq/client/cli/query_params.go @@ -0,0 +1,34 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + "github.com/comdex-official/comdex/x/newliq/types" +) + +func CmdQueryParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Short: "shows the parameters of the module", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/newliq/client/cli/tx.go b/x/newliq/client/cli/tx.go new file mode 100644 index 000000000..5cd6fc892 --- /dev/null +++ b/x/newliq/client/cli/tx.go @@ -0,0 +1,36 @@ +package cli + +import ( + "fmt" + "time" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/comdex-official/comdex/x/newliq/types" +) + +var ( + DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) +) + +const ( + flagPacketTimeoutTimestamp = "packet-timeout-timestamp" + listSeparator = "," +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/newliq/genesis.go b/x/newliq/genesis.go new file mode 100644 index 000000000..054b17f69 --- /dev/null +++ b/x/newliq/genesis.go @@ -0,0 +1,24 @@ +package newliq + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/comdex-official/comdex/x/newliq/keeper" + "github.com/comdex-official/comdex/x/newliq/types" +) + +// InitGenesis initializes the capability module's state from a provided genesis +// state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + // this line is used by starport scaffolding # genesis/module/init + k.SetParams(ctx, genState.Params) +} + +// ExportGenesis returns the capability module's exported genesis. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + genesis.Params = k.GetParams(ctx) + + // this line is used by starport scaffolding # genesis/module/export + + return genesis +} diff --git a/x/newliq/handler.go b/x/newliq/handler.go new file mode 100644 index 000000000..819ed8c55 --- /dev/null +++ b/x/newliq/handler.go @@ -0,0 +1,26 @@ +package newliq + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/comdex-official/comdex/x/newliq/keeper" + "github.com/comdex-official/comdex/x/newliq/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// NewHandler ... +func NewHandler(k keeper.Keeper) sdk.Handler { + // this line is used by starport scaffolding # handler/msgServer + + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { + ctx = ctx.WithEventManager(sdk.NewEventManager()) + + switch msg := msg.(type) { + // this line is used by starport scaffolding # 1 + default: + errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + } + } +} diff --git a/x/newliq/keeper/grpc_query.go b/x/newliq/keeper/grpc_query.go new file mode 100644 index 000000000..287c029ca --- /dev/null +++ b/x/newliq/keeper/grpc_query.go @@ -0,0 +1,7 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/newliq/types" +) + +var _ types.QueryServer = Keeper{} diff --git a/x/newliq/keeper/grpc_query_params.go b/x/newliq/keeper/grpc_query_params.go new file mode 100644 index 000000000..fa8610405 --- /dev/null +++ b/x/newliq/keeper/grpc_query_params.go @@ -0,0 +1,19 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/comdex-official/comdex/x/newliq/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} diff --git a/x/newliq/keeper/grpc_query_params_test.go b/x/newliq/keeper/grpc_query_params_test.go new file mode 100644 index 000000000..1d0dec783 --- /dev/null +++ b/x/newliq/keeper/grpc_query_params_test.go @@ -0,0 +1,21 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + testkeeper "github.com/comdex-official/comdex/testutil/keeper" + "github.com/comdex-official/comdex/x/newliq/types" +) + +func TestParamsQuery(t *testing.T) { + keeper, ctx := testkeeper.NewliqKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + params := types.DefaultParams() + keeper.SetParams(ctx, params) + + response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) + require.NoError(t, err) + require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +} diff --git a/x/newliq/keeper/keeper.go b/x/newliq/keeper/keeper.go new file mode 100644 index 000000000..8d2cb12e8 --- /dev/null +++ b/x/newliq/keeper/keeper.go @@ -0,0 +1,50 @@ +package keeper + +import ( + "fmt" + + "github.com/tendermint/tendermint/libs/log" + + "github.com/comdex-official/comdex/x/newliq/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey + paramstore paramtypes.Subspace + + bankKeeper types.BankKeeper + } +) + +func NewKeeper( + cdc codec.BinaryCodec, + storeKey, + memKey sdk.StoreKey, + ps paramtypes.Subspace, + + bankKeeper types.BankKeeper, +) Keeper { + // set KeyTable if it has not already been set + if !ps.HasKeyTable() { + ps = ps.WithKeyTable(types.ParamKeyTable()) + } + + return Keeper{ + + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + paramstore: ps, + bankKeeper: bankKeeper, + } +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} diff --git a/x/newliq/keeper/msg_server.go b/x/newliq/keeper/msg_server.go new file mode 100644 index 000000000..ba108cd87 --- /dev/null +++ b/x/newliq/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/newliq/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} diff --git a/x/newliq/keeper/msg_server_test.go b/x/newliq/keeper/msg_server_test.go new file mode 100644 index 000000000..7c623cf00 --- /dev/null +++ b/x/newliq/keeper/msg_server_test.go @@ -0,0 +1,16 @@ +package keeper_test + +import ( + "context" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/comdex-official/comdex/x/newliq/types" + "github.com/comdex-official/comdex/x/newliq/keeper" + keepertest "github.com/comdex-official/comdex/testutil/keeper" +) + +func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { + k, ctx := keepertest.NewliqKeeper(t) + return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) +} diff --git a/x/newliq/keeper/params.go b/x/newliq/keeper/params.go new file mode 100644 index 000000000..0a7fde44c --- /dev/null +++ b/x/newliq/keeper/params.go @@ -0,0 +1,18 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/newliq/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// GetParams get all parameters as types.Params +func (k Keeper) GetParams(ctx sdk.Context) types.Params { + return types.NewParams( + ) +} + +// SetParams set the params +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + k.paramstore.SetParamSet(ctx, ¶ms) +} + diff --git a/x/newliq/keeper/params_test.go b/x/newliq/keeper/params_test.go new file mode 100644 index 000000000..7dadd3a97 --- /dev/null +++ b/x/newliq/keeper/params_test.go @@ -0,0 +1,18 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + testkeeper "github.com/comdex-official/comdex/testutil/keeper" + "github.com/comdex-official/comdex/x/newliq/types" +) + +func TestGetParams(t *testing.T) { + k, ctx := testkeeper.NewliqKeeper(t) + params := types.DefaultParams() + + k.SetParams(ctx, params) + + require.EqualValues(t, params, k.GetParams(ctx)) +} diff --git a/x/newliq/module.go b/x/newliq/module.go new file mode 100644 index 000000000..0bd1642c3 --- /dev/null +++ b/x/newliq/module.go @@ -0,0 +1,177 @@ +package newliq + +import ( + "encoding/json" + "fmt" + // this line is used by starport scaffolding # 1 + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/tendermint/tendermint/abci/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/comdex-official/comdex/x/newliq/keeper" + "github.com/comdex-official/comdex/x/newliq/types" + "github.com/comdex-official/comdex/x/newliq/client/cli" + +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface for the capability module. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the capability module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +// RegisterInterfaces registers the module's interface types +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns the capability module's default genesis state. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis performs genesis state validation for the capability module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterRESTRoutes registers the capability module's REST service handlers. +func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + // this line is used by starport scaffolding # 2 +} + +// GetTxCmd returns the capability module's root tx command. +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the capability module's root query command. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface for the capability module. +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// Name returns the capability module's name. +func (am AppModule) Name() string { + return am.AppModuleBasic.Name() +} + +// Route returns the capability module's message routing key. +func (am AppModule) Route() sdk.Route { + return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) +} + +// QuerierRoute returns the capability module's query routing key. +func (AppModule) QuerierRoute() string { return types.QuerierRoute } + +// LegacyQuerierHandler returns the capability module's Querier. +func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { + return nil +} + +// RegisterServices registers a GRPC query service to respond to the +// module-specific GRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the capability module's invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the capability module's genesis initialization It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the capability module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion implements ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 2 } + +// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. +func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +// EndBlock executes all ABCI EndBlock logic respective to the capability module. It +// returns no validator updates. +func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} diff --git a/x/newliq/module_simulation.go b/x/newliq/module_simulation.go new file mode 100644 index 000000000..45f3c74f2 --- /dev/null +++ b/x/newliq/module_simulation.go @@ -0,0 +1,65 @@ +package newliq + +import ( + "math/rand" + + "github.com/comdex-official/comdex/testutil/sample" + newliqsimulation "github.com/comdex-official/comdex/x/newliq/simulation" + "github.com/comdex-official/comdex/x/newliq/types" + "github.com/cosmos/cosmos-sdk/baseapp" + simappparams "github.com/cosmos/cosmos-sdk/simapp/params" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" +) + +// avoid unused import issue +var ( + _ = sample.AccAddress + _ = newliqsimulation.FindAccount + _ = simappparams.StakePerAccount + _ = simulation.MsgEntryKind + _ = baseapp.Paramspace +) + +const ( + // this line is used by starport scaffolding # simapp/module/const +) + +// GenerateGenesisState creates a randomized GenState of the module +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + newliqGenesis := types.GenesisState{ + Params: types.DefaultParams(), + // this line is used by starport scaffolding # simapp/module/genesisState + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&newliqGenesis) +} + +// ProposalContents doesn't return any content functions for governance proposals +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RandomizedParams creates randomized param changes for the simulator +func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { + + return []simtypes.ParamChange{ + } +} + +// RegisterStoreDecoder registers a decoder +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + // this line is used by starport scaffolding # simapp/module/operation + + return operations +} diff --git a/x/newliq/simulation/simap.go b/x/newliq/simulation/simap.go new file mode 100644 index 000000000..92c437c0d --- /dev/null +++ b/x/newliq/simulation/simap.go @@ -0,0 +1,15 @@ +package simulation + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} diff --git a/x/newliq/types/codec.go b/x/newliq/types/codec.go new file mode 100644 index 000000000..fb6871d22 --- /dev/null +++ b/x/newliq/types/codec.go @@ -0,0 +1,23 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + // this line is used by starport scaffolding # 1 + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func RegisterCodec(cdc *codec.LegacyAmino) { + // this line is used by starport scaffolding # 2 +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + // this line is used by starport scaffolding # 3 + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + Amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) +) diff --git a/x/newliq/types/errors.go b/x/newliq/types/errors.go new file mode 100644 index 000000000..d150e0c3a --- /dev/null +++ b/x/newliq/types/errors.go @@ -0,0 +1,13 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// x/newliq module sentinel errors +var ( + ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") + +) diff --git a/x/newliq/types/expected_keepers.go b/x/newliq/types/expected_keepers.go new file mode 100644 index 000000000..bcb4371f8 --- /dev/null +++ b/x/newliq/types/expected_keepers.go @@ -0,0 +1,22 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/types" +) + + + + + +// AccountKeeper defines the expected account keeper used for simulations (noalias) +type AccountKeeper interface { + GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + // Methods imported from account should be defined here +} + +// BankKeeper defines the expected interface needed to retrieve account balances. +type BankKeeper interface { + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + // Methods imported from bank should be defined here +} \ No newline at end of file diff --git a/x/newliq/types/genesis.go b/x/newliq/types/genesis.go new file mode 100644 index 000000000..aa82115f8 --- /dev/null +++ b/x/newliq/types/genesis.go @@ -0,0 +1,24 @@ +package types + +import ( +// this line is used by starport scaffolding # genesis/types/import +) + +// DefaultIndex is the default capability global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default Capability genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // this line is used by starport scaffolding # genesis/types/validate + + return gs.Params.Validate() +} diff --git a/x/newliq/types/genesis.pb.go b/x/newliq/types/genesis.pb.go new file mode 100644 index 000000000..9fd772dfb --- /dev/null +++ b/x/newliq/types/genesis.pb.go @@ -0,0 +1,322 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/newliq/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_026aeb52a6f6d090, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "comdex.newliq.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("comdex/newliq/v1beta1/genesis.proto", fileDescriptor_026aeb52a6f6d090) +} + +var fileDescriptor_026aeb52a6f6d090 = []byte{ + // 203 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0xcf, 0x4b, 0x2d, 0xcf, 0xc9, 0x2c, 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, + 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x85, 0x28, 0xd2, 0x83, 0x28, 0xd2, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, + 0xab, 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0xa5, 0x94, 0xb0, 0x9b, 0x58, 0x90, 0x58, 0x94, 0x98, 0x0b, + 0x35, 0x50, 0xc9, 0x9b, 0x8b, 0xc7, 0x1d, 0x62, 0x43, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x35, + 0x17, 0x1b, 0x44, 0x5e, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x56, 0x0f, 0xab, 0x8d, 0x7a, + 0x01, 0x60, 0x45, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xb5, 0x38, 0x79, 0x9d, 0x78, + 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, + 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x12, + 0xc8, 0x30, 0x7d, 0x88, 0x81, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, + 0x3e, 0xdc, 0x9d, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xf7, 0x19, 0x03, 0x02, 0x00, + 0x00, 0xff, 0xff, 0x73, 0x74, 0x70, 0x3f, 0x17, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/newliq/types/genesis_test.go b/x/newliq/types/genesis_test.go new file mode 100644 index 000000000..2ece4f10f --- /dev/null +++ b/x/newliq/types/genesis_test.go @@ -0,0 +1,40 @@ +package types_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/comdex-official/comdex/x/newliq/types" +) + +func TestGenesisState_Validate(t *testing.T) { + for _, tc := range []struct { + desc string + genState *types.GenesisState + valid bool + } { + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} \ No newline at end of file diff --git a/x/newliq/types/keys.go b/x/newliq/types/keys.go new file mode 100644 index 000000000..740b28ab5 --- /dev/null +++ b/x/newliq/types/keys.go @@ -0,0 +1,26 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "newliq" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey is the message route for slashing + RouterKey = ModuleName + + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_newliq" + + +) + + + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/x/newliq/types/params.go b/x/newliq/types/params.go new file mode 100644 index 000000000..52a8a059f --- /dev/null +++ b/x/newliq/types/params.go @@ -0,0 +1,47 @@ +package types + +import ( + + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "gopkg.in/yaml.v2" +) + +var _ paramtypes.ParamSet = (*Params)(nil) + + + +// ParamKeyTable the param key table for launch module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance +func NewParams( +) Params { + return Params{ + } +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams( + ) +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + } +} + +// Validate validates the set of params +func (p Params) Validate() error { + return nil +} + +// String implements the Stringer interface. +func (p Params) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} diff --git a/x/newliq/types/params.pb.go b/x/newliq/types/params.pb.go new file mode 100644 index 000000000..88d612681 --- /dev/null +++ b/x/newliq/types/params.pb.go @@ -0,0 +1,266 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/newliq/v1beta1/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_dac7fa172b6c4a49, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "comdex.newliq.v1beta1.Params") +} + +func init() { + proto.RegisterFile("comdex/newliq/v1beta1/params.proto", fileDescriptor_dac7fa172b6c4a49) +} + +var fileDescriptor_dac7fa172b6c4a49 = []byte{ + // 163 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0xcf, 0x4b, 0x2d, 0xcf, 0xc9, 0x2c, 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, + 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x85, 0xa8, 0xd1, 0x83, 0xa8, 0xd1, 0x83, 0xaa, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, + 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0x95, 0xf8, 0xb8, 0xd8, 0x02, 0xc0, 0x9a, 0xad, 0x58, 0x66, 0x2c, + 0x90, 0x67, 0x70, 0xf2, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, + 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x83, + 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, 0x0d, 0xba, 0xf9, 0x69, + 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0xdc, 0x5d, 0x25, 0x95, 0x05, 0xa9, 0xc5, + 0x49, 0x6c, 0x60, 0x2b, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf6, 0x7c, 0xb0, 0xd5, 0xb5, + 0x00, 0x00, 0x00, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/newliq/types/query.pb.go b/x/newliq/types/query.pb.go new file mode 100644 index 000000000..519fdc6a8 --- /dev/null +++ b/x/newliq/types/query.pb.go @@ -0,0 +1,533 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/newliq/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1ff1262d44342b1b, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +type QueryParamsResponse struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1ff1262d44342b1b, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "comdex.newliq.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "comdex.newliq.v1beta1.QueryParamsResponse") +} + +func init() { proto.RegisterFile("comdex/newliq/v1beta1/query.proto", fileDescriptor_1ff1262d44342b1b) } + +var fileDescriptor_1ff1262d44342b1b = []byte{ + // 310 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4b, 0x33, 0x31, + 0x18, 0xc7, 0x2f, 0x2f, 0xaf, 0x1d, 0xe2, 0x16, 0x2b, 0x48, 0xd1, 0xa8, 0x07, 0xa2, 0x16, 0x7a, + 0xb1, 0x75, 0x74, 0xeb, 0xe8, 0xa4, 0x1d, 0xdd, 0x72, 0x35, 0x8d, 0x81, 0x36, 0x4f, 0xee, 0x92, + 0x53, 0xbb, 0xfa, 0x01, 0x44, 0x70, 0xf1, 0x23, 0x75, 0x2c, 0xb8, 0x38, 0x89, 0xdc, 0xf9, 0x41, + 0xe4, 0x2e, 0x47, 0xa1, 0xd8, 0x82, 0xdb, 0xf1, 0xdc, 0xef, 0xff, 0x7b, 0xfe, 0x79, 0xf0, 0xe1, + 0x10, 0x26, 0xb7, 0xe2, 0x91, 0x69, 0xf1, 0x30, 0x56, 0x09, 0xbb, 0xef, 0xc6, 0xc2, 0xf1, 0x2e, + 0x4b, 0x32, 0x91, 0x4e, 0x23, 0x93, 0x82, 0x03, 0xb2, 0xed, 0x91, 0xc8, 0x23, 0x51, 0x8d, 0xb4, + 0x9a, 0x12, 0x24, 0x54, 0x04, 0x2b, 0xbf, 0x3c, 0xdc, 0xda, 0x95, 0x00, 0x72, 0x2c, 0x18, 0x37, + 0x8a, 0x71, 0xad, 0xc1, 0x71, 0xa7, 0x40, 0xdb, 0xfa, 0x6f, 0x7b, 0x08, 0x76, 0x02, 0x96, 0xc5, + 0xdc, 0x0a, 0xbf, 0x63, 0xb1, 0xd1, 0x70, 0xa9, 0x74, 0x05, 0xd7, 0x6c, 0xb8, 0xba, 0x99, 0xe1, + 0x29, 0x9f, 0xd4, 0xbe, 0xb0, 0x89, 0xc9, 0x75, 0x69, 0xb9, 0xaa, 0x86, 0x03, 0x91, 0x64, 0xc2, + 0xba, 0x70, 0x80, 0xb7, 0x96, 0xa6, 0xd6, 0x80, 0xb6, 0x82, 0x5c, 0xe0, 0x86, 0x0f, 0xef, 0xa0, + 0x03, 0x74, 0xb2, 0xd9, 0xdb, 0x8b, 0x56, 0x3e, 0x2c, 0xf2, 0xb1, 0xfe, 0xff, 0xd9, 0xe7, 0x7e, + 0x30, 0xa8, 0x23, 0xbd, 0x37, 0x84, 0x37, 0x2a, 0x29, 0x79, 0x46, 0xb8, 0xe1, 0x11, 0x72, 0xba, + 0xc6, 0xf0, 0xbb, 0x53, 0xab, 0xfd, 0x17, 0xd4, 0x17, 0x0d, 0x3b, 0x4f, 0xef, 0xdf, 0xaf, 0xff, + 0x8e, 0xc9, 0x11, 0xf3, 0x99, 0x0e, 0x8c, 0x46, 0x6a, 0xa8, 0xf8, 0x98, 0x2d, 0x9f, 0xc4, 0x57, + 0xeb, 0x5f, 0xce, 0x72, 0x8a, 0xe6, 0x39, 0x45, 0x5f, 0x39, 0x45, 0x2f, 0x05, 0x0d, 0xe6, 0x05, + 0x0d, 0x3e, 0x0a, 0x1a, 0xdc, 0x9c, 0x49, 0xe5, 0xee, 0xb2, 0xb8, 0x5c, 0xbd, 0x4e, 0xb5, 0x90, + 0xb9, 0xa9, 0x11, 0x36, 0x6e, 0x54, 0x77, 0x3d, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x02, 0xe4, + 0x3e, 0x40, 0x17, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/comdex.newliq.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.newliq.v1beta1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "comdex.newliq.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "comdex/newliq/v1beta1/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/newliq/types/query.pb.gw.go b/x/newliq/types/query.pb.gw.go new file mode 100644 index 000000000..7ec53bc88 --- /dev/null +++ b/x/newliq/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: comdex/newliq/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex-official", "comdex", "newliq", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/newliq/types/tx.pb.go b/x/newliq/types/tx.pb.go new file mode 100644 index 000000000..fd97c8ee2 --- /dev/null +++ b/x/newliq/types/tx.pb.go @@ -0,0 +1,81 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/newliq/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func init() { proto.RegisterFile("comdex/newliq/v1beta1/tx.proto", fileDescriptor_9c4b8bbd08aaa2c5) } + +var fileDescriptor_9c4b8bbd08aaa2c5 = []byte{ + // 139 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0xcf, 0x4b, 0x2d, 0xcf, 0xc9, 0x2c, 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, + 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xc8, 0xeb, 0x41, + 0xe4, 0xf5, 0xa0, 0xf2, 0x46, 0xac, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x4e, 0x5e, 0x27, 0x1e, 0xc9, + 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, + 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, + 0x9c, 0x9f, 0xab, 0x0f, 0x31, 0x42, 0x37, 0x3f, 0x2d, 0x2d, 0x33, 0x39, 0x33, 0x31, 0x07, 0xca, + 0xd7, 0x87, 0x5b, 0x5a, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xb6, 0xd0, 0x18, 0x10, 0x00, + 0x00, 0xff, 0xff, 0x1e, 0x8f, 0xae, 0x73, 0x92, 0x00, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "comdex.newliq.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{}, + Metadata: "comdex/newliq/v1beta1/tx.proto", +} diff --git a/x/newliq/types/types.go b/x/newliq/types/types.go new file mode 100644 index 000000000..ab1254f4c --- /dev/null +++ b/x/newliq/types/types.go @@ -0,0 +1 @@ +package types From 3bfe7bbe6843206c5a53ef22e5b6a97f0fc9ecfe Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 5 Apr 2023 17:48:41 +0530 Subject: [PATCH 002/155] renaming module names --- app/app.go | 20 +++---- .../v1beta1/genesis.proto | 4 +- .../v1beta1/params.proto | 2 +- .../v1beta1/query.proto | 4 +- proto/comdex/auctionsV2/v1beta1/tx.proto | 8 +++ .../v1beta1/genesis.proto | 4 +- .../v1beta1/params.proto | 2 +- .../v1beta1/query.proto | 6 +- proto/comdex/liquidationsV2/v1beta1/tx.proto | 8 +++ proto/comdex/newauc/v1beta1/tx.proto | 8 --- proto/comdex/newliq/v1beta1/tx.proto | 8 --- testutil/keeper/{newauc.go => auctionsV2.go} | 4 +- .../keeper/{newliq.go => liquidationsV2.go} | 4 +- x/{newliq => auctionsV2}/client/cli/query.go | 11 ++-- x/{newauc => auctionsV2}/client/cli/tx.go | 4 +- x/{newliq => auctionsV2}/genesis.go | 12 ++-- x/{newliq => auctionsV2}/handler.go | 6 +- x/{newauc => auctionsV2}/keeper/grpc_query.go | 2 +- x/{newliq => auctionsV2}/keeper/keeper.go | 8 ++- x/{newliq => auctionsV2}/keeper/msg_server.go | 2 +- x/{newauc => auctionsV2}/keeper/params.go | 6 +- x/{newauc => auctionsV2}/module.go | 20 +++---- x/{newauc => auctionsV2}/module_simulation.go | 15 +++-- x/{newauc => auctionsV2}/simulation/simap.go | 0 x/{newauc => auctionsV2}/types/codec.go | 0 x/{newliq => auctionsV2}/types/errors.go | 3 +- .../types/expected_keepers.go | 0 x/{newliq => auctionsV2}/types/genesis.go | 10 +--- x/{newauc => auctionsV2}/types/genesis.pb.go | 37 ++++++------ x/auctionsV2/types/genesis_test.go | 40 +++++++++++++ x/{newauc => auctionsV2}/types/keys.go | 12 ++-- x/{newauc => auctionsV2}/types/params.go | 0 x/{newauc => auctionsV2}/types/params.pb.go | 32 +++++----- x/{newauc => auctionsV2}/types/query.pb.go | 58 ++++++++++--------- x/{newauc => auctionsV2}/types/query.pb.gw.go | 2 +- x/{newauc => auctionsV2}/types/tx.pb.go | 31 +++++----- x/{newauc => auctionsV2}/types/types.go | 0 .../client/cli/query.go | 7 +-- .../client/cli/query_params.go | 2 +- x/{newliq => liquidationsV2}/client/cli/tx.go | 4 +- x/{newauc => liquidationsV2}/genesis.go | 12 ++-- x/{newauc => liquidationsV2}/handler.go | 6 +- .../keeper/grpc_query.go | 2 +- .../keeper/grpc_query_params.go | 2 +- .../keeper/grpc_query_params_test.go | 4 +- x/{newauc => liquidationsV2}/keeper/keeper.go | 2 +- .../keeper/msg_server.go | 2 +- .../keeper/msg_server_test.go | 6 +- x/{newliq => liquidationsV2}/keeper/params.go | 6 +- .../keeper/params_test.go | 4 +- x/{newliq => liquidationsV2}/module.go | 20 +++---- .../module_simulation.go | 15 +++-- .../simulation/simap.go | 0 x/{newliq => liquidationsV2}/types/codec.go | 0 x/{newauc => liquidationsV2}/types/errors.go | 3 +- .../types/expected_keepers.go | 0 x/{newauc => liquidationsV2}/types/genesis.go | 0 .../types/genesis.pb.go | 37 ++++++------ x/liquidationsV2/types/genesis_test.go | 40 +++++++++++++ x/{newliq => liquidationsV2}/types/keys.go | 12 ++-- x/{newliq => liquidationsV2}/types/params.go | 0 .../types/params.pb.go | 32 +++++----- .../types/query.pb.go | 58 ++++++++++--------- .../types/query.pb.gw.go | 4 +- x/{newliq => liquidationsV2}/types/tx.pb.go | 31 +++++----- x/{newliq => liquidationsV2}/types/types.go | 0 x/newauc/client/cli/query_params.go | 34 ----------- x/newauc/keeper/grpc_query_params_test.go | 21 ------- x/newauc/keeper/msg_server_test.go | 16 ----- x/newauc/keeper/params_test.go | 18 ------ x/newauc/types/genesis_test.go | 40 ------------- x/newliq/keeper/grpc_query_params.go | 19 ------ x/newliq/types/genesis_test.go | 40 ------------- 73 files changed, 387 insertions(+), 505 deletions(-) rename proto/comdex/{newauc => auctionsV2}/v1beta1/genesis.proto (56%) rename proto/comdex/{newauc => auctionsV2}/v1beta1/params.proto (66%) rename proto/comdex/{newauc => auctionsV2}/v1beta1/query.proto (78%) create mode 100644 proto/comdex/auctionsV2/v1beta1/tx.proto rename proto/comdex/{newliq => liquidationsV2}/v1beta1/genesis.proto (54%) rename proto/comdex/{newliq => liquidationsV2}/v1beta1/params.proto (65%) rename proto/comdex/{newliq => liquidationsV2}/v1beta1/query.proto (63%) create mode 100644 proto/comdex/liquidationsV2/v1beta1/tx.proto delete mode 100644 proto/comdex/newauc/v1beta1/tx.proto delete mode 100644 proto/comdex/newliq/v1beta1/tx.proto rename testutil/keeper/{newauc.go => auctionsV2.go} (92%) rename testutil/keeper/{newliq.go => liquidationsV2.go} (92%) rename x/{newliq => auctionsV2}/client/cli/query.go (68%) rename x/{newauc => auctionsV2}/client/cli/tx.go (92%) rename x/{newliq => auctionsV2}/genesis.go (62%) rename x/{newliq => auctionsV2}/handler.go (82%) rename x/{newauc => auctionsV2}/keeper/grpc_query.go (52%) rename x/{newliq => auctionsV2}/keeper/keeper.go (79%) rename x/{newliq => auctionsV2}/keeper/msg_server.go (83%) rename x/{newauc => auctionsV2}/keeper/params.go (79%) rename x/{newauc => auctionsV2}/module.go (92%) rename x/{newauc => auctionsV2}/module_simulation.go (86%) rename x/{newauc => auctionsV2}/simulation/simap.go (100%) rename x/{newauc => auctionsV2}/types/codec.go (100%) rename x/{newliq => auctionsV2}/types/errors.go (81%) rename x/{newauc => auctionsV2}/types/expected_keepers.go (100%) rename x/{newliq => auctionsV2}/types/genesis.go (60%) rename x/{newauc => auctionsV2}/types/genesis.pb.go (81%) create mode 100644 x/auctionsV2/types/genesis_test.go rename x/{newauc => auctionsV2}/types/keys.go (69%) rename x/{newauc => auctionsV2}/types/params.go (100%) rename x/{newauc => auctionsV2}/types/params.pb.go (80%) rename x/{newauc => auctionsV2}/types/query.pb.go (84%) rename x/{newauc => auctionsV2}/types/query.pb.gw.go (99%) rename x/{newauc => auctionsV2}/types/tx.pb.go (62%) rename x/{newauc => auctionsV2}/types/types.go (100%) rename x/{newauc => liquidationsV2}/client/cli/query.go (85%) rename x/{newliq => liquidationsV2}/client/cli/query_params.go (91%) rename x/{newliq => liquidationsV2}/client/cli/tx.go (91%) rename x/{newauc => liquidationsV2}/genesis.go (61%) rename x/{newauc => liquidationsV2}/handler.go (81%) rename x/{newliq => liquidationsV2}/keeper/grpc_query.go (51%) rename x/{newauc => liquidationsV2}/keeper/grpc_query_params.go (88%) rename x/{newliq => liquidationsV2}/keeper/grpc_query_params_test.go (79%) rename x/{newauc => liquidationsV2}/keeper/keeper.go (93%) rename x/{newauc => liquidationsV2}/keeper/msg_server.go (83%) rename x/{newliq => liquidationsV2}/keeper/msg_server_test.go (59%) rename x/{newliq => liquidationsV2}/keeper/params.go (78%) rename x/{newliq => liquidationsV2}/keeper/params_test.go (84%) rename x/{newliq => liquidationsV2}/module.go (92%) rename x/{newliq => liquidationsV2}/module_simulation.go (86%) rename x/{newliq => liquidationsV2}/simulation/simap.go (100%) rename x/{newliq => liquidationsV2}/types/codec.go (100%) rename x/{newauc => liquidationsV2}/types/errors.go (79%) rename x/{newliq => liquidationsV2}/types/expected_keepers.go (100%) rename x/{newauc => liquidationsV2}/types/genesis.go (100%) rename x/{newliq => liquidationsV2}/types/genesis.pb.go (81%) create mode 100644 x/liquidationsV2/types/genesis_test.go rename x/{newliq => liquidationsV2}/types/keys.go (69%) rename x/{newliq => liquidationsV2}/types/params.go (100%) rename x/{newliq => liquidationsV2}/types/params.pb.go (80%) rename x/{newliq => liquidationsV2}/types/query.pb.go (84%) rename x/{newliq => liquidationsV2}/types/query.pb.gw.go (97%) rename x/{newliq => liquidationsV2}/types/tx.pb.go (61%) rename x/{newliq => liquidationsV2}/types/types.go (100%) delete mode 100644 x/newauc/client/cli/query_params.go delete mode 100644 x/newauc/keeper/grpc_query_params_test.go delete mode 100644 x/newauc/keeper/msg_server_test.go delete mode 100644 x/newauc/keeper/params_test.go delete mode 100644 x/newauc/types/genesis_test.go delete mode 100644 x/newliq/keeper/grpc_query_params.go delete mode 100644 x/newliq/types/genesis_test.go diff --git a/app/app.go b/app/app.go index b650cc710..068e8f256 100644 --- a/app/app.go +++ b/app/app.go @@ -164,13 +164,13 @@ import ( liquiditykeeper "github.com/comdex-official/comdex/x/liquidity/keeper" liquiditytypes "github.com/comdex-official/comdex/x/liquidity/types" - "github.com/comdex-official/comdex/x/newliq" - newliqkeeper "github.com/comdex-official/comdex/x/newliq/keeper" - newliqtypes "github.com/comdex-official/comdex/x/newliq/types" + "github.com/comdex-official/comdex/x/liquidationsV2" + newliqkeeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper" + newliqtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" - "github.com/comdex-official/comdex/x/newauc" - newauckeeper "github.com/comdex-official/comdex/x/newauc/keeper" - newauctypes "github.com/comdex-official/comdex/x/newauc/types" + "github.com/comdex-official/comdex/x/auctionsV2" + newauckeeper "github.com/comdex-official/comdex/x/auctionsV2/keeper" + newauctypes "github.com/comdex-official/comdex/x/auctionsV2/types" cwasm "github.com/comdex-official/comdex/app/wasm" @@ -278,8 +278,8 @@ var ( liquidity.AppModuleBasic{}, rewards.AppModuleBasic{}, ica.AppModuleBasic{}, - newliq.AppModuleBasic{}, - newauc.AppModuleBasic{}, + liquidationsV2.AppModuleBasic{}, + auctionsV2.AppModuleBasic{}, ) ) @@ -886,8 +886,8 @@ func New( tokenmint.NewAppModule(app.cdc, app.TokenmintKeeper, app.AccountKeeper, app.BankKeeper), liquidity.NewAppModule(app.cdc, app.LiquidityKeeper, app.AccountKeeper, app.BankKeeper, app.AssetKeeper), rewards.NewAppModule(app.cdc, app.Rewardskeeper, app.AccountKeeper, app.BankKeeper), - newliq.NewAppModule(app.cdc, app.NewliqKeeper, app.AccountKeeper, app.BankKeeper), - newauc.NewAppModule(app.cdc, app.NewaucKeeper, app.AccountKeeper, app.BankKeeper), + liquidationsV2.NewAppModule(app.cdc, app.NewliqKeeper, app.AccountKeeper, app.BankKeeper), + auctionsV2.NewAppModule(app.cdc, app.NewaucKeeper, app.AccountKeeper, app.BankKeeper), ) // During begin block slashing happens after distr.BeginBlocker so that diff --git a/proto/comdex/newauc/v1beta1/genesis.proto b/proto/comdex/auctionsV2/v1beta1/genesis.proto similarity index 56% rename from proto/comdex/newauc/v1beta1/genesis.proto rename to proto/comdex/auctionsV2/v1beta1/genesis.proto index 6c302fc29..1f960b6b1 100644 --- a/proto/comdex/newauc/v1beta1/genesis.proto +++ b/proto/comdex/auctionsV2/v1beta1/genesis.proto @@ -2,9 +2,9 @@ syntax = "proto3"; package comdex.newauc.v1beta1; import "gogoproto/gogo.proto"; -import "comdex/newauc/v1beta1/params.proto"; +import "comdex/auctionsV2/v1beta1/params.proto"; -option go_package = "github.com/comdex-official/comdex/x/newauc/types"; +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; diff --git a/proto/comdex/newauc/v1beta1/params.proto b/proto/comdex/auctionsV2/v1beta1/params.proto similarity index 66% rename from proto/comdex/newauc/v1beta1/params.proto rename to proto/comdex/auctionsV2/v1beta1/params.proto index 61676fd84..be66e5413 100644 --- a/proto/comdex/newauc/v1beta1/params.proto +++ b/proto/comdex/auctionsV2/v1beta1/params.proto @@ -3,7 +3,7 @@ package comdex.newauc.v1beta1; import "gogoproto/gogo.proto"; -option go_package = "github.com/comdex-official/comdex/x/newauc/types"; +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; message Params { option (gogoproto.goproto_stringer) = false; diff --git a/proto/comdex/newauc/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto similarity index 78% rename from proto/comdex/newauc/v1beta1/query.proto rename to proto/comdex/auctionsV2/v1beta1/query.proto index efc1b76de..3b55302c0 100644 --- a/proto/comdex/newauc/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -4,9 +4,9 @@ package comdex.newauc.v1beta1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -import "comdex/newauc/v1beta1/params.proto"; +import "comdex/auctionsV2/v1beta1/params.proto"; -option go_package = "github.com/comdex-official/comdex/x/newauc/types"; +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { diff --git a/proto/comdex/auctionsV2/v1beta1/tx.proto b/proto/comdex/auctionsV2/v1beta1/tx.proto new file mode 100644 index 000000000..5fc6eeb95 --- /dev/null +++ b/proto/comdex/auctionsV2/v1beta1/tx.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package comdex.newauc.v1beta1; + + +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; + +service Msg { +} diff --git a/proto/comdex/newliq/v1beta1/genesis.proto b/proto/comdex/liquidationsV2/v1beta1/genesis.proto similarity index 54% rename from proto/comdex/newliq/v1beta1/genesis.proto rename to proto/comdex/liquidationsV2/v1beta1/genesis.proto index cf5dccccd..e6939dace 100644 --- a/proto/comdex/newliq/v1beta1/genesis.proto +++ b/proto/comdex/liquidationsV2/v1beta1/genesis.proto @@ -2,9 +2,9 @@ syntax = "proto3"; package comdex.newliq.v1beta1; import "gogoproto/gogo.proto"; -import "comdex/newliq/v1beta1/params.proto"; +import "comdex/liquidationsV2/v1beta1/params.proto"; -option go_package = "github.com/comdex-official/comdex/x/newliq/types"; +option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; diff --git a/proto/comdex/newliq/v1beta1/params.proto b/proto/comdex/liquidationsV2/v1beta1/params.proto similarity index 65% rename from proto/comdex/newliq/v1beta1/params.proto rename to proto/comdex/liquidationsV2/v1beta1/params.proto index 865f91dbc..097c3a1e6 100644 --- a/proto/comdex/newliq/v1beta1/params.proto +++ b/proto/comdex/liquidationsV2/v1beta1/params.proto @@ -3,7 +3,7 @@ package comdex.newliq.v1beta1; import "gogoproto/gogo.proto"; -option go_package = "github.com/comdex-official/comdex/x/newliq/types"; +option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; message Params { option (gogoproto.goproto_stringer) = false; diff --git a/proto/comdex/newliq/v1beta1/query.proto b/proto/comdex/liquidationsV2/v1beta1/query.proto similarity index 63% rename from proto/comdex/newliq/v1beta1/query.proto rename to proto/comdex/liquidationsV2/v1beta1/query.proto index 4d9e8dac0..a88e1fe64 100644 --- a/proto/comdex/newliq/v1beta1/query.proto +++ b/proto/comdex/liquidationsV2/v1beta1/query.proto @@ -4,13 +4,13 @@ package comdex.newliq.v1beta1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -import "comdex/newliq/v1beta1/params.proto"; +import "comdex/liquidationsV2/v1beta1/params.proto"; -option go_package = "github.com/comdex-official/comdex/x/newliq/types"; +option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/comdex-official/comdex/newliq/params"; + option (google.api.http).get = "/comdex-official/comdex/liquidationsV2/params"; } } diff --git a/proto/comdex/liquidationsV2/v1beta1/tx.proto b/proto/comdex/liquidationsV2/v1beta1/tx.proto new file mode 100644 index 000000000..2d7758a4f --- /dev/null +++ b/proto/comdex/liquidationsV2/v1beta1/tx.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package comdex.newliq.v1beta1; + + +option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; + +service Msg { +} diff --git a/proto/comdex/newauc/v1beta1/tx.proto b/proto/comdex/newauc/v1beta1/tx.proto deleted file mode 100644 index 849955cf2..000000000 --- a/proto/comdex/newauc/v1beta1/tx.proto +++ /dev/null @@ -1,8 +0,0 @@ -syntax = "proto3"; -package comdex.newauc.v1beta1; - - -option go_package = "github.com/comdex-official/comdex/x/newauc/types"; - -service Msg { -} diff --git a/proto/comdex/newliq/v1beta1/tx.proto b/proto/comdex/newliq/v1beta1/tx.proto deleted file mode 100644 index 7fbf7d0df..000000000 --- a/proto/comdex/newliq/v1beta1/tx.proto +++ /dev/null @@ -1,8 +0,0 @@ -syntax = "proto3"; -package comdex.newliq.v1beta1; - - -option go_package = "github.com/comdex-official/comdex/x/newliq/types"; - -service Msg { -} diff --git a/testutil/keeper/newauc.go b/testutil/keeper/auctionsV2.go similarity index 92% rename from testutil/keeper/newauc.go rename to testutil/keeper/auctionsV2.go index a2207a971..084ad00f0 100644 --- a/testutil/keeper/newauc.go +++ b/testutil/keeper/auctionsV2.go @@ -3,8 +3,8 @@ package keeper //import ( // "testing" // -// "github.com/comdex-official/comdex/x/newauc/keeper" -// "github.com/comdex-official/comdex/x/newauc/types" +// "github.com/comdex-official/comdex/x/auctionsV2/keeper" +// "github.com/comdex-official/comdex/x/auctionsV2/types" // "github.com/cosmos/cosmos-sdk/codec" // codectypes "github.com/cosmos/cosmos-sdk/codec/types" // "github.com/cosmos/cosmos-sdk/store" diff --git a/testutil/keeper/newliq.go b/testutil/keeper/liquidationsV2.go similarity index 92% rename from testutil/keeper/newliq.go rename to testutil/keeper/liquidationsV2.go index b0b804630..d53ee8295 100644 --- a/testutil/keeper/newliq.go +++ b/testutil/keeper/liquidationsV2.go @@ -3,8 +3,8 @@ package keeper //import ( // "testing" // -// "github.com/comdex-official/comdex/x/newliq/keeper" -// "github.com/comdex-official/comdex/x/newliq/types" +// "github.com/comdex-official/comdex/x/liquidationsV2/keeper" +// "github.com/comdex-official/comdex/x/liquidationsV2/types" // "github.com/cosmos/cosmos-sdk/codec" // codectypes "github.com/cosmos/cosmos-sdk/codec/types" // "github.com/cosmos/cosmos-sdk/store" diff --git a/x/newliq/client/cli/query.go b/x/auctionsV2/client/cli/query.go similarity index 68% rename from x/newliq/client/cli/query.go rename to x/auctionsV2/client/cli/query.go index 20d88fcc4..3168f6d39 100644 --- a/x/newliq/client/cli/query.go +++ b/x/auctionsV2/client/cli/query.go @@ -10,12 +10,11 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/comdex-official/comdex/x/newliq/types" + "github.com/comdex-official/comdex/x/auctionsV2/types" ) -// GetQueryCmd returns the cli query commands for this module func GetQueryCmd(queryRoute string) *cobra.Command { - // Group newliq queries under a subcommand + // Group auctionsV2 queries under a subcommand cmd := &cobra.Command{ Use: types.ModuleName, Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), @@ -24,9 +23,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand(CmdQueryParams()) - // this line is used by starport scaffolding # 1 + cmd.AddCommand() - return cmd + return cmd } - diff --git a/x/newauc/client/cli/tx.go b/x/auctionsV2/client/cli/tx.go similarity index 92% rename from x/newauc/client/cli/tx.go rename to x/auctionsV2/client/cli/tx.go index a51727b0a..44b03a934 100644 --- a/x/newauc/client/cli/tx.go +++ b/x/auctionsV2/client/cli/tx.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/comdex-official/comdex/x/newauc/types" + "github.com/comdex-official/comdex/x/auctionsV2/types" ) var ( @@ -32,5 +32,5 @@ func GetTxCmd() *cobra.Command { // this line is used by starport scaffolding # 1 - return cmd + return cmd } diff --git a/x/newliq/genesis.go b/x/auctionsV2/genesis.go similarity index 62% rename from x/newliq/genesis.go rename to x/auctionsV2/genesis.go index 054b17f69..00580e289 100644 --- a/x/newliq/genesis.go +++ b/x/auctionsV2/genesis.go @@ -1,15 +1,15 @@ -package newliq +package auctionsV2 import ( + "github.com/comdex-official/comdex/x/auctionsV2/keeper" + "github.com/comdex-official/comdex/x/auctionsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/comdex-official/comdex/x/newliq/keeper" - "github.com/comdex-official/comdex/x/newliq/types" ) // InitGenesis initializes the capability module's state from a provided genesis // state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - // this line is used by starport scaffolding # genesis/module/init + // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -18,7 +18,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - // this line is used by starport scaffolding # genesis/module/export + // this line is used by starport scaffolding # genesis/module/export - return genesis + return genesis } diff --git a/x/newliq/handler.go b/x/auctionsV2/handler.go similarity index 82% rename from x/newliq/handler.go rename to x/auctionsV2/handler.go index 819ed8c55..efc6cbd58 100644 --- a/x/newliq/handler.go +++ b/x/auctionsV2/handler.go @@ -1,11 +1,11 @@ -package newliq +package auctionsV2 import ( "fmt" + "github.com/comdex-official/comdex/x/auctionsV2/keeper" + "github.com/comdex-official/comdex/x/auctionsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/comdex-official/comdex/x/newliq/keeper" - "github.com/comdex-official/comdex/x/newliq/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) diff --git a/x/newauc/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go similarity index 52% rename from x/newauc/keeper/grpc_query.go rename to x/auctionsV2/keeper/grpc_query.go index f2cd806e0..2a7953c0c 100644 --- a/x/newauc/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/comdex-official/comdex/x/newauc/types" + "github.com/comdex-official/comdex/x/auctionsV2/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/newliq/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go similarity index 79% rename from x/newliq/keeper/keeper.go rename to x/auctionsV2/keeper/keeper.go index 8d2cb12e8..547801c04 100644 --- a/x/newliq/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -1,11 +1,12 @@ package keeper import ( + "context" "fmt" "github.com/tendermint/tendermint/libs/log" - "github.com/comdex-official/comdex/x/newliq/types" + "github.com/comdex-official/comdex/x/auctionsV2/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -22,6 +23,11 @@ type ( } ) +func (k Keeper) Params(ctx context.Context, request *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + //TODO implement me + panic("implement me") +} + func NewKeeper( cdc codec.BinaryCodec, storeKey, diff --git a/x/newliq/keeper/msg_server.go b/x/auctionsV2/keeper/msg_server.go similarity index 83% rename from x/newliq/keeper/msg_server.go rename to x/auctionsV2/keeper/msg_server.go index ba108cd87..403b9a8ed 100644 --- a/x/newliq/keeper/msg_server.go +++ b/x/auctionsV2/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/comdex-official/comdex/x/newliq/types" + "github.com/comdex-official/comdex/x/auctionsV2/types" ) type msgServer struct { diff --git a/x/newauc/keeper/params.go b/x/auctionsV2/keeper/params.go similarity index 79% rename from x/newauc/keeper/params.go rename to x/auctionsV2/keeper/params.go index 1f799daba..628f68da1 100644 --- a/x/newauc/keeper/params.go +++ b/x/auctionsV2/keeper/params.go @@ -1,18 +1,16 @@ package keeper import ( - "github.com/comdex-official/comdex/x/newauc/types" + "github.com/comdex-official/comdex/x/auctionsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" ) // GetParams get all parameters as types.Params func (k Keeper) GetParams(ctx sdk.Context) types.Params { - return types.NewParams( - ) + return types.NewParams() } // SetParams set the params func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { k.paramstore.SetParamSet(ctx, ¶ms) } - diff --git a/x/newauc/module.go b/x/auctionsV2/module.go similarity index 92% rename from x/newauc/module.go rename to x/auctionsV2/module.go index c46c86b03..1e894d1d7 100644 --- a/x/newauc/module.go +++ b/x/auctionsV2/module.go @@ -1,9 +1,9 @@ -package newauc +package auctionsV2 import ( "encoding/json" "fmt" - // this line is used by starport scaffolding # 1 + // this line is used by starport scaffolding # 1 "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" @@ -11,21 +11,19 @@ import ( abci "github.com/tendermint/tendermint/abci/types" + "github.com/comdex-official/comdex/x/auctionsV2/client/cli" + "github.com/comdex-official/comdex/x/auctionsV2/keeper" + "github.com/comdex-official/comdex/x/auctionsV2/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/comdex-official/comdex/x/newauc/keeper" - "github.com/comdex-official/comdex/x/newauc/types" - "github.com/comdex-official/comdex/x/newauc/client/cli" - ) var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - ) // ---------------------------------------------------------------------------- @@ -79,17 +77,17 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - // this line is used by starport scaffolding # 2 + // this line is used by starport scaffolding # 2 } // GetTxCmd returns the capability module's root tx command. func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() + return cli.GetTxCmd() } // GetQueryCmd returns the capability module's root query command. func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(types.StoreKey) + return cli.GetQueryCmd(types.StoreKey) } // ---------------------------------------------------------------------------- @@ -140,7 +138,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // RegisterInvariants registers the capability module's invariants. diff --git a/x/newauc/module_simulation.go b/x/auctionsV2/module_simulation.go similarity index 86% rename from x/newauc/module_simulation.go rename to x/auctionsV2/module_simulation.go index 414448afb..2a2527763 100644 --- a/x/newauc/module_simulation.go +++ b/x/auctionsV2/module_simulation.go @@ -1,11 +1,11 @@ -package newauc +package auctionsV2 import ( "math/rand" "github.com/comdex-official/comdex/testutil/sample" - newaucsimulation "github.com/comdex-official/comdex/x/newauc/simulation" - "github.com/comdex-official/comdex/x/newauc/types" + newaucsimulation "github.com/comdex-official/comdex/x/auctionsV2/simulation" + "github.com/comdex-official/comdex/x/auctionsV2/types" "github.com/cosmos/cosmos-sdk/baseapp" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" @@ -24,7 +24,7 @@ var ( ) const ( - // this line is used by starport scaffolding # simapp/module/const +// this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module @@ -34,7 +34,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { accs[i] = acc.Address.String() } newaucGenesis := types.GenesisState{ - Params: types.DefaultParams(), + Params: types.DefaultParams(), // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&newaucGenesis) @@ -47,9 +47,8 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP // RandomizedParams creates randomized param changes for the simulator func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { - - return []simtypes.ParamChange{ - } + + return []simtypes.ParamChange{} } // RegisterStoreDecoder registers a decoder diff --git a/x/newauc/simulation/simap.go b/x/auctionsV2/simulation/simap.go similarity index 100% rename from x/newauc/simulation/simap.go rename to x/auctionsV2/simulation/simap.go diff --git a/x/newauc/types/codec.go b/x/auctionsV2/types/codec.go similarity index 100% rename from x/newauc/types/codec.go rename to x/auctionsV2/types/codec.go diff --git a/x/newliq/types/errors.go b/x/auctionsV2/types/errors.go similarity index 81% rename from x/newliq/types/errors.go rename to x/auctionsV2/types/errors.go index d150e0c3a..8fc4b3313 100644 --- a/x/newliq/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -6,8 +6,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -// x/newliq module sentinel errors +// x/auctionsV2 module sentinel errors var ( ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") - ) diff --git a/x/newauc/types/expected_keepers.go b/x/auctionsV2/types/expected_keepers.go similarity index 100% rename from x/newauc/types/expected_keepers.go rename to x/auctionsV2/types/expected_keepers.go diff --git a/x/newliq/types/genesis.go b/x/auctionsV2/types/genesis.go similarity index 60% rename from x/newliq/types/genesis.go rename to x/auctionsV2/types/genesis.go index aa82115f8..569211827 100644 --- a/x/newliq/types/genesis.go +++ b/x/auctionsV2/types/genesis.go @@ -1,24 +1,20 @@ package types -import ( -// this line is used by starport scaffolding # genesis/types/import -) - // DefaultIndex is the default capability global index const DefaultIndex uint64 = 1 // DefaultGenesis returns the default Capability genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - // this line is used by starport scaffolding # genesis/types/default - Params: DefaultParams(), + // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), } } // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - // this line is used by starport scaffolding # genesis/types/validate + // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() } diff --git a/x/newauc/types/genesis.pb.go b/x/auctionsV2/types/genesis.pb.go similarity index 81% rename from x/newauc/types/genesis.pb.go rename to x/auctionsV2/types/genesis.pb.go index 8cd0f6121..654a7496c 100644 --- a/x/newauc/types/genesis.pb.go +++ b/x/auctionsV2/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/newauc/v1beta1/genesis.proto +// source: comdex/auctionsV2/v1beta1/genesis.proto package types @@ -31,7 +31,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_a179a8afb1a02afb, []int{0} + return fileDescriptor_eebc68c04739f45f, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -72,24 +72,25 @@ func init() { } func init() { - proto.RegisterFile("comdex/newauc/v1beta1/genesis.proto", fileDescriptor_a179a8afb1a02afb) + proto.RegisterFile("comdex/auctionsV2/v1beta1/genesis.proto", fileDescriptor_eebc68c04739f45f) } -var fileDescriptor_a179a8afb1a02afb = []byte{ - // 203 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0xcf, 0x4b, 0x2d, 0x4f, 0x2c, 0x4d, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, - 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0x12, 0x85, 0x28, 0xd2, 0x83, 0x28, 0xd2, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, - 0xab, 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0xa5, 0x94, 0xb0, 0x9b, 0x58, 0x90, 0x58, 0x94, 0x98, 0x0b, - 0x35, 0x50, 0xc9, 0x9b, 0x8b, 0xc7, 0x1d, 0x62, 0x43, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x35, - 0x17, 0x1b, 0x44, 0x5e, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x56, 0x0f, 0xab, 0x8d, 0x7a, - 0x01, 0x60, 0x45, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xb5, 0x38, 0x79, 0x9d, 0x78, - 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, - 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x12, - 0xc8, 0x30, 0x7d, 0x88, 0x81, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, - 0x3e, 0xdc, 0x9d, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xf7, 0x19, 0x03, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x1c, 0x5e, 0x3c, 0xbf, 0x17, 0x01, 0x00, 0x00, +var fileDescriptor_eebc68c04739f45f = []byte{ + // 211 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4f, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, + 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0x28, 0xd4, 0xcb, 0x4b, 0x2d, 0x4f, 0x2c, 0x4d, 0xd6, 0x83, + 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0xa5, 0xd4, + 0x70, 0x9b, 0x5a, 0x90, 0x58, 0x94, 0x98, 0x0b, 0x35, 0x54, 0xc9, 0x9b, 0x8b, 0xc7, 0x1d, 0x62, + 0x4b, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x35, 0x17, 0x1b, 0x44, 0x5e, 0x82, 0x51, 0x81, 0x51, + 0x83, 0xdb, 0x48, 0x56, 0x0f, 0xab, 0xad, 0x7a, 0x01, 0x60, 0x45, 0x4e, 0x2c, 0x27, 0xee, 0xc9, + 0x33, 0x04, 0x41, 0xb5, 0x38, 0xf9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, + 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, + 0x94, 0x49, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x12, 0xc8, 0x30, 0x7d, 0x88, 0x81, 0xba, 0xf9, 0x69, + 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0x8a, 0x5b, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, + 0x93, 0xd8, 0xc0, 0x6e, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x5a, 0x5c, 0xe6, 0x23, + 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/genesis_test.go b/x/auctionsV2/types/genesis_test.go new file mode 100644 index 000000000..26e446305 --- /dev/null +++ b/x/auctionsV2/types/genesis_test.go @@ -0,0 +1,40 @@ +package types_test + +import ( + "testing" + + "github.com/comdex-official/comdex/x/auctionsV2/types" + "github.com/stretchr/testify/require" +) + +func TestGenesisState_Validate(t *testing.T) { + for _, tc := range []struct { + desc string + genState *types.GenesisState + valid bool + }{ + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} diff --git a/x/newauc/types/keys.go b/x/auctionsV2/types/keys.go similarity index 69% rename from x/newauc/types/keys.go rename to x/auctionsV2/types/keys.go index 1c9f08ad3..d78115f58 100644 --- a/x/newauc/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -2,7 +2,7 @@ package types const ( // ModuleName defines the module name - ModuleName = "newauc" + ModuleName = "auctionsV2" // StoreKey defines the primary module store key StoreKey = ModuleName @@ -10,17 +10,13 @@ const ( // RouterKey is the message route for slashing RouterKey = ModuleName - // QuerierRoute defines the module's query routing key - QuerierRoute = ModuleName + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName // MemStoreKey defines the in-memory store key MemStoreKey = "mem_newauc" - - ) - - func KeyPrefix(p string) []byte { - return []byte(p) + return []byte(p) } diff --git a/x/newauc/types/params.go b/x/auctionsV2/types/params.go similarity index 100% rename from x/newauc/types/params.go rename to x/auctionsV2/types/params.go diff --git a/x/newauc/types/params.pb.go b/x/auctionsV2/types/params.pb.go similarity index 80% rename from x/newauc/types/params.pb.go rename to x/auctionsV2/types/params.pb.go index 5b329503e..4335069d0 100644 --- a/x/newauc/types/params.pb.go +++ b/x/auctionsV2/types/params.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/newauc/v1beta1/params.proto +// source: comdex/auctionsV2/v1beta1/params.proto package types @@ -29,7 +29,7 @@ type Params struct { func (m *Params) Reset() { *m = Params{} } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_692928c502ee8249, []int{0} + return fileDescriptor_5122d8002bd05fc0, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -63,22 +63,22 @@ func init() { } func init() { - proto.RegisterFile("comdex/newauc/v1beta1/params.proto", fileDescriptor_692928c502ee8249) + proto.RegisterFile("comdex/auctionsV2/v1beta1/params.proto", fileDescriptor_5122d8002bd05fc0) } -var fileDescriptor_692928c502ee8249 = []byte{ - // 163 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0xcf, 0x4b, 0x2d, 0x4f, 0x2c, 0x4d, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, - 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, - 0x85, 0xa8, 0xd1, 0x83, 0xa8, 0xd1, 0x83, 0xaa, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, - 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0x95, 0xf8, 0xb8, 0xd8, 0x02, 0xc0, 0x9a, 0xad, 0x58, 0x66, 0x2c, - 0x90, 0x67, 0x70, 0xf2, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, - 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x83, - 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, 0x0d, 0xba, 0xf9, 0x69, - 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0xdc, 0x5d, 0x25, 0x95, 0x05, 0xa9, 0xc5, - 0x49, 0x6c, 0x60, 0x2b, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xae, 0x01, 0x45, 0x89, 0xb5, - 0x00, 0x00, 0x00, +var fileDescriptor_5122d8002bd05fc0 = []byte{ + // 171 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4b, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, + 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xa8, 0xd3, 0xcb, 0x4b, 0x2d, 0x4f, 0x2c, 0x4d, 0xd6, 0x83, 0xaa, + 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0x95, 0xf8, 0xb8, + 0xd8, 0x02, 0xc0, 0x9a, 0xad, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0xf2, 0x3b, 0xf1, 0x48, 0x8e, + 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, + 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x93, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, + 0xfc, 0x5c, 0x7d, 0x88, 0x0d, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, + 0x3e, 0x8a, 0xdb, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xd6, 0x18, 0x03, 0x02, 0x00, + 0x00, 0xff, 0xff, 0x8f, 0x6f, 0x23, 0x4c, 0xbd, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/newauc/types/query.pb.go b/x/auctionsV2/types/query.pb.go similarity index 84% rename from x/newauc/types/query.pb.go rename to x/auctionsV2/types/query.pb.go index 6f244ca78..4a15c628b 100644 --- a/x/newauc/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/newauc/v1beta1/query.proto +// source: comdex/auctionsV2/v1beta1/query.proto package types @@ -37,7 +37,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_74e5801892b1e918, []int{0} + return fileDescriptor_5270c3f1c79728ac, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -74,7 +74,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_74e5801892b1e918, []int{1} + return fileDescriptor_5270c3f1c79728ac, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -115,30 +115,32 @@ func init() { proto.RegisterType((*QueryParamsResponse)(nil), "comdex.newauc.v1beta1.QueryParamsResponse") } -func init() { proto.RegisterFile("comdex/newauc/v1beta1/query.proto", fileDescriptor_74e5801892b1e918) } - -var fileDescriptor_74e5801892b1e918 = []byte{ - // 310 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4b, 0x33, 0x31, - 0x18, 0xc7, 0x2f, 0x2f, 0xaf, 0x1d, 0xe2, 0x16, 0x2b, 0x48, 0xd1, 0xa8, 0x07, 0xa2, 0x16, 0x7a, - 0xb1, 0x75, 0x74, 0xeb, 0xe8, 0xa4, 0x1d, 0xdd, 0x72, 0x67, 0x1a, 0x03, 0x6d, 0x9e, 0xf4, 0x92, - 0x53, 0xbb, 0xfa, 0x01, 0x44, 0x70, 0xf1, 0x23, 0x75, 0x2c, 0xb8, 0x38, 0x89, 0xdc, 0xf9, 0x41, - 0xe4, 0x2e, 0x47, 0xa1, 0xd8, 0x82, 0xdb, 0xf1, 0xdc, 0xef, 0xff, 0x7b, 0xfe, 0x79, 0xf0, 0x61, - 0x02, 0xe3, 0x5b, 0xf1, 0xc8, 0xb4, 0x78, 0xe0, 0x59, 0xc2, 0xee, 0xbb, 0xb1, 0x70, 0xbc, 0xcb, - 0x26, 0x99, 0x48, 0xa7, 0x91, 0x49, 0xc1, 0x01, 0xd9, 0xf6, 0x48, 0xe4, 0x91, 0xa8, 0x46, 0x5a, - 0x4d, 0x09, 0x12, 0x2a, 0x82, 0x95, 0x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, 0xff, 0x31, 0x47, - 0x1d, 0x4c, 0x17, 0x02, 0x00, 0x00, +func init() { + proto.RegisterFile("comdex/auctionsV2/v1beta1/query.proto", fileDescriptor_5270c3f1c79728ac) +} + +var fileDescriptor_5270c3f1c79728ac = []byte{ + // 317 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xbf, 0x4a, 0x7b, 0x31, + 0x14, 0xc7, 0x6f, 0x7e, 0xfc, 0xec, 0x10, 0xb7, 0x58, 0x41, 0x8a, 0x46, 0x29, 0xd4, 0x3f, 0x85, + 0xde, 0xd0, 0xea, 0xe6, 0xd6, 0x07, 0x10, 0xed, 0xe0, 0xe0, 0x96, 0x7b, 0x4d, 0x63, 0xa0, 0xcd, + 0x49, 0x9b, 0x5c, 0xb5, 0xab, 0x0f, 0x20, 0x82, 0x8b, 0x8f, 0xd4, 0xb1, 0xe0, 0xe2, 0x24, 0xd2, + 0xfa, 0x20, 0xd2, 0x24, 0x08, 0x45, 0x2f, 0xb8, 0x25, 0x27, 0x9f, 0xef, 0xe7, 0x9c, 0x1c, 0xdc, + 0xc8, 0x61, 0x78, 0x2d, 0xee, 0x19, 0x2f, 0x72, 0xa7, 0x40, 0xdb, 0xcb, 0x0e, 0xbb, 0x6d, 0x67, + 0xc2, 0xf1, 0x36, 0x1b, 0x15, 0x62, 0x3c, 0x49, 0xcd, 0x18, 0x1c, 0x90, 0xcd, 0x80, 0xa5, 0x5a, + 0xdc, 0xf1, 0x22, 0x4f, 0x23, 0x52, 0xab, 0x4a, 0x90, 0xe0, 0x09, 0xb6, 0x3c, 0x05, 0xb8, 0xb6, + 0x2d, 0x01, 0xe4, 0x40, 0x30, 0x6e, 0x14, 0xe3, 0x5a, 0x83, 0xe3, 0x5e, 0x1d, 0x5f, 0x9b, 0x39, + 0xd8, 0x21, 0x58, 0x96, 0x71, 0x2b, 0x42, 0x8f, 0xef, 0x8e, 0x86, 0x4b, 0xa5, 0x3d, 0x1c, 0xd9, + 0xfd, 0xf2, 0xe9, 0x0c, 0x1f, 0xf3, 0x61, 0x74, 0xd6, 0xab, 0x98, 0x5c, 0x2c, 0x4d, 0xe7, 0xbe, + 0xd8, 0x13, 0xa3, 0x42, 0x58, 0x57, 0xef, 0xe1, 0x8d, 0x95, 0xaa, 0x35, 0xa0, 0xad, 0x20, 0xa7, + 0xb8, 0x12, 0xc2, 0x5b, 0x68, 0x0f, 0x1d, 0xae, 0x77, 0x76, 0xd2, 0x5f, 0x3f, 0x97, 0x86, 0x58, + 0xf7, 0xff, 0xf4, 0x7d, 0x37, 0xe9, 0xc5, 0x48, 0xe7, 0x05, 0xe1, 0x35, 0x2f, 0x25, 0x8f, 0x08, + 0x57, 0x02, 0x42, 0x8e, 0x4a, 0x0c, 0x3f, 0x67, 0xaa, 0x35, 0xff, 0x82, 0x86, 0x41, 0xeb, 0xad, + 0x87, 0xd7, 0xcf, 0xe7, 0x7f, 0x07, 0xa4, 0xc1, 0x42, 0xa6, 0x05, 0xfd, 0xbe, 0xca, 0x15, 0x1f, + 0xc4, 0x3b, 0x0b, 0x8e, 0xb8, 0x8a, 0xee, 0xd9, 0x74, 0x4e, 0xd1, 0x6c, 0x4e, 0xd1, 0xc7, 0x9c, + 0xa2, 0xa7, 0x05, 0x4d, 0x66, 0x0b, 0x9a, 0xbc, 0x2d, 0x68, 0x72, 0x75, 0x22, 0x95, 0xbb, 0x29, + 0xb2, 0x65, 0xeb, 0x32, 0xd5, 0xca, 0x8e, 0xdd, 0xc4, 0x08, 0x9b, 0x55, 0xfc, 0x6e, 0x8f, 0xbf, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x56, 0xeb, 0x62, 0x37, 0x23, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -218,7 +220,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "comdex/newauc/v1beta1/query.proto", + Metadata: "comdex/auctionsV2/v1beta1/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/newauc/types/query.pb.gw.go b/x/auctionsV2/types/query.pb.gw.go similarity index 99% rename from x/newauc/types/query.pb.gw.go rename to x/auctionsV2/types/query.pb.gw.go index 7a85e2f0c..86a8e63fa 100644 --- a/x/newauc/types/query.pb.gw.go +++ b/x/auctionsV2/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: comdex/newauc/v1beta1/query.proto +// source: comdex/auctionsV2/v1beta1/query.proto /* Package types is a reverse proxy. diff --git a/x/newauc/types/tx.pb.go b/x/auctionsV2/types/tx.pb.go similarity index 62% rename from x/newauc/types/tx.pb.go rename to x/auctionsV2/types/tx.pb.go index 1110bdd85..8dbe7d6ce 100644 --- a/x/newauc/types/tx.pb.go +++ b/x/auctionsV2/types/tx.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/newauc/v1beta1/tx.proto +// source: comdex/auctionsV2/v1beta1/tx.proto package types @@ -23,19 +23,22 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -func init() { proto.RegisterFile("comdex/newauc/v1beta1/tx.proto", fileDescriptor_3d36f481f1fa79f9) } +func init() { + proto.RegisterFile("comdex/auctionsV2/v1beta1/tx.proto", fileDescriptor_2c216a24ef98c1b4) +} -var fileDescriptor_3d36f481f1fa79f9 = []byte{ - // 139 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0xcf, 0x4b, 0x2d, 0x4f, 0x2c, 0x4d, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, - 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xc8, 0xeb, 0x41, - 0xe4, 0xf5, 0xa0, 0xf2, 0x46, 0xac, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x4e, 0x5e, 0x27, 0x1e, 0xc9, - 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, - 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, - 0x9c, 0x9f, 0xab, 0x0f, 0x31, 0x42, 0x37, 0x3f, 0x2d, 0x2d, 0x33, 0x39, 0x33, 0x31, 0x07, 0xca, - 0xd7, 0x87, 0x5b, 0x5a, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xb6, 0xd0, 0x18, 0x10, 0x00, - 0x00, 0xff, 0xff, 0xf6, 0xd7, 0x6a, 0x18, 0x92, 0x00, 0x00, 0x00, +var fileDescriptor_2c216a24ef98c1b4 = []byte{ + // 148 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, + 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x85, 0xa8, 0xd1, 0xcb, 0x4b, 0x2d, 0x4f, 0x2c, 0x4d, 0xd6, 0x83, 0xca, 0x1b, 0xb1, 0x72, 0x31, + 0xfb, 0x16, 0xa7, 0x3b, 0xf9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, + 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, + 0x49, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xc4, 0x08, 0xdd, 0xfc, + 0xb4, 0xb4, 0xcc, 0xe4, 0xcc, 0xc4, 0x1c, 0x28, 0x5f, 0x1f, 0xc5, 0xe2, 0x92, 0xca, 0x82, 0xd4, + 0xe2, 0x24, 0x36, 0xb0, 0xa5, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc3, 0xcf, 0x88, 0x73, + 0x9a, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -77,5 +80,5 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{}, - Metadata: "comdex/newauc/v1beta1/tx.proto", + Metadata: "comdex/auctionsV2/v1beta1/tx.proto", } diff --git a/x/newauc/types/types.go b/x/auctionsV2/types/types.go similarity index 100% rename from x/newauc/types/types.go rename to x/auctionsV2/types/types.go diff --git a/x/newauc/client/cli/query.go b/x/liquidationsV2/client/cli/query.go similarity index 85% rename from x/newauc/client/cli/query.go rename to x/liquidationsV2/client/cli/query.go index cc97d878f..56e41ca63 100644 --- a/x/newauc/client/cli/query.go +++ b/x/liquidationsV2/client/cli/query.go @@ -10,12 +10,12 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/comdex-official/comdex/x/newauc/types" + "github.com/comdex-official/comdex/x/liquidationsV2/types" ) // GetQueryCmd returns the cli query commands for this module func GetQueryCmd(queryRoute string) *cobra.Command { - // Group newauc queries under a subcommand + // Group liquidationsV2 queries under a subcommand cmd := &cobra.Command{ Use: types.ModuleName, Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), @@ -27,6 +27,5 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryParams()) // this line is used by starport scaffolding # 1 - return cmd + return cmd } - diff --git a/x/newliq/client/cli/query_params.go b/x/liquidationsV2/client/cli/query_params.go similarity index 91% rename from x/newliq/client/cli/query_params.go rename to x/liquidationsV2/client/cli/query_params.go index 65ec10df5..ee2004be0 100644 --- a/x/newliq/client/cli/query_params.go +++ b/x/liquidationsV2/client/cli/query_params.go @@ -3,10 +3,10 @@ package cli import ( "context" + "github.com/comdex-official/comdex/x/liquidationsV2/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/comdex-official/comdex/x/newliq/types" ) func CmdQueryParams() *cobra.Command { diff --git a/x/newliq/client/cli/tx.go b/x/liquidationsV2/client/cli/tx.go similarity index 91% rename from x/newliq/client/cli/tx.go rename to x/liquidationsV2/client/cli/tx.go index 5cd6fc892..80310a94a 100644 --- a/x/newliq/client/cli/tx.go +++ b/x/liquidationsV2/client/cli/tx.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/comdex-official/comdex/x/newliq/types" + "github.com/comdex-official/comdex/x/liquidationsV2/types" ) var ( @@ -32,5 +32,5 @@ func GetTxCmd() *cobra.Command { // this line is used by starport scaffolding # 1 - return cmd + return cmd } diff --git a/x/newauc/genesis.go b/x/liquidationsV2/genesis.go similarity index 61% rename from x/newauc/genesis.go rename to x/liquidationsV2/genesis.go index 7d2111941..32fb04602 100644 --- a/x/newauc/genesis.go +++ b/x/liquidationsV2/genesis.go @@ -1,15 +1,15 @@ -package newauc +package liquidationsV2 import ( + "github.com/comdex-official/comdex/x/liquidationsV2/keeper" + "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/comdex-official/comdex/x/newauc/keeper" - "github.com/comdex-official/comdex/x/newauc/types" ) // InitGenesis initializes the capability module's state from a provided genesis // state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - // this line is used by starport scaffolding # genesis/module/init + // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -18,7 +18,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - // this line is used by starport scaffolding # genesis/module/export + // this line is used by starport scaffolding # genesis/module/export - return genesis + return genesis } diff --git a/x/newauc/handler.go b/x/liquidationsV2/handler.go similarity index 81% rename from x/newauc/handler.go rename to x/liquidationsV2/handler.go index ca40af610..4bde12d3e 100644 --- a/x/newauc/handler.go +++ b/x/liquidationsV2/handler.go @@ -1,11 +1,11 @@ -package newauc +package liquidationsV2 import ( "fmt" + "github.com/comdex-official/comdex/x/liquidationsV2/keeper" + "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/comdex-official/comdex/x/newauc/keeper" - "github.com/comdex-official/comdex/x/newauc/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) diff --git a/x/newliq/keeper/grpc_query.go b/x/liquidationsV2/keeper/grpc_query.go similarity index 51% rename from x/newliq/keeper/grpc_query.go rename to x/liquidationsV2/keeper/grpc_query.go index 287c029ca..c67891845 100644 --- a/x/newliq/keeper/grpc_query.go +++ b/x/liquidationsV2/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/comdex-official/comdex/x/newliq/types" + "github.com/comdex-official/comdex/x/liquidationsV2/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/newauc/keeper/grpc_query_params.go b/x/liquidationsV2/keeper/grpc_query_params.go similarity index 88% rename from x/newauc/keeper/grpc_query_params.go rename to x/liquidationsV2/keeper/grpc_query_params.go index 52fb5cbaa..8e4bfb4c9 100644 --- a/x/newauc/keeper/grpc_query_params.go +++ b/x/liquidationsV2/keeper/grpc_query_params.go @@ -3,8 +3,8 @@ package keeper import ( "context" + "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/comdex-official/comdex/x/newauc/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/newliq/keeper/grpc_query_params_test.go b/x/liquidationsV2/keeper/grpc_query_params_test.go similarity index 79% rename from x/newliq/keeper/grpc_query_params_test.go rename to x/liquidationsV2/keeper/grpc_query_params_test.go index 1d0dec783..1eb67efe1 100644 --- a/x/newliq/keeper/grpc_query_params_test.go +++ b/x/liquidationsV2/keeper/grpc_query_params_test.go @@ -3,10 +3,10 @@ package keeper_test import ( "testing" + testkeeper "github.com/comdex-official/comdex/testutil/keeper" + "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - testkeeper "github.com/comdex-official/comdex/testutil/keeper" - "github.com/comdex-official/comdex/x/newliq/types" ) func TestParamsQuery(t *testing.T) { diff --git a/x/newauc/keeper/keeper.go b/x/liquidationsV2/keeper/keeper.go similarity index 93% rename from x/newauc/keeper/keeper.go rename to x/liquidationsV2/keeper/keeper.go index b97affd10..997638a38 100644 --- a/x/newauc/keeper/keeper.go +++ b/x/liquidationsV2/keeper/keeper.go @@ -5,7 +5,7 @@ import ( "github.com/tendermint/tendermint/libs/log" - "github.com/comdex-official/comdex/x/newauc/types" + "github.com/comdex-official/comdex/x/liquidationsV2/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" diff --git a/x/newauc/keeper/msg_server.go b/x/liquidationsV2/keeper/msg_server.go similarity index 83% rename from x/newauc/keeper/msg_server.go rename to x/liquidationsV2/keeper/msg_server.go index d68a408cf..3a1212c55 100644 --- a/x/newauc/keeper/msg_server.go +++ b/x/liquidationsV2/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/comdex-official/comdex/x/newauc/types" + "github.com/comdex-official/comdex/x/liquidationsV2/types" ) type msgServer struct { diff --git a/x/newliq/keeper/msg_server_test.go b/x/liquidationsV2/keeper/msg_server_test.go similarity index 59% rename from x/newliq/keeper/msg_server_test.go rename to x/liquidationsV2/keeper/msg_server_test.go index 7c623cf00..66c23c92a 100644 --- a/x/newliq/keeper/msg_server_test.go +++ b/x/liquidationsV2/keeper/msg_server_test.go @@ -4,10 +4,10 @@ import ( "context" "testing" + keepertest "github.com/comdex-official/comdex/testutil/keeper" + "github.com/comdex-official/comdex/x/liquidationsV2/keeper" + "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/comdex-official/comdex/x/newliq/types" - "github.com/comdex-official/comdex/x/newliq/keeper" - keepertest "github.com/comdex-official/comdex/testutil/keeper" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/newliq/keeper/params.go b/x/liquidationsV2/keeper/params.go similarity index 78% rename from x/newliq/keeper/params.go rename to x/liquidationsV2/keeper/params.go index 0a7fde44c..853f6e1bf 100644 --- a/x/newliq/keeper/params.go +++ b/x/liquidationsV2/keeper/params.go @@ -1,18 +1,16 @@ package keeper import ( - "github.com/comdex-official/comdex/x/newliq/types" + "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" ) // GetParams get all parameters as types.Params func (k Keeper) GetParams(ctx sdk.Context) types.Params { - return types.NewParams( - ) + return types.NewParams() } // SetParams set the params func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { k.paramstore.SetParamSet(ctx, ¶ms) } - diff --git a/x/newliq/keeper/params_test.go b/x/liquidationsV2/keeper/params_test.go similarity index 84% rename from x/newliq/keeper/params_test.go rename to x/liquidationsV2/keeper/params_test.go index 7dadd3a97..6cd048c3d 100644 --- a/x/newliq/keeper/params_test.go +++ b/x/liquidationsV2/keeper/params_test.go @@ -3,9 +3,9 @@ package keeper_test import ( "testing" - "github.com/stretchr/testify/require" testkeeper "github.com/comdex-official/comdex/testutil/keeper" - "github.com/comdex-official/comdex/x/newliq/types" + "github.com/comdex-official/comdex/x/liquidationsV2/types" + "github.com/stretchr/testify/require" ) func TestGetParams(t *testing.T) { diff --git a/x/newliq/module.go b/x/liquidationsV2/module.go similarity index 92% rename from x/newliq/module.go rename to x/liquidationsV2/module.go index 0bd1642c3..cf9426045 100644 --- a/x/newliq/module.go +++ b/x/liquidationsV2/module.go @@ -1,9 +1,9 @@ -package newliq +package liquidationsV2 import ( "encoding/json" "fmt" - // this line is used by starport scaffolding # 1 + // this line is used by starport scaffolding # 1 "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" @@ -11,21 +11,19 @@ import ( abci "github.com/tendermint/tendermint/abci/types" + "github.com/comdex-official/comdex/x/liquidationsV2/client/cli" + "github.com/comdex-official/comdex/x/liquidationsV2/keeper" + "github.com/comdex-official/comdex/x/liquidationsV2/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/comdex-official/comdex/x/newliq/keeper" - "github.com/comdex-official/comdex/x/newliq/types" - "github.com/comdex-official/comdex/x/newliq/client/cli" - ) var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} - ) // ---------------------------------------------------------------------------- @@ -79,17 +77,17 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - // this line is used by starport scaffolding # 2 + // this line is used by starport scaffolding # 2 } // GetTxCmd returns the capability module's root tx command. func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() + return cli.GetTxCmd() } // GetQueryCmd returns the capability module's root query command. func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(types.StoreKey) + return cli.GetQueryCmd(types.StoreKey) } // ---------------------------------------------------------------------------- @@ -140,7 +138,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // RegisterInvariants registers the capability module's invariants. diff --git a/x/newliq/module_simulation.go b/x/liquidationsV2/module_simulation.go similarity index 86% rename from x/newliq/module_simulation.go rename to x/liquidationsV2/module_simulation.go index 45f3c74f2..8a30f16f1 100644 --- a/x/newliq/module_simulation.go +++ b/x/liquidationsV2/module_simulation.go @@ -1,11 +1,11 @@ -package newliq +package liquidationsV2 import ( "math/rand" "github.com/comdex-official/comdex/testutil/sample" - newliqsimulation "github.com/comdex-official/comdex/x/newliq/simulation" - "github.com/comdex-official/comdex/x/newliq/types" + newliqsimulation "github.com/comdex-official/comdex/x/liquidationsV2/simulation" + "github.com/comdex-official/comdex/x/liquidationsV2/types" "github.com/cosmos/cosmos-sdk/baseapp" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" @@ -24,7 +24,7 @@ var ( ) const ( - // this line is used by starport scaffolding # simapp/module/const +// this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module @@ -34,7 +34,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { accs[i] = acc.Address.String() } newliqGenesis := types.GenesisState{ - Params: types.DefaultParams(), + Params: types.DefaultParams(), // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&newliqGenesis) @@ -47,9 +47,8 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP // RandomizedParams creates randomized param changes for the simulator func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { - - return []simtypes.ParamChange{ - } + + return []simtypes.ParamChange{} } // RegisterStoreDecoder registers a decoder diff --git a/x/newliq/simulation/simap.go b/x/liquidationsV2/simulation/simap.go similarity index 100% rename from x/newliq/simulation/simap.go rename to x/liquidationsV2/simulation/simap.go diff --git a/x/newliq/types/codec.go b/x/liquidationsV2/types/codec.go similarity index 100% rename from x/newliq/types/codec.go rename to x/liquidationsV2/types/codec.go diff --git a/x/newauc/types/errors.go b/x/liquidationsV2/types/errors.go similarity index 79% rename from x/newauc/types/errors.go rename to x/liquidationsV2/types/errors.go index 06ce9d5d3..7f1805f55 100644 --- a/x/newauc/types/errors.go +++ b/x/liquidationsV2/types/errors.go @@ -6,8 +6,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -// x/newauc module sentinel errors +// x/liquidationsV2 module sentinel errors var ( ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") - ) diff --git a/x/newliq/types/expected_keepers.go b/x/liquidationsV2/types/expected_keepers.go similarity index 100% rename from x/newliq/types/expected_keepers.go rename to x/liquidationsV2/types/expected_keepers.go diff --git a/x/newauc/types/genesis.go b/x/liquidationsV2/types/genesis.go similarity index 100% rename from x/newauc/types/genesis.go rename to x/liquidationsV2/types/genesis.go diff --git a/x/newliq/types/genesis.pb.go b/x/liquidationsV2/types/genesis.pb.go similarity index 81% rename from x/newliq/types/genesis.pb.go rename to x/liquidationsV2/types/genesis.pb.go index 9fd772dfb..1ba655866 100644 --- a/x/newliq/types/genesis.pb.go +++ b/x/liquidationsV2/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/newliq/v1beta1/genesis.proto +// source: comdex/liquidationsV2/v1beta1/genesis.proto package types @@ -31,7 +31,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_026aeb52a6f6d090, []int{0} + return fileDescriptor_7ee1f29509948006, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -72,24 +72,25 @@ func init() { } func init() { - proto.RegisterFile("comdex/newliq/v1beta1/genesis.proto", fileDescriptor_026aeb52a6f6d090) + proto.RegisterFile("comdex/liquidationsV2/v1beta1/genesis.proto", fileDescriptor_7ee1f29509948006) } -var fileDescriptor_026aeb52a6f6d090 = []byte{ - // 203 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0xcf, 0x4b, 0x2d, 0xcf, 0xc9, 0x2c, 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, - 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0x12, 0x85, 0x28, 0xd2, 0x83, 0x28, 0xd2, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, - 0xab, 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0xa5, 0x94, 0xb0, 0x9b, 0x58, 0x90, 0x58, 0x94, 0x98, 0x0b, - 0x35, 0x50, 0xc9, 0x9b, 0x8b, 0xc7, 0x1d, 0x62, 0x43, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x35, - 0x17, 0x1b, 0x44, 0x5e, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x56, 0x0f, 0xab, 0x8d, 0x7a, - 0x01, 0x60, 0x45, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xb5, 0x38, 0x79, 0x9d, 0x78, - 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, - 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x12, - 0xc8, 0x30, 0x7d, 0x88, 0x81, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, - 0x3e, 0xdc, 0x9d, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xf7, 0x19, 0x03, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x73, 0x74, 0x70, 0x3f, 0x17, 0x01, 0x00, 0x00, +var fileDescriptor_7ee1f29509948006 = []byte{ + // 215 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4e, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0xcf, 0xc9, 0x2c, 0x2c, 0xcd, 0x4c, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, + 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, + 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0x28, 0xd6, 0xcb, 0x4b, 0x2d, 0xcf, + 0xc9, 0x2c, 0xd4, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd0, 0x07, 0xb1, + 0x20, 0x8a, 0xa5, 0xb4, 0xf0, 0x9b, 0x5c, 0x90, 0x58, 0x94, 0x98, 0x0b, 0x35, 0x58, 0xc9, 0x9b, + 0x8b, 0xc7, 0x1d, 0x62, 0x53, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x35, 0x17, 0x1b, 0x44, 0x5e, + 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x56, 0x0f, 0xab, 0xcd, 0x7a, 0x01, 0x60, 0x45, 0x4e, + 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xb5, 0x38, 0x05, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, + 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, + 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x45, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x12, 0xc8, 0x30, 0x7d, 0x88, + 0x81, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0x86, 0x7b, 0x4b, + 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xee, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x83, + 0x4c, 0x26, 0x66, 0x2f, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/liquidationsV2/types/genesis_test.go b/x/liquidationsV2/types/genesis_test.go new file mode 100644 index 000000000..8ce20f8f7 --- /dev/null +++ b/x/liquidationsV2/types/genesis_test.go @@ -0,0 +1,40 @@ +package types_test + +import ( + "testing" + + "github.com/comdex-official/comdex/x/liquidationsV2/types" + "github.com/stretchr/testify/require" +) + +func TestGenesisState_Validate(t *testing.T) { + for _, tc := range []struct { + desc string + genState *types.GenesisState + valid bool + }{ + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} diff --git a/x/newliq/types/keys.go b/x/liquidationsV2/types/keys.go similarity index 69% rename from x/newliq/types/keys.go rename to x/liquidationsV2/types/keys.go index 740b28ab5..86fd942b1 100644 --- a/x/newliq/types/keys.go +++ b/x/liquidationsV2/types/keys.go @@ -2,7 +2,7 @@ package types const ( // ModuleName defines the module name - ModuleName = "newliq" + ModuleName = "liquidationsV2" // StoreKey defines the primary module store key StoreKey = ModuleName @@ -10,17 +10,13 @@ const ( // RouterKey is the message route for slashing RouterKey = ModuleName - // QuerierRoute defines the module's query routing key - QuerierRoute = ModuleName + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName // MemStoreKey defines the in-memory store key MemStoreKey = "mem_newliq" - - ) - - func KeyPrefix(p string) []byte { - return []byte(p) + return []byte(p) } diff --git a/x/newliq/types/params.go b/x/liquidationsV2/types/params.go similarity index 100% rename from x/newliq/types/params.go rename to x/liquidationsV2/types/params.go diff --git a/x/newliq/types/params.pb.go b/x/liquidationsV2/types/params.pb.go similarity index 80% rename from x/newliq/types/params.pb.go rename to x/liquidationsV2/types/params.pb.go index 88d612681..fbb01cab4 100644 --- a/x/newliq/types/params.pb.go +++ b/x/liquidationsV2/types/params.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/newliq/v1beta1/params.proto +// source: comdex/liquidationsV2/v1beta1/params.proto package types @@ -29,7 +29,7 @@ type Params struct { func (m *Params) Reset() { *m = Params{} } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_dac7fa172b6c4a49, []int{0} + return fileDescriptor_32258fedf7caac4b, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -63,22 +63,22 @@ func init() { } func init() { - proto.RegisterFile("comdex/newliq/v1beta1/params.proto", fileDescriptor_dac7fa172b6c4a49) + proto.RegisterFile("comdex/liquidationsV2/v1beta1/params.proto", fileDescriptor_32258fedf7caac4b) } -var fileDescriptor_dac7fa172b6c4a49 = []byte{ - // 163 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0xcf, 0x4b, 0x2d, 0xcf, 0xc9, 0x2c, 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, - 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, - 0x85, 0xa8, 0xd1, 0x83, 0xa8, 0xd1, 0x83, 0xaa, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, - 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0x95, 0xf8, 0xb8, 0xd8, 0x02, 0xc0, 0x9a, 0xad, 0x58, 0x66, 0x2c, - 0x90, 0x67, 0x70, 0xf2, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, - 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x83, - 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, 0x0d, 0xba, 0xf9, 0x69, - 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0xdc, 0x5d, 0x25, 0x95, 0x05, 0xa9, 0xc5, - 0x49, 0x6c, 0x60, 0x2b, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf6, 0x7c, 0xb0, 0xd5, 0xb5, - 0x00, 0x00, 0x00, +var fileDescriptor_32258fedf7caac4b = []byte{ + // 175 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4a, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0xcf, 0xc9, 0x2c, 0x2c, 0xcd, 0x4c, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, + 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, + 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xa8, 0xd5, 0xcb, 0x4b, 0x2d, 0xcf, 0xc9, + 0x2c, 0xd4, 0x83, 0xaa, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd0, 0x07, 0xb1, 0x20, + 0x8a, 0x95, 0xf8, 0xb8, 0xd8, 0x02, 0xc0, 0x9a, 0xad, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0x0a, + 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, + 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x8b, 0xf4, 0xcc, 0x92, 0x8c, + 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, 0x0d, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, + 0x89, 0x39, 0x50, 0xbe, 0x3e, 0x86, 0xfb, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x56, + 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x12, 0xb0, 0x1f, 0x73, 0xc5, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/newliq/types/query.pb.go b/x/liquidationsV2/types/query.pb.go similarity index 84% rename from x/newliq/types/query.pb.go rename to x/liquidationsV2/types/query.pb.go index 519fdc6a8..b399640c7 100644 --- a/x/newliq/types/query.pb.go +++ b/x/liquidationsV2/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/newliq/v1beta1/query.proto +// source: comdex/liquidationsV2/v1beta1/query.proto package types @@ -37,7 +37,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_1ff1262d44342b1b, []int{0} + return fileDescriptor_5ed3babcdef7f922, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -74,7 +74,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1ff1262d44342b1b, []int{1} + return fileDescriptor_5ed3babcdef7f922, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -115,30 +115,32 @@ func init() { proto.RegisterType((*QueryParamsResponse)(nil), "comdex.newliq.v1beta1.QueryParamsResponse") } -func init() { proto.RegisterFile("comdex/newliq/v1beta1/query.proto", fileDescriptor_1ff1262d44342b1b) } - -var fileDescriptor_1ff1262d44342b1b = []byte{ - // 310 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4b, 0x33, 0x31, - 0x18, 0xc7, 0x2f, 0x2f, 0xaf, 0x1d, 0xe2, 0x16, 0x2b, 0x48, 0xd1, 0xa8, 0x07, 0xa2, 0x16, 0x7a, - 0xb1, 0x75, 0x74, 0xeb, 0xe8, 0xa4, 0x1d, 0xdd, 0x72, 0x35, 0x8d, 0x81, 0x36, 0x4f, 0xee, 0x92, - 0x53, 0xbb, 0xfa, 0x01, 0x44, 0x70, 0xf1, 0x23, 0x75, 0x2c, 0xb8, 0x38, 0x89, 0xdc, 0xf9, 0x41, - 0xe4, 0x2e, 0x47, 0xa1, 0xd8, 0x82, 0xdb, 0xf1, 0xdc, 0xef, 0xff, 0x7b, 0xfe, 0x79, 0xf0, 0xe1, - 0x10, 0x26, 0xb7, 0xe2, 0x91, 0x69, 0xf1, 0x30, 0x56, 0x09, 0xbb, 0xef, 0xc6, 0xc2, 0xf1, 0x2e, - 0x4b, 0x32, 0x91, 0x4e, 0x23, 0x93, 0x82, 0x03, 0xb2, 0xed, 0x91, 0xc8, 0x23, 0x51, 0x8d, 0xb4, - 0x9a, 0x12, 0x24, 0x54, 0x04, 0x2b, 0xbf, 0x3c, 0xdc, 0xda, 0x95, 0x00, 0x72, 0x2c, 0x18, 0x37, - 0x8a, 0x71, 0xad, 0xc1, 0x71, 0xa7, 0x40, 0xdb, 0xfa, 0x6f, 0x7b, 0x08, 0x76, 0x02, 0x96, 0xc5, - 0xdc, 0x0a, 0xbf, 0x63, 0xb1, 0xd1, 0x70, 0xa9, 0x74, 0x05, 0xd7, 0x6c, 0xb8, 0xba, 0x99, 0xe1, - 0x29, 0x9f, 0xd4, 0xbe, 0xb0, 0x89, 0xc9, 0x75, 0x69, 0xb9, 0xaa, 0x86, 0x03, 0x91, 0x64, 0xc2, - 0xba, 0x70, 0x80, 0xb7, 0x96, 0xa6, 0xd6, 0x80, 0xb6, 0x82, 0x5c, 0xe0, 0x86, 0x0f, 0xef, 0xa0, - 0x03, 0x74, 0xb2, 0xd9, 0xdb, 0x8b, 0x56, 0x3e, 0x2c, 0xf2, 0xb1, 0xfe, 0xff, 0xd9, 0xe7, 0x7e, - 0x30, 0xa8, 0x23, 0xbd, 0x37, 0x84, 0x37, 0x2a, 0x29, 0x79, 0x46, 0xb8, 0xe1, 0x11, 0x72, 0xba, - 0xc6, 0xf0, 0xbb, 0x53, 0xab, 0xfd, 0x17, 0xd4, 0x17, 0x0d, 0x3b, 0x4f, 0xef, 0xdf, 0xaf, 0xff, - 0x8e, 0xc9, 0x11, 0xf3, 0x99, 0x0e, 0x8c, 0x46, 0x6a, 0xa8, 0xf8, 0x98, 0x2d, 0x9f, 0xc4, 0x57, - 0xeb, 0x5f, 0xce, 0x72, 0x8a, 0xe6, 0x39, 0x45, 0x5f, 0x39, 0x45, 0x2f, 0x05, 0x0d, 0xe6, 0x05, - 0x0d, 0x3e, 0x0a, 0x1a, 0xdc, 0x9c, 0x49, 0xe5, 0xee, 0xb2, 0xb8, 0x5c, 0xbd, 0x4e, 0xb5, 0x90, - 0xb9, 0xa9, 0x11, 0x36, 0x6e, 0x54, 0x77, 0x3d, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x02, 0xe4, - 0x3e, 0x40, 0x17, 0x02, 0x00, 0x00, +func init() { + proto.RegisterFile("comdex/liquidationsV2/v1beta1/query.proto", fileDescriptor_5ed3babcdef7f922) +} + +var fileDescriptor_5ed3babcdef7f922 = []byte{ + // 316 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xb1, 0x4a, 0x03, 0x31, + 0x18, 0xc7, 0x2f, 0xa2, 0x1d, 0xe2, 0x16, 0x2b, 0x48, 0xd1, 0x28, 0x9d, 0x6c, 0xa1, 0x17, 0x5a, + 0x11, 0x04, 0xb7, 0x3e, 0x81, 0xde, 0xe0, 0xe0, 0x96, 0x6b, 0xd3, 0x18, 0xb8, 0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xe6, 0x11, 0xd2, 0x5a, 0x63, 0x58, 0xee, 0xd4, 0x68, 0xff, 0x07, 0xf5, 0x45, 0x9b, + 0xa7, 0x0f, 0xaf, 0x9f, 0x4f, 0x1b, 0x8c, 0x74, 0x98, 0xcf, 0x74, 0x60, 0x34, 0x52, 0x03, 0xc5, + 0x13, 0xb6, 0xfa, 0x34, 0xbe, 0x62, 0x3f, 0x9a, 0x2d, 0x28, 0x9a, 0x2f, 0x28, 0xfa, 0x58, 0x50, + 0xf4, 0x98, 0xd3, 0x60, 0x9e, 0xd3, 0xe0, 0x2d, 0xa7, 0xc1, 0xf5, 0x99, 0x54, 0xee, 0x26, 0x8b, + 0x8b, 0x0a, 0xeb, 0x94, 0x4b, 0x52, 0x37, 0x35, 0xc2, 0xc6, 0xb5, 0xf2, 0xce, 0x27, 0x5f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x7a, 0x18, 0x4c, 0x3f, 0x37, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -218,7 +220,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "comdex/newliq/v1beta1/query.proto", + Metadata: "comdex/liquidationsV2/v1beta1/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/newliq/types/query.pb.gw.go b/x/liquidationsV2/types/query.pb.gw.go similarity index 97% rename from x/newliq/types/query.pb.gw.go rename to x/liquidationsV2/types/query.pb.gw.go index 7ec53bc88..f030c9001 100644 --- a/x/newliq/types/query.pb.gw.go +++ b/x/liquidationsV2/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: comdex/newliq/v1beta1/query.proto +// source: comdex/liquidationsV2/v1beta1/query.proto /* Package types is a reverse proxy. @@ -145,7 +145,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex-official", "comdex", "newliq", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex-official", "comdex", "liquidationsV2", "params"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/newliq/types/tx.pb.go b/x/liquidationsV2/types/tx.pb.go similarity index 61% rename from x/newliq/types/tx.pb.go rename to x/liquidationsV2/types/tx.pb.go index fd97c8ee2..72a2b8838 100644 --- a/x/newliq/types/tx.pb.go +++ b/x/liquidationsV2/types/tx.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/newliq/v1beta1/tx.proto +// source: comdex/liquidationsV2/v1beta1/tx.proto package types @@ -23,19 +23,22 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -func init() { proto.RegisterFile("comdex/newliq/v1beta1/tx.proto", fileDescriptor_9c4b8bbd08aaa2c5) } +func init() { + proto.RegisterFile("comdex/liquidationsV2/v1beta1/tx.proto", fileDescriptor_51c735c845851e88) +} -var fileDescriptor_9c4b8bbd08aaa2c5 = []byte{ - // 139 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0xcf, 0x4b, 0x2d, 0xcf, 0xc9, 0x2c, 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, - 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xc8, 0xeb, 0x41, - 0xe4, 0xf5, 0xa0, 0xf2, 0x46, 0xac, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x4e, 0x5e, 0x27, 0x1e, 0xc9, - 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, - 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, - 0x9c, 0x9f, 0xab, 0x0f, 0x31, 0x42, 0x37, 0x3f, 0x2d, 0x2d, 0x33, 0x39, 0x33, 0x31, 0x07, 0xca, - 0xd7, 0x87, 0x5b, 0x5a, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xb6, 0xd0, 0x18, 0x10, 0x00, - 0x00, 0xff, 0xff, 0x1e, 0x8f, 0xae, 0x73, 0x92, 0x00, 0x00, 0x00, +var fileDescriptor_51c735c845851e88 = []byte{ + // 152 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4b, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0xcf, 0xc9, 0x2c, 0x2c, 0xcd, 0x4c, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, + 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xa8, 0xd3, 0xcb, 0x4b, 0x2d, 0xcf, 0xc9, 0x2c, 0xd4, 0x83, 0xca, + 0x1b, 0xb1, 0x72, 0x31, 0xfb, 0x16, 0xa7, 0x3b, 0x05, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, + 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, + 0xb1, 0x1c, 0x43, 0x94, 0x45, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, + 0xc4, 0x08, 0xdd, 0xfc, 0xb4, 0xb4, 0xcc, 0xe4, 0xcc, 0xc4, 0x1c, 0x28, 0x5f, 0x1f, 0xc3, 0xf2, + 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xc5, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xaa, 0xff, 0x42, 0x46, 0xa2, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -77,5 +80,5 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{}, - Metadata: "comdex/newliq/v1beta1/tx.proto", + Metadata: "comdex/liquidationsV2/v1beta1/tx.proto", } diff --git a/x/newliq/types/types.go b/x/liquidationsV2/types/types.go similarity index 100% rename from x/newliq/types/types.go rename to x/liquidationsV2/types/types.go diff --git a/x/newauc/client/cli/query_params.go b/x/newauc/client/cli/query_params.go deleted file mode 100644 index 60f723740..000000000 --- a/x/newauc/client/cli/query_params.go +++ /dev/null @@ -1,34 +0,0 @@ -package cli - -import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - "github.com/comdex-official/comdex/x/newauc/types" -) - -func CmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "shows the parameters of the module", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/newauc/keeper/grpc_query_params_test.go b/x/newauc/keeper/grpc_query_params_test.go deleted file mode 100644 index e4e2fdbac..000000000 --- a/x/newauc/keeper/grpc_query_params_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - testkeeper "github.com/comdex-official/comdex/testutil/keeper" - "github.com/comdex-official/comdex/x/newauc/types" -) - -func TestParamsQuery(t *testing.T) { - keeper, ctx := testkeeper.NewaucKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - params := types.DefaultParams() - keeper.SetParams(ctx, params) - - response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) - require.NoError(t, err) - require.Equal(t, &types.QueryParamsResponse{Params: params}, response) -} diff --git a/x/newauc/keeper/msg_server_test.go b/x/newauc/keeper/msg_server_test.go deleted file mode 100644 index b3c9ed430..000000000 --- a/x/newauc/keeper/msg_server_test.go +++ /dev/null @@ -1,16 +0,0 @@ -package keeper_test - -import ( - "context" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/comdex-official/comdex/x/newauc/types" - "github.com/comdex-official/comdex/x/newauc/keeper" - keepertest "github.com/comdex-official/comdex/testutil/keeper" -) - -func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { - k, ctx := keepertest.NewaucKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) -} diff --git a/x/newauc/keeper/params_test.go b/x/newauc/keeper/params_test.go deleted file mode 100644 index 1feeec6cc..000000000 --- a/x/newauc/keeper/params_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - testkeeper "github.com/comdex-official/comdex/testutil/keeper" - "github.com/comdex-official/comdex/x/newauc/types" -) - -func TestGetParams(t *testing.T) { - k, ctx := testkeeper.NewaucKeeper(t) - params := types.DefaultParams() - - k.SetParams(ctx, params) - - require.EqualValues(t, params, k.GetParams(ctx)) -} diff --git a/x/newauc/types/genesis_test.go b/x/newauc/types/genesis_test.go deleted file mode 100644 index 80eeff908..000000000 --- a/x/newauc/types/genesis_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - "github.com/comdex-official/comdex/x/newauc/types" -) - -func TestGenesisState_Validate(t *testing.T) { - for _, tc := range []struct { - desc string - genState *types.GenesisState - valid bool - } { - { - desc: "default is valid", - genState: types.DefaultGenesis(), - valid: true, - }, - { - desc: "valid genesis state", - genState: &types.GenesisState{ - - // this line is used by starport scaffolding # types/genesis/validField - }, - valid: true, - }, - // this line is used by starport scaffolding # types/genesis/testcase - } { - t.Run(tc.desc, func(t *testing.T) { - err := tc.genState.Validate() - if tc.valid { - require.NoError(t, err) - } else { - require.Error(t, err) - } - }) - } -} \ No newline at end of file diff --git a/x/newliq/keeper/grpc_query_params.go b/x/newliq/keeper/grpc_query_params.go deleted file mode 100644 index fa8610405..000000000 --- a/x/newliq/keeper/grpc_query_params.go +++ /dev/null @@ -1,19 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/comdex-official/comdex/x/newliq/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil -} diff --git a/x/newliq/types/genesis_test.go b/x/newliq/types/genesis_test.go deleted file mode 100644 index 2ece4f10f..000000000 --- a/x/newliq/types/genesis_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - "github.com/comdex-official/comdex/x/newliq/types" -) - -func TestGenesisState_Validate(t *testing.T) { - for _, tc := range []struct { - desc string - genState *types.GenesisState - valid bool - } { - { - desc: "default is valid", - genState: types.DefaultGenesis(), - valid: true, - }, - { - desc: "valid genesis state", - genState: &types.GenesisState{ - - // this line is used by starport scaffolding # types/genesis/validField - }, - valid: true, - }, - // this line is used by starport scaffolding # types/genesis/testcase - } { - t.Run(tc.desc, func(t *testing.T) { - err := tc.genState.Validate() - if tc.valid { - require.NoError(t, err) - } else { - require.Error(t, err) - } - }) - } -} \ No newline at end of file From 963a6bc8c1c733e8549a9e0ac2b1aedec3098b3d Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Fri, 7 Apr 2023 02:49:14 +0530 Subject: [PATCH 003/155] creating liquidation proto --- .../liquidationsV2/v1beta1/liquidate.proto | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 proto/comdex/liquidationsV2/v1beta1/liquidate.proto diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto new file mode 100644 index 000000000..cc1743c84 --- /dev/null +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -0,0 +1,156 @@ +syntax = "proto3"; +package comdex.newliq.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; +option (gogoproto.equal_all) = false; +option (gogoproto.goproto_getters_all) = false; + + +message WhiteListing { + + uint64 app_id = 1 [ + (gogoproto.customname) = "AppId", + (gogoproto.moretags) = "yaml:\"app_id\""]; + + uint64 auction_type = 2 [ + (gogoproto.customname) = "AuctionType", + (gogoproto.moretags) = "yaml:\"auction_type\""]; + + +} + + + +//Internal keepers are bots run by people to liquidate positions of comdex apps +//They run tx function to liquidate the positions +//External keeper function allows external projects to use comdex auction- +//market to liquidate their positions and take part in auctions. + + +message LockedVault { + + uint64 id = 1 [ + (gogoproto.customname) = "LockedVaultId", + (gogoproto.moretags) = "yaml:\"id\""]; + + uint64 app_id = 2 [ + (gogoproto.customname) = "AppId", + (gogoproto.moretags) = "yaml:\"id\""]; + + uint64 original_vault_id = 3 [ + (gogoproto.customname) = "OriginalVaultId", + (gogoproto.moretags) = "yaml:\"id\""]; + + uint64 extended_pair_vault_id = 4 [ + (gogoproto.customname) = "ExtendedPairId", + (gogoproto.moretags) = "yaml:\"extended_pair_vault_id\""]; + + string owner = 5 [ + (gogoproto.customname) = "Owner", + (gogoproto.moretags) = "yaml:\"owner\""]; + + string amount_in = 6 [ + (gogoproto.customname) = "AmountIn", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"amount_in\"", + (gogoproto.nullable) = false]; + + string amount_out = 7 [ + (gogoproto.customname) = "AmountOut", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"amount_out\"", + (gogoproto.nullable) = false]; + + string current_collateralisation_ratio = 8 [ + (gogoproto.customname) = "CurrentCollaterlisationRatio", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"current_collateralisation_ratio\""]; + + string collateral_to_be_auctioned =9 [ + (gogoproto.nullable) = false, + (gogoproto.customname) = "CollateralToBeAuctioned", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"collateral_to_be_auctioned\""]; + + google.protobuf.Timestamp liquidation_timestamp = 10 [ + (gogoproto.customname) = "LiquidationTimestamp", + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"liquidation_timestamp\""]; + bool is_internal_keeper = 11 [ + (gogoproto.customname) = "IsInternalKeeper", + (gogoproto.moretags) = "yaml:\"is_intenal_keeper\""]; + string internal_keeper_address = 12 [ + (gogoproto.customname) = "InternalKeeperAddress", + (gogoproto.moretags) = "yaml:\"internal_keeper_address\""]; + string is_external_keeper = 13 [ + (gogoproto.customname) = "IsExternalKeeper", + (gogoproto.moretags) = "yaml:\"is_external_keeper\""]; + string external_keeper_address = 14 [ + (gogoproto.customname) = "ExternalKeeperAddress", + (gogoproto.moretags) = "yaml:\"external_keeper_address\""]; + + + + + +//updated_amount_out = amount_out + interest_accumulated + opening_fee_accumulated +// // + closing_fee_accumulated +// string updated_amount_out = 8 [ +// (gogoproto.customname) = "UpdatedAmountOut", +// (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", +// (gogoproto.moretags) = "yaml:\"updated_amount_out\"", +// (gogoproto.nullable) = false]; + +// string initiator = 9 [ +// (gogoproto.customname) = "Initiator", +// (gogoproto.moretags) = "yaml:\"admin\""]; + +// bool is_auction_complete = 10 [ +// (gogoproto.customname) = "IsAuctionComplete", +// (gogoproto.moretags) = "yaml:\"is_auction_complete\""]; + +// bool is_auction_in_progress = 11 [ +// (gogoproto.customname) = "IsAuctionInProgress", +// (gogoproto.moretags) = "yaml:\"is_auction_in_progress\""]; + +// string cr_at_liquidation = 12 [ +// (gogoproto.customname) = "CrAtLiquidation", +// (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", +// (gogoproto.nullable) = false, +// (gogoproto.moretags) = "yaml:\"cr_at_liquidation\""]; + + +// repeated string selloff_history = 16 [ +// (gogoproto.customname) = "SellOffHistory", +// (gogoproto.moretags) = "yaml:\"selloff_history\""]; + +// string interest_accumulated = 17[ +// (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", +// (gogoproto.moretags) = "yaml:\"interest_accumulated\"", +// (gogoproto.nullable) = false]; +// oneof kind { +// BorrowMetaData borrow_meta_data = 18; +// } +} + +// message BorrowMetaData { +// uint64 lending_id = 1; +// bool is_stable_borrow = 2; +// string stable_borrow_rate = 3 [ +// (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", +// (gogoproto.nullable) = false, +// (gogoproto.moretags) = "yaml:\"stable_borrow_rate\"" +// ]; +// cosmos.base.v1beta1.Coin bridged_asset_amount = 4 [ +// (gogoproto.nullable) = false, +// (gogoproto.moretags) = "yaml:\"bridged_asset_amount\"", +// (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" +// ]; + +// } From 3f081bec6937c38cee0ddb91a9d39091abd7d32b Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 7 Apr 2023 02:51:53 +0530 Subject: [PATCH 004/155] adding pb files --- .../liquidationsV2/v1beta1/liquidate.proto | 6 +- x/liquidationsV2/types/liquidate.pb.go | 1045 +++++++++++++++++ 2 files changed, 1050 insertions(+), 1 deletion(-) create mode 100644 x/liquidationsV2/types/liquidate.pb.go diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index cc1743c84..fffe46614 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -81,16 +81,20 @@ message LockedVault { (gogoproto.customname) = "LiquidationTimestamp", (gogoproto.nullable) = false, (gogoproto.stdtime) = true, - (gogoproto.moretags) = "yaml:\"liquidation_timestamp\""]; + (gogoproto.moretags) = "yaml:\"liquidation_timestamp\""]; + bool is_internal_keeper = 11 [ (gogoproto.customname) = "IsInternalKeeper", (gogoproto.moretags) = "yaml:\"is_intenal_keeper\""]; + string internal_keeper_address = 12 [ (gogoproto.customname) = "InternalKeeperAddress", (gogoproto.moretags) = "yaml:\"internal_keeper_address\""]; + string is_external_keeper = 13 [ (gogoproto.customname) = "IsExternalKeeper", (gogoproto.moretags) = "yaml:\"is_external_keeper\""]; + string external_keeper_address = 14 [ (gogoproto.customname) = "ExternalKeeperAddress", (gogoproto.moretags) = "yaml:\"external_keeper_address\""]; diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go new file mode 100644 index 000000000..bc53e6250 --- /dev/null +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -0,0 +1,1045 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/liquidationsV2/v1beta1/liquidate.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/timestamp" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type WhiteListing struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AuctionType uint64 `protobuf:"varint,2,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` +} + +func (m *WhiteListing) Reset() { *m = WhiteListing{} } +func (m *WhiteListing) String() string { return proto.CompactTextString(m) } +func (*WhiteListing) ProtoMessage() {} +func (*WhiteListing) Descriptor() ([]byte, []int) { + return fileDescriptor_631048b9d11253bf, []int{0} +} +func (m *WhiteListing) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WhiteListing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WhiteListing.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WhiteListing) XXX_Merge(src proto.Message) { + xxx_messageInfo_WhiteListing.Merge(m, src) +} +func (m *WhiteListing) XXX_Size() int { + return m.Size() +} +func (m *WhiteListing) XXX_DiscardUnknown() { + xxx_messageInfo_WhiteListing.DiscardUnknown(m) +} + +var xxx_messageInfo_WhiteListing proto.InternalMessageInfo + +type LockedVault struct { + LockedVaultId uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"id"` + OriginalVaultId uint64 `protobuf:"varint,3,opt,name=original_vault_id,json=originalVaultId,proto3" json:"original_vault_id,omitempty" yaml:"id"` + ExtendedPairId uint64 `protobuf:"varint,4,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` + AmountIn github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=amount_in,json=amountIn,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_in" yaml:"amount_in"` + AmountOut github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=amount_out,json=amountOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_out" yaml:"amount_out"` + CurrentCollaterlisationRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=current_collateralisation_ratio,json=currentCollateralisationRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"current_collateralisation_ratio" yaml:"current_collateralisation_ratio"` + CollateralToBeAuctioned github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=collateral_to_be_auctioned,json=collateralToBeAuctioned,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_to_be_auctioned" yaml:"collateral_to_be_auctioned"` + LiquidationTimestamp time.Time `protobuf:"bytes,10,opt,name=liquidation_timestamp,json=liquidationTimestamp,proto3,stdtime" json:"liquidation_timestamp" yaml:"liquidation_timestamp"` + IsInternalKeeper bool `protobuf:"varint,11,opt,name=is_internal_keeper,json=isInternalKeeper,proto3" json:"is_internal_keeper,omitempty" yaml:"is_intenal_keeper"` + InternalKeeperAddress string `protobuf:"bytes,12,opt,name=internal_keeper_address,json=internalKeeperAddress,proto3" json:"internal_keeper_address,omitempty" yaml:"internal_keeper_address"` + IsExternalKeeper string `protobuf:"bytes,13,opt,name=is_external_keeper,json=isExternalKeeper,proto3" json:"is_external_keeper,omitempty" yaml:"is_external_keeper"` + ExternalKeeperAddress string `protobuf:"bytes,14,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` +} + +func (m *LockedVault) Reset() { *m = LockedVault{} } +func (m *LockedVault) String() string { return proto.CompactTextString(m) } +func (*LockedVault) ProtoMessage() {} +func (*LockedVault) Descriptor() ([]byte, []int) { + return fileDescriptor_631048b9d11253bf, []int{1} +} +func (m *LockedVault) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LockedVault) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LockedVault.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LockedVault) XXX_Merge(src proto.Message) { + xxx_messageInfo_LockedVault.Merge(m, src) +} +func (m *LockedVault) XXX_Size() int { + return m.Size() +} +func (m *LockedVault) XXX_DiscardUnknown() { + xxx_messageInfo_LockedVault.DiscardUnknown(m) +} + +var xxx_messageInfo_LockedVault proto.InternalMessageInfo + +func init() { + proto.RegisterType((*WhiteListing)(nil), "comdex.newliq.v1beta1.WhiteListing") + proto.RegisterType((*LockedVault)(nil), "comdex.newliq.v1beta1.LockedVault") +} + +func init() { + proto.RegisterFile("comdex/liquidationsV2/v1beta1/liquidate.proto", fileDescriptor_631048b9d11253bf) +} + +var fileDescriptor_631048b9d11253bf = []byte{ + // 856 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcd, 0x6e, 0xdb, 0x36, + 0x1c, 0xb7, 0xb2, 0x26, 0x8b, 0xe9, 0xa4, 0x4d, 0xd5, 0xb8, 0x51, 0x8d, 0x56, 0xf4, 0x74, 0x08, + 0x72, 0x89, 0xb4, 0xb4, 0x97, 0x61, 0xbb, 0xcc, 0xee, 0x7a, 0x30, 0x16, 0x2c, 0x85, 0x10, 0x74, + 0x40, 0x0f, 0x13, 0x68, 0x89, 0x71, 0x88, 0xc8, 0xa2, 0x2a, 0x51, 0x6d, 0xf2, 0x0e, 0x3b, 0x74, + 0x6f, 0x31, 0x60, 0x2f, 0xb1, 0x63, 0x8e, 0x3d, 0x0e, 0x3b, 0x70, 0x9b, 0xf2, 0x06, 0x7a, 0x82, + 0x81, 0x1f, 0xfe, 0x90, 0xab, 0xa2, 0xc8, 0x25, 0x8e, 0xf8, 0xff, 0x7d, 0x42, 0x24, 0x05, 0x0e, + 0x43, 0x3a, 0x8d, 0xf0, 0xa5, 0x17, 0x93, 0x37, 0x05, 0x89, 0x10, 0x23, 0x34, 0xc9, 0x5f, 0x3d, + 0xf5, 0xde, 0x1e, 0x8d, 0x31, 0x43, 0x47, 0xf3, 0x65, 0xec, 0xa6, 0x19, 0x65, 0xd4, 0xec, 0x2a, + 0xb8, 0x9b, 0xe0, 0x77, 0x31, 0x79, 0xe3, 0x6a, 0x58, 0x6f, 0x77, 0x42, 0x27, 0x54, 0x22, 0x3c, + 0xf1, 0x9f, 0x02, 0xf7, 0xe0, 0x84, 0xd2, 0x49, 0x8c, 0x3d, 0xf9, 0x34, 0x2e, 0xce, 0x3c, 0x46, + 0xa6, 0x38, 0x67, 0x68, 0x9a, 0x6a, 0x80, 0x1d, 0xd2, 0x7c, 0x4a, 0x73, 0x6f, 0x8c, 0x72, 0x3c, + 0xb7, 0x0c, 0x29, 0x49, 0xd4, 0xdc, 0xf9, 0xd5, 0x00, 0x5b, 0x3f, 0x9f, 0x13, 0x86, 0x8f, 0x49, + 0xce, 0x48, 0x32, 0x31, 0x8f, 0xc0, 0x06, 0x4a, 0xd3, 0x80, 0x44, 0x96, 0xd1, 0x37, 0x0e, 0xee, + 0x0c, 0x7b, 0x25, 0x87, 0xeb, 0x83, 0x34, 0x1d, 0x45, 0x15, 0x87, 0xdb, 0x57, 0x68, 0x1a, 0x7f, + 0xeb, 0x28, 0x80, 0xe3, 0xaf, 0x23, 0xb1, 0x6e, 0x8e, 0xc0, 0x16, 0x2a, 0x42, 0xd1, 0x2b, 0x60, + 0x57, 0x29, 0xb6, 0xd6, 0x24, 0x71, 0xbf, 0xe4, 0xb0, 0x33, 0x50, 0xeb, 0xa7, 0x57, 0x29, 0xae, + 0x38, 0x7c, 0xa0, 0xe9, 0x4b, 0x60, 0xc7, 0xef, 0xa0, 0x05, 0xc6, 0xb9, 0xe9, 0x80, 0xce, 0x31, + 0x0d, 0x2f, 0x70, 0xf4, 0x0a, 0x15, 0x31, 0x33, 0x5d, 0xb0, 0x36, 0x4f, 0x62, 0x97, 0x1c, 0x6e, + 0x2f, 0x0d, 0x65, 0xa2, 0xb6, 0x92, 0x14, 0x69, 0xd6, 0x48, 0x64, 0x1e, 0xce, 0xd3, 0xab, 0x10, + 0x0f, 0x97, 0xd3, 0x2f, 0x61, 0x75, 0xf2, 0x63, 0x70, 0x9f, 0x66, 0x64, 0x42, 0x12, 0x14, 0x07, + 0x6f, 0x85, 0xa6, 0x60, 0x7e, 0x21, 0x99, 0xfd, 0x92, 0xc3, 0x7b, 0x27, 0x7a, 0xd8, 0xe8, 0x77, + 0x8f, 0xd6, 0xa7, 0xe6, 0x39, 0x78, 0x88, 0x2f, 0x19, 0x4e, 0x22, 0x1c, 0x05, 0x29, 0x22, 0xd9, + 0x42, 0xf2, 0x8e, 0x94, 0x7c, 0x56, 0x72, 0x78, 0xf7, 0x85, 0x46, 0xbc, 0x44, 0x24, 0x93, 0x8a, +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 0x4e, 0xcd, 0x0a, 0x8e, 0xdf, 0x25, + 0x4d, 0x44, 0x33, 0x90, 0xa5, 0xc4, 0x15, 0xb0, 0x5c, 0x6a, 0x5b, 0xfa, 0x1d, 0xa9, 0x52, 0x2f, + 0x2e, 0x57, 0x4a, 0x3d, 0x9a, 0x97, 0x5a, 0xe1, 0xc9, 0x56, 0x75, 0xb8, 0x68, 0xb5, 0x82, 0x9a, + 0xb7, 0xba, 0xbb, 0x68, 0x55, 0x27, 0x7d, 0xd4, 0xea, 0x13, 0x0a, 0x8e, 0xdf, 0xc5, 0x4d, 0xc4, + 0xe1, 0xeb, 0xeb, 0xff, 0xec, 0xd6, 0xef, 0xa5, 0xdd, 0xba, 0x2e, 0x6d, 0xe3, 0x43, 0x69, 0x1b, + 0xff, 0x96, 0xb6, 0xf1, 0xfe, 0xc6, 0x6e, 0x7d, 0xb8, 0xb1, 0x5b, 0x7f, 0xdd, 0xd8, 0xad, 0xd7, + 0xdf, 0xd4, 0x76, 0xb8, 0xf8, 0x1e, 0x1e, 0xd2, 0xb3, 0x33, 0x12, 0x12, 0x14, 0xeb, 0x67, 0xef, + 0xa3, 0x0f, 0xaa, 0xdc, 0xf7, 0xe3, 0x0d, 0xb9, 0xe5, 0x9e, 0xfd, 0x1f, 0x00, 0x00, 0xff, 0xff, + 0x99, 0x33, 0xd7, 0x9e, 0x76, 0x07, 0x00, 0x00, +} + +func (m *WhiteListing) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WhiteListing) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuctionType != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.AuctionType)) + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *LockedVault) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LockedVault) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ExternalKeeperAddress) > 0 { + i -= len(m.ExternalKeeperAddress) + copy(dAtA[i:], m.ExternalKeeperAddress) + i = encodeVarintLiquidate(dAtA, i, uint64(len(m.ExternalKeeperAddress))) + i-- + dAtA[i] = 0x72 + } + if len(m.IsExternalKeeper) > 0 { + i -= len(m.IsExternalKeeper) + copy(dAtA[i:], m.IsExternalKeeper) + i = encodeVarintLiquidate(dAtA, i, uint64(len(m.IsExternalKeeper))) + i-- + dAtA[i] = 0x6a + } + if len(m.InternalKeeperAddress) > 0 { + i -= len(m.InternalKeeperAddress) + copy(dAtA[i:], m.InternalKeeperAddress) + i = encodeVarintLiquidate(dAtA, i, uint64(len(m.InternalKeeperAddress))) + i-- + dAtA[i] = 0x62 + } + if m.IsInternalKeeper { + i-- + if m.IsInternalKeeper { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LiquidationTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LiquidationTimestamp):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintLiquidate(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x52 + { + size := m.CollateralToBeAuctioned.Size() + i -= size + if _, err := m.CollateralToBeAuctioned.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + { + size := m.CurrentCollaterlisationRatio.Size() + i -= size + if _, err := m.CurrentCollaterlisationRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size := m.AmountOut.Size() + i -= size + if _, err := m.AmountOut.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size := m.AmountIn.Size() + i -= size + if _, err := m.AmountIn.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintLiquidate(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x2a + } + if m.ExtendedPairId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.ExtendedPairId)) + i-- + dAtA[i] = 0x20 + } + if m.OriginalVaultId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.OriginalVaultId)) + i-- + dAtA[i] = 0x18 + } + if m.AppId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x10 + } + if m.LockedVaultId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.LockedVaultId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintLiquidate(dAtA []byte, offset int, v uint64) int { + offset -= sovLiquidate(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *WhiteListing) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovLiquidate(uint64(m.AppId)) + } + if m.AuctionType != 0 { + n += 1 + sovLiquidate(uint64(m.AuctionType)) + } + return n +} + +func (m *LockedVault) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LockedVaultId != 0 { + n += 1 + sovLiquidate(uint64(m.LockedVaultId)) + } + if m.AppId != 0 { + n += 1 + sovLiquidate(uint64(m.AppId)) + } + if m.OriginalVaultId != 0 { + n += 1 + sovLiquidate(uint64(m.OriginalVaultId)) + } + if m.ExtendedPairId != 0 { + n += 1 + sovLiquidate(uint64(m.ExtendedPairId)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovLiquidate(uint64(l)) + } + l = m.AmountIn.Size() + n += 1 + l + sovLiquidate(uint64(l)) + l = m.AmountOut.Size() + n += 1 + l + sovLiquidate(uint64(l)) + l = m.CurrentCollaterlisationRatio.Size() + n += 1 + l + sovLiquidate(uint64(l)) + l = m.CollateralToBeAuctioned.Size() + n += 1 + l + sovLiquidate(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LiquidationTimestamp) + n += 1 + l + sovLiquidate(uint64(l)) + if m.IsInternalKeeper { + n += 2 + } + l = len(m.InternalKeeperAddress) + if l > 0 { + n += 1 + l + sovLiquidate(uint64(l)) + } + l = len(m.IsExternalKeeper) + if l > 0 { + n += 1 + l + sovLiquidate(uint64(l)) + } + l = len(m.ExternalKeeperAddress) + if l > 0 { + n += 1 + l + sovLiquidate(uint64(l)) + } + return n +} + +func sovLiquidate(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozLiquidate(x uint64) (n int) { + return sovLiquidate(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *WhiteListing) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WhiteListing: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WhiteListing: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionType", wireType) + } + m.AuctionType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionType |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipLiquidate(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLiquidate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LockedVault) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockedVault: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockedVault: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LockedVaultId", wireType) + } + m.LockedVaultId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LockedVaultId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OriginalVaultId", wireType) + } + m.OriginalVaultId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OriginalVaultId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtendedPairId", wireType) + } + m.ExtendedPairId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExtendedPairId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AmountIn", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AmountIn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AmountOut", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AmountOut.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentCollaterlisationRatio", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CurrentCollaterlisationRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralToBeAuctioned", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CollateralToBeAuctioned.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidationTimestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLiquidate + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LiquidationTimestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsInternalKeeper", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsInternalKeeper = bool(v != 0) + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InternalKeeperAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InternalKeeperAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IsExternalKeeper", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IsExternalKeeper = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExternalKeeperAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExternalKeeperAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLiquidate(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLiquidate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipLiquidate(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowLiquidate + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowLiquidate + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowLiquidate + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthLiquidate + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupLiquidate + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthLiquidate + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthLiquidate = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowLiquidate = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupLiquidate = fmt.Errorf("proto: unexpected end of group") +) From f709395cb57fcc7bfcea63f985765686e7a16730 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Fri, 7 Apr 2023 16:50:30 +0530 Subject: [PATCH 005/155] modifying liquidation module --- x/liquidationsV2/keeper/keeper.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/x/liquidationsV2/keeper/keeper.go b/x/liquidationsV2/keeper/keeper.go index 997638a38..ebf39220f 100644 --- a/x/liquidationsV2/keeper/keeper.go +++ b/x/liquidationsV2/keeper/keeper.go @@ -48,3 +48,23 @@ func NewKeeper( func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } + + +// List of functions to be created + + + + +//1. ABCI +//2. Liquidate +//3. Harbor +//4. Commodo + +// MsgServer +//5. HarborLiquidateKeeper +// 6. CommodoLiquidateKeeper +//7. ExternalLiquidateKeeper + + +//8. Liquidation Whitelisting Proposal + From 5c92de8110a8d78de23d97c2e6a8d28210ca9d55 Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 7 Apr 2023 16:50:32 +0530 Subject: [PATCH 006/155] liquidate function --- .../liquidationsV2/v1beta1/genesis.proto | 2 +- proto/comdex/liquidationsV2/v1beta1/gov.proto | 17 + .../liquidationsV2/v1beta1/liquidate.proto | 17 +- .../liquidationsV2/v1beta1/params.proto | 5 +- .../comdex/liquidationsV2/v1beta1/query.proto | 2 +- proto/comdex/liquidationsV2/v1beta1/tx.proto | 2 +- x/liquidationsV2/abci.go | 25 ++ x/liquidationsV2/expected/keeper.go | 94 ++++ x/liquidationsV2/keeper/keeper.go | 49 ++- x/liquidationsV2/keeper/liquidate.go | 158 +++++++ x/liquidationsV2/keeper/liquidations.go | 115 +++++ x/liquidationsV2/keeper/offset.go | 27 ++ x/liquidationsV2/keeper/params.go | 17 +- x/liquidationsV2/keeper/whitelist.go | 70 +++ x/liquidationsV2/module.go | 4 +- x/liquidationsV2/types/genesis.pb.go | 26 +- x/liquidationsV2/types/gov.pb.go | 413 ++++++++++++++++++ x/liquidationsV2/types/keys.go | 40 +- x/liquidationsV2/types/liquidate.pb.go | 291 +++++++++--- x/liquidationsV2/types/offset.go | 61 +++ x/liquidationsV2/types/params.go | 51 ++- x/liquidationsV2/types/params.pb.go | 62 ++- x/liquidationsV2/types/query.pb.go | 52 +-- x/liquidationsV2/types/tx.pb.go | 18 +- 24 files changed, 1450 insertions(+), 168 deletions(-) create mode 100644 proto/comdex/liquidationsV2/v1beta1/gov.proto create mode 100644 x/liquidationsV2/abci.go create mode 100644 x/liquidationsV2/expected/keeper.go create mode 100644 x/liquidationsV2/keeper/liquidate.go create mode 100644 x/liquidationsV2/keeper/liquidations.go create mode 100644 x/liquidationsV2/keeper/offset.go create mode 100644 x/liquidationsV2/keeper/whitelist.go create mode 100644 x/liquidationsV2/types/gov.pb.go create mode 100644 x/liquidationsV2/types/offset.go diff --git a/proto/comdex/liquidationsV2/v1beta1/genesis.proto b/proto/comdex/liquidationsV2/v1beta1/genesis.proto index e6939dace..94f8db9e7 100644 --- a/proto/comdex/liquidationsV2/v1beta1/genesis.proto +++ b/proto/comdex/liquidationsV2/v1beta1/genesis.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package comdex.newliq.v1beta1; +package comdex.liquidationsV2.v1beta1; import "gogoproto/gogo.proto"; import "comdex/liquidationsV2/v1beta1/params.proto"; diff --git a/proto/comdex/liquidationsV2/v1beta1/gov.proto b/proto/comdex/liquidationsV2/v1beta1/gov.proto new file mode 100644 index 000000000..573cf42f0 --- /dev/null +++ b/proto/comdex/liquidationsV2/v1beta1/gov.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package comdex.liquidationsV2.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "comdex/liquidationsV2/v1beta1/liquidate.proto"; + +option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; +option (gogoproto.equal_all) = false; +option (gogoproto.goproto_getters_all) = false; + +message WhitelistAppProposal { + string title = 1 [(gogoproto.moretags) = "yaml:\"title\""]; + string description = 2 [(gogoproto.moretags) = "yaml:\"description\""]; + WhiteListing whitelisting = 3 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index fffe46614..60fbfb5c1 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package comdex.newliq.v1beta1; +package comdex.liquidationsV2.v1beta1; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; @@ -19,8 +19,6 @@ message WhiteListing { uint64 auction_type = 2 [ (gogoproto.customname) = "AuctionType", (gogoproto.moretags) = "yaml:\"auction_type\""]; - - } @@ -39,7 +37,7 @@ message LockedVault { uint64 app_id = 2 [ (gogoproto.customname) = "AppId", - (gogoproto.moretags) = "yaml:\"id\""]; + (gogoproto.moretags) = "yaml:\"id\""]; uint64 original_vault_id = 3 [ (gogoproto.customname) = "OriginalVaultId", @@ -67,7 +65,7 @@ message LockedVault { string current_collateralisation_ratio = 8 [ (gogoproto.customname) = "CurrentCollaterlisationRatio", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"current_collateralisation_ratio\""]; @@ -81,11 +79,11 @@ message LockedVault { (gogoproto.customname) = "LiquidationTimestamp", (gogoproto.nullable) = false, (gogoproto.stdtime) = true, - (gogoproto.moretags) = "yaml:\"liquidation_timestamp\""]; + (gogoproto.moretags) = "yaml:\"liquidation_timestamp\""]; bool is_internal_keeper = 11 [ (gogoproto.customname) = "IsInternalKeeper", - (gogoproto.moretags) = "yaml:\"is_intenal_keeper\""]; + (gogoproto.moretags) = "yaml:\"is_intenal_keeper\""]; string internal_keeper_address = 12 [ (gogoproto.customname) = "InternalKeeperAddress", @@ -158,3 +156,8 @@ message LockedVault { // ]; // } + +message LiquidationOffsetHolder { + uint64 app_id = 1; + uint64 current_offset = 2; +} \ No newline at end of file diff --git a/proto/comdex/liquidationsV2/v1beta1/params.proto b/proto/comdex/liquidationsV2/v1beta1/params.proto index 097c3a1e6..70cc04b08 100644 --- a/proto/comdex/liquidationsV2/v1beta1/params.proto +++ b/proto/comdex/liquidationsV2/v1beta1/params.proto @@ -1,11 +1,10 @@ syntax = "proto3"; -package comdex.newliq.v1beta1; +package comdex.liquidationsV2.v1beta1; import "gogoproto/gogo.proto"; option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; message Params { - option (gogoproto.goproto_stringer) = false; - + uint64 liquidation_batch_size = 1; } diff --git a/proto/comdex/liquidationsV2/v1beta1/query.proto b/proto/comdex/liquidationsV2/v1beta1/query.proto index a88e1fe64..c29c11f68 100644 --- a/proto/comdex/liquidationsV2/v1beta1/query.proto +++ b/proto/comdex/liquidationsV2/v1beta1/query.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package comdex.newliq.v1beta1; +package comdex.liquidationsV2.v1beta1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; diff --git a/proto/comdex/liquidationsV2/v1beta1/tx.proto b/proto/comdex/liquidationsV2/v1beta1/tx.proto index 2d7758a4f..1c36fbeeb 100644 --- a/proto/comdex/liquidationsV2/v1beta1/tx.proto +++ b/proto/comdex/liquidationsV2/v1beta1/tx.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package comdex.newliq.v1beta1; +package comdex.liquidationsV2.v1beta1; option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; diff --git a/x/liquidationsV2/abci.go b/x/liquidationsV2/abci.go new file mode 100644 index 000000000..03b478241 --- /dev/null +++ b/x/liquidationsV2/abci.go @@ -0,0 +1,25 @@ +package liquidationsV2 + +import ( + "fmt" + "github.com/comdex-official/comdex/x/liquidationsV2/keeper" + "github.com/comdex-official/comdex/x/liquidationsV2/types" + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + abci "github.com/tendermint/tendermint/abci/types" +) + +func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k keeper.Keeper) { + defer telemetry.ModuleMeasureSince(types.ModuleName, ctx.BlockTime(), telemetry.MetricKeyBeginBlocker) + + err := k.Liquidate(ctx) + if err != nil { + ctx.Logger().Error("error in Liquidate function") + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeLiquidateVaultsErr, + sdk.NewAttribute(types.Error, fmt.Sprintf("%s", err)), + ), + ) + } +} diff --git a/x/liquidationsV2/expected/keeper.go b/x/liquidationsV2/expected/keeper.go new file mode 100644 index 000000000..a48877ebc --- /dev/null +++ b/x/liquidationsV2/expected/keeper.go @@ -0,0 +1,94 @@ +package expected + +import ( + assettypes "github.com/comdex-official/comdex/x/asset/types" + esmtypes "github.com/comdex-official/comdex/x/esm/types" + lendtypes "github.com/comdex-official/comdex/x/lend/types" + liquidationtypes "github.com/comdex-official/comdex/x/liquidation/types" + markettypes "github.com/comdex-official/comdex/x/market/types" + rewardstypes "github.com/comdex-official/comdex/x/rewards/types" + "github.com/comdex-official/comdex/x/vault/types" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +type AccountKeeper interface { + GetModuleAccount(ctx sdk.Context, name string) authtypes.ModuleAccountI +} + +type BankKeeper interface { + BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error + MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error + SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error + GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + SendCoinsFromModuleToAccount(ctx sdk.Context, name string, address sdk.AccAddress, coins sdk.Coins) error +} + +type AssetKeeper interface { + GetAsset(ctx sdk.Context, id uint64) (assettypes.Asset, bool) + GetPair(ctx sdk.Context, id uint64) (assettypes.Pair, bool) + GetApps(ctx sdk.Context) (apps []assettypes.AppData, found bool) + GetPairsVault(ctx sdk.Context, id uint64) (pairs assettypes.ExtendedPairVault, found bool) +} + +type VaultKeeper interface { + GetAppMappingData(ctx sdk.Context, appMappingID uint64) (appExtendedPairVaultData []types.AppExtendedPairVaultMappingData, found bool) + CalculateCollateralizationRatio(ctx sdk.Context, extendedPairVaultID uint64, amountIn sdk.Int, amountOut sdk.Int) (sdk.Dec, error) + GetVault(ctx sdk.Context, id uint64) (vault types.Vault, found bool) + GetVaults(ctx sdk.Context) (vaults []types.Vault) + GetIDForVault(ctx sdk.Context) uint64 + DeleteVault(ctx sdk.Context, id uint64) + GetLengthOfVault(ctx sdk.Context) uint64 + SetLengthOfVault(ctx sdk.Context, length uint64) + UpdateAppExtendedPairVaultMappingDataOnMsgCreate(ctx sdk.Context, vaultData types.Vault) + UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) + UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) + DeleteUserVaultExtendedPairMapping(ctx sdk.Context, address string, appID uint64, pairVaultID uint64) + DeleteAddressFromAppExtendedPairVaultMapping(ctx sdk.Context, extendedPairID uint64, userVaultID uint64, appMappingID uint64) + SetVault(ctx sdk.Context, vault types.Vault) +} + +type MarketKeeper interface { + CalcAssetPrice(ctx sdk.Context, id uint64, amt sdk.Int) (price sdk.Dec, err error) + GetTwa(ctx sdk.Context, id uint64) (twa markettypes.TimeWeightedAverage, found bool) +} + +type EsmKeeper interface { + GetKillSwitchData(ctx sdk.Context, appID uint64) (esmtypes.KillSwitchParams, bool) + GetESMStatus(ctx sdk.Context, id uint64) (esmStatus esmtypes.ESMStatus, found bool) +} + +type LendKeeper interface { + GetBorrows(ctx sdk.Context) (userBorrows []uint64, found bool) + GetBorrow(ctx sdk.Context, id uint64) (borrow lendtypes.BorrowAsset, found bool) + GetLendPair(ctx sdk.Context, id uint64) (pair lendtypes.Extended_Pair, found bool) + GetAssetRatesParams(ctx sdk.Context, assetID uint64) (assetRatesStats lendtypes.AssetRatesParams, found bool) + VerifyCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset, liquidationThreshold sdk.Dec) error + CalculateCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset) (sdk.Dec, error) + GetLend(ctx sdk.Context, id uint64) (lend lendtypes.LendAsset, found bool) + CreteNewBorrow(ctx sdk.Context, liqBorrow liquidationtypes.LockedVault) + GetPool(ctx sdk.Context, id uint64) (pool lendtypes.Pool, found bool) + + GetAssetStatsByPoolIDAndAssetID(ctx sdk.Context, assetID, poolID uint64) (AssetStats lendtypes.PoolAssetLBMapping, found bool) + SetAssetStatsByPoolIDAndAssetID(ctx sdk.Context, AssetStats lendtypes.PoolAssetLBMapping) + UpdateReserveBalances(ctx sdk.Context, assetID uint64, moduleName string, payment sdk.Coin, inc bool) error + SetLend(ctx sdk.Context, lend lendtypes.LendAsset) + SetBorrow(ctx sdk.Context, borrow lendtypes.BorrowAsset) + CalculateBorrowInterestForLiquidation(ctx sdk.Context, borrowID uint64) (lendtypes.BorrowAsset, error) + ReBalanceStableRates(ctx sdk.Context, borrowPos lendtypes.BorrowAsset) (lendtypes.BorrowAsset, error) + DeleteBorrow(ctx sdk.Context, ID uint64) + DeleteIDFromAssetStatsMapping(ctx sdk.Context, poolID, assetID, id uint64, typeOfID bool) + DeleteBorrowIDFromUserMapping(ctx sdk.Context, owner string, lendID, borrowID uint64) + DeleteBorrowInterestTracker(ctx sdk.Context, ID uint64) + UpdateBorrowStats(ctx sdk.Context, pair lendtypes.Extended_Pair, isStableBorrow bool, amount sdk.Int, inc bool) + GetBorrowInterestTracker(ctx sdk.Context, ID uint64) (interest lendtypes.BorrowInterestTracker, found bool) + SetBorrowInterestTracker(ctx sdk.Context, interest lendtypes.BorrowInterestTracker) + SetAllReserveStatsByAssetID(ctx sdk.Context, allReserveStats lendtypes.AllReserveStats) + GetAllReserveStatsByAssetID(ctx sdk.Context, id uint64) (allReserveStats lendtypes.AllReserveStats, found bool) + MsgCalculateBorrowInterest(ctx sdk.Context, borrowerAddr string, borrowID uint64) error +} + +type RewardsKeeper interface { + CalculateVaultInterest(ctx sdk.Context, appID, assetID, lockerID uint64, NetBalance sdk.Int, blockHeight int64, lockerBlockTime int64) error + DeleteVaultInterestTracker(ctx sdk.Context, vault rewardstypes.VaultInterestTracker) +} diff --git a/x/liquidationsV2/keeper/keeper.go b/x/liquidationsV2/keeper/keeper.go index 997638a38..2c9f768ec 100644 --- a/x/liquidationsV2/keeper/keeper.go +++ b/x/liquidationsV2/keeper/keeper.go @@ -5,30 +5,41 @@ import ( "github.com/tendermint/tendermint/libs/log" + "github.com/comdex-official/comdex/x/liquidationsV2/expected" "github.com/comdex-official/comdex/x/liquidationsV2/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) -type ( - Keeper struct { - cdc codec.BinaryCodec - storeKey sdk.StoreKey - memKey sdk.StoreKey - paramstore paramtypes.Subspace - - bankKeeper types.BankKeeper - } -) +type Keeper struct { + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey + paramstore paramtypes.Subspace + account expected.AccountKeeper + bank expected.BankKeeper + vault expected.VaultKeeper + asset expected.AssetKeeper + market expected.MarketKeeper + esm expected.EsmKeeper + rewards expected.RewardsKeeper + lend expected.LendKeeper +} func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey sdk.StoreKey, ps paramtypes.Subspace, - - bankKeeper types.BankKeeper, + account expected.AccountKeeper, + bank expected.BankKeeper, + asset expected.AssetKeeper, + vault expected.VaultKeeper, + market expected.MarketKeeper, + esm expected.EsmKeeper, + rewards expected.RewardsKeeper, + lend expected.LendKeeper, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -36,15 +47,25 @@ func NewKeeper( } return Keeper{ - cdc: cdc, storeKey: storeKey, memKey: memKey, paramstore: ps, - bankKeeper: bankKeeper, + account: account, + bank: bank, + asset: asset, + vault: vault, + market: market, + esm: esm, + rewards: rewards, + lend: lend, } } func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } + +func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { + return ctx.KVStore(k.storeKey) +} diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go new file mode 100644 index 000000000..48e2372bb --- /dev/null +++ b/x/liquidationsV2/keeper/liquidate.go @@ -0,0 +1,158 @@ +package keeper + +import ( + "fmt" + utils "github.com/comdex-official/comdex/types" + "github.com/comdex-official/comdex/x/liquidationsV2/types" + rewardstypes "github.com/comdex-official/comdex/x/rewards/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) Liquidate(ctx sdk.Context) error { + err := k.LiquidateVaults(ctx) + if err != nil { + return err + } + err = k.LiquidateBorrows(ctx) + if err != nil { + return err + } + return nil +} + +func (k Keeper) LiquidateVaults(ctx sdk.Context) error { + appIds := k.GetAppIdsForLiquidation(ctx) + params := k.GetParams(ctx) + + for i := range appIds { + esmStatus, found := k.esm.GetESMStatus(ctx, appIds[i]) + status := false + if found { + status = esmStatus.Status + } + klwsParams, _ := k.esm.GetKillSwitchData(ctx, appIds[i]) + if klwsParams.BreakerEnable || status { + ctx.Logger().Error("Kill Switch Or ESM is enabled For Liquidation, liquidate_vaults.go for AppID %d", appIds[i]) + continue + } + + liquidationOffsetHolder, found := k.GetLiquidationOffsetHolder(ctx, appIds[i], types.VaultLiquidationsOffsetPrefix) + if !found { + liquidationOffsetHolder = types.NewLiquidationOffsetHolder(appIds[i], 0) + } + totalVaults := k.vault.GetVaults(ctx) + lengthOfVaults := int(k.vault.GetLengthOfVault(ctx)) + //// get all vaults + /// range over those vaults + //// for length of vaults use vault counter + //// wen inside the vault slice check if the app_id matches with that of app_id[i] + + start, end := types.GetSliceStartEndForLiquidations(lengthOfVaults, int(liquidationOffsetHolder.CurrentOffset), int(params.LiquidationBatchSize)) + if start == end { + liquidationOffsetHolder.CurrentOffset = 0 + start, end = types.GetSliceStartEndForLiquidations(lengthOfVaults, int(liquidationOffsetHolder.CurrentOffset), int(params.LiquidationBatchSize)) + } + + newVaults := totalVaults[start:end] + for _, vault := range newVaults { + _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { + if vault.AppId != appIds[i] { + return fmt.Errorf("vault and app id mismatch in Liquidation, liquidate_vaults.go for vault ID %d", vault.Id) + } + extPair, _ := k.asset.GetPairsVault(ctx, vault.ExtendedPairVaultID) + pair, _ := k.asset.GetPair(ctx, extPair.PairId) + assetIn, found := k.asset.GetAsset(ctx, pair.AssetIn) + if !found { + return fmt.Errorf("asset not found in Liquidation, liquidate_vaults.go for vault ID %d", vault.Id) + } + totalRate, err := k.market.CalcAssetPrice(ctx, assetIn.Id, vault.AmountIn) + if err != nil { + return fmt.Errorf("error in CalcAssetPrice in Liquidation, liquidate_vaults.go for vault ID %d", vault.Id) + } + totalIn := totalRate + + liqRatio := extPair.MinCr + totalOut := vault.AmountOut.Add(vault.InterestAccumulated).Add(vault.ClosingFeeAccumulated) + collateralizationRatio, err := k.vault.CalculateCollateralizationRatio(ctx, vault.ExtendedPairVaultID, vault.AmountIn, totalOut) + if err != nil { + return fmt.Errorf("error Calculating CR in Liquidation, liquidate_vaults.go for vault ID %d", vault.Id) + } + if collateralizationRatio.LT(liqRatio) { + // calculate interest and update vault + totalDebt := vault.AmountOut.Add(vault.InterestAccumulated) + err1 := k.rewards.CalculateVaultInterest(ctx, vault.AppId, vault.ExtendedPairVaultID, vault.Id, totalDebt, vault.BlockHeight, vault.BlockTime.Unix()) + if err1 != nil { + return fmt.Errorf("error Calculating vault interest in Liquidation, liquidate_vaults.go for vaultID %d", vault.Id) + } + vault, _ := k.vault.GetVault(ctx, vault.Id) + totalFees := vault.InterestAccumulated.Add(vault.ClosingFeeAccumulated) + totalOut := vault.AmountOut.Add(vault.InterestAccumulated).Add(vault.ClosingFeeAccumulated) + collateralizationRatio, err := k.vault.CalculateCollateralizationRatio(ctx, vault.ExtendedPairVaultID, vault.AmountIn, totalOut) + if err != nil { + return fmt.Errorf("error Calculating CR in Liquidation, liquidate_vaults.go for vaultID %d", vault.Id) + } + err = k.CreateLockedVault(ctx, vault, totalIn, collateralizationRatio, appIds[i], totalFees) + if err != nil { + return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for Vault %d", vault.Id) + } + k.vault.DeleteVault(ctx, vault.Id) + var rewards rewardstypes.VaultInterestTracker + rewards.AppMappingId = appIds[i] + rewards.VaultId = vault.Id + k.rewards.DeleteVaultInterestTracker(ctx, rewards) + k.vault.DeleteAddressFromAppExtendedPairVaultMapping(ctx, vault.ExtendedPairVaultID, vault.Id, appIds[i]) + } + return nil + }) + } + liquidationOffsetHolder.CurrentOffset = uint64(end) + k.SetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix, liquidationOffsetHolder) + } + return nil +} + +func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut sdk.Int, totalIn sdk.Dec, collateralizationRatio sdk.Dec, appID uint64, totalFees sdk.Int) error { + lockedVaultID := k.GetLockedVaultID(ctx) + + //value := types.LockedVault{ + // LockedVaultId: lockedVaultID + 1, + // AppId: appID, + // OriginalVaultId: vault.Id, + // ExtendedPairId: vault.ExtendedPairVaultID, + // Owner: vault.Owner, + // AmountIn: vault.AmountIn, + // AmountOut: vault.AmountOut, + // UpdatedAmountOut: sdk.ZeroInt(), + // Initiator: types.ModuleName, + // IsAuctionComplete: false, + // IsAuctionInProgress: false, + // CrAtLiquidation: collateralizationRatio, + // CollateralToBeAuctioned: totalIn, + // LiquidationTimestamp: ctx.BlockTime(), + // InterestAccumulated: totalFees, + // Kind: nil, + //} + + value := types.LockedVault{ + LockedVaultId: lockedVaultID + 1, + AppId: appID, + OriginalVaultId: OriginalVaultId, + ExtendedPairId: ExtendedPairId, + Owner: Owner, + AmountIn: AmountIn, + AmountOut: AmountOut.Add(totalFees), + CurrentCollaterlisationRatio: collateralizationRatio, + CollateralToBeAuctioned: totalIn, + LiquidationTimestamp: ctx.BlockTime(), + IsInternalKeeper: false, + InternalKeeperAddress: "", + IsExternalKeeper: "", + ExternalKeeperAddress: "", + } + + k.SetLockedVault(ctx, value) + k.SetLockedVaultID(ctx, value.LockedVaultId) + length := k.vault.GetLengthOfVault(ctx) + k.vault.SetLengthOfVault(ctx, length-1) + return nil +} diff --git a/x/liquidationsV2/keeper/liquidations.go b/x/liquidationsV2/keeper/liquidations.go new file mode 100644 index 000000000..2af4e76d7 --- /dev/null +++ b/x/liquidationsV2/keeper/liquidations.go @@ -0,0 +1,115 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/liquidationsV2/types" + sdk "github.com/cosmos/cosmos-sdk/types" + protobuftypes "github.com/gogo/protobuf/types" +) + +// locked vaults kvs + +func (k Keeper) SetLockedVaultID(ctx sdk.Context, id uint64) { + var ( + store = k.Store(ctx) + key = types.LockedVaultIDKey + value = k.cdc.MustMarshal( + &protobuftypes.UInt64Value{ + Value: id, + }, + ) + ) + store.Set(key, value) +} + +func (k Keeper) GetLockedVaultID(ctx sdk.Context) uint64 { + var ( + store = k.Store(ctx) + key = types.LockedVaultIDKey + value = store.Get(key) + ) + + if value == nil { + return 0 + } + + var id protobuftypes.UInt64Value + k.cdc.MustUnmarshal(value, &id) + + return id.GetValue() +} + +func (k Keeper) SetLockedVault(ctx sdk.Context, lockedVault types.LockedVault) { + var ( + store = k.Store(ctx) + key = types.LockedVaultKey(lockedVault.AppId, lockedVault.LockedVaultId) + value = k.cdc.MustMarshal(&lockedVault) + ) + store.Set(key, value) +} + +func (k Keeper) DeleteLockedVault(ctx sdk.Context, appID, id uint64) { + var ( + store = k.Store(ctx) + key = types.LockedVaultKey(appID, id) + ) + store.Delete(key) +} + +func (k Keeper) GetLockedVault(ctx sdk.Context, appID, id uint64) (lockedVault types.LockedVault, found bool) { + var ( + store = k.Store(ctx) + key = types.LockedVaultKey(appID, id) + value = store.Get(key) + ) + + if value == nil { + return lockedVault, false + } + + k.cdc.MustUnmarshal(value, &lockedVault) + return lockedVault, true +} + +func (k Keeper) GetLockedVaultByApp(ctx sdk.Context, appID uint64) (lockedVault []types.LockedVault) { + var ( + store = k.Store(ctx) + key = types.LockedVaultKeyByApp(appID) + iter = sdk.KVStorePrefixIterator(store, key) + ) + + defer func(iter sdk.Iterator) { + err := iter.Close() + if err != nil { + return + } + }(iter) + + for ; iter.Valid(); iter.Next() { + var mapData types.LockedVault + k.cdc.MustUnmarshal(iter.Value(), &mapData) + lockedVault = append(lockedVault, mapData) + } + return lockedVault +} + +func (k Keeper) GetLockedVaults(ctx sdk.Context) (lockedVaults []types.LockedVault) { + var ( + store = k.Store(ctx) + iter = sdk.KVStorePrefixIterator(store, types.LockedVaultKeyPrefix) + ) + + defer func(iter sdk.Iterator) { + err := iter.Close() + if err != nil { + return + } + }(iter) + + for ; iter.Valid(); iter.Next() { + var lockedVault types.LockedVault + k.cdc.MustUnmarshal(iter.Value(), &lockedVault) + lockedVaults = append(lockedVaults, lockedVault) + } + + return lockedVaults +} diff --git a/x/liquidationsV2/keeper/offset.go b/x/liquidationsV2/keeper/offset.go new file mode 100644 index 000000000..2964c0f90 --- /dev/null +++ b/x/liquidationsV2/keeper/offset.go @@ -0,0 +1,27 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/liquidationsV2/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// SetLiquidationOffsetHolder stores the LiquidationOffsetHolder. +func (k Keeper) SetLiquidationOffsetHolder(ctx sdk.Context, liquidatonPrefix string, liquidationOffsetHolder types.LiquidationOffsetHolder) { + store := ctx.KVStore(k.storeKey) + bz := types.MustMarshalLiquidationOffsetHolder(k.cdc, liquidationOffsetHolder) + store.Set( + types.GetLiquidationOffsetHolderKey(liquidationOffsetHolder.AppId, liquidatonPrefix), + bz, + ) +} + +// GetLiquidationOffsetHolder returns liquidationOffsetHolder object for the given app id, pool id and farmer. +func (k Keeper) GetLiquidationOffsetHolder(ctx sdk.Context, appID uint64, liquidatonPrefix string) (liquidationOffsetHolder types.LiquidationOffsetHolder, found bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.GetLiquidationOffsetHolderKey(appID, liquidatonPrefix)) + if bz == nil { + return + } + liquidationOffsetHolder = types.MustUnmarshalLiquidationOffsetHolder(k.cdc, bz) + return liquidationOffsetHolder, true +} diff --git a/x/liquidationsV2/keeper/params.go b/x/liquidationsV2/keeper/params.go index 853f6e1bf..8f63a8a03 100644 --- a/x/liquidationsV2/keeper/params.go +++ b/x/liquidationsV2/keeper/params.go @@ -3,14 +3,23 @@ package keeper import ( "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/x/params/types" ) -// GetParams get all parameters as types.Params -func (k Keeper) GetParams(ctx sdk.Context) types.Params { - return types.NewParams() +// LiquidationBatchSize defines the batch size for each ABCI interaction +func (k Keeper) LiquidationBatchSize(ctx sdk.Context) (res uint64) { + k.paramstore.Get(ctx, types.KeyLiquidationBatchSize, &res) + return } -// SetParams set the params +// GetParams returns the parameters for the liquidation module. +func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { + return types.NewParams( + k.LiquidationBatchSize(ctx), + ) +} + +// SetParams set the params. func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { k.paramstore.SetParamSet(ctx, ¶ms) } diff --git a/x/liquidationsV2/keeper/whitelist.go b/x/liquidationsV2/keeper/whitelist.go new file mode 100644 index 000000000..293a951c2 --- /dev/null +++ b/x/liquidationsV2/keeper/whitelist.go @@ -0,0 +1,70 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/liquidationsV2/types" + sdk "github.com/cosmos/cosmos-sdk/types" + protobuftypes "github.com/gogo/protobuf/types" +) + +// whitelisted appIds kvs + +func (k Keeper) SetAppIDForLiquidation(ctx sdk.Context, appID uint64) { + var ( + store = k.Store(ctx) + key = types.WhitelistAppKeyByApp(appID) + value = k.cdc.MustMarshal( + &protobuftypes.UInt64Value{ + Value: appID, + }, + ) + ) + + store.Set(key, value) +} + +func (k Keeper) GetAppIDByAppForLiquidation(ctx sdk.Context, appID uint64) (uint64, bool) { + var ( + store = k.Store(ctx) + key = types.WhitelistAppKeyByApp(appID) + value = store.Get(key) + ) + + if value == nil { + return 0, false + } + + var id protobuftypes.UInt64Value + k.cdc.MustUnmarshal(value, &id) + + return id.GetValue(), true +} + +func (k Keeper) GetAppIdsForLiquidation(ctx sdk.Context) (appIds []uint64) { + var ( + store = k.Store(ctx) + iter = sdk.KVStorePrefixIterator(store, types.AppIdsKeyPrefix) + ) + + defer func(iter sdk.Iterator) { + err := iter.Close() + if err != nil { + return + } + }(iter) + + for ; iter.Valid(); iter.Next() { + var app protobuftypes.UInt64Value + k.cdc.MustUnmarshal(iter.Value(), &app) + appIds = append(appIds, app.Value) + } + return appIds +} + +func (k Keeper) DeleteAppID(ctx sdk.Context, appID uint64) { + var ( + store = k.Store(ctx) + key = types.WhitelistAppKeyByApp(appID) + ) + + store.Delete(key) +} diff --git a/x/liquidationsV2/module.go b/x/liquidationsV2/module.go index cf9426045..0a582363a 100644 --- a/x/liquidationsV2/module.go +++ b/x/liquidationsV2/module.go @@ -166,7 +166,9 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(ctx sdk.Context, request abci.RequestBeginBlock) { + BeginBlocker(ctx, request, am.keeper) +} // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. diff --git a/x/liquidationsV2/types/genesis.pb.go b/x/liquidationsV2/types/genesis.pb.go index 1ba655866..7654ad098 100644 --- a/x/liquidationsV2/types/genesis.pb.go +++ b/x/liquidationsV2/types/genesis.pb.go @@ -68,7 +68,7 @@ func (m *GenesisState) GetParams() Params { } func init() { - proto.RegisterType((*GenesisState)(nil), "comdex.newliq.v1beta1.GenesisState") + proto.RegisterType((*GenesisState)(nil), "comdex.liquidationsV2.v1beta1.GenesisState") } func init() { @@ -76,21 +76,21 @@ func init() { } var fileDescriptor_7ee1f29509948006 = []byte{ - // 215 bytes of a gzipped FileDescriptorProto + // 211 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4e, 0xce, 0xcf, 0x4d, 0x49, 0xad, 0xd0, 0xcf, 0xc9, 0x2c, 0x2c, 0xcd, 0x4c, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, - 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0x28, 0xd6, 0xcb, 0x4b, 0x2d, 0xcf, - 0xc9, 0x2c, 0xd4, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd0, 0x07, 0xb1, - 0x20, 0x8a, 0xa5, 0xb4, 0xf0, 0x9b, 0x5c, 0x90, 0x58, 0x94, 0x98, 0x0b, 0x35, 0x58, 0xc9, 0x9b, - 0x8b, 0xc7, 0x1d, 0x62, 0x53, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x35, 0x17, 0x1b, 0x44, 0x5e, - 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x56, 0x0f, 0xab, 0xcd, 0x7a, 0x01, 0x60, 0x45, 0x4e, - 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xb5, 0x38, 0x05, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, - 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, - 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x45, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x12, 0xc8, 0x30, 0x7d, 0x88, - 0x81, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0x86, 0x7b, 0x4b, - 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xee, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x83, - 0x4c, 0x26, 0x66, 0x2f, 0x01, 0x00, 0x00, + 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x85, 0x28, 0xd6, 0x43, 0x55, 0xac, 0x07, + 0x55, 0x2c, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa9, 0x0f, 0x62, 0x41, 0x34, 0x49, 0x69, + 0xe1, 0xb7, 0xa1, 0x20, 0xb1, 0x28, 0x31, 0x17, 0x6a, 0x81, 0x52, 0x30, 0x17, 0x8f, 0x3b, 0xc4, + 0xc6, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x67, 0x2e, 0x36, 0x88, 0xbc, 0x04, 0xa3, 0x02, 0xa3, + 0x06, 0xb7, 0x91, 0xaa, 0x1e, 0x5e, 0x17, 0xe8, 0x05, 0x80, 0x15, 0x3b, 0xb1, 0x9c, 0xb8, 0x27, + 0xcf, 0x10, 0x04, 0xd5, 0xea, 0x14, 0x74, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, + 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, + 0x51, 0x16, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x20, 0x43, 0xf5, 0x21, 0x06, 0xeb, 0xe6, 0xa7, + 0xa5, 0x65, 0x26, 0x67, 0x26, 0xe6, 0x40, 0xf9, 0xfa, 0x18, 0xee, 0x2e, 0xa9, 0x2c, 0x48, 0x2d, + 0x4e, 0x62, 0x03, 0xbb, 0xd7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x5b, 0x7e, 0x80, 0x3f, + 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/liquidationsV2/types/gov.pb.go b/x/liquidationsV2/types/gov.pb.go new file mode 100644 index 000000000..e995bd3f5 --- /dev/null +++ b/x/liquidationsV2/types/gov.pb.go @@ -0,0 +1,413 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/liquidationsV2/v1beta1/gov.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/golang/protobuf/ptypes/timestamp" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type WhitelistAppProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + Whitelisting WhiteListing `protobuf:"bytes,3,opt,name=whitelisting,proto3" json:"whitelisting"` +} + +func (m *WhitelistAppProposal) Reset() { *m = WhitelistAppProposal{} } +func (m *WhitelistAppProposal) String() string { return proto.CompactTextString(m) } +func (*WhitelistAppProposal) ProtoMessage() {} +func (*WhitelistAppProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_4fbf1b0be7d4e97b, []int{0} +} +func (m *WhitelistAppProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WhitelistAppProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WhitelistAppProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WhitelistAppProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_WhitelistAppProposal.Merge(m, src) +} +func (m *WhitelistAppProposal) XXX_Size() int { + return m.Size() +} +func (m *WhitelistAppProposal) XXX_DiscardUnknown() { + xxx_messageInfo_WhitelistAppProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_WhitelistAppProposal proto.InternalMessageInfo + +func init() { + proto.RegisterType((*WhitelistAppProposal)(nil), "comdex.liquidationsV2.v1beta1.WhitelistAppProposal") +} + +func init() { + proto.RegisterFile("comdex/liquidationsV2/v1beta1/gov.proto", fileDescriptor_4fbf1b0be7d4e97b) +} + +var fileDescriptor_4fbf1b0be7d4e97b = []byte{ + // 334 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xcf, 0x6a, 0x02, 0x31, + 0x10, 0x87, 0x37, 0xfd, 0x07, 0x5d, 0x3d, 0x94, 0x45, 0x8a, 0x08, 0xcd, 0xca, 0x1e, 0x5a, 0xa1, + 0xb8, 0x41, 0x7b, 0x91, 0xde, 0xea, 0xb9, 0x87, 0x22, 0xb4, 0x05, 0x6f, 0xd9, 0x35, 0xc6, 0x40, + 0xd6, 0x49, 0x4d, 0xb4, 0xf5, 0x2d, 0xfa, 0x18, 0x7d, 0x14, 0x6f, 0xf5, 0xd8, 0x93, 0xb4, 0xeb, + 0x1b, 0xf8, 0x04, 0xc5, 0xcd, 0x5a, 0x94, 0x82, 0xb7, 0xcc, 0xcc, 0x37, 0xf9, 0x86, 0x9f, 0x7b, + 0x15, 0x43, 0xd2, 0x63, 0x6f, 0x44, 0x8a, 0x97, 0xb1, 0xe8, 0x51, 0x23, 0x60, 0xa8, 0x9f, 0x9a, + 0x64, 0xd2, 0x88, 0x98, 0xa1, 0x0d, 0xc2, 0x61, 0x12, 0xaa, 0x11, 0x18, 0xf0, 0x2e, 0x2c, 0x18, + 0xee, 0x82, 0x61, 0x0e, 0x56, 0x4a, 0x1c, 0x38, 0x64, 0x24, 0x59, 0xbf, 0xec, 0x52, 0xc5, 0xe7, + 0x00, 0x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f, 0x7e, 0x66, 0xaa, 0x98, 0x8e, 0x4e, 0xb2, 0xd0, 0x6e, + 0x7e, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x80, 0xfd, 0xbe, 0x04, 0x02, 0x00, 0x00, +} + +func (m *WhitelistAppProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WhitelistAppProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WhitelistAppProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Whitelisting.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGov(dAtA []byte, offset int, v uint64) int { + offset -= sovGov(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *WhitelistAppProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = m.Whitelisting.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func sovGov(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGov(x uint64) (n int) { + return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *WhitelistAppProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WhitelistAppProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WhitelistAppProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Whitelisting", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Whitelisting.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGov(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGov + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGov + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGov + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGov + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGov + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGov + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/liquidationsV2/types/keys.go b/x/liquidationsV2/types/keys.go index 86fd942b1..c32356a43 100644 --- a/x/liquidationsV2/types/keys.go +++ b/x/liquidationsV2/types/keys.go @@ -1,5 +1,7 @@ package types +import sdk "github.com/cosmos/cosmos-sdk/types" + const ( // ModuleName defines the module name ModuleName = "liquidationsV2" @@ -17,6 +19,40 @@ const ( MemStoreKey = "mem_newliq" ) -func KeyPrefix(p string) []byte { - return []byte(p) +var ( + TypeMsgLiquidateRequest = ModuleName + ":liquidate" + AppIdsKeyPrefix = []byte{0x01} + LiquidationOffsetHolderKeyPrefix = []byte{0x02} + LockedVaultIDKey = []byte{0x03} + LockedVaultKeyPrefix = []byte{0x04} + LockedVaultDataKeyHistory = []byte{0x05} +) + +// LengthPrefixString returns length-prefixed bytes representation +// of a string. +func LengthPrefixString(s string) []byte { + bz := []byte(s) + bzLen := len(bz) + if bzLen == 0 { + return bz + } + return append([]byte{byte(bzLen)}, bz...) +} + +// GetLiquidationOffsetHolderKey returns the index key to look offset value for liquidation. +func GetLiquidationOffsetHolderKey(appID uint64, liquidationForPrefix string) []byte { + return append(append(LiquidationOffsetHolderKeyPrefix, sdk.Uint64ToBigEndian(appID)...), LengthPrefixString(liquidationForPrefix)...) +} + +// WhitelistAppKeyByApp whitelisting kv +func WhitelistAppKeyByApp(appID uint64) []byte { + return append(AppIdsKeyPrefix, sdk.Uint64ToBigEndian(appID)...) +} + +func LockedVaultKey(appID, lockedVaultID uint64) []byte { + return append(append(LockedVaultKeyPrefix, sdk.Uint64ToBigEndian(appID)...), sdk.Uint64ToBigEndian(lockedVaultID)...) +} + +func LockedVaultKeyByApp(appID uint64) []byte { + return append(LockedVaultKeyPrefix, sdk.Uint64ToBigEndian(appID)...) } diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index bc53e6250..26714c443 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -117,9 +117,48 @@ func (m *LockedVault) XXX_DiscardUnknown() { var xxx_messageInfo_LockedVault proto.InternalMessageInfo +type LiquidationOffsetHolder struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + CurrentOffset uint64 `protobuf:"varint,2,opt,name=current_offset,json=currentOffset,proto3" json:"current_offset,omitempty"` +} + +func (m *LiquidationOffsetHolder) Reset() { *m = LiquidationOffsetHolder{} } +func (m *LiquidationOffsetHolder) String() string { return proto.CompactTextString(m) } +func (*LiquidationOffsetHolder) ProtoMessage() {} +func (*LiquidationOffsetHolder) Descriptor() ([]byte, []int) { + return fileDescriptor_631048b9d11253bf, []int{2} +} +func (m *LiquidationOffsetHolder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LiquidationOffsetHolder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LiquidationOffsetHolder.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LiquidationOffsetHolder) XXX_Merge(src proto.Message) { + xxx_messageInfo_LiquidationOffsetHolder.Merge(m, src) +} +func (m *LiquidationOffsetHolder) XXX_Size() int { + return m.Size() +} +func (m *LiquidationOffsetHolder) XXX_DiscardUnknown() { + xxx_messageInfo_LiquidationOffsetHolder.DiscardUnknown(m) +} + +var xxx_messageInfo_LiquidationOffsetHolder proto.InternalMessageInfo + func init() { - proto.RegisterType((*WhiteListing)(nil), "comdex.newliq.v1beta1.WhiteListing") - proto.RegisterType((*LockedVault)(nil), "comdex.newliq.v1beta1.LockedVault") + proto.RegisterType((*WhiteListing)(nil), "comdex.liquidationsV2.v1beta1.WhiteListing") + proto.RegisterType((*LockedVault)(nil), "comdex.liquidationsV2.v1beta1.LockedVault") + proto.RegisterType((*LiquidationOffsetHolder)(nil), "comdex.liquidationsV2.v1beta1.LiquidationOffsetHolder") } func init() { @@ -127,61 +166,63 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 856 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcd, 0x6e, 0xdb, 0x36, - 0x1c, 0xb7, 0xb2, 0x26, 0x8b, 0xe9, 0xa4, 0x4d, 0xd5, 0xb8, 0x51, 0x8d, 0x56, 0xf4, 0x74, 0x08, - 0x72, 0x89, 0xb4, 0xb4, 0x97, 0x61, 0xbb, 0xcc, 0xee, 0x7a, 0x30, 0x16, 0x2c, 0x85, 0x10, 0x74, - 0x40, 0x0f, 0x13, 0x68, 0x89, 0x71, 0x88, 0xc8, 0xa2, 0x2a, 0x51, 0x6d, 0xf2, 0x0e, 0x3b, 0x74, - 0x6f, 0x31, 0x60, 0x2f, 0xb1, 0x63, 0x8e, 0x3d, 0x0e, 0x3b, 0x70, 0x9b, 0xf2, 0x06, 0x7a, 0x82, - 0x81, 0x1f, 0xfe, 0x90, 0xab, 0xa2, 0xc8, 0x25, 0x8e, 0xf8, 0xff, 0x7d, 0x42, 0x24, 0x05, 0x0e, - 0x43, 0x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b3, 0x33, 0x12, 0x12, 0x14, 0xeb, 0x67, 0xef, - 0xa3, 0x0f, 0xaa, 0xdc, 0xf7, 0xe3, 0x0d, 0xb9, 0xe5, 0x9e, 0xfd, 0x1f, 0x00, 0x00, 0xff, 0xff, - 0x99, 0x33, 0xd7, 0x9e, 0x76, 0x07, 0x00, 0x00, + // 895 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4d, 0x6e, 0xdb, 0x46, + 0x18, 0x15, 0xdd, 0xd8, 0xb5, 0x46, 0xb6, 0xe3, 0x30, 0x56, 0xcc, 0x08, 0x31, 0x47, 0x25, 0x50, + 0xc3, 0x1b, 0x93, 0x75, 0xb2, 0x29, 0xda, 0x4d, 0xa5, 0x34, 0x40, 0x85, 0x1a, 0x55, 0x40, 0x18, + 0x09, 0x90, 0x45, 0x89, 0x11, 0x39, 0x92, 0x07, 0xa6, 0x38, 0x2c, 0x39, 0x4c, 0xed, 0x3b, 0x74, + 0x91, 0xde, 0xa2, 0x40, 0x2f, 0xd1, 0xa5, 0x97, 0x59, 0x16, 0x5d, 0x4c, 0x5b, 0xea, 0x06, 0x3c, + 0x41, 0xc1, 0x99, 0xd1, 0x0f, 0x15, 0x06, 0x85, 0x37, 0x96, 0x39, 0xdf, 0x7b, 0xef, 0x7b, 0x0f, + 0xc3, 0xef, 0x23, 0x38, 0xf5, 0xe9, 0x34, 0xc0, 0xd7, 0x4e, 0x48, 0x7e, 0xca, 0x48, 0x80, 0x18, + 0xa1, 0x51, 0xfa, 0xea, 0xa9, 0xf3, 0xf6, 0x6c, 0x84, 0x19, 0x3a, 0x5b, 0x1c, 0x63, 0x3b, 0x4e, + 0x28, 0xa3, 0xfa, 0x91, 0x84, 0xdb, 0x55, 0xb8, 0xad, 0xe0, 0x9d, 0x83, 0x09, 0x9d, 0x50, 0x81, + 0x74, 0xca, 0xff, 0x24, 0xa9, 0x03, 0x27, 0x94, 0x4e, 0x42, 0xec, 0x88, 0xa7, 0x51, 0x36, 0x76, + 0x18, 0x99, 0xe2, 0x94, 0xa1, 0x69, 0xac, 0x00, 0xa6, 0x4f, 0xd3, 0x29, 0x4d, 0x9d, 0x11, 0x4a, + 0xf1, 0xa2, 0xb5, 0x4f, 0x49, 0x24, 0xeb, 0xd6, 0x2f, 0x1a, 0xd8, 0x79, 0x7d, 0x49, 0x18, 0x3e, + 0x27, 0x29, 0x23, 0xd1, 0x44, 0x3f, 0x03, 0x5b, 0x28, 0x8e, 0x3d, 0x12, 0x18, 0x5a, 0x57, 0x3b, + 0xb9, 0xd7, 0xef, 0xe4, 0x1c, 0x6e, 0xf6, 0xe2, 0x78, 0x10, 0x14, 0x1c, 0xee, 0xde, 0xa0, 0x69, + 0xf8, 0x95, 0x25, 0x01, 0x96, 0xbb, 0x89, 0xca, 0x73, 0x7d, 0x00, 0x76, 0x50, 0xe6, 0x97, 0x86, + 0x3d, 0x76, 0x13, 0x63, 0x63, 0x43, 0x10, 0x8f, 0x73, 0x0e, 0x5b, 0x3d, 0x79, 0x7e, 0x71, 0x13, + 0xe3, 0x82, 0xc3, 0x87, 0x8a, 0xbe, 0x02, 0xb6, 0xdc, 0x16, 0x5a, 0x62, 0xac, 0x59, 0x0b, 0xb4, + 0xce, 0xa9, 0x7f, 0x85, 0x83, 0x57, 0x28, 0x0b, 0x99, 0x6e, 0x83, 0x8d, 0x85, 0x13, 0x33, 0xe7, + 0x70, 0x77, 0xa5, 0x28, 0x1c, 0x35, 0xa5, 0x64, 0xe9, 0x66, 0x83, 0x04, 0xfa, 0xe9, 0xc2, 0xbd, + 0x34, 0xf1, 0x68, 0xd5, 0xfd, 0x0a, 0x56, 0x39, 0x3f, 0x07, 0x0f, 0x68, 0x42, 0x26, 0x24, 0x42, + 0xa1, 0xf7, 0xb6, 0xd4, 0x2c, 0x99, 0x9f, 0x08, 0x66, 0x37, 0xe7, 0xf0, 0xfe, 0x50, 0x15, 0x6b, +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4, 0xbb, 0xfc, + 0xec, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x68, 0x8b, 0xa3, 0xe3, 0xd7, 0x07, 0x00, 0x00, } func (m *WhiteListing) Marshal() (dAtA []byte, err error) { @@ -346,6 +387,39 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *LiquidationOffsetHolder) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LiquidationOffsetHolder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LiquidationOffsetHolder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CurrentOffset != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.CurrentOffset)) + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintLiquidate(dAtA []byte, offset int, v uint64) int { offset -= sovLiquidate(v) base := offset @@ -422,6 +496,21 @@ func (m *LockedVault) Size() (n int) { return n } +func (m *LiquidationOffsetHolder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovLiquidate(uint64(m.AppId)) + } + if m.CurrentOffset != 0 { + n += 1 + sovLiquidate(uint64(m.CurrentOffset)) + } + return n +} + func sovLiquidate(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -959,6 +1048,94 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } return nil } +func (m *LiquidationOffsetHolder) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LiquidationOffsetHolder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LiquidationOffsetHolder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentOffset", wireType) + } + m.CurrentOffset = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentOffset |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipLiquidate(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLiquidate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipLiquidate(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/liquidationsV2/types/offset.go b/x/liquidationsV2/types/offset.go new file mode 100644 index 000000000..3ba32be4e --- /dev/null +++ b/x/liquidationsV2/types/offset.go @@ -0,0 +1,61 @@ +package types + +import ( + "fmt" + "github.com/cosmos/cosmos-sdk/codec" +) + +const ( + VaultLiquidationsOffsetPrefix = "vault-liquidations" +) + +// NewLiquidationOffsetHolder returns a new LiquidationOffsetHolder object. +func NewLiquidationOffsetHolder(appID, currentOffset uint64) LiquidationOffsetHolder { + return LiquidationOffsetHolder{ + AppId: appID, + CurrentOffset: currentOffset, + } +} + +func GetSliceStartEndForLiquidations(sliceLen, offset, batchSize int) (int, int) { + if offset >= sliceLen || offset < 0 || batchSize < 0 { + return sliceLen, sliceLen + } + start := offset + end := offset + batchSize + if end >= sliceLen { + return start, sliceLen + } + return start, end +} + +// Validate validates ActiveFarmer. +func (liquidationOffsetHolder LiquidationOffsetHolder) Validate() error { + if liquidationOffsetHolder.AppId == 0 { + return fmt.Errorf("app id must not be 0") + } + return nil +} + +// MustMarshalLiquidationOffsetHolder returns the LiquidationOffsetHolder bytes. +// It throws panic if it fails. +func MustMarshalLiquidationOffsetHolder(cdc codec.BinaryCodec, liquidationOffsetHolder LiquidationOffsetHolder) []byte { + return cdc.MustMarshal(&liquidationOffsetHolder) +} + +// MustUnmarshalLiquidationOffsetHolder return the unmarshalledLiquidationOffsetHolder from bytes. +// It throws panic if it fails. +func MustUnmarshalLiquidationOffsetHolder(cdc codec.BinaryCodec, value []byte) LiquidationOffsetHolder { + liquidationOffsetHolder, err := UnmarshalLiquidationOffsetHolder(cdc, value) + if err != nil { + panic(err) + } + + return liquidationOffsetHolder +} + +// UnmarshalLiquidationOffsetHolder returns the current offeset from bytes. +func UnmarshalLiquidationOffsetHolder(cdc codec.BinaryCodec, value []byte) (liquidationOffsetHolder LiquidationOffsetHolder, err error) { + err = cdc.Unmarshal(value, &liquidationOffsetHolder) + return liquidationOffsetHolder, err +} diff --git a/x/liquidationsV2/types/params.go b/x/liquidationsV2/types/params.go index 52a8a059f..6c91f7790 100644 --- a/x/liquidationsV2/types/params.go +++ b/x/liquidationsV2/types/params.go @@ -1,47 +1,64 @@ package types import ( - - + "fmt" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "gopkg.in/yaml.v2" ) -var _ paramtypes.ParamSet = (*Params)(nil) +// DefaultLiquidationBatchSize Liquidation params default values +var ( + DefaultLiquidationBatchSize = uint64(200) +) +var KeyLiquidationBatchSize = []byte("LiquidationBatchSize") +var _ paramtypes.ParamSet = (*Params)(nil) // ParamKeyTable the param key table for launch module func ParamKeyTable() paramtypes.KeyTable { return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) } -// NewParams creates a new Params instance -func NewParams( -) Params { +func NewParams(liquidationBatchSize uint64) Params { return Params{ + LiquidationBatchSize: liquidationBatchSize, } } -// DefaultParams returns a default set of parameters func DefaultParams() Params { - return NewParams( - ) + return NewParams(DefaultLiquidationBatchSize) } -// ParamSetPairs get the params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { +func (p Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair(KeyLiquidationBatchSize, &p.LiquidationBatchSize, validateLiquidationBatchSize), } } -// Validate validates the set of params +// Validate validates Params. func (p Params) Validate() error { + for _, field := range []struct { + val interface{} + validateFunc func(i interface{}) error + }{ + {p.LiquidationBatchSize, validateLiquidationBatchSize}, + } { + if err := field.validateFunc(field.val); err != nil { + return err + } + } return nil } -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) +func validateLiquidationBatchSize(i interface{}) error { + v, ok := i.(uint64) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v <= 0 { + return fmt.Errorf("batch size must be positive: %d", v) + } + + return nil } diff --git a/x/liquidationsV2/types/params.pb.go b/x/liquidationsV2/types/params.pb.go index fbb01cab4..0435dfbe9 100644 --- a/x/liquidationsV2/types/params.pb.go +++ b/x/liquidationsV2/types/params.pb.go @@ -24,10 +24,12 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Params struct { + LiquidationBatchSize uint64 `protobuf:"varint,1,opt,name=liquidation_batch_size,json=liquidationBatchSize,proto3" json:"liquidation_batch_size,omitempty"` } -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { return fileDescriptor_32258fedf7caac4b, []int{0} } @@ -58,8 +60,15 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo +func (m *Params) GetLiquidationBatchSize() uint64 { + if m != nil { + return m.LiquidationBatchSize + } + return 0 +} + func init() { - proto.RegisterType((*Params)(nil), "comdex.newliq.v1beta1.Params") + proto.RegisterType((*Params)(nil), "comdex.liquidationsV2.v1beta1.Params") } func init() { @@ -67,18 +76,20 @@ func init() { } var fileDescriptor_32258fedf7caac4b = []byte{ - // 175 bytes of a gzipped FileDescriptorProto + // 199 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4a, 0xce, 0xcf, 0x4d, 0x49, 0xad, 0xd0, 0xcf, 0xc9, 0x2c, 0x2c, 0xcd, 0x4c, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, - 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xa8, 0xd5, 0xcb, 0x4b, 0x2d, 0xcf, 0xc9, - 0x2c, 0xd4, 0x83, 0xaa, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd0, 0x07, 0xb1, 0x20, - 0x8a, 0x95, 0xf8, 0xb8, 0xd8, 0x02, 0xc0, 0x9a, 0xad, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0x0a, - 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, - 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x8b, 0xf4, 0xcc, 0x92, 0x8c, - 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, 0x0d, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, - 0x89, 0x39, 0x50, 0xbe, 0x3e, 0x86, 0xfb, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x56, - 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x12, 0xb0, 0x1f, 0x73, 0xc5, 0x00, 0x00, 0x00, + 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x85, 0xa8, 0xd5, 0x43, 0x55, 0xab, 0x07, 0x55, + 0x2b, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa9, 0x0f, 0x62, 0x41, 0x34, 0x29, 0xd9, 0x71, + 0xb1, 0x05, 0x80, 0x0d, 0x11, 0x32, 0xe1, 0x12, 0x43, 0xd2, 0x19, 0x9f, 0x94, 0x58, 0x92, 0x9c, + 0x11, 0x5f, 0x9c, 0x59, 0x95, 0x2a, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x12, 0x24, 0x82, 0x24, 0xeb, + 0x04, 0x92, 0x0c, 0xce, 0xac, 0x4a, 0x75, 0x0a, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, + 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, + 0x39, 0x86, 0x28, 0x8b, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, + 0xcb, 0x74, 0xf3, 0xd3, 0xd2, 0x32, 0x93, 0x33, 0x13, 0x73, 0xa0, 0x7c, 0x7d, 0x0c, 0x7f, 0x95, + 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x9d, 0x66, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x7a, + 0xcd, 0xb2, 0xb7, 0xfd, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -101,6 +112,11 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.LiquidationBatchSize != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.LiquidationBatchSize)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } @@ -121,6 +137,9 @@ func (m *Params) Size() (n int) { } var l int _ = l + if m.LiquidationBatchSize != 0 { + n += 1 + sovParams(uint64(m.LiquidationBatchSize)) + } return n } @@ -159,6 +178,25 @@ func (m *Params) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidationBatchSize", wireType) + } + m.LiquidationBatchSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LiquidationBatchSize |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/liquidationsV2/types/query.pb.go b/x/liquidationsV2/types/query.pb.go index b399640c7..5a09810b6 100644 --- a/x/liquidationsV2/types/query.pb.go +++ b/x/liquidationsV2/types/query.pb.go @@ -111,8 +111,8 @@ func (m *QueryParamsResponse) GetParams() Params { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "comdex.newliq.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "comdex.newliq.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "comdex.liquidationsV2.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "comdex.liquidationsV2.v1beta1.QueryParamsResponse") } func init() { @@ -120,27 +120,27 @@ func init() { } var fileDescriptor_5ed3babcdef7f922 = []byte{ - // 316 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xb1, 0x4a, 0x03, 0x31, - 0x18, 0xc7, 0x2f, 0xa2, 0x1d, 0xe2, 0x16, 0x2b, 0x48, 0xd1, 0x28, 0x9d, 0x6c, 0xa1, 0x17, 0x5a, - 0x11, 0x04, 0xb7, 0x3e, 0x81, 0xde, 0xe0, 0xe0, 0x96, 0x6b, 0xd3, 0x18, 0xb8, 0xe6, 0xcb, 0x35, - 0x39, 0xb5, 0xab, 0x4f, 0x20, 0x08, 0xce, 0x3e, 0x4e, 0xc7, 0x82, 0x8b, 0x93, 0x48, 0xcf, 0x07, - 0x91, 0xbb, 0x1c, 0x8a, 0xb4, 0x15, 0xb7, 0xe3, 0xbb, 0xdf, 0xff, 0xf7, 0xfd, 0xf3, 0xe1, 0xd6, - 0x00, 0xc6, 0x43, 0x71, 0xcf, 0x12, 0x95, 0x66, 0x6a, 0xc8, 0x9d, 0x02, 0x6d, 0xaf, 0x7a, 0xec, - 0xb6, 0x1b, 0x0b, 0xc7, 0xbb, 0x2c, 0xcd, 0xc4, 0x64, 0x1a, 0x9a, 0x09, 0x38, 0x20, 0xbb, 0x1e, - 0x0d, 0xb5, 0xb8, 0x4b, 0x54, 0x1a, 0x56, 0x48, 0xa3, 0x2e, 0x41, 0x42, 0x49, 0xb0, 0xe2, 0xcb, - 0xc3, 0x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0x37, 0x02, 0x00, 0x00, + // 314 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4c, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0xcf, 0xc9, 0x2c, 0x2c, 0xcd, 0x4c, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, + 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x85, 0x28, 0xd5, 0x43, 0x55, 0xaa, 0x07, 0x55, 0x2a, + 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa9, 0x0f, 0x62, 0x41, 0x34, 0x49, 0xc9, 0xa4, 0xe7, + 0xe7, 0xa7, 0xe7, 0xa4, 0xea, 0x27, 0x16, 0x64, 0xea, 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x40, 0xf4, + 0x41, 0x65, 0xb5, 0x92, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xf5, 0x93, 0x12, 0x8b, 0x53, 0x21, 0x76, + 0xc1, 0x6d, 0x2e, 0x48, 0x4c, 0xcf, 0xcc, 0x03, 0x2b, 0x46, 0xa8, 0xc5, 0xe7, 0xd2, 0x82, 0xc4, + 0xa2, 0xc4, 0x5c, 0xa8, 0xb9, 0x4a, 0x22, 0x5c, 0x42, 0x81, 0x20, 0xd3, 0x02, 0xc0, 0x82, 0x41, + 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x4a, 0x51, 0x5c, 0xc2, 0x28, 0xa2, 0xc5, 0x05, 0xf9, 0x79, + 0xc5, 0xa9, 0x42, 0xce, 0x5c, 0x6c, 0x10, 0xcd, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0xaa, + 0x7a, 0x78, 0x3d, 0xaa, 0x07, 0xd1, 0xee, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x54, 0xab, + 0xd1, 0x06, 0x46, 0x2e, 0x56, 0xb0, 0xe1, 0x42, 0xcb, 0x18, 0xb9, 0xd8, 0x20, 0x4a, 0x84, 0x0c, + 0x09, 0x98, 0x84, 0xe9, 0x46, 0x29, 0x23, 0x52, 0xb4, 0x40, 0x3c, 0xa0, 0x64, 0xda, 0x74, 0xf9, + 0xc9, 0x64, 0x26, 0x7d, 0x21, 0x5d, 0x7d, 0x88, 0x5e, 0xdd, 0xfc, 0xb4, 0xb4, 0xcc, 0xe4, 0xcc, + 0xc4, 0x1c, 0x7d, 0xec, 0x41, 0x06, 0x71, 0xb2, 0x53, 0xd0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, + 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, + 0x1e, 0xcb, 0x31, 0x44, 0x59, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0x81, 0x9c, 0x82, 0xcb, 0x48, + 0x0c, 0x43, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xe1, 0x6f, 0x0c, 0x08, 0x00, 0x00, + 0xff, 0xff, 0x7f, 0xc8, 0xf5, 0x9a, 0x57, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -168,7 +168,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/comdex.newliq.v1beta1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/comdex.liquidationsV2.v1beta1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -202,7 +202,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/comdex.newliq.v1beta1.Query/Params", + FullMethod: "/comdex.liquidationsV2.v1beta1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -211,7 +211,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.newliq.v1beta1.Query", + ServiceName: "comdex.liquidationsV2.v1beta1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/x/liquidationsV2/types/tx.pb.go b/x/liquidationsV2/types/tx.pb.go index 72a2b8838..57b8d742a 100644 --- a/x/liquidationsV2/types/tx.pb.go +++ b/x/liquidationsV2/types/tx.pb.go @@ -28,17 +28,17 @@ func init() { } var fileDescriptor_51c735c845851e88 = []byte{ - // 152 bytes of a gzipped FileDescriptorProto + // 148 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4b, 0xce, 0xcf, 0x4d, 0x49, 0xad, 0xd0, 0xcf, 0xc9, 0x2c, 0x2c, 0xcd, 0x4c, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, - 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xa8, 0xd3, 0xcb, 0x4b, 0x2d, 0xcf, 0xc9, 0x2c, 0xd4, 0x83, 0xca, - 0x1b, 0xb1, 0x72, 0x31, 0xfb, 0x16, 0xa7, 0x3b, 0x05, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, - 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, - 0xb1, 0x1c, 0x43, 0x94, 0x45, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, - 0xc4, 0x08, 0xdd, 0xfc, 0xb4, 0xb4, 0xcc, 0xe4, 0xcc, 0xc4, 0x1c, 0x28, 0x5f, 0x1f, 0xc3, 0xf2, - 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xc5, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xaa, 0xff, 0x42, 0x46, 0xa2, 0x00, 0x00, 0x00, + 0x2f, 0xc9, 0x17, 0x92, 0x85, 0xa8, 0xd3, 0x43, 0x55, 0xa7, 0x07, 0x55, 0x67, 0xc4, 0xca, 0xc5, + 0xec, 0x5b, 0x9c, 0xee, 0x14, 0x74, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, + 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, + 0x16, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x10, 0xa3, 0x74, 0xf3, + 0xd3, 0xd2, 0x32, 0x93, 0x33, 0x13, 0x73, 0xa0, 0x7c, 0x7d, 0x0c, 0x47, 0x94, 0x54, 0x16, 0xa4, + 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x46, 0x90, 0x91, + 0xaa, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -76,7 +76,7 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.newliq.v1beta1.Msg", + ServiceName: "comdex.liquidationsV2.v1beta1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{}, From 3228e61af845fef6e581c76f93441b358dd5aed9 Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 7 Apr 2023 19:50:22 +0530 Subject: [PATCH 007/155] updating pb files --- proto/comdex/liquidationsV2/v1beta1/gov.proto | 2 +- x/liquidationsV2/types/gov.pb.go | 51 +- x/liquidationsV2/types/liquidate.pb.go | 441 +++++++----------- 3 files changed, 198 insertions(+), 296 deletions(-) diff --git a/proto/comdex/liquidationsV2/v1beta1/gov.proto b/proto/comdex/liquidationsV2/v1beta1/gov.proto index 573cf42f0..3af8e9ff1 100644 --- a/proto/comdex/liquidationsV2/v1beta1/gov.proto +++ b/proto/comdex/liquidationsV2/v1beta1/gov.proto @@ -13,5 +13,5 @@ option (gogoproto.goproto_getters_all) = false; message WhitelistAppProposal { string title = 1 [(gogoproto.moretags) = "yaml:\"title\""]; string description = 2 [(gogoproto.moretags) = "yaml:\"description\""]; - WhiteListing whitelisting = 3 [(gogoproto.nullable) = false]; + LiquidationWhiteListing whitelisting = 3 [(gogoproto.nullable) = false]; } \ No newline at end of file diff --git a/x/liquidationsV2/types/gov.pb.go b/x/liquidationsV2/types/gov.pb.go index e995bd3f5..bcb05cfa9 100644 --- a/x/liquidationsV2/types/gov.pb.go +++ b/x/liquidationsV2/types/gov.pb.go @@ -26,9 +26,9 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type WhitelistAppProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - Whitelisting WhiteListing `protobuf:"bytes,3,opt,name=whitelisting,proto3" json:"whitelisting"` + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + Whitelisting LiquidationWhiteListing `protobuf:"bytes,3,opt,name=whitelisting,proto3" json:"whitelisting"` } func (m *WhitelistAppProposal) Reset() { *m = WhitelistAppProposal{} } @@ -73,28 +73,29 @@ func init() { } var fileDescriptor_4fbf1b0be7d4e97b = []byte{ - // 334 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xcf, 0x6a, 0x02, 0x31, - 0x10, 0x87, 0x37, 0xfd, 0x07, 0x5d, 0x3d, 0x94, 0x45, 0x8a, 0x08, 0xcd, 0xca, 0x1e, 0x5a, 0xa1, - 0xb8, 0x41, 0x7b, 0x91, 0xde, 0xea, 0xb9, 0x87, 0x22, 0xb4, 0x05, 0x6f, 0xd9, 0x35, 0xc6, 0x40, - 0xd6, 0x49, 0x4d, 0xb4, 0xf5, 0x2d, 0xfa, 0x18, 0x7d, 0x14, 0x6f, 0xf5, 0xd8, 0x93, 0xb4, 0xeb, - 0x1b, 0xf8, 0x04, 0xc5, 0xcd, 0x5a, 0x94, 0x82, 0xb7, 0xcc, 0xcc, 0x37, 0xf9, 0x86, 0x9f, 0x7b, - 0x15, 0x43, 0xd2, 0x63, 0x6f, 0x44, 0x8a, 0x97, 0xb1, 0xe8, 0x51, 0x23, 0x60, 0xa8, 0x9f, 0x9a, - 0x64, 0xd2, 0x88, 0x98, 0xa1, 0x0d, 0xc2, 0x61, 0x12, 0xaa, 0x11, 0x18, 0xf0, 0x2e, 0x2c, 0x18, - 0xee, 0x82, 0x61, 0x0e, 0x56, 0x4a, 0x1c, 0x38, 0x64, 0x24, 0x59, 0xbf, 0xec, 0x52, 0xc5, 0xe7, - 0x00, 0x5c, 0x32, 0x92, 0x55, 0xd1, 0xb8, 0x4f, 0x8c, 0x48, 0x98, 0x36, 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7e, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x80, 0xfd, 0xbe, 0x04, 0x02, 0x00, 0x00, + // 339 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xcd, 0x4e, 0x3a, 0x31, + 0x14, 0xc5, 0xa7, 0xff, 0x0f, 0x13, 0x07, 0x16, 0x66, 0x42, 0x0c, 0x21, 0xb1, 0x43, 0x66, 0xa1, + 0x6c, 0x98, 0x06, 0x4c, 0x0c, 0x71, 0x27, 0x6b, 0x16, 0x86, 0x85, 0x26, 0xac, 0xec, 0x0c, 0xa5, + 0x34, 0xe9, 0x70, 0x2b, 0x2d, 0x28, 0x6f, 0xe1, 0x63, 0xf8, 0x28, 0x2c, 0x59, 0x1a, 0x17, 0x44, + 0x87, 0x37, 0xe0, 0x09, 0x0c, 0xd3, 0x41, 0x21, 0x26, 0xec, 0x7a, 0xcf, 0xf9, 0xdd, 0x9e, 0x9b, + 0xe3, 0x5e, 0xc4, 0x90, 0xf4, 0xd9, 0x33, 0x91, 0xe2, 0x71, 0x22, 0xfa, 0xd4, 0x08, 0x18, 0xe9, + 0xbb, 0x26, 0x99, 0x36, 0x22, 0x66, 0x68, 0x83, 0x70, 0x98, 0x86, 0x6a, 0x0c, 0x06, 0xbc, 0x33, + 0x0b, 0x86, 0xfb, 0x60, 0x98, 0x83, 0x95, 0x12, 0x07, 0x0e, 0x19, 0x49, 0x36, 0x2f, 0xbb, 0x54, + 0xf1, 0x39, 0x00, 0x97, 0x8c, 0x64, 0x53, 0x34, 0x19, 0x10, 0x23, 0x12, 0xa6, 0x0d, 0x4d, 0x54, + 0x0e, 0xe0, 0x18, 0x74, 0x02, 0x9a, 0x44, 0x54, 0xb3, 0xef, 0xd0, 0x18, 0xc4, 0x28, 0xf7, 0xeb, + 0x87, 0xcf, 0xdb, 0xca, 0xcc, 0xe2, 0xc1, 0x3b, 0x72, 0x4b, 0xf7, 0x43, 0x61, 0x98, 0x14, 0xda, + 0xdc, 0x28, 0x75, 0x3b, 0x06, 0x05, 0x9a, 0x4a, 0xef, 0xdc, 0xfd, 0x6f, 0x84, 0x91, 0xac, 0x8c, + 0xaa, 0xa8, 0x76, 0xdc, 0x3e, 0x59, 0x2f, 0xfd, 0xe2, 0x8c, 0x26, 0xf2, 0x3a, 0xc8, 0xe4, 0xa0, + 0x6b, 0x6d, 0xaf, 0xe5, 0x16, 0xfa, 0x4c, 0xc7, 0x63, 0xa1, 0x36, 0x51, 0xe5, 0x3f, 0x19, 0x7d, + 0xba, 0x5e, 0xfa, 0x9e, 0xa5, 0x77, 0xcc, 0xa0, 0xbb, 0x8b, 0x7a, 0x0f, 0x6e, 0xf1, 0x69, 0x9b, + 0x2c, 0x46, 0xbc, 0xfc, 0xb7, 0x8a, 0x6a, 0x85, 0xe6, 0x55, 0x78, 0xb0, 0xb6, 0xb0, 0xf3, 0x23, + 0x67, 0x77, 0x77, 0xec, 0x76, 0xfb, 0xdf, 0x7c, 0xe9, 0x3b, 0xdd, 0xbd, 0x1f, 0xdb, 0xbd, 0xf9, + 0x27, 0x76, 0x5e, 0x53, 0xec, 0xcc, 0x53, 0x8c, 0x16, 0x29, 0x46, 0x1f, 0x29, 0x46, 0x2f, 0x2b, + 0xec, 0x2c, 0x56, 0xd8, 0x79, 0x5b, 0x61, 0xa7, 0xd7, 0xe2, 0xc2, 0x0c, 0x27, 0xd1, 0x26, 0x93, + 0xd8, 0xdc, 0x3a, 0x0c, 0x06, 0x22, 0x16, 0x54, 0xe6, 0x33, 0xf9, 0x55, 0xa5, 0x99, 0x29, 0xa6, + 0xa3, 0xa3, 0xac, 0xbf, 0xcb, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xca, 0x11, 0x85, 0x46, 0x0f, + 0x02, 0x00, 0x00, } func (m *WhitelistAppProposal) Marshal() (dAtA []byte, err error) { diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index 26714c443..fc27357c0 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -29,23 +29,24 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type WhiteListing struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AuctionType uint64 `protobuf:"varint,2,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` +type LiquidationWhiteListing struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AuctionType uint64 `protobuf:"varint,2,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` + CurrentOffset uint64 `protobuf:"varint,3,opt,name=current_offset,json=currentOffset,proto3" json:"current_offset,omitempty"` } -func (m *WhiteListing) Reset() { *m = WhiteListing{} } -func (m *WhiteListing) String() string { return proto.CompactTextString(m) } -func (*WhiteListing) ProtoMessage() {} -func (*WhiteListing) Descriptor() ([]byte, []int) { +func (m *LiquidationWhiteListing) Reset() { *m = LiquidationWhiteListing{} } +func (m *LiquidationWhiteListing) String() string { return proto.CompactTextString(m) } +func (*LiquidationWhiteListing) ProtoMessage() {} +func (*LiquidationWhiteListing) Descriptor() ([]byte, []int) { return fileDescriptor_631048b9d11253bf, []int{0} } -func (m *WhiteListing) XXX_Unmarshal(b []byte) error { +func (m *LiquidationWhiteListing) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *WhiteListing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *LiquidationWhiteListing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_WhiteListing.Marshal(b, m, deterministic) + return xxx_messageInfo_LiquidationWhiteListing.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -55,17 +56,17 @@ func (m *WhiteListing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *WhiteListing) XXX_Merge(src proto.Message) { - xxx_messageInfo_WhiteListing.Merge(m, src) +func (m *LiquidationWhiteListing) XXX_Merge(src proto.Message) { + xxx_messageInfo_LiquidationWhiteListing.Merge(m, src) } -func (m *WhiteListing) XXX_Size() int { +func (m *LiquidationWhiteListing) XXX_Size() int { return m.Size() } -func (m *WhiteListing) XXX_DiscardUnknown() { - xxx_messageInfo_WhiteListing.DiscardUnknown(m) +func (m *LiquidationWhiteListing) XXX_DiscardUnknown() { + xxx_messageInfo_LiquidationWhiteListing.DiscardUnknown(m) } -var xxx_messageInfo_WhiteListing proto.InternalMessageInfo +var xxx_messageInfo_LiquidationWhiteListing proto.InternalMessageInfo type LockedVault struct { LockedVaultId uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` @@ -76,12 +77,13 @@ type LockedVault struct { AmountIn github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=amount_in,json=amountIn,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_in" yaml:"amount_in"` AmountOut github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=amount_out,json=amountOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_out" yaml:"amount_out"` CurrentCollaterlisationRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=current_collateralisation_ratio,json=currentCollateralisationRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"current_collateralisation_ratio" yaml:"current_collateralisation_ratio"` - CollateralToBeAuctioned github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=collateral_to_be_auctioned,json=collateralToBeAuctioned,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_to_be_auctioned" yaml:"collateral_to_be_auctioned"` - LiquidationTimestamp time.Time `protobuf:"bytes,10,opt,name=liquidation_timestamp,json=liquidationTimestamp,proto3,stdtime" json:"liquidation_timestamp" yaml:"liquidation_timestamp"` - IsInternalKeeper bool `protobuf:"varint,11,opt,name=is_internal_keeper,json=isInternalKeeper,proto3" json:"is_internal_keeper,omitempty" yaml:"is_intenal_keeper"` - InternalKeeperAddress string `protobuf:"bytes,12,opt,name=internal_keeper_address,json=internalKeeperAddress,proto3" json:"internal_keeper_address,omitempty" yaml:"internal_keeper_address"` - IsExternalKeeper string `protobuf:"bytes,13,opt,name=is_external_keeper,json=isExternalKeeper,proto3" json:"is_external_keeper,omitempty" yaml:"is_external_keeper"` - ExternalKeeperAddress string `protobuf:"bytes,14,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` + CollateralToBeAuctioned github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,9,opt,name=collateral_to_be_auctioned,json=collateralToBeAuctioned,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"collateral_to_be_auctioned" yaml:"collateral_to_be_auctioned"` + TargetDebt github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=target_debt,json=targetDebt,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"target_debt" yaml:"target_debt"` + LiquidationTimestamp time.Time `protobuf:"bytes,11,opt,name=liquidation_timestamp,json=liquidationTimestamp,proto3,stdtime" json:"liquidation_timestamp" yaml:"liquidation_timestamp"` + IsInternalKeeper bool `protobuf:"varint,12,opt,name=is_internal_keeper,json=isInternalKeeper,proto3" json:"is_internal_keeper,omitempty" yaml:"is_intenal_keeper"` + InternalKeeperAddress string `protobuf:"bytes,13,opt,name=internal_keeper_address,json=internalKeeperAddress,proto3" json:"internal_keeper_address,omitempty" yaml:"internal_keeper_address"` + IsExternalKeeper string `protobuf:"bytes,14,opt,name=is_external_keeper,json=isExternalKeeper,proto3" json:"is_external_keeper,omitempty" yaml:"is_external_keeper"` + ExternalKeeperAddress string `protobuf:"bytes,15,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` } func (m *LockedVault) Reset() { *m = LockedVault{} } @@ -117,48 +119,9 @@ func (m *LockedVault) XXX_DiscardUnknown() { var xxx_messageInfo_LockedVault proto.InternalMessageInfo -type LiquidationOffsetHolder struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - CurrentOffset uint64 `protobuf:"varint,2,opt,name=current_offset,json=currentOffset,proto3" json:"current_offset,omitempty"` -} - -func (m *LiquidationOffsetHolder) Reset() { *m = LiquidationOffsetHolder{} } -func (m *LiquidationOffsetHolder) String() string { return proto.CompactTextString(m) } -func (*LiquidationOffsetHolder) ProtoMessage() {} -func (*LiquidationOffsetHolder) Descriptor() ([]byte, []int) { - return fileDescriptor_631048b9d11253bf, []int{2} -} -func (m *LiquidationOffsetHolder) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LiquidationOffsetHolder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LiquidationOffsetHolder.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LiquidationOffsetHolder) XXX_Merge(src proto.Message) { - xxx_messageInfo_LiquidationOffsetHolder.Merge(m, src) -} -func (m *LiquidationOffsetHolder) XXX_Size() int { - return m.Size() -} -func (m *LiquidationOffsetHolder) XXX_DiscardUnknown() { - xxx_messageInfo_LiquidationOffsetHolder.DiscardUnknown(m) -} - -var xxx_messageInfo_LiquidationOffsetHolder proto.InternalMessageInfo - func init() { - proto.RegisterType((*WhiteListing)(nil), "comdex.liquidationsV2.v1beta1.WhiteListing") + proto.RegisterType((*LiquidationWhiteListing)(nil), "comdex.liquidationsV2.v1beta1.LiquidationWhiteListing") proto.RegisterType((*LockedVault)(nil), "comdex.liquidationsV2.v1beta1.LockedVault") - proto.RegisterType((*LiquidationOffsetHolder)(nil), "comdex.liquidationsV2.v1beta1.LiquidationOffsetHolder") } func init() { @@ -166,66 +129,67 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 895 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4d, 0x6e, 0xdb, 0x46, - 0x18, 0x15, 0xdd, 0xd8, 0xb5, 0x46, 0xb6, 0xe3, 0x30, 0x56, 0xcc, 0x08, 0x31, 0x47, 0x25, 0x50, - 0xc3, 0x1b, 0x93, 0x75, 0xb2, 0x29, 0xda, 0x4d, 0xa5, 0x34, 0x40, 0x85, 0x1a, 0x55, 0x40, 0x18, - 0x09, 0x90, 0x45, 0x89, 0x11, 0x39, 0x92, 0x07, 0xa6, 0x38, 0x2c, 0x39, 0x4c, 0xed, 0x3b, 0x74, - 0x91, 0xde, 0xa2, 0x40, 0x2f, 0xd1, 0xa5, 0x97, 0x59, 0x16, 0x5d, 0x4c, 0x5b, 0xea, 0x06, 0x3c, - 0x41, 0xc1, 0x99, 0xd1, 0x0f, 0x15, 0x06, 0x85, 0x37, 0x96, 0x39, 0xdf, 0x7b, 0xef, 0x7b, 0x0f, - 0xc3, 0xef, 0x23, 0x38, 0xf5, 0xe9, 0x34, 0xc0, 0xd7, 0x4e, 0x48, 0x7e, 0xca, 0x48, 0x80, 0x18, - 0xa1, 0x51, 0xfa, 0xea, 0xa9, 0xf3, 0xf6, 0x6c, 0x84, 0x19, 0x3a, 0x5b, 0x1c, 0x63, 0x3b, 0x4e, - 0x28, 0xa3, 0xfa, 0x91, 0x84, 0xdb, 0x55, 0xb8, 0xad, 0xe0, 0x9d, 0x83, 0x09, 0x9d, 0x50, 0x81, - 0x74, 0xca, 0xff, 0x24, 0xa9, 0x03, 0x27, 0x94, 0x4e, 0x42, 0xec, 0x88, 0xa7, 0x51, 0x36, 0x76, - 0x18, 0x99, 0xe2, 0x94, 0xa1, 0x69, 0xac, 0x00, 0xa6, 0x4f, 0xd3, 0x29, 0x4d, 0x9d, 0x11, 0x4a, - 0xf1, 0xa2, 0xb5, 0x4f, 0x49, 0x24, 0xeb, 0xd6, 0x2f, 0x1a, 0xd8, 0x79, 0x7d, 0x49, 0x18, 0x3e, - 0x27, 0x29, 0x23, 0xd1, 0x44, 0x3f, 0x03, 0x5b, 0x28, 0x8e, 0x3d, 0x12, 0x18, 0x5a, 0x57, 0x3b, - 0xb9, 0xd7, 0xef, 0xe4, 0x1c, 0x6e, 0xf6, 0xe2, 0x78, 0x10, 0x14, 0x1c, 0xee, 0xde, 0xa0, 0x69, - 0xf8, 0x95, 0x25, 0x01, 0x96, 0xbb, 0x89, 0xca, 0x73, 0x7d, 0x00, 0x76, 0x50, 0xe6, 0x97, 0x86, - 0x3d, 0x76, 0x13, 0x63, 0x63, 0x43, 0x10, 0x8f, 0x73, 0x0e, 0x5b, 0x3d, 0x79, 0x7e, 0x71, 0x13, - 0xe3, 0x82, 0xc3, 0x87, 0x8a, 0xbe, 0x02, 0xb6, 0xdc, 0x16, 0x5a, 0x62, 0xac, 0x59, 0x0b, 0xb4, - 0xce, 0xa9, 0x7f, 0x85, 0x83, 0x57, 0x28, 0x0b, 0x99, 0x6e, 0x83, 0x8d, 0x85, 0x13, 0x33, 0xe7, - 0x70, 0x77, 0xa5, 0x28, 0x1c, 0x35, 0xa5, 0x64, 0xe9, 0x66, 0x83, 0x04, 0xfa, 0xe9, 0xc2, 0xbd, - 0x34, 0xf1, 0x68, 0xd5, 0xfd, 0x0a, 0x56, 0x39, 0x3f, 0x07, 0x0f, 0x68, 0x42, 0x26, 0x24, 0x42, - 0xa1, 0xf7, 0xb6, 0xd4, 0x2c, 0x99, 0x9f, 0x08, 0x66, 0x37, 0xe7, 0xf0, 0xfe, 0x50, 0x15, 0x6b, - 0xfb, 0xdd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fc, - 0xec, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x68, 0x8b, 0xa3, 0xe3, 0xd7, 0x07, 0x00, 0x00, + // 912 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcb, 0x6e, 0xdb, 0x46, + 0x14, 0x15, 0xd3, 0xd8, 0xb5, 0x46, 0x7e, 0x65, 0x62, 0xc7, 0x8c, 0x10, 0x73, 0x54, 0x02, 0x35, + 0xbc, 0xb1, 0x58, 0x27, 0x9b, 0xa2, 0xdd, 0x54, 0x4a, 0xb2, 0x10, 0x6a, 0x54, 0x01, 0x61, 0xa4, + 0x40, 0x16, 0x25, 0x46, 0xe4, 0x48, 0x1e, 0x98, 0xe2, 0xb0, 0xe4, 0x30, 0xb5, 0xff, 0x22, 0xfd, + 0x8b, 0x02, 0xfd, 0x87, 0xa2, 0x4b, 0x2f, 0xb3, 0x0c, 0xba, 0x98, 0xb6, 0xf4, 0x1f, 0xf0, 0x0b, + 0x8a, 0x79, 0xe8, 0x19, 0x05, 0x85, 0x37, 0x96, 0x79, 0xef, 0x79, 0xdc, 0x43, 0x0e, 0x2f, 0xc1, + 0x49, 0xc8, 0xc6, 0x11, 0xb9, 0xf2, 0x62, 0xfa, 0x73, 0x41, 0x23, 0xcc, 0x29, 0x4b, 0xf2, 0xd7, + 0x4f, 0xbd, 0xb7, 0xa7, 0x03, 0xc2, 0xf1, 0xe9, 0xb4, 0x4c, 0xda, 0x69, 0xc6, 0x38, 0x83, 0x87, + 0x1a, 0xde, 0x5e, 0x84, 0xb7, 0x0d, 0xbc, 0xb9, 0x37, 0x62, 0x23, 0xa6, 0x90, 0x9e, 0xfc, 0x4f, + 0x93, 0x9a, 0x68, 0xc4, 0xd8, 0x28, 0x26, 0x9e, 0xba, 0x1a, 0x14, 0x43, 0x8f, 0xd3, 0x31, 0xc9, + 0x39, 0x1e, 0xa7, 0x06, 0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bf, 0x3a, 0xce, 0x83, 0x75, 0x75, + 0xe4, 0x9e, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x1c, 0xc9, 0x32, 0x25, 0x08, 0x00, 0x00, } -func (m *WhiteListing) Marshal() (dAtA []byte, err error) { +func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -235,16 +199,21 @@ func (m *WhiteListing) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *WhiteListing) MarshalTo(dAtA []byte) (int, error) { +func (m *LiquidationWhiteListing) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.CurrentOffset != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.CurrentOffset)) + i-- + dAtA[i] = 0x18 + } if m.AuctionType != 0 { i = encodeVarintLiquidate(dAtA, i, uint64(m.AuctionType)) i-- @@ -283,21 +252,21 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.ExternalKeeperAddress) i = encodeVarintLiquidate(dAtA, i, uint64(len(m.ExternalKeeperAddress))) i-- - dAtA[i] = 0x72 + dAtA[i] = 0x7a } if len(m.IsExternalKeeper) > 0 { i -= len(m.IsExternalKeeper) copy(dAtA[i:], m.IsExternalKeeper) i = encodeVarintLiquidate(dAtA, i, uint64(len(m.IsExternalKeeper))) i-- - dAtA[i] = 0x6a + dAtA[i] = 0x72 } if len(m.InternalKeeperAddress) > 0 { i -= len(m.InternalKeeperAddress) copy(dAtA[i:], m.InternalKeeperAddress) i = encodeVarintLiquidate(dAtA, i, uint64(len(m.InternalKeeperAddress))) i-- - dAtA[i] = 0x62 + dAtA[i] = 0x6a } if m.IsInternalKeeper { i-- @@ -307,7 +276,7 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x58 + dAtA[i] = 0x60 } n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LiquidationTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LiquidationTimestamp):]) if err1 != nil { @@ -316,6 +285,16 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n1 i = encodeVarintLiquidate(dAtA, i, uint64(n1)) i-- + dAtA[i] = 0x5a + { + size := m.TargetDebt.Size() + i -= size + if _, err := m.TargetDebt.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x52 { size := m.CollateralToBeAuctioned.Size() @@ -387,39 +366,6 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *LiquidationOffsetHolder) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LiquidationOffsetHolder) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LiquidationOffsetHolder) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CurrentOffset != 0 { - i = encodeVarintLiquidate(dAtA, i, uint64(m.CurrentOffset)) - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintLiquidate(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func encodeVarintLiquidate(dAtA []byte, offset int, v uint64) int { offset -= sovLiquidate(v) base := offset @@ -431,7 +377,7 @@ func encodeVarintLiquidate(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *WhiteListing) Size() (n int) { +func (m *LiquidationWhiteListing) Size() (n int) { if m == nil { return 0 } @@ -443,6 +389,9 @@ func (m *WhiteListing) Size() (n int) { if m.AuctionType != 0 { n += 1 + sovLiquidate(uint64(m.AuctionType)) } + if m.CurrentOffset != 0 { + n += 1 + sovLiquidate(uint64(m.CurrentOffset)) + } return n } @@ -476,6 +425,8 @@ func (m *LockedVault) Size() (n int) { n += 1 + l + sovLiquidate(uint64(l)) l = m.CollateralToBeAuctioned.Size() n += 1 + l + sovLiquidate(uint64(l)) + l = m.TargetDebt.Size() + n += 1 + l + sovLiquidate(uint64(l)) l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LiquidationTimestamp) n += 1 + l + sovLiquidate(uint64(l)) if m.IsInternalKeeper { @@ -496,28 +447,13 @@ func (m *LockedVault) Size() (n int) { return n } -func (m *LiquidationOffsetHolder) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovLiquidate(uint64(m.AppId)) - } - if m.CurrentOffset != 0 { - n += 1 + sovLiquidate(uint64(m.CurrentOffset)) - } - return n -} - func sovLiquidate(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozLiquidate(x uint64) (n int) { return sovLiquidate(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *WhiteListing) Unmarshal(dAtA []byte) error { +func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -540,10 +476,10 @@ func (m *WhiteListing) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WhiteListing: wiretype end group for non-group") + return fmt.Errorf("proto: LiquidationWhiteListing: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WhiteListing: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LiquidationWhiteListing: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -584,6 +520,25 @@ func (m *WhiteListing) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentOffset", wireType) + } + m.CurrentOffset = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentOffset |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipLiquidate(dAtA[iNdEx:]) @@ -879,6 +834,40 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetDebt", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TargetDebt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LiquidationTimestamp", wireType) } @@ -911,7 +900,7 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 11: + case 12: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field IsInternalKeeper", wireType) } @@ -931,7 +920,7 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } } m.IsInternalKeeper = bool(v != 0) - case 12: + case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field InternalKeeperAddress", wireType) } @@ -963,7 +952,7 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } m.InternalKeeperAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 13: + case 14: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field IsExternalKeeper", wireType) } @@ -995,7 +984,7 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } m.IsExternalKeeper = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 14: + case 15: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ExternalKeeperAddress", wireType) } @@ -1048,94 +1037,6 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } return nil } -func (m *LiquidationOffsetHolder) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLiquidate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LiquidationOffsetHolder: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LiquidationOffsetHolder: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLiquidate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentOffset", wireType) - } - m.CurrentOffset = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLiquidate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CurrentOffset |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipLiquidate(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLiquidate - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipLiquidate(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From fd5292aab052d8381c06c77559155153097dd7c4 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Fri, 7 Apr 2023 20:05:26 +0530 Subject: [PATCH 008/155] liquidation-liquidateVaults --- x/liquidationsV2/keeper/liquidate.go | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 52a8a6fee..0a56ac4a2 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -64,14 +64,10 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { if !found { return fmt.Errorf("Liquidation not enabled for App ID %d", vault.AppId) } - //Checking extended pair vault data - extPair, _ := k.asset.GetPairsVault(ctx, vault.ExtendedPairVaultID) - pair, _ := k.asset.GetPair(ctx, extPair.PairId) - assetIn, found := k.asset.GetAsset(ctx, pair.AssetIn) - if !found { - return fmt.Errorf("asset not found in Liquidation, liquidate_vaults.go for vault ID %d", vault.Id) - } + + // Checking extended pair vault data for Minimum collateralisation ratio + extPair, _ := k.asset.GetPairsVault(ctx, vault.ExtendedPairVaultID) liqRatio := extPair.MinCr totalOut := vault.AmountOut.Add(vault.InterestAccumulated).Add(vault.ClosingFeeAccumulated) collateralizationRatio, err := k.vault.CalculateCollateralizationRatio(ctx, vault.ExtendedPairVaultID, vault.AmountIn, totalOut) @@ -79,12 +75,12 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { return fmt.Errorf("error Calculating CR in Liquidation, liquidate_vaults.go for vault ID %d", vault.Id) } if collateralizationRatio.LT(liqRatio) { - totalDebt := vault.AmountOut.Add(vault.InterestAccumulated) err1 := k.rewards.CalculateVaultInterest(ctx, vault.AppId, vault.ExtendedPairVaultID, vault.Id, totalDebt, vault.BlockHeight, vault.BlockTime.Unix()) if err1 != nil { return fmt.Errorf("error Calculating vault interest in Liquidation, liquidate_vaults.go for vaultID %d", vault.Id) } + //Callling vault to use the updated values of the vault vault, _ := k.vault.GetVault(ctx, vault.Id) totalOut := vault.AmountOut.Add(vault.InterestAccumulated).Add(vault.ClosingFeeAccumulated) @@ -92,12 +88,14 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { if err != nil { return fmt.Errorf("error Calculating CR in Liquidation, liquidate_vaults.go for vaultID %d", vault.Id) } - - err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner,vault.AmountIn,totalOut,collateralizationRatio, vault.AppId,false,false,"","") + //Creating locked vault struct , which will trigger auction + err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, vault.AmountIn, totalOut, collateralizationRatio, vault.AppId, false, false, "", "") if err != nil { return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for Vault %d", vault.Id) } + + //Removing data from existing structs k.vault.DeleteVault(ctx, vault.Id) var rewards rewardstypes.VaultInterestTracker rewards.AppMappingId = vault.AppId @@ -108,6 +106,7 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { return nil }) } + liquidationOffsetHolder.CurrentOffset = uint64(end) k.SetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix, liquidationOffsetHolder) @@ -115,12 +114,9 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { } - - -func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn sdk.Int, AmountOut sdk.Int, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string) error { +func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn sdk.Int, AmountOut sdk.Int, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string) error { lockedVaultID := k.GetLockedVaultID(ctx) - value := types.LockedVault{ LockedVaultId: lockedVaultID + 1, AppId: appID, @@ -131,6 +127,7 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair AmountOut: AmountOut, CurrentCollaterlisationRatio: collateralizationRatio, CollateralToBeAuctioned: AmountIn, + TargetDebt: AmountOut, LiquidationTimestamp: ctx.BlockTime(), IsInternalKeeper: false, InternalKeeperAddress: "", From 7dd5ed2a54c1e4dc9d30b889f7c1eef1535379ef Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Fri, 7 Apr 2023 22:58:21 +0530 Subject: [PATCH 009/155] liquidation-liquidateVaults --- .../comdex/liquidationsV2/v1beta1/liquidate.proto | 14 +++++++++++++- x/liquidationsV2/keeper/offset.go | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index b66beca81..abf4275f7 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -19,10 +19,13 @@ message LiquidationWhiteListing { uint64 auction_type = 2 [ (gogoproto.customname) = "AuctionType", (gogoproto.moretags) = "yaml:\"auction_type\""]; - uint64 current_offset = 3; } +message LiquidationOffsetHolder { + uint64 current_offset = 2; +} + //Internal keepers are bots run by people to liquidate positions of comdex apps //They run tx function to liquidate the positions @@ -147,6 +150,15 @@ message LockedVault { // } } + + + + + + + + + // message BorrowMetaData { // uint64 lending_id = 1; // bool is_stable_borrow = 2; diff --git a/x/liquidationsV2/keeper/offset.go b/x/liquidationsV2/keeper/offset.go index 2964c0f90..a33026623 100644 --- a/x/liquidationsV2/keeper/offset.go +++ b/x/liquidationsV2/keeper/offset.go @@ -16,7 +16,7 @@ func (k Keeper) SetLiquidationOffsetHolder(ctx sdk.Context, liquidatonPrefix str } // GetLiquidationOffsetHolder returns liquidationOffsetHolder object for the given app id, pool id and farmer. -func (k Keeper) GetLiquidationOffsetHolder(ctx sdk.Context, appID uint64, liquidatonPrefix string) (liquidationOffsetHolder types.LiquidationOffsetHolder, found bool) { +func (k Keeper) GetLiquidationOffsetHolder(ctx sdk.Context, liquidatonPrefix string) (liquidationOffsetHolder types.LiquidationOffsetHolder, found bool) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.GetLiquidationOffsetHolderKey(appID, liquidatonPrefix)) if bz == nil { From e4cf630dc56ccd41379b3123792e605126970ee7 Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 7 Apr 2023 23:01:04 +0530 Subject: [PATCH 010/155] updating proto --- x/liquidationsV2/keeper/liquidate.go | 4 +- x/liquidationsV2/types/liquidate.pb.go | 256 ++++++++++++++++++------- 2 files changed, 189 insertions(+), 71 deletions(-) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 0a56ac4a2..a776aca71 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/liquidationsV2/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" @@ -65,7 +64,6 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { return fmt.Errorf("Liquidation not enabled for App ID %d", vault.AppId) } - // Checking extended pair vault data for Minimum collateralisation ratio extPair, _ := k.asset.GetPairsVault(ctx, vault.ExtendedPairVaultID) liqRatio := extPair.MinCr @@ -106,7 +104,7 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { return nil }) } - + liquidationOffsetHolder.CurrentOffset = uint64(end) k.SetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix, liquidationOffsetHolder) diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index fc27357c0..69daad311 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -30,9 +30,8 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type LiquidationWhiteListing struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AuctionType uint64 `protobuf:"varint,2,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` - CurrentOffset uint64 `protobuf:"varint,3,opt,name=current_offset,json=currentOffset,proto3" json:"current_offset,omitempty"` + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AuctionType uint64 `protobuf:"varint,2,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` } func (m *LiquidationWhiteListing) Reset() { *m = LiquidationWhiteListing{} } @@ -68,6 +67,43 @@ func (m *LiquidationWhiteListing) XXX_DiscardUnknown() { var xxx_messageInfo_LiquidationWhiteListing proto.InternalMessageInfo +type LiquidationOffsetHolder struct { + CurrentOffset uint64 `protobuf:"varint,2,opt,name=current_offset,json=currentOffset,proto3" json:"current_offset,omitempty"` +} + +func (m *LiquidationOffsetHolder) Reset() { *m = LiquidationOffsetHolder{} } +func (m *LiquidationOffsetHolder) String() string { return proto.CompactTextString(m) } +func (*LiquidationOffsetHolder) ProtoMessage() {} +func (*LiquidationOffsetHolder) Descriptor() ([]byte, []int) { + return fileDescriptor_631048b9d11253bf, []int{1} +} +func (m *LiquidationOffsetHolder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LiquidationOffsetHolder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LiquidationOffsetHolder.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LiquidationOffsetHolder) XXX_Merge(src proto.Message) { + xxx_messageInfo_LiquidationOffsetHolder.Merge(m, src) +} +func (m *LiquidationOffsetHolder) XXX_Size() int { + return m.Size() +} +func (m *LiquidationOffsetHolder) XXX_DiscardUnknown() { + xxx_messageInfo_LiquidationOffsetHolder.DiscardUnknown(m) +} + +var xxx_messageInfo_LiquidationOffsetHolder proto.InternalMessageInfo + type LockedVault struct { LockedVaultId uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"id"` @@ -90,7 +126,7 @@ func (m *LockedVault) Reset() { *m = LockedVault{} } func (m *LockedVault) String() string { return proto.CompactTextString(m) } func (*LockedVault) ProtoMessage() {} func (*LockedVault) Descriptor() ([]byte, []int) { - return fileDescriptor_631048b9d11253bf, []int{1} + return fileDescriptor_631048b9d11253bf, []int{2} } func (m *LockedVault) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -121,6 +157,7 @@ var xxx_messageInfo_LockedVault proto.InternalMessageInfo func init() { proto.RegisterType((*LiquidationWhiteListing)(nil), "comdex.liquidationsV2.v1beta1.LiquidationWhiteListing") + proto.RegisterType((*LiquidationOffsetHolder)(nil), "comdex.liquidationsV2.v1beta1.LiquidationOffsetHolder") proto.RegisterType((*LockedVault)(nil), "comdex.liquidationsV2.v1beta1.LockedVault") } @@ -129,64 +166,65 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 912 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcb, 0x6e, 0xdb, 0x46, - 0x14, 0x15, 0xd3, 0xd8, 0xb5, 0x46, 0x7e, 0x65, 0x62, 0xc7, 0x8c, 0x10, 0x73, 0x54, 0x02, 0x35, - 0xbc, 0xb1, 0x58, 0x27, 0x9b, 0xa2, 0xdd, 0x54, 0x4a, 0xb2, 0x10, 0x6a, 0x54, 0x01, 0x61, 0xa4, - 0x40, 0x16, 0x25, 0x46, 0xe4, 0x48, 0x1e, 0x98, 0xe2, 0xb0, 0xe4, 0x30, 0xb5, 0xff, 0x22, 0xfd, - 0x8b, 0x02, 0xfd, 0x87, 0xa2, 0x4b, 0x2f, 0xb3, 0x0c, 0xba, 0x98, 0xb6, 0xf4, 0x1f, 0xf0, 0x0b, - 0x8a, 0x79, 0xe8, 0x19, 0x05, 0x85, 0x37, 0x96, 0x79, 0xef, 0x79, 0xdc, 0x43, 0x0e, 0x2f, 0xc1, - 0x49, 0xc8, 0xc6, 0x11, 0xb9, 0xf2, 0x62, 0xfa, 0x73, 0x41, 0x23, 0xcc, 0x29, 0x4b, 0xf2, 0xd7, - 0x4f, 0xbd, 0xb7, 0xa7, 0x03, 0xc2, 0xf1, 0xe9, 0xb4, 0x4c, 0xda, 0x69, 0xc6, 0x38, 0x83, 0x87, - 0x1a, 0xde, 0x5e, 0x84, 0xb7, 0x0d, 0xbc, 0xb9, 0x37, 0x62, 0x23, 0xa6, 0x90, 0x9e, 0xfc, 0x4f, - 0x93, 0x9a, 0x68, 0xc4, 0xd8, 0x28, 0x26, 0x9e, 0xba, 0x1a, 0x14, 0x43, 0x8f, 0xd3, 0x31, 0xc9, -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0x6b, 0xef, 0xa3, 0xef, 0xbf, 0x3a, 0xce, 0x83, 0x75, 0x75, - 0xe4, 0x9e, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x1c, 0xc9, 0x32, 0x25, 0x08, 0x00, 0x00, + // 923 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcf, 0x6e, 0xdb, 0x36, + 0x18, 0xb7, 0xb2, 0x26, 0x4b, 0xe8, 0xfc, 0x2b, 0x9b, 0x34, 0xaa, 0xd1, 0x88, 0x9e, 0x80, 0x05, + 0xb9, 0xc4, 0x5a, 0xda, 0xcb, 0xb0, 0x5d, 0x6a, 0xb7, 0x05, 0x66, 0x2c, 0x98, 0x0b, 0x21, 0xe8, + 0x80, 0x1e, 0x26, 0xd0, 0x12, 0xed, 0x10, 0x91, 0x45, 0x4d, 0xa2, 0xba, 0xe4, 0x2d, 0xba, 0xd3, + 0x5e, 0x61, 0xc0, 0x5e, 0x62, 0xc7, 0x1c, 0x7b, 0x2c, 0x76, 0xe0, 0x36, 0xe5, 0x0d, 0xf4, 0x04, + 0x83, 0x48, 0xda, 0x96, 0x5c, 0x17, 0x43, 0x2e, 0x51, 0xc4, 0xef, 0xf7, 0xe7, 0xfb, 0x49, 0x9f, + 0x3f, 0x1b, 0x9c, 0xf8, 0x6c, 0x12, 0x90, 0x2b, 0x27, 0xa4, 0x3f, 0x67, 0x34, 0xc0, 0x9c, 0xb2, + 0x28, 0x7d, 0xfd, 0xc4, 0x79, 0x7b, 0x3a, 0x24, 0x1c, 0x9f, 0xce, 0x8e, 0x49, 0x27, 0x4e, 0x18, + 0x67, 0xf0, 0x50, 0xc1, 0x3b, 0x75, 0x78, 0x47, 0xc3, 0x5b, 0x7b, 0x63, 0x36, 0x66, 0x12, 0xe9, + 0x94, 0xff, 0x29, 0x52, 0x0b, 0x8d, 0x19, 0x1b, 0x87, 0xc4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 0xb5, 0xc1, 0x2d, 0xbf, 0xd9, 0x4f, 0xd8, 0x68, 0x44, 0x7d, 0x8a, 0x43, + 0x7d, 0xef, 0x7c, 0xf4, 0xd3, 0x40, 0x8e, 0xf3, 0x70, 0x4d, 0x8e, 0xdc, 0xd3, 0xff, 0x02, 0x00, + 0x00, 0xff, 0xff, 0xac, 0x97, 0x85, 0x1f, 0x40, 0x08, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -209,11 +247,6 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - if m.CurrentOffset != 0 { - i = encodeVarintLiquidate(dAtA, i, uint64(m.CurrentOffset)) - i-- - dAtA[i] = 0x18 - } if m.AuctionType != 0 { i = encodeVarintLiquidate(dAtA, i, uint64(m.AuctionType)) i-- @@ -227,6 +260,34 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *LiquidationOffsetHolder) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LiquidationOffsetHolder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LiquidationOffsetHolder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CurrentOffset != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.CurrentOffset)) + i-- + dAtA[i] = 0x10 + } + return len(dAtA) - i, nil +} + func (m *LockedVault) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -389,6 +450,15 @@ func (m *LiquidationWhiteListing) Size() (n int) { if m.AuctionType != 0 { n += 1 + sovLiquidate(uint64(m.AuctionType)) } + return n +} + +func (m *LiquidationOffsetHolder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l if m.CurrentOffset != 0 { n += 1 + sovLiquidate(uint64(m.CurrentOffset)) } @@ -520,7 +590,57 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { break } } - case 3: + default: + iNdEx = preIndex + skippy, err := skipLiquidate(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLiquidate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LiquidationOffsetHolder) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LiquidationOffsetHolder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LiquidationOffsetHolder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CurrentOffset", wireType) } From c49a19fc4da0ace7d3aca1c7c577d7425085680e Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Fri, 7 Apr 2023 23:17:30 +0530 Subject: [PATCH 011/155] liquidation-liquidateVaults --- .../liquidationsV2/v1beta1/liquidate.proto | 3 +++ x/liquidationsV2/types/offset.go | 17 ++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index abf4275f7..89df8b2b4 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -105,6 +105,9 @@ message LockedVault { string external_keeper_address = 15 [ (gogoproto.customname) = "ExternalKeeperAddress", (gogoproto.moretags) = "yaml:\"external_keeper_address\""]; + string fee_to_be_collected = 16 [ + (gogoproto.customname) = "FeeToBeCollected", + (gogoproto.moretags) = "yaml:\"fee_to_be_collected\""]; diff --git a/x/liquidationsV2/types/offset.go b/x/liquidationsV2/types/offset.go index 3ba32be4e..49fe2c6b4 100644 --- a/x/liquidationsV2/types/offset.go +++ b/x/liquidationsV2/types/offset.go @@ -1,7 +1,7 @@ package types import ( - "fmt" + "github.com/cosmos/cosmos-sdk/codec" ) @@ -10,9 +10,8 @@ const ( ) // NewLiquidationOffsetHolder returns a new LiquidationOffsetHolder object. -func NewLiquidationOffsetHolder(appID, currentOffset uint64) LiquidationOffsetHolder { +func NewLiquidationOffsetHolder( currentOffset uint64) LiquidationOffsetHolder { return LiquidationOffsetHolder{ - AppId: appID, CurrentOffset: currentOffset, } } @@ -30,12 +29,12 @@ func GetSliceStartEndForLiquidations(sliceLen, offset, batchSize int) (int, int) } // Validate validates ActiveFarmer. -func (liquidationOffsetHolder LiquidationOffsetHolder) Validate() error { - if liquidationOffsetHolder.AppId == 0 { - return fmt.Errorf("app id must not be 0") - } - return nil -} +// func (liquidationOffsetHolder LiquidationOffsetHolder) Validate() error { +// if liquidationOffsetHolder.AppId == 0 { +// return fmt.Errorf("app id must not be 0") +// } +// return nil +// } // MustMarshalLiquidationOffsetHolder returns the LiquidationOffsetHolder bytes. // It throws panic if it fails. From 4e38cfa71b690a75e1cf9a9bbf3a11c2a639d02e Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 7 Apr 2023 23:17:53 +0530 Subject: [PATCH 012/155] updating proto --- x/liquidationsV2/keeper/liquidate.go | 211 +++++++++++++++++++++++++ x/liquidationsV2/types/liquidate.pb.go | 167 ++++++++++++------- 2 files changed, 319 insertions(+), 59 deletions(-) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index a776aca71..7777a3a85 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -3,6 +3,9 @@ package keeper import ( "fmt" utils "github.com/comdex-official/comdex/types" + assettypes "github.com/comdex-official/comdex/x/asset/types" + auctiontypes "github.com/comdex-official/comdex/x/auction/types" + lendtypes "github.com/comdex-official/comdex/x/lend/types" "github.com/comdex-official/comdex/x/liquidationsV2/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -112,6 +115,214 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { } +func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { + borrows, found := k.lend.GetBorrows(ctx) + params := k.GetParams(ctx) + if !found { + ctx.Logger().Error("Params Not Found in Liquidation, liquidate_borrow.go") + return nil + } + liquidationOffsetHolder, found := k.GetLiquidationOffsetHolder(ctx, lendtypes.AppID, types.VaultLiquidationsOffsetPrefix) + if !found { + liquidationOffsetHolder = types.NewLiquidationOffsetHolder(lendtypes.AppID, 0) + } + borrowIDs := borrows + start, end := types.GetSliceStartEndForLiquidations(len(borrowIDs), int(liquidationOffsetHolder.CurrentOffset), int(params.LiquidationBatchSize)) + + if start == end { + liquidationOffsetHolder.CurrentOffset = 0 + start, end = types.GetSliceStartEndForLiquidations(len(borrowIDs), int(liquidationOffsetHolder.CurrentOffset), int(params.LiquidationBatchSize)) + } + newBorrowIDs := borrowIDs[start:end] + for l := range newBorrowIDs { + _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { + borrowPos, found := k.lend.GetBorrow(ctx, newBorrowIDs[l]) + if !found { + return nil + } + if borrowPos.IsLiquidated { + return nil + } + + lendPair, _ := k.lend.GetLendPair(ctx, borrowPos.PairID) + lendPos, found := k.lend.GetLend(ctx, borrowPos.LendingID) + if !found { + return fmt.Errorf("lend Pos Not Found in Liquidation, liquidate_borrow.go for ID %d", borrowPos.LendingID) + } + pool, _ := k.lend.GetPool(ctx, lendPos.PoolID) + assetIn, _ := k.asset.GetAsset(ctx, lendPair.AssetIn) + assetOut, _ := k.asset.GetAsset(ctx, lendPair.AssetOut) + liqThreshold, _ := k.lend.GetAssetRatesParams(ctx, lendPair.AssetIn) + killSwitchParams, _ := k.esm.GetKillSwitchData(ctx, lendPos.AppID) + if killSwitchParams.BreakerEnable { + return fmt.Errorf("kill Switch is enabled in Liquidation, liquidate_borrow.go for ID %d", lendPos.AppID) + } + // calculating and updating the interest accumulated before checking for liquidations + borrowPos, err := k.lend.CalculateBorrowInterestForLiquidation(ctx, borrowPos.ID) + if err != nil { + return fmt.Errorf("error in calculating Borrow Interest before liquidation") + } + if !borrowPos.StableBorrowRate.Equal(sdk.ZeroDec()) { + borrowPos, err = k.lend.ReBalanceStableRates(ctx, borrowPos) + if err != nil { + return fmt.Errorf("error in re-balance stable rate check before liquidation") + } + } + + var currentCollateralizationRatio sdk.Dec + var firstTransitAssetID, secondTransitAssetID uint64 + // for getting transit assets details + for _, data := range pool.AssetData { + if data.AssetTransitType == 2 { + firstTransitAssetID = data.AssetID + } + if data.AssetTransitType == 3 { + secondTransitAssetID = data.AssetID + } + } + + liqThresholdBridgedAssetOne, _ := k.lend.GetAssetRatesParams(ctx, firstTransitAssetID) + liqThresholdBridgedAssetTwo, _ := k.lend.GetAssetRatesParams(ctx, secondTransitAssetID) + firstBridgedAsset, _ := k.asset.GetAsset(ctx, firstTransitAssetID) + secondBridgedAsset, _ := k.asset.GetAsset(ctx, secondTransitAssetID) + + // there are three possible cases + // a. if borrow is from same pool + // b. if borrow is from first transit asset + // c. if borrow is from second transit asset + if borrowPos.BridgedAssetAmount.Amount.Equal(sdk.ZeroInt()) { // first condition + currentCollateralizationRatio, err = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) + if err != nil { + return err + } + if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold) { + err = k.UpdateLockedBorrows(ctx, lockedVault) + if err != nil { + return fmt.Errorf("error in first condition UpdateLockedBorrows in UpdateLockedBorrows , liquidate_borrow.go for ID %d", lockedVault.LockedVaultId) + } + k.lend.UpdateBorrowStats(ctx, lendPair, borrowPos.IsStableBorrow, borrowPos.AmountOut.Amount, false) + } + } else { + if borrowPos.BridgedAssetAmount.Denom == firstBridgedAsset.Denom { + currentCollateralizationRatio, err = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) + if err != nil { + return err + } + if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetOne.LiquidationThreshold)) { + err = k.UpdateLockedBorrows(ctx, lockedVault) + if err != nil { + return fmt.Errorf("error in second condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID %d", lockedVault.LockedVaultId) + } + k.lend.UpdateBorrowStats(ctx, lendPair, borrowPos.IsStableBorrow, borrowPos.AmountOut.Amount, false) + } + } else { + currentCollateralizationRatio, err = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) + if err != nil { + return err + } + + if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetTwo.LiquidationThreshold)) { + err = k.UpdateLockedBorrows(ctx, lockedVault, lendPair) + if err != nil { + return fmt.Errorf("error in third condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID %d", lockedVault.LockedVaultId) + } + k.lend.UpdateBorrowStats(ctx, lendPair, borrowPos.IsStableBorrow, borrowPos.AmountOut.Amount, false) + } + } + } + return nil + }) + } + liquidationOffsetHolder.CurrentOffset = uint64(end) + k.SetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix, liquidationOffsetHolder) + + return nil +} + +func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, updatedLockedVault types.LockedVault, lendPos lendtypes.LendAsset, pool lendtypes.Pool, borrow lendtypes.BorrowAsset, assetRatesStats lendtypes.AssetRatesParams, assetIn, assetOut, firstBridgeAsset assettypes.Asset) error { + firstBridgeAssetStats, _ := k.lend.GetAssetRatesParams(ctx, firstBridgeAsset.Id) + secondBridgeAssetStats, _ := k.lend.GetAssetRatesParams(ctx, firstBridgeAsset.Id) + + assetInTotal, _ := k.market.CalcAssetPrice(ctx, assetIn.Id, updatedLockedVault.AmountIn) + assetOutTotal, _ := k.market.CalcAssetPrice(ctx, assetOut.Id, updatedLockedVault.AmountOut) + + deductionPercentage, _ := sdk.NewDecFromStr("1.0") + + var c sdk.Dec + if !borrow.BridgedAssetAmount.Amount.Equal(sdk.ZeroInt()) { + if borrow.BridgedAssetAmount.Denom == firstBridgeAsset.Denom { + c = assetRatesStats.Ltv.Mul(firstBridgeAssetStats.Ltv) + } else { + c = assetRatesStats.Ltv.Mul(secondBridgeAssetStats.Ltv) + } + } else { + c = assetRatesStats.Ltv + } + // calculations for finding selloff amount and liquidationDeductionAmount + b := deductionPercentage.Add(assetRatesStats.LiquidationPenalty.Add(assetRatesStats.LiquidationBonus)) + totalIn := assetInTotal + totalOut := assetOutTotal + factor1 := c.Mul(totalIn) + factor2 := b.Mul(c) + numerator := totalOut.Sub(factor1) + denominator := deductionPercentage.Sub(factor2) + selloffAmount := numerator.Quo(denominator) // Dollar Value + aip, _ := k.market.CalcAssetPrice(ctx, assetIn.Id, sdk.OneInt()) + liquidationDeductionAmt := selloffAmount.Mul(assetRatesStats.LiquidationPenalty.Add(assetRatesStats.LiquidationBonus)) + liquidationDeductionAmount := liquidationDeductionAmt.Quo(aip) // To be subtracted from AmountIn along with sellOff amt + + bonusToBidderAmount := (selloffAmount.Mul(assetRatesStats.LiquidationBonus)).Quo(aip) + penaltyToReserveAmount := (selloffAmount.Mul(assetRatesStats.LiquidationPenalty)).Quo(aip) + sellOffAmt := selloffAmount.Quo(aip) + err := k.bank.SendCoinsFromModuleToModule(ctx, pool.ModuleName, auctiontypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetIn.Denom, bonusToBidderAmount.Add(sellOffAmt).TruncateInt()))) + if err != nil { + return err + } + err = k.lend.UpdateReserveBalances(ctx, assetIn.Id, pool.ModuleName, sdk.NewCoin(assetIn.Denom, penaltyToReserveAmount.TruncateInt()), true) + if err != nil { + return err + } + + cAsset, _ := k.asset.GetAsset(ctx, assetRatesStats.CAssetID) + // totalDeduction is the sum of liquidationDeductionAmount and selloffAmount + totalDeduction := liquidationDeductionAmount.Add(sellOffAmt).TruncateInt() // Total deduction from amountIn also reduce to lend Position amountIn + borrow.IsLiquidated = true + if totalDeduction.GTE(updatedLockedVault.AmountIn) { // rare case only + lendPos.AmountIn.Amount = lendPos.AmountIn.Amount.Sub(updatedLockedVault.AmountIn) + // also global lend data is subtracted by totalDeduction amount + assetStats, _ := k.lend.GetAssetStatsByPoolIDAndAssetID(ctx, lendPos.PoolID, lendPos.AssetID) + assetStats.TotalLend = assetStats.TotalLend.Sub(updatedLockedVault.AmountIn) + // setting the updated global lend data + k.lend.SetAssetStatsByPoolIDAndAssetID(ctx, assetStats) + updatedLockedVault.AmountIn = sdk.ZeroInt() + borrow.AmountIn.Amount = sdk.ZeroInt() + } else { + updatedLockedVault.AmountIn = updatedLockedVault.AmountIn.Sub(totalDeduction) + lendPos.AmountIn.Amount = lendPos.AmountIn.Amount.Sub(totalDeduction) + // also global lend data is subtracted by totalDeduction amount + assetStats, _ := k.lend.GetAssetStatsByPoolIDAndAssetID(ctx, lendPos.PoolID, lendPos.AssetID) + assetStats.TotalLend = assetStats.TotalLend.Sub(totalDeduction) + // setting the updated global lend data + k.lend.SetAssetStatsByPoolIDAndAssetID(ctx, assetStats) + borrow.AmountIn.Amount = borrow.AmountIn.Amount.Sub(totalDeduction) + } + + // users cToken present in pool's module will be burnt + // update borrow position + // update lend position + err = k.bank.BurnCoins(ctx, pool.ModuleName, sdk.NewCoins(sdk.NewCoin(cAsset.Denom, totalDeduction))) + if err != nil { + return err + } + k.lend.SetLend(ctx, lendPos) + k.lend.SetBorrow(ctx, borrow) + updatedLockedVault.CollateralToBeAuctioned = selloffAmount + k.SetLockedVault(ctx, updatedLockedVault) + k.SetLockedVaultID(ctx, updatedLockedVault.LockedVaultId) + + return nil +} + func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn sdk.Int, AmountOut sdk.Int, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string) error { lockedVaultID := k.GetLockedVaultID(ctx) diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index 69daad311..ac8b54ca1 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -120,6 +120,7 @@ type LockedVault struct { InternalKeeperAddress string `protobuf:"bytes,13,opt,name=internal_keeper_address,json=internalKeeperAddress,proto3" json:"internal_keeper_address,omitempty" yaml:"internal_keeper_address"` IsExternalKeeper string `protobuf:"bytes,14,opt,name=is_external_keeper,json=isExternalKeeper,proto3" json:"is_external_keeper,omitempty" yaml:"is_external_keeper"` ExternalKeeperAddress string `protobuf:"bytes,15,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` + FeeToBeCollected string `protobuf:"bytes,16,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3" json:"fee_to_be_collected,omitempty" yaml:"fee_to_be_collected"` } func (m *LockedVault) Reset() { *m = LockedVault{} } @@ -166,65 +167,68 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 923 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcf, 0x6e, 0xdb, 0x36, - 0x18, 0xb7, 0xb2, 0x26, 0x4b, 0xe8, 0xfc, 0x2b, 0x9b, 0x34, 0xaa, 0xd1, 0x88, 0x9e, 0x80, 0x05, - 0xb9, 0xc4, 0x5a, 0xda, 0xcb, 0xb0, 0x5d, 0x6a, 0xb7, 0x05, 0x66, 0x2c, 0x98, 0x0b, 0x21, 0xe8, - 0x80, 0x1e, 0x26, 0xd0, 0x12, 0xed, 0x10, 0x91, 0x45, 0x4d, 0xa2, 0xba, 0xe4, 0x2d, 0xba, 0xd3, - 0x5e, 0x61, 0xc0, 0x5e, 0x62, 0xc7, 0x1c, 0x7b, 0x2c, 0x76, 0xe0, 0x36, 0xe5, 0x0d, 0xf4, 0x04, - 0x83, 0x48, 0xda, 0x96, 0x5c, 0x17, 0x43, 0x2e, 0x51, 0xc4, 0xef, 0xf7, 0xe7, 0xfb, 0x49, 0x9f, - 0x3f, 0x1b, 0x9c, 0xf8, 0x6c, 0x12, 0x90, 0x2b, 0x27, 0xa4, 0x3f, 0x67, 0x34, 0xc0, 0x9c, 0xb2, - 0x28, 0x7d, 0xfd, 0xc4, 0x79, 0x7b, 0x3a, 0x24, 0x1c, 0x9f, 0xce, 0x8e, 0x49, 0x27, 0x4e, 0x18, - 0x67, 0xf0, 0x50, 0xc1, 0x3b, 0x75, 0x78, 0x47, 0xc3, 0x5b, 0x7b, 0x63, 0x36, 0x66, 0x12, 0xe9, - 0x94, 0xff, 0x29, 0x52, 0x0b, 0x8d, 0x19, 0x1b, 0x87, 0xc4, 0x91, 0x77, 0xc3, 0x6c, 0xe4, 0x70, - 0x3a, 0x21, 0x29, 0xc7, 0x93, 0x58, 0x03, 0x2c, 0x9f, 0xa5, 0x13, 0x96, 0x3a, 0x43, 0x9c, 0x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, 0x4d, 0x8e, 0xdc, 0xd3, 0xff, 0x02, 0x00, - 0x00, 0xff, 0xff, 0xac, 0x97, 0x85, 0x1f, 0x40, 0x08, 0x00, 0x00, + // 963 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcb, 0x6e, 0xdb, 0x46, + 0x14, 0x15, 0xdd, 0xd8, 0xb5, 0x47, 0x7e, 0x85, 0xb6, 0x63, 0x46, 0x88, 0x39, 0x2a, 0x81, 0x1a, + 0xde, 0x58, 0xac, 0x9d, 0x4d, 0xd1, 0x6e, 0x22, 0x39, 0x29, 0x2a, 0xd4, 0xa8, 0x02, 0xc2, 0x48, + 0x81, 0x2c, 0x4a, 0x8c, 0xc8, 0x91, 0x3c, 0x30, 0xc5, 0x61, 0xc9, 0x61, 0x6a, 0xff, 0x45, 0xba, + 0xea, 0x2f, 0x14, 0xe8, 0x27, 0x74, 0xd3, 0xa5, 0x97, 0x59, 0x16, 0x5d, 0x4c, 0x5b, 0xfa, 0x0f, + 0xf8, 0x05, 0xc5, 0x3c, 0xf4, 0xa0, 0xa2, 0x20, 0xf0, 0xc6, 0x32, 0xe7, 0x9e, 0xc7, 0x3d, 0xe4, + 0xe5, 0x05, 0xc1, 0x71, 0x40, 0x47, 0x21, 0xbe, 0x76, 0x23, 0xf2, 0x53, 0x4e, 0x42, 0xc4, 0x08, + 0x8d, 0xb3, 0x57, 0xa7, 0xee, 0x9b, 0x93, 0x3e, 0x66, 0xe8, 0x64, 0x72, 0x8c, 0x5b, 0x49, 0x4a, + 0x19, 0x35, 0x0f, 0x14, 0xbc, 0x55, 0x85, 0xb7, 0x34, 0xbc, 0xb1, 0x3b, 0xa4, 0x43, 0x2a, 0x91, + 0xae, 0xf8, 0x4f, 0x91, 0x1a, 0x70, 0x48, 0xe9, 0x30, 0xc2, 0xae, 0xbc, 0xea, 0xe7, 0x03, 0x97, + 0x91, 0x11, 0x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, 0x9d, 0xd7, 0xb7, 0xff, 0xd9, 0xb5, + 0xdf, 0x0a, 0xbb, 0x76, 0x5b, 0xd8, 0xc6, 0xbb, 0xc2, 0x36, 0xfe, 0x2d, 0x6c, 0xe3, 0xed, 0x9d, + 0x5d, 0x7b, 0x77, 0x67, 0xd7, 0xfe, 0xba, 0xb3, 0x6b, 0xaf, 0xbf, 0xac, 0xbc, 0x1b, 0xe2, 0xe3, + 0xe1, 0x98, 0x0e, 0x06, 0x24, 0x20, 0x28, 0xd2, 0xd7, 0xee, 0x7b, 0x5f, 0x1f, 0xf2, 0x8d, 0xe9, + 0xaf, 0xc8, 0xa9, 0x7e, 0xfa, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x76, 0xa2, 0x13, 0xfd, 0xa3, + 0x08, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -308,6 +312,15 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.FeeToBeCollected) > 0 { + i -= len(m.FeeToBeCollected) + copy(dAtA[i:], m.FeeToBeCollected) + i = encodeVarintLiquidate(dAtA, i, uint64(len(m.FeeToBeCollected))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } if len(m.ExternalKeeperAddress) > 0 { i -= len(m.ExternalKeeperAddress) copy(dAtA[i:], m.ExternalKeeperAddress) @@ -514,6 +527,10 @@ func (m *LockedVault) Size() (n int) { if l > 0 { n += 1 + l + sovLiquidate(uint64(l)) } + l = len(m.FeeToBeCollected) + if l > 0 { + n += 2 + l + sovLiquidate(uint64(l)) + } return n } @@ -1136,6 +1153,38 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } m.ExternalKeeperAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeToBeCollected", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeToBeCollected = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipLiquidate(dAtA[iNdEx:]) From 4cee87ac3ab8d20ca5cf53d0f97da4d476596e3a Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Fri, 7 Apr 2023 23:22:38 +0530 Subject: [PATCH 013/155] liquidation-liquidateVaults --- x/liquidationsV2/keeper/liquidate.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index a776aca71..31248df09 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/liquidationsV2/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" @@ -92,6 +93,8 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { if err != nil { return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for Vault %d", vault.Id) } + length := k.vault.GetLengthOfVault(ctx) + k.vault.SetLengthOfVault(ctx, length-1) //Removing data from existing structs k.vault.DeleteVault(ctx, vault.Id) @@ -131,11 +134,11 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair InternalKeeperAddress: "", IsExternalKeeper: "", ExternalKeeperAddress: "", + } k.SetLockedVault(ctx, value) k.SetLockedVaultID(ctx, value.LockedVaultId) - length := k.vault.GetLengthOfVault(ctx) - k.vault.SetLengthOfVault(ctx, length-1) + return nil } From a8b4eb59c9695a08e3b4057c4270c994bb390f56 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Fri, 7 Apr 2023 23:24:46 +0530 Subject: [PATCH 014/155] liquidation-liquidateVaults --- proto/comdex/liquidationsV2/v1beta1/liquidate.proto | 2 ++ x/liquidationsV2/keeper/liquidate.go | 1 + 2 files changed, 3 insertions(+) diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index 89df8b2b4..88339f7f9 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -107,6 +107,8 @@ message LockedVault { (gogoproto.moretags) = "yaml:\"external_keeper_address\""]; string fee_to_be_collected = 16 [ (gogoproto.customname) = "FeeToBeCollected", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.moretags) = "yaml:\"fee_to_be_collected\""]; diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 6ec0f0c0f..3db41683c 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -341,6 +341,7 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair CollateralToBeAuctioned: AmountIn, TargetDebt: AmountOut, LiquidationTimestamp: ctx.BlockTime(), + FeeToBeCollected: , IsInternalKeeper: false, InternalKeeperAddress: "", IsExternalKeeper: "", From 2044c4ec47ec6d2e0123c014041c2dc45e505483 Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 7 Apr 2023 23:25:33 +0530 Subject: [PATCH 015/155] updating proto --- x/liquidationsV2/types/liquidate.pb.go | 155 +++++++++++++------------ 1 file changed, 79 insertions(+), 76 deletions(-) diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index ac8b54ca1..be375846f 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -120,7 +120,7 @@ type LockedVault struct { InternalKeeperAddress string `protobuf:"bytes,13,opt,name=internal_keeper_address,json=internalKeeperAddress,proto3" json:"internal_keeper_address,omitempty" yaml:"internal_keeper_address"` IsExternalKeeper string `protobuf:"bytes,14,opt,name=is_external_keeper,json=isExternalKeeper,proto3" json:"is_external_keeper,omitempty" yaml:"is_external_keeper"` ExternalKeeperAddress string `protobuf:"bytes,15,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` - FeeToBeCollected string `protobuf:"bytes,16,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3" json:"fee_to_be_collected,omitempty" yaml:"fee_to_be_collected"` + FeeToBeCollected github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,16,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee_to_be_collected" yaml:"fee_to_be_collected"` } func (m *LockedVault) Reset() { *m = LockedVault{} } @@ -167,68 +167,68 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 963 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcb, 0x6e, 0xdb, 0x46, - 0x14, 0x15, 0xdd, 0xd8, 0xb5, 0x47, 0x7e, 0x85, 0xb6, 0x63, 0x46, 0x88, 0x39, 0x2a, 0x81, 0x1a, - 0xde, 0x58, 0xac, 0x9d, 0x4d, 0xd1, 0x6e, 0x22, 0x39, 0x29, 0x2a, 0xd4, 0xa8, 0x02, 0xc2, 0x48, - 0x81, 0x2c, 0x4a, 0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, - 0x08, 0x00, 0x00, + // 967 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xbf, 0x6e, 0xdb, 0x46, + 0x18, 0x17, 0xdd, 0xd8, 0xb5, 0x4e, 0x96, 0xad, 0xd0, 0x76, 0xcc, 0x08, 0x31, 0x4f, 0x25, 0x50, + 0xc3, 0x8b, 0xc5, 0x3a, 0x59, 0x8a, 0x76, 0x89, 0xe4, 0xa4, 0xa8, 0x50, 0xa3, 0x0a, 0x08, 0x23, + 0x05, 0x32, 0x94, 0x3d, 0x91, 0x27, 0xf9, 0x60, 0x8a, 0xc7, 0x92, 0xc7, 0xd4, 0x7e, 0x8a, 0xa6, + 0x53, 0x5f, 0xa1, 0x40, 0x5f, 0xa2, 0xa3, 0xc7, 0x8c, 0x45, 0x87, 0x6b, 0x4b, 0x6f, 0x1d, 0xf9, + 0x04, 0x05, 0xef, 0x4e, 0x7f, 0xa8, 0x28, 0x08, 0xb4, 0x58, 0xe6, 0x7d, 0xbf, 0x3f, 0xdf, 0x8f, + 0xfc, 0xf8, 0x81, 0xe0, 0xc4, 0xa3, 0x63, 0x1f, 0x5f, 0xdb, 0x01, 0xf9, 0x31, 0x25, 0x3e, 0x62, + 0x84, 0x86, 0xc9, 0xcb, 0xc7, 0xf6, 0xeb, 0xd3, 0x01, 0x66, 0xe8, 0x74, 0x7a, 0x8c, 0xdb, 0x51, + 0x4c, 0x19, 0xd5, 0x0f, 0x25, 0xbc, 0x5d, 0x86, 0xb7, 0x15, 0xbc, 0xb9, 0x37, 0xa2, 0x23, 0x2a, + 0x90, 0x76, 0xf1, 0x9f, 0x24, 0x35, 0xe1, 0x88, 0xd2, 0x51, 0x80, 0x6d, 0x71, 0x35, 0x48, 0x87, + 0x36, 0x23, 0x63, 0x9c, 0x30, 0x34, 0x8e, 0x14, 0xc0, 0xf4, 0x68, 0x32, 0xa6, 0x89, 0x3d, 0x40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 0xcb, 0xcc, 0xca, 0x6d, 0x66, 0x6a, 0x6f, 0x33, 0x53, 0xfb, + 0x27, 0x33, 0xb5, 0x37, 0x77, 0x66, 0xe5, 0xed, 0x9d, 0x59, 0xf9, 0xf3, 0xce, 0xac, 0xbc, 0xfa, + 0xbc, 0xd4, 0x4d, 0xf1, 0xad, 0x71, 0x42, 0x87, 0x43, 0xe2, 0x11, 0x14, 0xa8, 0x6b, 0xfb, 0x9d, + 0x8f, 0x15, 0xd1, 0xe3, 0x60, 0x43, 0xbc, 0x04, 0x4f, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x7d, + 0x57, 0xa4, 0xca, 0xd2, 0x08, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -312,15 +312,18 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.FeeToBeCollected) > 0 { - i -= len(m.FeeToBeCollected) - copy(dAtA[i:], m.FeeToBeCollected) - i = encodeVarintLiquidate(dAtA, i, uint64(len(m.FeeToBeCollected))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 + { + size := m.FeeToBeCollected.Size() + i -= size + if _, err := m.FeeToBeCollected.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLiquidate(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 if len(m.ExternalKeeperAddress) > 0 { i -= len(m.ExternalKeeperAddress) copy(dAtA[i:], m.ExternalKeeperAddress) @@ -527,10 +530,8 @@ func (m *LockedVault) Size() (n int) { if l > 0 { n += 1 + l + sovLiquidate(uint64(l)) } - l = len(m.FeeToBeCollected) - if l > 0 { - n += 2 + l + sovLiquidate(uint64(l)) - } + l = m.FeeToBeCollected.Size() + n += 2 + l + sovLiquidate(uint64(l)) return n } @@ -1183,7 +1184,9 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FeeToBeCollected = string(dAtA[iNdEx:postIndex]) + if err := m.FeeToBeCollected.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex From 82f78900485e084ebef82afca93f4c4162c0b12a Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Fri, 7 Apr 2023 23:55:03 +0530 Subject: [PATCH 016/155] liquidation-liquidateVaults --- x/liquidationsV2/keeper/liquidate.go | 179 ++++++++++++++------------- 1 file changed, 96 insertions(+), 83 deletions(-) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 3db41683c..d39c855c1 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -4,9 +4,6 @@ import ( "fmt" utils "github.com/comdex-official/comdex/types" - assettypes "github.com/comdex-official/comdex/x/asset/types" - auctiontypes "github.com/comdex-official/comdex/x/auction/types" - lendtypes "github.com/comdex-official/comdex/x/lend/types" "github.com/comdex-official/comdex/x/liquidationsV2/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -53,60 +50,12 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { for _, vault := range newVaults { _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { - //Checking ESM status and / or kill switch status - esmStatus, found := k.esm.GetESMStatus(ctx, vault.AppId) - klwsParams, _ := k.esm.GetKillSwitchData(ctx, vault.AppId) - if (found && esmStatus.Status) || klwsParams.BreakerEnable { - ctx.Logger().Error("Kill Switch Or ESM is enabled For Liquidation, liquidate_vaults.go for AppID %d", vault.AppId) - continue - } - - //Checking if app has enabled liquidations or not - _, found = k.GetAppIDByAppForLiquidation(ctx, vault.AppId) - - if !found { - return fmt.Errorf("Liquidation not enabled for App ID %d", vault.AppId) - } - - // Checking extended pair vault data for Minimum collateralisation ratio - extPair, _ := k.asset.GetPairsVault(ctx, vault.ExtendedPairVaultID) - liqRatio := extPair.MinCr - totalOut := vault.AmountOut.Add(vault.InterestAccumulated).Add(vault.ClosingFeeAccumulated) - collateralizationRatio, err := k.vault.CalculateCollateralizationRatio(ctx, vault.ExtendedPairVaultID, vault.AmountIn, totalOut) + err := k.LiquidateIndividualVault(ctx, vault.Id) if err != nil { - return fmt.Errorf("error Calculating CR in Liquidation, liquidate_vaults.go for vault ID %d", vault.Id) - } - if collateralizationRatio.LT(liqRatio) { - totalDebt := vault.AmountOut.Add(vault.InterestAccumulated) - err1 := k.rewards.CalculateVaultInterest(ctx, vault.AppId, vault.ExtendedPairVaultID, vault.Id, totalDebt, vault.BlockHeight, vault.BlockTime.Unix()) - if err1 != nil { - return fmt.Errorf("error Calculating vault interest in Liquidation, liquidate_vaults.go for vaultID %d", vault.Id) - } - //Callling vault to use the updated values of the vault - vault, _ := k.vault.GetVault(ctx, vault.Id) - - totalOut := vault.AmountOut.Add(vault.InterestAccumulated).Add(vault.ClosingFeeAccumulated) - collateralizationRatio, err := k.vault.CalculateCollateralizationRatio(ctx, vault.ExtendedPairVaultID, vault.AmountIn, totalOut) - if err != nil { - return fmt.Errorf("error Calculating CR in Liquidation, liquidate_vaults.go for vaultID %d", vault.Id) - } - //Creating locked vault struct , which will trigger auction - err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, vault.AmountIn, totalOut, collateralizationRatio, vault.AppId, false, false, "", "") - if err != nil { - return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for Vault %d", vault.Id) - } - length := k.vault.GetLengthOfVault(ctx) - k.vault.SetLengthOfVault(ctx, length-1) - - //Removing data from existing structs - k.vault.DeleteVault(ctx, vault.Id) - var rewards rewardstypes.VaultInterestTracker - rewards.AppMappingId = vault.AppId - rewards.VaultId = vault.Id - k.rewards.DeleteVaultInterestTracker(ctx, rewards) - k.vault.DeleteAddressFromAppExtendedPairVaultMapping(ctx, vault.ExtendedPairVaultID, vault.Id, vault.AppId) + return fmt.Errorf(err.Error()) } + return nil }) } @@ -118,6 +67,99 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { } +func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error { + + vault, found := k.vault.GetVault(ctx, vaultID) + if !found { + return fmt.Errorf("Vault ID not found %d", vault.Id) + } + + //Checking ESM status and / or kill switch status + esmStatus, found := k.esm.GetESMStatus(ctx, vault.AppId) + klwsParams, _ := k.esm.GetKillSwitchData(ctx, vault.AppId) + if (found && esmStatus.Status) || klwsParams.BreakerEnable { + return fmt.Errorf("Kill Switch Or ESM is enabled For Liquidation,") + } + + //Checking if app has enabled liquidations or not + _, found = k.GetAppIDByAppForLiquidation(ctx, vault.AppId) + if !found { + return fmt.Errorf("Liquidation not enabled for App ID %d", vault.AppId) + } + + // Checking extended pair vault data for Minimum collateralisation ratio + extPair, _ := k.asset.GetPairsVault(ctx, vault.ExtendedPairVaultID) + liqRatio := extPair.MinCr + totalOut := vault.AmountOut.Add(vault.InterestAccumulated).Add(vault.ClosingFeeAccumulated) + collateralizationRatio, err := k.vault.CalculateCollateralizationRatio(ctx, vault.ExtendedPairVaultID, vault.AmountIn, totalOut) + if err != nil { + return fmt.Errorf("error Calculating CR in Liquidation, liquidate_vaults.go for vault ID %d", vault.Id) + } + if collateralizationRatio.LT(liqRatio) { + totalDebt := vault.AmountOut.Add(vault.InterestAccumulated) + err1 := k.rewards.CalculateVaultInterest(ctx, vault.AppId, vault.ExtendedPairVaultID, vault.Id, totalDebt, vault.BlockHeight, vault.BlockTime.Unix()) + if err1 != nil { + return fmt.Errorf("error Calculating vault interest in Liquidation, liquidate_vaults.go for vaultID %d", vault.Id) + } + //Callling vault to use the updated values of the vault + vault, _ := k.vault.GetVault(ctx, vault.Id) + + totalOut := vault.AmountOut.Add(vault.InterestAccumulated).Add(vault.ClosingFeeAccumulated) + collateralizationRatio, err := k.vault.CalculateCollateralizationRatio(ctx, vault.ExtendedPairVaultID, vault.AmountIn, totalOut) + if err != nil { + return fmt.Errorf("error Calculating CR in Liquidation, liquidate_vaults.go for vaultID %d", vault.Id) + } + //Calculating Liquidation Fees + feesToBeCollected := sdk.NewDecFromInt(totalOut).Mul(extPair.LiquidationPenalty).TruncateInt() + + //Creating locked vault struct , which will trigger auction + err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, vault.AmountIn, totalOut, collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected) + if err != nil { + return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for Vault %d", vault.Id) + } + length := k.vault.GetLengthOfVault(ctx) + k.vault.SetLengthOfVault(ctx, length-1) + + //Removing data from existing structs + k.vault.DeleteVault(ctx, vault.Id) + var rewards rewardstypes.VaultInterestTracker + rewards.AppMappingId = vault.AppId + rewards.VaultId = vault.Id + k.rewards.DeleteVaultInterestTracker(ctx, rewards) + k.vault.DeleteAddressFromAppExtendedPairVaultMapping(ctx, vault.ExtendedPairVaultID, vault.Id, vault.AppId) + } + + return nil +} + +func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn sdk.Int, AmountOut sdk.Int, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int) error { + lockedVaultID := k.GetLockedVaultID(ctx) + + value := types.LockedVault{ + LockedVaultId: lockedVaultID + 1, + AppId: appID, + OriginalVaultId: OriginalVaultId, + ExtendedPairId: ExtendedPairId, + Owner: Owner, + AmountIn: AmountIn, + AmountOut: AmountOut, + CurrentCollaterlisationRatio: collateralizationRatio, + CollateralToBeAuctioned: AmountIn, + TargetDebt: AmountOut, + LiquidationTimestamp: ctx.BlockTime(), + FeeToBeCollected: feesToBeCollected, + IsInternalKeeper: false, + InternalKeeperAddress: "", + IsExternalKeeper: "", + ExternalKeeperAddress: "", + } + + k.SetLockedVault(ctx, value) + k.SetLockedVaultID(ctx, value.LockedVaultId) + + return nil +} + func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { borrows, found := k.lend.GetBorrows(ctx) params := k.GetParams(ctx) @@ -325,32 +367,3 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, updatedLockedVault types.Lo return nil } - -func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn sdk.Int, AmountOut sdk.Int, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string) error { - lockedVaultID := k.GetLockedVaultID(ctx) - - value := types.LockedVault{ - LockedVaultId: lockedVaultID + 1, - AppId: appID, - OriginalVaultId: OriginalVaultId, - ExtendedPairId: ExtendedPairId, - Owner: Owner, - AmountIn: AmountIn, - AmountOut: AmountOut, - CurrentCollaterlisationRatio: collateralizationRatio, - CollateralToBeAuctioned: AmountIn, - TargetDebt: AmountOut, - LiquidationTimestamp: ctx.BlockTime(), - FeeToBeCollected: , - IsInternalKeeper: false, - InternalKeeperAddress: "", - IsExternalKeeper: "", - ExternalKeeperAddress: "", - - } - - k.SetLockedVault(ctx, value) - k.SetLockedVaultID(ctx, value.LockedVaultId) - - return nil -} From ae27f5bee1e95e49f7d2e18595e9cb7639c631fe Mon Sep 17 00:00:00 2001 From: Pratik Date: Sat, 8 Apr 2023 16:10:57 +0530 Subject: [PATCH 017/155] updating tx commands --- proto/comdex/liquidationsV2/v1beta1/tx.proto | 19 + x/liquidationsV2/client/cli/tx.go | 41 +- x/liquidationsV2/keeper/liquidate.go | 174 ++++-- x/liquidationsV2/keeper/msg_server.go | 23 +- x/liquidationsV2/types/errors.go | 2 +- x/liquidationsV2/types/events.go | 8 + x/liquidationsV2/types/msg.go | 46 ++ x/liquidationsV2/types/tx.pb.go | 530 ++++++++++++++++++- 8 files changed, 769 insertions(+), 74 deletions(-) create mode 100644 x/liquidationsV2/types/events.go create mode 100644 x/liquidationsV2/types/msg.go diff --git a/proto/comdex/liquidationsV2/v1beta1/tx.proto b/proto/comdex/liquidationsV2/v1beta1/tx.proto index 1c36fbeeb..5416ba675 100644 --- a/proto/comdex/liquidationsV2/v1beta1/tx.proto +++ b/proto/comdex/liquidationsV2/v1beta1/tx.proto @@ -1,8 +1,27 @@ syntax = "proto3"; package comdex.liquidationsV2.v1beta1; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; +option (gogoproto.equal_all) = false; +option (gogoproto.goproto_getters_all) = false; service Msg { + rpc MsgLiquidateInternalKeeper(MsgLiquidateInternalKeeperRequest) returns (MsgLiquidateInternalKeeperResponse); } + +message MsgLiquidateInternalKeeperRequest { + string from = 1 [ (gogoproto.moretags) = "yaml:\"from\"" ]; + + uint64 liq_type = 2 [ + (gogoproto.customname) = "LiqType", + (gogoproto.moretags) = "yaml:\"liq_type\""]; + + uint64 id = 3 [ + (gogoproto.customname) = "Id", + (gogoproto.moretags) = "yaml:\"id\""]; +} +message MsgLiquidateInternalKeeperResponse{} diff --git a/x/liquidationsV2/client/cli/tx.go b/x/liquidationsV2/client/cli/tx.go index 80310a94a..fa2291c7f 100644 --- a/x/liquidationsV2/client/cli/tx.go +++ b/x/liquidationsV2/client/cli/tx.go @@ -2,6 +2,9 @@ package cli import ( "fmt" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "strconv" "time" "github.com/spf13/cobra" @@ -30,7 +33,43 @@ func GetTxCmd() *cobra.Command { RunE: client.ValidateCmd, } - // this line is used by starport scaffolding # 1 + cmd.AddCommand( + txLiquidateInternalKeeper(), + ) + return cmd +} + +func txLiquidateInternalKeeper() *cobra.Command { + cmd := &cobra.Command{ + Use: "liquidate_internal_keeper [type] [id]", + Short: "liquidate faulty positions", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + liqType, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + + id, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + + msg := types.NewMsgLiquidateInternalKeeperRequest(ctx.FromAddress, liqType, id) + + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(ctx, cmd.Flags(), msg) + }, + } + flags.AddTxFlagsToCmd(cmd) return cmd } diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index d39c855c1..64c34139c 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -2,6 +2,9 @@ package keeper import ( "fmt" + assettypes "github.com/comdex-official/comdex/x/asset/types" + auctiontypes "github.com/comdex-official/comdex/x/auctionsV2/types" + lendtypes "github.com/comdex-official/comdex/x/lend/types" utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/liquidationsV2/types" @@ -113,7 +116,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error feesToBeCollected := sdk.NewDecFromInt(totalOut).Mul(extPair.LiquidationPenalty).TruncateInt() //Creating locked vault struct , which will trigger auction - err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, vault.AmountIn, totalOut, collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected) + err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, vault.AmountIn, totalOut, vault.AmountIn, totalOut, collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected) if err != nil { return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for Vault %d", vault.Id) } @@ -132,7 +135,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error return nil } -func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn sdk.Int, AmountOut sdk.Int, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int) error { +func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Int, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int) error { lockedVaultID := k.GetLockedVaultID(ctx) value := types.LockedVault{ @@ -167,9 +170,9 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { ctx.Logger().Error("Params Not Found in Liquidation, liquidate_borrow.go") return nil } - liquidationOffsetHolder, found := k.GetLiquidationOffsetHolder(ctx, lendtypes.AppID, types.VaultLiquidationsOffsetPrefix) + liquidationOffsetHolder, found := k.GetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix) if !found { - liquidationOffsetHolder = types.NewLiquidationOffsetHolder(lendtypes.AppID, 0) + liquidationOffsetHolder = types.NewLiquidationOffsetHolder(0) } borrowIDs := borrows start, end := types.GetSliceStartEndForLiquidations(len(borrowIDs), int(liquidationOffsetHolder.CurrentOffset), int(params.LiquidationBatchSize)) @@ -229,7 +232,6 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { liqThresholdBridgedAssetOne, _ := k.lend.GetAssetRatesParams(ctx, firstTransitAssetID) liqThresholdBridgedAssetTwo, _ := k.lend.GetAssetRatesParams(ctx, secondTransitAssetID) firstBridgedAsset, _ := k.asset.GetAsset(ctx, firstTransitAssetID) - secondBridgedAsset, _ := k.asset.GetAsset(ctx, secondTransitAssetID) // there are three possible cases // a. if borrow is from same pool @@ -241,11 +243,10 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { return err } if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold) { - err = k.UpdateLockedBorrows(ctx, lockedVault) + err = k.UpdateLockedBorrows(ctx, pool, borrowPos, lendPos.Owner, liqThreshold, assetIn, assetOut, firstBridgedAsset, lendPos.AppID, currentCollateralizationRatio) if err != nil { - return fmt.Errorf("error in first condition UpdateLockedBorrows in UpdateLockedBorrows , liquidate_borrow.go for ID %d", lockedVault.LockedVaultId) + return fmt.Errorf("error in first condition UpdateLockedBorrows in UpdateLockedBorrows , liquidate_borrow.go for ID ") } - k.lend.UpdateBorrowStats(ctx, lendPair, borrowPos.IsStableBorrow, borrowPos.AmountOut.Amount, false) } } else { if borrowPos.BridgedAssetAmount.Denom == firstBridgedAsset.Denom { @@ -254,11 +255,10 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { return err } if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetOne.LiquidationThreshold)) { - err = k.UpdateLockedBorrows(ctx, lockedVault) + err = k.UpdateLockedBorrows(ctx, pool, borrowPos, lendPos.Owner, liqThreshold, assetIn, assetOut, firstBridgedAsset, lendPos.AppID, currentCollateralizationRatio) if err != nil { - return fmt.Errorf("error in second condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID %d", lockedVault.LockedVaultId) + return fmt.Errorf("error in second condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") } - k.lend.UpdateBorrowStats(ctx, lendPair, borrowPos.IsStableBorrow, borrowPos.AmountOut.Amount, false) } } else { currentCollateralizationRatio, err = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) @@ -267,11 +267,10 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { } if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetTwo.LiquidationThreshold)) { - err = k.UpdateLockedBorrows(ctx, lockedVault, lendPair) + err = k.UpdateLockedBorrows(ctx, pool, borrowPos, lendPos.Owner, liqThreshold, assetIn, assetOut, firstBridgedAsset, lendPos.AppID, currentCollateralizationRatio) if err != nil { - return fmt.Errorf("error in third condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID %d", lockedVault.LockedVaultId) + return fmt.Errorf("error in third condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") } - k.lend.UpdateBorrowStats(ctx, lendPair, borrowPos.IsStableBorrow, borrowPos.AmountOut.Amount, false) } } } @@ -284,12 +283,12 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { return nil } -func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, updatedLockedVault types.LockedVault, lendPos lendtypes.LendAsset, pool lendtypes.Pool, borrow lendtypes.BorrowAsset, assetRatesStats lendtypes.AssetRatesParams, assetIn, assetOut, firstBridgeAsset assettypes.Asset) error { +func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, pool lendtypes.Pool, borrow lendtypes.BorrowAsset, owner string, assetRatesStats lendtypes.AssetRatesParams, assetIn, assetOut, firstBridgeAsset assettypes.Asset, appID uint64, currentCollateralizationRatio sdk.Dec) error { firstBridgeAssetStats, _ := k.lend.GetAssetRatesParams(ctx, firstBridgeAsset.Id) secondBridgeAssetStats, _ := k.lend.GetAssetRatesParams(ctx, firstBridgeAsset.Id) - assetInTotal, _ := k.market.CalcAssetPrice(ctx, assetIn.Id, updatedLockedVault.AmountIn) - assetOutTotal, _ := k.market.CalcAssetPrice(ctx, assetOut.Id, updatedLockedVault.AmountOut) + assetInTotal, _ := k.market.CalcAssetPrice(ctx, assetIn.Id, borrow.AmountIn.Amount) + assetOutTotal, _ := k.market.CalcAssetPrice(ctx, assetOut.Id, borrow.AmountOut.Amount) deductionPercentage, _ := sdk.NewDecFromStr("1.0") @@ -313,57 +312,120 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, updatedLockedVault types.Lo denominator := deductionPercentage.Sub(factor2) selloffAmount := numerator.Quo(denominator) // Dollar Value aip, _ := k.market.CalcAssetPrice(ctx, assetIn.Id, sdk.OneInt()) - liquidationDeductionAmt := selloffAmount.Mul(assetRatesStats.LiquidationPenalty.Add(assetRatesStats.LiquidationBonus)) - liquidationDeductionAmount := liquidationDeductionAmt.Quo(aip) // To be subtracted from AmountIn along with sellOff amt - - bonusToBidderAmount := (selloffAmount.Mul(assetRatesStats.LiquidationBonus)).Quo(aip) - penaltyToReserveAmount := (selloffAmount.Mul(assetRatesStats.LiquidationPenalty)).Quo(aip) + aop, _ := k.market.CalcAssetPrice(ctx, assetOut.Id, sdk.OneInt()) + bonusToBidderAmount := (selloffAmount.Mul(assetRatesStats.LiquidationBonus)).Quo(aop) + penaltyToReserveAmount := (selloffAmount.Mul(assetRatesStats.LiquidationPenalty)).Quo(aop) sellOffAmt := selloffAmount.Quo(aip) - err := k.bank.SendCoinsFromModuleToModule(ctx, pool.ModuleName, auctiontypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetIn.Denom, bonusToBidderAmount.Add(sellOffAmt).TruncateInt()))) + //TODO: sellOffAmt At oracle price currently + err := k.bank.SendCoinsFromModuleToModule(ctx, pool.ModuleName, auctiontypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetIn.Denom, sellOffAmt.TruncateInt()))) if err != nil { return err } - err = k.lend.UpdateReserveBalances(ctx, assetIn.Id, pool.ModuleName, sdk.NewCoin(assetIn.Denom, penaltyToReserveAmount.TruncateInt()), true) + borrow.IsLiquidated = true + k.lend.SetBorrow(ctx, borrow) + //updatedLockedVault.CollateralToBeAuctioned = selloffAmount.TruncateInt() + err = k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn.Amount, borrow.AmountOut.Amount, borrow.AmountIn.Amount, sellOffAmt.TruncateInt(), currentCollateralizationRatio, appID, false, false, "", "", bonusToBidderAmount.Add(penaltyToReserveAmount).TruncateInt()) if err != nil { return err } - cAsset, _ := k.asset.GetAsset(ctx, assetRatesStats.CAssetID) - // totalDeduction is the sum of liquidationDeductionAmount and selloffAmount - totalDeduction := liquidationDeductionAmount.Add(sellOffAmt).TruncateInt() // Total deduction from amountIn also reduce to lend Position amountIn - borrow.IsLiquidated = true - if totalDeduction.GTE(updatedLockedVault.AmountIn) { // rare case only - lendPos.AmountIn.Amount = lendPos.AmountIn.Amount.Sub(updatedLockedVault.AmountIn) - // also global lend data is subtracted by totalDeduction amount - assetStats, _ := k.lend.GetAssetStatsByPoolIDAndAssetID(ctx, lendPos.PoolID, lendPos.AssetID) - assetStats.TotalLend = assetStats.TotalLend.Sub(updatedLockedVault.AmountIn) - // setting the updated global lend data - k.lend.SetAssetStatsByPoolIDAndAssetID(ctx, assetStats) - updatedLockedVault.AmountIn = sdk.ZeroInt() - borrow.AmountIn.Amount = sdk.ZeroInt() - } else { - updatedLockedVault.AmountIn = updatedLockedVault.AmountIn.Sub(totalDeduction) - lendPos.AmountIn.Amount = lendPos.AmountIn.Amount.Sub(totalDeduction) - // also global lend data is subtracted by totalDeduction amount - assetStats, _ := k.lend.GetAssetStatsByPoolIDAndAssetID(ctx, lendPos.PoolID, lendPos.AssetID) - assetStats.TotalLend = assetStats.TotalLend.Sub(totalDeduction) - // setting the updated global lend data - k.lend.SetAssetStatsByPoolIDAndAssetID(ctx, assetStats) - borrow.AmountIn.Amount = borrow.AmountIn.Amount.Sub(totalDeduction) + return nil +} + +func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) error { + borrowPos, found := k.lend.GetBorrow(ctx, borrowID) + if !found { + return nil + } + if borrowPos.IsLiquidated { + return nil } - // users cToken present in pool's module will be burnt - // update borrow position - // update lend position - err = k.bank.BurnCoins(ctx, pool.ModuleName, sdk.NewCoins(sdk.NewCoin(cAsset.Denom, totalDeduction))) + lendPair, _ := k.lend.GetLendPair(ctx, borrowPos.PairID) + lendPos, found := k.lend.GetLend(ctx, borrowPos.LendingID) + if !found { + return fmt.Errorf("lend Pos Not Found in Liquidation, liquidate_borrow.go for ID %d", borrowPos.LendingID) + } + pool, _ := k.lend.GetPool(ctx, lendPos.PoolID) + assetIn, _ := k.asset.GetAsset(ctx, lendPair.AssetIn) + assetOut, _ := k.asset.GetAsset(ctx, lendPair.AssetOut) + liqThreshold, _ := k.lend.GetAssetRatesParams(ctx, lendPair.AssetIn) + killSwitchParams, _ := k.esm.GetKillSwitchData(ctx, lendPos.AppID) + if killSwitchParams.BreakerEnable { + return fmt.Errorf("kill Switch is enabled in Liquidation, liquidate_borrow.go for ID %d", lendPos.AppID) + } + // calculating and updating the interest accumulated before checking for liquidations + borrowPos, err := k.lend.CalculateBorrowInterestForLiquidation(ctx, borrowPos.ID) if err != nil { - return err + return fmt.Errorf("error in calculating Borrow Interest before liquidation") } - k.lend.SetLend(ctx, lendPos) - k.lend.SetBorrow(ctx, borrow) - updatedLockedVault.CollateralToBeAuctioned = selloffAmount - k.SetLockedVault(ctx, updatedLockedVault) - k.SetLockedVaultID(ctx, updatedLockedVault.LockedVaultId) + if !borrowPos.StableBorrowRate.Equal(sdk.ZeroDec()) { + borrowPos, err = k.lend.ReBalanceStableRates(ctx, borrowPos) + if err != nil { + return fmt.Errorf("error in re-balance stable rate check before liquidation") + } + } + + var currentCollateralizationRatio sdk.Dec + var firstTransitAssetID, secondTransitAssetID uint64 + // for getting transit assets details + for _, data := range pool.AssetData { + if data.AssetTransitType == 2 { + firstTransitAssetID = data.AssetID + } + if data.AssetTransitType == 3 { + secondTransitAssetID = data.AssetID + } + } + + liqThresholdBridgedAssetOne, _ := k.lend.GetAssetRatesParams(ctx, firstTransitAssetID) + liqThresholdBridgedAssetTwo, _ := k.lend.GetAssetRatesParams(ctx, secondTransitAssetID) + firstBridgedAsset, _ := k.asset.GetAsset(ctx, firstTransitAssetID) + + // there are three possible cases + // a. if borrow is from same pool + // b. if borrow is from first transit asset + // c. if borrow is from second transit asset + if borrowPos.BridgedAssetAmount.Amount.Equal(sdk.ZeroInt()) { // first condition + currentCollateralizationRatio, err = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) + if err != nil { + return err + } + if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold) { + err = k.UpdateLockedBorrows(ctx, pool, borrowPos, lendPos.Owner, liqThreshold, assetIn, assetOut, firstBridgedAsset, lendPos.AppID, currentCollateralizationRatio) + if err != nil { + return fmt.Errorf("error in first condition UpdateLockedBorrows in UpdateLockedBorrows , liquidate_borrow.go for ID ") + } + } + } else { + if borrowPos.BridgedAssetAmount.Denom == firstBridgedAsset.Denom { + currentCollateralizationRatio, err = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) + if err != nil { + return err + } + if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetOne.LiquidationThreshold)) { + err = k.UpdateLockedBorrows(ctx, pool, borrowPos, lendPos.Owner, liqThreshold, assetIn, assetOut, firstBridgedAsset, lendPos.AppID, currentCollateralizationRatio) + if err != nil { + return fmt.Errorf("error in second condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") + } + } + } else { + currentCollateralizationRatio, err = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) + if err != nil { + return err + } + + if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetTwo.LiquidationThreshold)) { + err = k.UpdateLockedBorrows(ctx, pool, borrowPos, lendPos.Owner, liqThreshold, assetIn, assetOut, firstBridgedAsset, lendPos.AppID, currentCollateralizationRatio) + if err != nil { + return fmt.Errorf("error in third condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") + } + } + } + } + return nil +} +func (k Keeper) MsgLiquidate(ctx sdk.Context, liquidator string, liqType, id uint64) error { return nil } diff --git a/x/liquidationsV2/keeper/msg_server.go b/x/liquidationsV2/keeper/msg_server.go index 3a1212c55..07d248848 100644 --- a/x/liquidationsV2/keeper/msg_server.go +++ b/x/liquidationsV2/keeper/msg_server.go @@ -1,17 +1,36 @@ package keeper import ( + "context" "github.com/comdex-official/comdex/x/liquidationsV2/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "strconv" ) type msgServer struct { - Keeper + keeper Keeper } // NewMsgServerImpl returns an implementation of the MsgServer interface // for the provided Keeper. func NewMsgServerImpl(keeper Keeper) types.MsgServer { - return &msgServer{Keeper: keeper} + return &msgServer{keeper: keeper} } var _ types.MsgServer = msgServer{} + +func (m msgServer) MsgLiquidateInternalKeeper(c context.Context, req *types.MsgLiquidateInternalKeeperRequest) (*types.MsgLiquidateInternalKeeperResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + if err := m.keeper.MsgLiquidate(ctx, req.From, req.LiqType, req.Id); err != nil { + return nil, err + } + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeLiquidateInternalKeeper, + sdk.NewAttribute(types.AttributeKeyLiqType, strconv.FormatUint(req.LiqType, 10)), + sdk.NewAttribute(types.AttributeKeyID, strconv.FormatUint(req.Id, 10)), + sdk.NewAttribute(types.AttributeKeyCreator, req.From), + ), + }) + return &types.MsgLiquidateInternalKeeperResponse{}, nil +} diff --git a/x/liquidationsV2/types/errors.go b/x/liquidationsV2/types/errors.go index 7f1805f55..8025e6bb4 100644 --- a/x/liquidationsV2/types/errors.go +++ b/x/liquidationsV2/types/errors.go @@ -8,5 +8,5 @@ import ( // x/liquidationsV2 module sentinel errors var ( - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") + ErrVaultIDInvalid = sdkerrors.Register(ModuleName, 1501, "Vault Id invalid") ) diff --git a/x/liquidationsV2/types/events.go b/x/liquidationsV2/types/events.go new file mode 100644 index 000000000..99de1b134 --- /dev/null +++ b/x/liquidationsV2/types/events.go @@ -0,0 +1,8 @@ +package types + +const ( + EventTypeLiquidateInternalKeeper = "liquidateInternalKeeper" + AttributeKeyLiqType = "liqType" + AttributeKeyID = "id" + AttributeKeyCreator = "creator" +) diff --git a/x/liquidationsV2/types/msg.go b/x/liquidationsV2/types/msg.go new file mode 100644 index 000000000..77ae0b57d --- /dev/null +++ b/x/liquidationsV2/types/msg.go @@ -0,0 +1,46 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/errors" +) + +func NewMsgLiquidateInternalKeeperRequest( + from sdk.AccAddress, + liqType, id uint64, +) *MsgLiquidateInternalKeeperRequest { + return &MsgLiquidateInternalKeeperRequest{ + From: from.String(), + LiqType: liqType, + Id: id, + } +} + +func (m *MsgLiquidateInternalKeeperRequest) Route() string { + return RouterKey +} + +func (m *MsgLiquidateInternalKeeperRequest) Type() string { + return TypeMsgLiquidateRequest +} + +func (m *MsgLiquidateInternalKeeperRequest) ValidateBasic() error { + if m.Id == 0 { + return errors.Wrap(ErrVaultIDInvalid, "id cannot be zero") + } + + return nil +} + +func (m *MsgLiquidateInternalKeeperRequest) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) +} + +func (m *MsgLiquidateInternalKeeperRequest) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(m.From) + if err != nil { + panic(err) + } + + return []sdk.AccAddress{from} +} diff --git a/x/liquidationsV2/types/tx.pb.go b/x/liquidationsV2/types/tx.pb.go index 57b8d742a..48bbb52e0 100644 --- a/x/liquidationsV2/types/tx.pb.go +++ b/x/liquidationsV2/types/tx.pb.go @@ -6,10 +6,17 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + _ "github.com/golang/protobuf/ptypes/timestamp" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -23,22 +30,116 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type MsgLiquidateInternalKeeperRequest struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` + LiqType uint64 `protobuf:"varint,2,opt,name=liq_type,json=liqType,proto3" json:"liq_type,omitempty" yaml:"liq_type"` + Id uint64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` +} + +func (m *MsgLiquidateInternalKeeperRequest) Reset() { *m = MsgLiquidateInternalKeeperRequest{} } +func (m *MsgLiquidateInternalKeeperRequest) String() string { return proto.CompactTextString(m) } +func (*MsgLiquidateInternalKeeperRequest) ProtoMessage() {} +func (*MsgLiquidateInternalKeeperRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_51c735c845851e88, []int{0} +} +func (m *MsgLiquidateInternalKeeperRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgLiquidateInternalKeeperRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgLiquidateInternalKeeperRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgLiquidateInternalKeeperRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgLiquidateInternalKeeperRequest.Merge(m, src) +} +func (m *MsgLiquidateInternalKeeperRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgLiquidateInternalKeeperRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgLiquidateInternalKeeperRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgLiquidateInternalKeeperRequest proto.InternalMessageInfo + +type MsgLiquidateInternalKeeperResponse struct { +} + +func (m *MsgLiquidateInternalKeeperResponse) Reset() { *m = MsgLiquidateInternalKeeperResponse{} } +func (m *MsgLiquidateInternalKeeperResponse) String() string { return proto.CompactTextString(m) } +func (*MsgLiquidateInternalKeeperResponse) ProtoMessage() {} +func (*MsgLiquidateInternalKeeperResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51c735c845851e88, []int{1} +} +func (m *MsgLiquidateInternalKeeperResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgLiquidateInternalKeeperResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgLiquidateInternalKeeperResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgLiquidateInternalKeeperResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgLiquidateInternalKeeperResponse.Merge(m, src) +} +func (m *MsgLiquidateInternalKeeperResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgLiquidateInternalKeeperResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgLiquidateInternalKeeperResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgLiquidateInternalKeeperResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgLiquidateInternalKeeperRequest)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateInternalKeeperRequest") + proto.RegisterType((*MsgLiquidateInternalKeeperResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateInternalKeeperResponse") +} + func init() { proto.RegisterFile("comdex/liquidationsV2/v1beta1/tx.proto", fileDescriptor_51c735c845851e88) } var fileDescriptor_51c735c845851e88 = []byte{ - // 148 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4b, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0xcf, 0xc9, 0x2c, 0x2c, 0xcd, 0x4c, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, - 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, - 0x2f, 0xc9, 0x17, 0x92, 0x85, 0xa8, 0xd3, 0x43, 0x55, 0xa7, 0x07, 0x55, 0x67, 0xc4, 0xca, 0xc5, - 0xec, 0x5b, 0x9c, 0xee, 0x14, 0x74, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, - 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, - 0x16, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x10, 0xa3, 0x74, 0xf3, - 0xd3, 0xd2, 0x32, 0x93, 0x33, 0x13, 0x73, 0xa0, 0x7c, 0x7d, 0x0c, 0x47, 0x94, 0x54, 0x16, 0xa4, - 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x46, 0x90, 0x91, - 0xaa, 0x00, 0x00, 0x00, + // 384 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0x3f, 0x8e, 0x9b, 0x40, + 0x18, 0xc5, 0x19, 0x6c, 0xc5, 0xf1, 0xa4, 0xb0, 0x44, 0x52, 0x58, 0x48, 0x19, 0x1c, 0x1c, 0x45, + 0x6e, 0xc2, 0xc8, 0x4e, 0x93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, 0xf0, 0x65, 0x44, 0xb3, + 0xdf, 0x62, 0x9b, 0x92, 0xa1, 0x3a, 0x02, 0x93, 0xee, 0x1c, 0x55, 0xa5, 0xd1, 0x5b, 0xd2, 0xec, + 0xe7, 0x36, 0x25, 0xa7, 0xd2, 0x18, 0x48, 0xcf, 0x2d, 0x64, 0xda, 0xbd, 0x48, 0x6a, 0xda, 0x18, + 0xaa, 0xd4, 0x1f, 0x76, 0x1a, 0xd3, 0xeb, 0xaa, 0x34, 0xd4, 0x85, 0x7f, 0x2a, 0x8d, 0xbe, 0xe4, + 0xa9, 0x6f, 0xda, 0x2a, 0xf5, 0xcd, 0xf7, 0xd0, 0x3c, 0xb7, 0x29, 0x4f, 0x59, 0xc2, 0xc9, 0xec, + 0x02, 0xc0, 0xce, 0x8a, 0x87, 0xda, 0x7f, 0x00, 0xf5, 0xc7, 0x71, 0xed, 0x9b, 0x75, 0xb6, 0x6e, + 0xeb, 0xc9, 0x4e, 0xf4, 0xef, 0xcf, 0x38, 0x41, 0xee, 0x3a, 0x5f, 0xef, 0xaf, 0x91, 0xb2, 0xab, + 0x90, 0xb2, 0xaf, 0x10, 0x38, 0x54, 0x08, 0x5c, 0x55, 0x08, 0xfc, 0x3b, 0x22, 0xe5, 0x70, 0x44, + 0xca, 0xe5, 0x11, 0x29, 0xeb, 0xcf, 0x21, 0x15, 0x7f, 0x0a, 0xb7, 0x8e, 0xc2, 0x32, 0xee, 0x23, + 0x0b, 0x02, 0xea, 0x51, 0x27, 0x6a, 0x67, 0xfc, 0xe0, 0x65, 0xd5, 0xdd, 0x72, 0xf7, 0x45, 0x73, + 0xbf, 0x9f, 0x6e, 0x02, 0x00, 0x00, 0xff, 0xff, 0x38, 0x0d, 0x9d, 0x54, 0x7f, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -53,6 +154,7 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { + MsgLiquidateInternalKeeper(ctx context.Context, in *MsgLiquidateInternalKeeperRequest, opts ...grpc.CallOption) (*MsgLiquidateInternalKeeperResponse, error) } type msgClient struct { @@ -63,22 +165,422 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) MsgLiquidateInternalKeeper(ctx context.Context, in *MsgLiquidateInternalKeeperRequest, opts ...grpc.CallOption) (*MsgLiquidateInternalKeeperResponse, error) { + out := new(MsgLiquidateInternalKeeperResponse) + err := c.cc.Invoke(ctx, "/comdex.liquidationsV2.v1beta1.Msg/MsgLiquidateInternalKeeper", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { + MsgLiquidateInternalKeeper(context.Context, *MsgLiquidateInternalKeeperRequest) (*MsgLiquidateInternalKeeperResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) MsgLiquidateInternalKeeper(ctx context.Context, req *MsgLiquidateInternalKeeperRequest) (*MsgLiquidateInternalKeeperResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgLiquidateInternalKeeper not implemented") +} + func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_MsgLiquidateInternalKeeper_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgLiquidateInternalKeeperRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgLiquidateInternalKeeper(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.liquidationsV2.v1beta1.Msg/MsgLiquidateInternalKeeper", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgLiquidateInternalKeeper(ctx, req.(*MsgLiquidateInternalKeeperRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.liquidationsV2.v1beta1.Msg", HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{}, - Metadata: "comdex/liquidationsV2/v1beta1/tx.proto", + Methods: []grpc.MethodDesc{ + { + MethodName: "MsgLiquidateInternalKeeper", + Handler: _Msg_MsgLiquidateInternalKeeper_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "comdex/liquidationsV2/v1beta1/tx.proto", +} + +func (m *MsgLiquidateInternalKeeperRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgLiquidateInternalKeeperRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgLiquidateInternalKeeperRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x18 + } + if m.LiqType != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.LiqType)) + i-- + dAtA[i] = 0x10 + } + if len(m.From) > 0 { + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintTx(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgLiquidateInternalKeeperResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgLiquidateInternalKeeperResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgLiquidateInternalKeeperResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgLiquidateInternalKeeperRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.LiqType != 0 { + n += 1 + sovTx(uint64(m.LiqType)) + } + if m.Id != 0 { + n += 1 + sovTx(uint64(m.Id)) + } + return n +} + +func (m *MsgLiquidateInternalKeeperResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MsgLiquidateInternalKeeperRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgLiquidateInternalKeeperRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgLiquidateInternalKeeperRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LiqType", wireType) + } + m.LiqType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LiqType |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgLiquidateInternalKeeperResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgLiquidateInternalKeeperResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgLiquidateInternalKeeperResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) From ef1a0a020ea15d5d024cc97a53cf671a5aad40f0 Mon Sep 17 00:00:00 2001 From: Pratik Date: Sat, 8 Apr 2023 16:28:06 +0530 Subject: [PATCH 018/155] updating tx commands- codecs --- x/liquidationsV2/abci.go | 2 +- x/liquidationsV2/handler.go | 11 +++++------ x/liquidationsV2/module.go | 6 +----- x/liquidationsV2/types/codec.go | 25 ++++++++++++++++++------- x/liquidationsV2/types/errors.go | 3 ++- x/liquidationsV2/types/events.go | 2 ++ 6 files changed, 29 insertions(+), 20 deletions(-) diff --git a/x/liquidationsV2/abci.go b/x/liquidationsV2/abci.go index 03b478241..8a191f856 100644 --- a/x/liquidationsV2/abci.go +++ b/x/liquidationsV2/abci.go @@ -17,7 +17,7 @@ func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k keeper.Keeper) ctx.Logger().Error("error in Liquidate function") ctx.EventManager().EmitEvent( sdk.NewEvent( - types.EventTypeLiquidateVaultsErr, + types.EventTypeLiquidateErr, sdk.NewAttribute(types.Error, fmt.Sprintf("%s", err)), ), ) diff --git a/x/liquidationsV2/handler.go b/x/liquidationsV2/handler.go index 4bde12d3e..90f808169 100644 --- a/x/liquidationsV2/handler.go +++ b/x/liquidationsV2/handler.go @@ -1,8 +1,6 @@ package liquidationsV2 import ( - "fmt" - "github.com/comdex-official/comdex/x/liquidationsV2/keeper" "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -11,16 +9,17 @@ import ( // NewHandler ... func NewHandler(k keeper.Keeper) sdk.Handler { - // this line is used by starport scaffolding # handler/msgServer + server := keeper.NewMsgServerImpl(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { - // this line is used by starport scaffolding # 1 + case *types.MsgLiquidateInternalKeeperRequest: + res, err := server.MsgLiquidateInternalKeeper(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + return nil, sdkerrors.Wrapf(types.ErrorUnknownMsgType, "%T", msg) } } } diff --git a/x/liquidationsV2/module.go b/x/liquidationsV2/module.go index 0a582363a..7b6a193c6 100644 --- a/x/liquidationsV2/module.go +++ b/x/liquidationsV2/module.go @@ -44,12 +44,8 @@ func (AppModuleBasic) Name() string { return types.ModuleName } -func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) + types.RegisterLegacyAminoCodec(cdc) } // RegisterInterfaces registers the module's interface types diff --git a/x/liquidationsV2/types/codec.go b/x/liquidationsV2/types/codec.go index fb6871d22..bc84c6a97 100644 --- a/x/liquidationsV2/types/codec.go +++ b/x/liquidationsV2/types/codec.go @@ -2,22 +2,33 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + // this line is used by starport scaffolding # 1 "github.com/cosmos/cosmos-sdk/types/msgservice" ) -func RegisterCodec(cdc *codec.LegacyAmino) { - // this line is used by starport scaffolding # 2 -} +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgLiquidateInternalKeeperRequest{}, "comdex/liquidation/MsgLiquidateInternalKeeperRequest", nil) +} func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - // this line is used by starport scaffolding # 3 - + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgLiquidateInternalKeeperRequest{}, + ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } var ( - Amino = codec.NewLegacyAmino() + amino = codec.NewLegacyAmino() ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) ) + +func init() { + RegisterLegacyAminoCodec(amino) + cryptocodec.RegisterCrypto(amino) + amino.Seal() +} diff --git a/x/liquidationsV2/types/errors.go b/x/liquidationsV2/types/errors.go index 8025e6bb4..976466c36 100644 --- a/x/liquidationsV2/types/errors.go +++ b/x/liquidationsV2/types/errors.go @@ -8,5 +8,6 @@ import ( // x/liquidationsV2 module sentinel errors var ( - ErrVaultIDInvalid = sdkerrors.Register(ModuleName, 1501, "Vault Id invalid") + ErrVaultIDInvalid = sdkerrors.Register(ModuleName, 1501, "Vault Id invalid") + ErrorUnknownMsgType = sdkerrors.Register(ModuleName, 1502, "Unknown msg type") ) diff --git a/x/liquidationsV2/types/events.go b/x/liquidationsV2/types/events.go index 99de1b134..e6e788dfb 100644 --- a/x/liquidationsV2/types/events.go +++ b/x/liquidationsV2/types/events.go @@ -5,4 +5,6 @@ const ( AttributeKeyLiqType = "liqType" AttributeKeyID = "id" AttributeKeyCreator = "creator" + EventTypeLiquidateErr = "liquidate_err" + Error = "error" ) From 663e4439d72e808f57619940aad7a5adebdb45eb Mon Sep 17 00:00:00 2001 From: Pratik Date: Sat, 8 Apr 2023 16:53:21 +0530 Subject: [PATCH 019/155] updating tx commands func --- x/liquidationsV2/keeper/liquidate.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 64c34139c..0d4581455 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -427,5 +427,19 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro } func (k Keeper) MsgLiquidate(ctx sdk.Context, liquidator string, liqType, id uint64) error { + if liqType == 0 { + err := k.LiquidateIndividualVault(ctx, id) + if err != nil { + return err + } + } else if liqType == 1 { + err := k.LiquidateIndividualBorrow(ctx, id) + if err != nil { + return err + } + } else { + // TODO: for other apps + } + // TODO: send liquidation bonus to liquidator address logic return nil } From bfb6780c549b11f5840e8ff1917dd9410d21fd4b Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Mon, 10 Apr 2023 18:51:37 +0530 Subject: [PATCH 020/155] auction-structuring --- x/liquidationsV2/keeper/keeper.go | 24 ++++++++++++++++++++++++ x/liquidationsV2/keeper/liquidate.go | 5 +++++ 2 files changed, 29 insertions(+) diff --git a/x/liquidationsV2/keeper/keeper.go b/x/liquidationsV2/keeper/keeper.go index 53405cfd0..3d913b50f 100644 --- a/x/liquidationsV2/keeper/keeper.go +++ b/x/liquidationsV2/keeper/keeper.go @@ -85,3 +85,27 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { //8. Liquidation Whitelisting Proposal + + + +// List of auction functions to be created + +// 1. Auction Activator +// 2.Dutch Activator +// 3.English Activator + +//4. User Biddings +//5. DEPOSIT BID +//6. CANCEL BID/ UPDATE BID +//7. TRIGGER BID (ABCI) +//8. WITHDRAW BID + +//9. RESTART AUCTION +//16. END AUCTION +//10. HARBOR AUCTION TRIGGER +//11. HARBOR AUCTION END TRIGGER +//12. VAULT AUCTION END TRIGGER +//13. BORROW AUCTION END TRIGGER +//14. EXTERNAL APPS AUCTION END TRIGGER +//15. INTERNAL LIQUIDATORS INCENTIVISING LOGIC TRIGGER + diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 0d4581455..ddf3eb672 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -151,6 +151,7 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair TargetDebt: AmountOut, LiquidationTimestamp: ctx.BlockTime(), FeeToBeCollected: feesToBeCollected, + type: "vault" IsInternalKeeper: false, InternalKeeperAddress: "", IsExternalKeeper: "", @@ -159,6 +160,10 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair k.SetLockedVault(ctx, value) k.SetLockedVaultID(ctx, value.LockedVaultId) + //Call auction activator + //struct for auction will stay same for english and dutch + // based on type recieved from + return nil } From a6d1e0b3b33d7a0a06fc415897eac7d4bfa2a4bb Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Tue, 11 Apr 2023 16:55:24 +0530 Subject: [PATCH 021/155] auction-structuring --- .../liquidationsV2/v1beta1/liquidate.proto | 4 +++- x/auctionsV2/keeper/auctions.go | 20 +++++++++++++++++++ x/liquidationsV2/keeper/keeper.go | 3 ++- x/liquidationsV2/keeper/liquidate.go | 1 + 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 x/auctionsV2/keeper/auctions.go diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index 88339f7f9..e9a19dff7 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -15,7 +15,9 @@ message LiquidationWhiteListing { uint64 app_id = 1 [ (gogoproto.customname) = "AppId", (gogoproto.moretags) = "yaml:\"app_id\""]; - +//------------Auction Types defn +// 0 auction type - "dutch" +//1 auction type - "english" uint64 auction_type = 2 [ (gogoproto.customname) = "AuctionType", (gogoproto.moretags) = "yaml:\"auction_type\""]; diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go new file mode 100644 index 000000000..f7289e350 --- /dev/null +++ b/x/auctionsV2/keeper/auctions.go @@ -0,0 +1,20 @@ +package keeper + +import( + + // "github.com/comdex-official/comdex/types" + liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" + sdk "github.com/cosmos/cosmos-sdk/types" + +) + + + +func (k Keeper) AuctionActivator(ctx sdk.Context,liquidationData liquidationtypes.LockedVault) error { + + auctionType:=liquidationData.AppId + + + + return nil +} \ No newline at end of file diff --git a/x/liquidationsV2/keeper/keeper.go b/x/liquidationsV2/keeper/keeper.go index 3d913b50f..bdb131c7e 100644 --- a/x/liquidationsV2/keeper/keeper.go +++ b/x/liquidationsV2/keeper/keeper.go @@ -95,6 +95,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { // 3.English Activator //4. User Biddings + //5. DEPOSIT BID //6. CANCEL BID/ UPDATE BID //7. TRIGGER BID (ABCI) @@ -107,5 +108,5 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { //12. VAULT AUCTION END TRIGGER //13. BORROW AUCTION END TRIGGER //14. EXTERNAL APPS AUCTION END TRIGGER -//15. INTERNAL LIQUIDATORS INCENTIVISING LOGIC TRIGGER +//15. INTERNAL LIQUIDATORS INCENTIVISING LOGIC TRIGGER diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index ddf3eb672..a44190263 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -163,6 +163,7 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair //Call auction activator //struct for auction will stay same for english and dutch // based on type recieved from + return nil From 11510ff12e6bae66fd9e9b5f46052e4a44b0c5ae Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 11 Apr 2023 17:07:06 +0530 Subject: [PATCH 022/155] LiquidationWhiteListing setter/getter fn --- proto/comdex/auctionsV2/v1beta1/bid.proto | 83 ++ proto/comdex/auctionsV2/v1beta1/genesis.proto | 2 +- proto/comdex/auctionsV2/v1beta1/gov.proto | 13 + proto/comdex/auctionsV2/v1beta1/params.proto | 2 +- proto/comdex/auctionsV2/v1beta1/query.proto | 2 +- proto/comdex/auctionsV2/v1beta1/tx.proto | 2 +- x/auctionsV2/types/bid.pb.go | 1014 +++++++++++++++++ x/auctionsV2/types/genesis.pb.go | 25 +- x/auctionsV2/types/gov.pb.go | 429 +++++++ x/auctionsV2/types/params.pb.go | 20 +- x/auctionsV2/types/query.pb.go | 52 +- x/auctionsV2/types/tx.pb.go | 19 +- x/liquidationsV2/keeper/keeper.go | 21 +- x/liquidationsV2/keeper/liquidate.go | 26 + x/liquidationsV2/types/keys.go | 6 +- 15 files changed, 1639 insertions(+), 77 deletions(-) create mode 100644 proto/comdex/auctionsV2/v1beta1/bid.proto create mode 100644 proto/comdex/auctionsV2/v1beta1/gov.proto create mode 100644 x/auctionsV2/types/bid.pb.go create mode 100644 x/auctionsV2/types/gov.pb.go diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto new file mode 100644 index 000000000..b58b019d4 --- /dev/null +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; +package comdex.auctionsV2.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; + +message DutchBiddings { + uint64 bidding_id = 1 [ + (gogoproto.moretags) = "yaml:\"bidding_id\"" + ]; + + uint64 auction_id = 2 [ + (gogoproto.moretags) = "yaml:\"auction_id\"" + ]; + + string auction_status = 3 [ + (gogoproto.moretags) = "yaml:\"auction_status\"" + ]; + + cosmos.base.v1beta1.Coin outflow_token_amount = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"outflow_token_amount\"", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + + cosmos.base.v1beta1.Coin inflow_token_amount = 5 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"inflow_token_amount\"", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + + string bidder = 6 [ + (gogoproto.moretags) = "yaml:\"bidder\"" + ]; + + + google.protobuf.Timestamp bidding_timestamp = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"bidding_timestamp\"" + ]; + + string bidding_status = 8 [ + (gogoproto.moretags) = "yaml:\"bidding_status\"" + ]; + + uint64 auction_mapping_id = 9 [ + (gogoproto.moretags) = "yaml:\"auction_mapping_id\"" + ]; + + uint64 app_id = 10 [ + (gogoproto.moretags) = "yaml:\"app_id\"" + ]; + +} + + +// params will include for park your asset for dutch bid +// % slots above which we have to increase or decrease (step) +// withdrawal fee for taking out bid +// Closing fee for taking out collateral parked + +message DutchAutoBidParams{ + string step = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"step\"" + ]; + string withdrawal_fee = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"withdrawal_fee\"" + ]; + string closing_fee = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"closing_fee\"" + ]; +} + diff --git a/proto/comdex/auctionsV2/v1beta1/genesis.proto b/proto/comdex/auctionsV2/v1beta1/genesis.proto index 1f960b6b1..96d9ec396 100644 --- a/proto/comdex/auctionsV2/v1beta1/genesis.proto +++ b/proto/comdex/auctionsV2/v1beta1/genesis.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package comdex.newauc.v1beta1; +package comdex.auctionsV2.v1beta1; import "gogoproto/gogo.proto"; import "comdex/auctionsV2/v1beta1/params.proto"; diff --git a/proto/comdex/auctionsV2/v1beta1/gov.proto b/proto/comdex/auctionsV2/v1beta1/gov.proto new file mode 100644 index 000000000..ac256ac87 --- /dev/null +++ b/proto/comdex/auctionsV2/v1beta1/gov.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package comdex.auctionsV2.v1beta1; + +import "gogoproto/gogo.proto"; +import "comdex/auctionsV2/v1beta1/bid.proto"; + +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; + +message DutchAutoBidParamsProposal { + string title = 1 [(gogoproto.moretags) = "yaml:\"title\""]; + string description = 2 [(gogoproto.moretags) = "yaml:\"description\""]; + DutchAutoBidParams dutchAutoBidParams = 3 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/proto/comdex/auctionsV2/v1beta1/params.proto b/proto/comdex/auctionsV2/v1beta1/params.proto index be66e5413..675db1b85 100644 --- a/proto/comdex/auctionsV2/v1beta1/params.proto +++ b/proto/comdex/auctionsV2/v1beta1/params.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package comdex.newauc.v1beta1; +package comdex.auctionsV2.v1beta1; import "gogoproto/gogo.proto"; diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index 3b55302c0..79ce69c2a 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package comdex.newauc.v1beta1; +package comdex.auctionsV2.v1beta1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; diff --git a/proto/comdex/auctionsV2/v1beta1/tx.proto b/proto/comdex/auctionsV2/v1beta1/tx.proto index 5fc6eeb95..57b3e17ad 100644 --- a/proto/comdex/auctionsV2/v1beta1/tx.proto +++ b/proto/comdex/auctionsV2/v1beta1/tx.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package comdex.newauc.v1beta1; +package comdex.auctionsV2.v1beta1; option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go new file mode 100644 index 000000000..c27b349d3 --- /dev/null +++ b/x/auctionsV2/types/bid.pb.go @@ -0,0 +1,1014 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/auctionsV2/v1beta1/bid.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/timestamp" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type DutchBiddings struct { + BiddingId uint64 `protobuf:"varint,1,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` + AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + AuctionStatus string `protobuf:"bytes,3,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` + OutflowTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=outflow_token_amount,json=outflowTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_token_amount" yaml:"outflow_token_amount"` + InflowTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=inflow_token_amount,json=inflowTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_amount" yaml:"inflow_token_amount"` + Bidder string `protobuf:"bytes,6,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` + BiddingTimestamp time.Time `protobuf:"bytes,7,opt,name=bidding_timestamp,json=biddingTimestamp,proto3,stdtime" json:"bidding_timestamp" yaml:"bidding_timestamp"` + BiddingStatus string `protobuf:"bytes,8,opt,name=bidding_status,json=biddingStatus,proto3" json:"bidding_status,omitempty" yaml:"bidding_status"` + AuctionMappingId uint64 `protobuf:"varint,9,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` + AppId uint64 `protobuf:"varint,10,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` +} + +func (m *DutchBiddings) Reset() { *m = DutchBiddings{} } +func (m *DutchBiddings) String() string { return proto.CompactTextString(m) } +func (*DutchBiddings) ProtoMessage() {} +func (*DutchBiddings) Descriptor() ([]byte, []int) { + return fileDescriptor_6f6db8f3a6a396ec, []int{0} +} +func (m *DutchBiddings) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DutchBiddings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DutchBiddings.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DutchBiddings) XXX_Merge(src proto.Message) { + xxx_messageInfo_DutchBiddings.Merge(m, src) +} +func (m *DutchBiddings) XXX_Size() int { + return m.Size() +} +func (m *DutchBiddings) XXX_DiscardUnknown() { + xxx_messageInfo_DutchBiddings.DiscardUnknown(m) +} + +var xxx_messageInfo_DutchBiddings proto.InternalMessageInfo + +func (m *DutchBiddings) GetBiddingId() uint64 { + if m != nil { + return m.BiddingId + } + return 0 +} + +func (m *DutchBiddings) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + +func (m *DutchBiddings) GetAuctionStatus() string { + if m != nil { + return m.AuctionStatus + } + return "" +} + +func (m *DutchBiddings) GetOutflowTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { + if m != nil { + return m.OutflowTokenAmount + } + return github_com_cosmos_cosmos_sdk_types.Coin{} +} + +func (m *DutchBiddings) GetInflowTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { + if m != nil { + return m.InflowTokenAmount + } + return github_com_cosmos_cosmos_sdk_types.Coin{} +} + +func (m *DutchBiddings) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *DutchBiddings) GetBiddingTimestamp() time.Time { + if m != nil { + return m.BiddingTimestamp + } + return time.Time{} +} + +func (m *DutchBiddings) GetBiddingStatus() string { + if m != nil { + return m.BiddingStatus + } + return "" +} + +func (m *DutchBiddings) GetAuctionMappingId() uint64 { + if m != nil { + return m.AuctionMappingId + } + return 0 +} + +func (m *DutchBiddings) GetAppId() uint64 { + if m != nil { + return m.AppId + } + return 0 +} + +type DutchAutoBidParams struct { + Step github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"step" yaml:"step"` + WithdrawalFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=withdrawal_fee,json=withdrawalFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"withdrawal_fee" yaml:"withdrawal_fee"` + ClosingFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=closing_fee,json=closingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"closing_fee" yaml:"closing_fee"` +} + +func (m *DutchAutoBidParams) Reset() { *m = DutchAutoBidParams{} } +func (m *DutchAutoBidParams) String() string { return proto.CompactTextString(m) } +func (*DutchAutoBidParams) ProtoMessage() {} +func (*DutchAutoBidParams) Descriptor() ([]byte, []int) { + return fileDescriptor_6f6db8f3a6a396ec, []int{1} +} +func (m *DutchAutoBidParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DutchAutoBidParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DutchAutoBidParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DutchAutoBidParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_DutchAutoBidParams.Merge(m, src) +} +func (m *DutchAutoBidParams) XXX_Size() int { + return m.Size() +} +func (m *DutchAutoBidParams) XXX_DiscardUnknown() { + xxx_messageInfo_DutchAutoBidParams.DiscardUnknown(m) +} + +var xxx_messageInfo_DutchAutoBidParams proto.InternalMessageInfo + +func init() { + proto.RegisterType((*DutchBiddings)(nil), "comdex.auctionsV2.v1beta1.DutchBiddings") + proto.RegisterType((*DutchAutoBidParams)(nil), "comdex.auctionsV2.v1beta1.DutchAutoBidParams") +} + +func init() { + proto.RegisterFile("comdex/auctionsV2/v1beta1/bid.proto", fileDescriptor_6f6db8f3a6a396ec) +} + +var fileDescriptor_6f6db8f3a6a396ec = []byte{ + // 663 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0x8e, 0x4b, 0x1b, 0xc8, 0x56, 0xa9, 0x9a, 0xa5, 0x95, 0x92, 0x20, 0xec, 0x6a, 0x41, 0x10, + 0x0e, 0xb5, 0xd5, 0xd2, 0x13, 0x12, 0x12, 0x35, 0x55, 0x51, 0x84, 0x5a, 0x81, 0xa9, 0x38, 0x70, + 0x89, 0xd6, 0xf6, 0x26, 0x5d, 0x35, 0xf6, 0x5a, 0xf1, 0x9a, 0xd2, 0xb7, 0xe8, 0x11, 0x89, 0x77, + 0xe1, 0x5c, 0x6e, 0x3d, 0x22, 0x0e, 0x06, 0xb5, 0x6f, 0x90, 0x23, 0x27, 0xb4, 0x3f, 0x4e, 0xea, + 0x52, 0x09, 0x72, 0xb2, 0x67, 0xe6, 0x9b, 0x6f, 0x66, 0x67, 0xbf, 0x59, 0xf0, 0x20, 0x60, 0x51, + 0x48, 0x3e, 0x39, 0x38, 0x0b, 0x38, 0x65, 0x71, 0xfa, 0x7e, 0xd3, 0xf9, 0xb8, 0xe1, 0x13, 0x8e, + 0x37, 0x1c, 0x9f, 0x86, 0x76, 0x32, 0x62, 0x9c, 0xc1, 0x96, 0x02, 0xd9, 0x53, 0x90, 0xad, 0x41, + 0xed, 0x95, 0x01, 0x1b, 0x30, 0x89, 0x72, 0xc4, 0x9f, 0x4a, 0x68, 0x5b, 0x03, 0xc6, 0x06, 0x43, + 0xe2, 0x48, 0xcb, 0xcf, 0xfa, 0x0e, 0xa7, 0x11, 0x49, 0x39, 0x8e, 0x12, 0x0d, 0x30, 0x03, 0x96, + 0x46, 0x2c, 0x75, 0x7c, 0x9c, 0x92, 0x49, 0xc1, 0x80, 0xd1, 0x58, 0xc5, 0xd1, 0xb7, 0x2a, 0xa8, + 0xef, 0x64, 0x3c, 0x38, 0x74, 0x69, 0x18, 0xd2, 0x78, 0x90, 0xc2, 0x2d, 0x00, 0x7c, 0xf5, 0xdf, + 0xa3, 0x61, 0xd3, 0x58, 0x33, 0x3a, 0xf3, 0xee, 0xea, 0x38, 0xb7, 0x1a, 0x27, 0x38, 0x1a, 0x3e, + 0x43, 0xd3, 0x18, 0xf2, 0x6a, 0xda, 0xe8, 0x86, 0x22, 0x4b, 0x37, 0x2d, 0xb2, 0xe6, 0xae, 0x67, + 0x4d, 0x63, 0xc8, 0xab, 0x69, 0xa3, 0x1b, 0xc2, 0x17, 0x60, 0xa9, 0x88, 0xa4, 0x1c, 0xf3, 0x2c, + 0x6d, 0xde, 0x5a, 0x33, 0x3a, 0x35, 0xb7, 0x35, 0xce, 0xad, 0xd5, 0x72, 0xa6, 0x8a, 0x23, 0xaf, + 0xae, 0x1d, 0xef, 0xa4, 0x0d, 0xbf, 0x18, 0x60, 0x85, 0x65, 0xbc, 0x3f,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, 0x4f, 0x03, 0x8a, 0x87, 0xda, 0x76, + 0x4a, 0x4f, 0xab, 0xac, 0xea, 0x57, 0xa5, 0x2a, 0x9f, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0xd7, + 0x00, 0x5c, 0xc9, 0x7c, 0x05, 0x00, 0x00, +} + +func (m *DutchBiddings) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DutchBiddings) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DutchBiddings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x50 + } + if m.AuctionMappingId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x48 + } + if len(m.BiddingStatus) > 0 { + i -= len(m.BiddingStatus) + copy(dAtA[i:], m.BiddingStatus) + i = encodeVarintBid(dAtA, i, uint64(len(m.BiddingStatus))) + i-- + dAtA[i] = 0x42 + } + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BiddingTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintBid(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x3a + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintBid(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x32 + } + { + size, err := m.InflowTokenAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size, err := m.OutflowTokenAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.AuctionStatus) > 0 { + i -= len(m.AuctionStatus) + copy(dAtA[i:], m.AuctionStatus) + i = encodeVarintBid(dAtA, i, uint64(len(m.AuctionStatus))) + i-- + dAtA[i] = 0x1a + } + if m.AuctionId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x10 + } + if m.BiddingId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.BiddingId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DutchAutoBidParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DutchAutoBidParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DutchAutoBidParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.ClosingFee.Size() + i -= size + if _, err := m.ClosingFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.WithdrawalFee.Size() + i -= size + if _, err := m.WithdrawalFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.Step.Size() + i -= size + if _, err := m.Step.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintBid(dAtA []byte, offset int, v uint64) int { + offset -= sovBid(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *DutchBiddings) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BiddingId != 0 { + n += 1 + sovBid(uint64(m.BiddingId)) + } + if m.AuctionId != 0 { + n += 1 + sovBid(uint64(m.AuctionId)) + } + l = len(m.AuctionStatus) + if l > 0 { + n += 1 + l + sovBid(uint64(l)) + } + l = m.OutflowTokenAmount.Size() + n += 1 + l + sovBid(uint64(l)) + l = m.InflowTokenAmount.Size() + n += 1 + l + sovBid(uint64(l)) + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovBid(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp) + n += 1 + l + sovBid(uint64(l)) + l = len(m.BiddingStatus) + if l > 0 { + n += 1 + l + sovBid(uint64(l)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovBid(uint64(m.AuctionMappingId)) + } + if m.AppId != 0 { + n += 1 + sovBid(uint64(m.AppId)) + } + return n +} + +func (m *DutchAutoBidParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Step.Size() + n += 1 + l + sovBid(uint64(l)) + l = m.WithdrawalFee.Size() + n += 1 + l + sovBid(uint64(l)) + l = m.ClosingFee.Size() + n += 1 + l + sovBid(uint64(l)) + return n +} + +func sovBid(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBid(x uint64) (n int) { + return sovBid(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *DutchBiddings) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DutchBiddings: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DutchBiddings: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingId", wireType) + } + m.BiddingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BiddingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuctionStatus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBid + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OutflowTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBid + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InflowTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingTimestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBid + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BiddingTimestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingStatus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BiddingStatus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipBid(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBid + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DutchAutoBidParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DutchAutoBidParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DutchAutoBidParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Step.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithdrawalFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WithdrawalFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClosingFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ClosingFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBid(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBid + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBid(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBid + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBid + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBid + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthBid + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBid + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBid + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBid = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBid = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBid = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/auctionsV2/types/genesis.pb.go b/x/auctionsV2/types/genesis.pb.go index 654a7496c..70e86b595 100644 --- a/x/auctionsV2/types/genesis.pb.go +++ b/x/auctionsV2/types/genesis.pb.go @@ -68,7 +68,7 @@ func (m *GenesisState) GetParams() Params { } func init() { - proto.RegisterType((*GenesisState)(nil), "comdex.newauc.v1beta1.GenesisState") + proto.RegisterType((*GenesisState)(nil), "comdex.auctionsV2.v1beta1.GenesisState") } func init() { @@ -76,21 +76,20 @@ func init() { } var fileDescriptor_eebc68c04739f45f = []byte{ - // 211 bytes of a gzipped FileDescriptorProto + // 207 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4f, 0xce, 0xcf, 0x4d, 0x49, 0xad, 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xff, 0xb3, 0x5a, 0x5c, 0xe6, 0x23, - 0x01, 0x00, 0x00, + 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x84, 0x28, 0xd4, 0x43, 0x28, 0xd4, 0x83, 0x2a, 0x94, 0x12, 0x49, + 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0xa4, 0xd4, 0x70, 0x9b, 0x5c, 0x90, + 0x58, 0x94, 0x98, 0x0b, 0x35, 0x58, 0xc9, 0x9f, 0x8b, 0xc7, 0x1d, 0x62, 0x53, 0x70, 0x49, 0x62, + 0x49, 0xaa, 0x90, 0x3d, 0x17, 0x1b, 0x44, 0x5e, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x51, + 0x0f, 0xa7, 0xcd, 0x7a, 0x01, 0x60, 0x85, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xb5, + 0x39, 0xf9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, + 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x49, 0x7a, 0x66, + 0x49, 0x46, 0x69, 0x12, 0xc8, 0x40, 0x7d, 0x88, 0xa1, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, + 0x89, 0x39, 0x50, 0xbe, 0x3e, 0x8a, 0x7b, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xee, + 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xff, 0x32, 0x82, 0x5d, 0x2b, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/gov.pb.go b/x/auctionsV2/types/gov.pb.go new file mode 100644 index 000000000..2ffbb8c17 --- /dev/null +++ b/x/auctionsV2/types/gov.pb.go @@ -0,0 +1,429 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/auctionsV2/v1beta1/gov.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type DutchAutoBidParamsProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + DutchAutoBidParams DutchAutoBidParams `protobuf:"bytes,3,opt,name=dutchAutoBidParams,proto3" json:"dutchAutoBidParams"` +} + +func (m *DutchAutoBidParamsProposal) Reset() { *m = DutchAutoBidParamsProposal{} } +func (m *DutchAutoBidParamsProposal) String() string { return proto.CompactTextString(m) } +func (*DutchAutoBidParamsProposal) ProtoMessage() {} +func (*DutchAutoBidParamsProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_11f3d7c5f2a28b27, []int{0} +} +func (m *DutchAutoBidParamsProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DutchAutoBidParamsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DutchAutoBidParamsProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DutchAutoBidParamsProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_DutchAutoBidParamsProposal.Merge(m, src) +} +func (m *DutchAutoBidParamsProposal) XXX_Size() int { + return m.Size() +} +func (m *DutchAutoBidParamsProposal) XXX_DiscardUnknown() { + xxx_messageInfo_DutchAutoBidParamsProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_DutchAutoBidParamsProposal proto.InternalMessageInfo + +func (m *DutchAutoBidParamsProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *DutchAutoBidParamsProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *DutchAutoBidParamsProposal) GetDutchAutoBidParams() DutchAutoBidParams { + if m != nil { + return m.DutchAutoBidParams + } + return DutchAutoBidParams{} +} + +func init() { + proto.RegisterType((*DutchAutoBidParamsProposal)(nil), "comdex.auctionsV2.v1beta1.DutchAutoBidParamsProposal") +} + +func init() { + proto.RegisterFile("comdex/auctionsV2/v1beta1/gov.proto", fileDescriptor_11f3d7c5f2a28b27) +} + +var fileDescriptor_11f3d7c5f2a28b27 = []byte{ + // 284 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, + 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0xcf, 0x2f, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x92, 0x84, 0x28, 0xd2, 0x43, 0x28, 0xd2, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, + 0xab, 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0xa4, 0xf0, 0x98, 0x9a, 0x94, 0x99, 0x02, 0x51, 0xa4, 0xf4, + 0x98, 0x91, 0x4b, 0xca, 0xa5, 0xb4, 0x24, 0x39, 0xc3, 0xb1, 0xb4, 0x24, 0xdf, 0x29, 0x33, 0x25, + 0x20, 0xb1, 0x28, 0x31, 0xb7, 0x38, 0xa0, 0x28, 0xbf, 0x20, 0xbf, 0x38, 0x31, 0x47, 0x48, 0x8d, + 0x8b, 0xb5, 0x24, 0xb3, 0x24, 0x27, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, 0x49, 0xe0, 0xd3, + 0x3d, 0x79, 0x9e, 0xca, 0xc4, 0xdc, 0x1c, 0x2b, 0x25, 0xb0, 0xb0, 0x52, 0x10, 0x44, 0x5a, 0xc8, + 0x82, 0x8b, 0x3b, 0x25, 0xb5, 0x38, 0xb9, 0x28, 0xb3, 0x00, 0x64, 0x95, 0x04, 0x13, 0x58, 0xb5, + 0xd8, 0xa7, 0x7b, 0xf2, 0x42, 0x10, 0xd5, 0x48, 0x92, 0x4a, 0x41, 0xc8, 0x4a, 0x85, 0x92, 0xb9, + 0x84, 0x52, 0x30, 0xec, 0x97, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x36, 0xd2, 0xd5, 0xc3, 0xe9, 0x67, + 0x3d, 0x4c, 0x47, 0x3b, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x84, 0xc5, 0x38, 0x27, 0xbf, 0x13, + 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, + 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x32, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, + 0x02, 0x59, 0xa4, 0x0f, 0xb1, 0x4c, 0x37, 0x3f, 0x2d, 0x2d, 0x33, 0x39, 0x33, 0x31, 0x07, 0xca, + 0xd7, 0x47, 0x09, 0xc1, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0xe0, 0x19, 0x03, 0x02, + 0x00, 0x00, 0xff, 0xff, 0x5c, 0xba, 0x28, 0x64, 0xb9, 0x01, 0x00, 0x00, +} + +func (m *DutchAutoBidParamsProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DutchAutoBidParamsProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DutchAutoBidParamsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.DutchAutoBidParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGov(dAtA []byte, offset int, v uint64) int { + offset -= sovGov(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *DutchAutoBidParamsProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = m.DutchAutoBidParams.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func sovGov(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGov(x uint64) (n int) { + return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *DutchAutoBidParamsProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DutchAutoBidParamsProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DutchAutoBidParamsProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DutchAutoBidParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DutchAutoBidParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGov(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGov + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGov + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGov + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGov + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGov + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGov + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/auctionsV2/types/params.pb.go b/x/auctionsV2/types/params.pb.go index 4335069d0..64e5f8ff0 100644 --- a/x/auctionsV2/types/params.pb.go +++ b/x/auctionsV2/types/params.pb.go @@ -59,7 +59,7 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo func init() { - proto.RegisterType((*Params)(nil), "comdex.newauc.v1beta1.Params") + proto.RegisterType((*Params)(nil), "comdex.auctionsV2.v1beta1.Params") } func init() { @@ -67,18 +67,18 @@ func init() { } var fileDescriptor_5122d8002bd05fc0 = []byte{ - // 171 bytes of a gzipped FileDescriptorProto + // 167 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4b, 0xce, 0xcf, 0x4d, 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, - 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xa8, 0xd3, 0xcb, 0x4b, 0x2d, 0x4f, 0x2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19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x10, + 0x5b, 0x74, 0xf3, 0xd3, 0xd2, 0x32, 0x93, 0x33, 0x13, 0x73, 0xa0, 0x7c, 0x7d, 0x14, 0xf7, 0x95, + 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xad, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x8d, + 0x26, 0xbe, 0x52, 0xc1, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index 4a15c628b..8ecdcde08 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -111,8 +111,8 @@ func (m *QueryParamsResponse) GetParams() Params { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "comdex.newauc.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "comdex.newauc.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryParamsResponse") } func init() { @@ -120,27 +120,27 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 317 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xbf, 0x4a, 0x7b, 0x31, - 0x14, 0xc7, 0x6f, 0x7e, 0xfc, 0xec, 0x10, 0xb7, 0x58, 0x41, 0x8a, 0x46, 0x29, 0xd4, 0x3f, 0x85, - 0xde, 0xd0, 0xea, 0xe6, 0xd6, 0x07, 0x10, 0xed, 0xe0, 0xe0, 0x96, 0x7b, 0x4d, 0x63, 0xa0, 0xcd, - 0x49, 0x9b, 0x5c, 0xb5, 0xab, 0x0f, 0x20, 0x82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, 0xeb, 0xad, - 0x87, 0xd7, 0xcf, 0xe7, 0x7f, 0x07, 0xa4, 0xc1, 0x42, 0xa6, 0x05, 0xfd, 0xbe, 0xca, 0x15, 0x1f, - 0xc4, 0x3b, 0x0b, 0x8e, 0xb8, 0x8a, 0xee, 0xd9, 0x74, 0x4e, 0xd1, 0x6c, 0x4e, 0xd1, 0xc7, 0x9c, - 0xa2, 0xa7, 0x05, 0x4d, 0x66, 0x0b, 0x9a, 0xbc, 0x2d, 0x68, 0x72, 0x75, 0x22, 0x95, 0xbb, 0x29, - 0xb2, 0x65, 0xeb, 0x32, 0xd5, 0xca, 0x8e, 0xdd, 0xc4, 0x08, 0x9b, 0x55, 0xfc, 0x6e, 0x8f, 0xbf, - 0x02, 0x00, 0x00, 0xff, 0xff, 0x56, 0xeb, 0x62, 0x37, 0x23, 0x02, 0x00, 0x00, + // 316 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xb1, 0x4a, 0x73, 0x31, + 0x14, 0xc7, 0x6f, 0x3e, 0x3e, 0x3b, 0x5c, 0xb7, 0xd8, 0x41, 0x8b, 0x44, 0x2d, 0x54, 0x45, 0x68, + 0x42, 0xab, 0xbb, 0xd0, 0x07, 0x10, 0xed, 0xd0, 0xc1, 0x2d, 0xf7, 0x9a, 0xc6, 0x40, 0x9b, 0x93, + 0x36, 0xb9, 0x6a, 0x57, 0x9f, 0x40, 0x10, 0x9c, 0x7d, 0x9c, 0x8e, 0x05, 0x17, 0x27, 0x91, 0xd6, + 0x07, 0x91, 0x26, 0x41, 0x29, 0x72, 0xc5, 0x2d, 0x39, 0xf9, 0xfd, 0xfe, 0xe7, 0xe4, 0xa4, 0x8d, + 0x1c, 0x86, 0x57, 0xe2, 0x8e, 0xf1, 0x22, 0x77, 0x0a, 0xb4, 0xed, 0xb5, 0xd9, 0x4d, 0x2b, 0x13, + 0x8e, 0xb7, 0xd8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, 0x20, 0xc9, 0xe5, 0x89, 0x54, 0xee, 0xba, 0xc8, + 0x96, 0xed, 0xcb, 0xa2, 0x56, 0xf6, 0xed, 0x26, 0x46, 0xd8, 0xac, 0xe2, 0xf7, 0x7c, 0xfc, 0x19, + 0x00, 0x00, 0xff, 0xff, 0x32, 0xff, 0x8b, 0xae, 0x33, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -168,7 +168,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/comdex.newauc.v1beta1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -202,7 +202,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/comdex.newauc.v1beta1.Query/Params", + FullMethod: "/comdex.auctionsV2.v1beta1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -211,7 +211,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.newauc.v1beta1.Query", + ServiceName: "comdex.auctionsV2.v1beta1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/x/auctionsV2/types/tx.pb.go b/x/auctionsV2/types/tx.pb.go index 8dbe7d6ce..e96bb52ed 100644 --- a/x/auctionsV2/types/tx.pb.go +++ b/x/auctionsV2/types/tx.pb.go @@ -28,17 +28,16 @@ func init() { } var fileDescriptor_2c216a24ef98c1b4 = []byte{ - // 148 bytes of a gzipped FileDescriptorProto + // 144 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b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, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, + 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x93, 0xf4, 0xcc, 0x92, + 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, 0x31, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, + 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0x8a, 0xe5, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, + 0x8b, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xeb, 0xa1, 0xe8, 0xb6, 0x9e, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -76,7 +75,7 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.newauc.v1beta1.Msg", + ServiceName: "comdex.auctionsV2.v1beta1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{}, diff --git a/x/liquidationsV2/keeper/keeper.go b/x/liquidationsV2/keeper/keeper.go index bdb131c7e..d882a0c0c 100644 --- a/x/liquidationsV2/keeper/keeper.go +++ b/x/liquidationsV2/keeper/keeper.go @@ -66,15 +66,15 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } +func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { + return ctx.KVStore(k.storeKey) +} // List of functions to be created - - - //1. ABCI //2. Liquidate -//3. Harbor +//3. Harbor //4. Commodo // MsgServer @@ -82,31 +82,26 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { // 6. CommodoLiquidateKeeper //7. ExternalLiquidateKeeper - //8. Liquidation Whitelisting Proposal - - - // List of auction functions to be created // 1. Auction Activator // 2.Dutch Activator -// 3.English Activator +// 3.English Activator -//4. User Biddings +//4. User Biddings //5. DEPOSIT BID //6. CANCEL BID/ UPDATE BID //7. TRIGGER BID (ABCI) -//8. WITHDRAW BID +//8. WITHDRAW BID //9. RESTART AUCTION -//16. END AUCTION +//16. END AUCTION //10. HARBOR AUCTION TRIGGER //11. HARBOR AUCTION END TRIGGER //12. VAULT AUCTION END TRIGGER //13. BORROW AUCTION END TRIGGER //14. EXTERNAL APPS AUCTION END TRIGGER //15. INTERNAL LIQUIDATORS INCENTIVISING LOGIC TRIGGER - diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index a44190263..c02487002 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -449,3 +449,29 @@ func (k Keeper) MsgLiquidate(ctx sdk.Context, liquidator string, liqType, id uin // TODO: send liquidation bonus to liquidator address logic return nil } + + +func (k Keeper) SetLiquidationWhiteListing(ctx sdk.Context, liquidationWhiteListing types.LiquidationWhiteListing) { + var ( + store = k.Store(ctx) + key = types.LiquidationWhiteListingKey(liquidationWhiteListing.AppId) + value = k.cdc.MustMarshal(&liquidationWhiteListing) + ) + + store.Set(key, value) +} + +func (k Keeper) GetLiquidationWhiteListing(ctx sdk.Context, appId uint64) (liquidationWhiteListing types.LiquidationWhiteListing, found bool) { + var ( + store = k.Store(ctx) + key = types.LiquidationWhiteListingKey(appId) + value = store.Get(key) + ) + + if value == nil { + return liquidationWhiteListing, false + } + + k.cdc.MustUnmarshal(value, &liquidationWhiteListing) + return liquidationWhiteListing, true +} \ No newline at end of file diff --git a/x/liquidationsV2/types/keys.go b/x/liquidationsV2/types/keys.go index c32356a43..4593e3e8f 100644 --- a/x/liquidationsV2/types/keys.go +++ b/x/liquidationsV2/types/keys.go @@ -25,7 +25,7 @@ var ( LiquidationOffsetHolderKeyPrefix = []byte{0x02} LockedVaultIDKey = []byte{0x03} LockedVaultKeyPrefix = []byte{0x04} - LockedVaultDataKeyHistory = []byte{0x05} + LiquidationWhiteListingKeyPrefix = []byte{0x05} ) // LengthPrefixString returns length-prefixed bytes representation @@ -56,3 +56,7 @@ func LockedVaultKey(appID, lockedVaultID uint64) []byte { func LockedVaultKeyByApp(appID uint64) []byte { return append(LockedVaultKeyPrefix, sdk.Uint64ToBigEndian(appID)...) } + +func LiquidationWhiteListingKey(appId uint64) []byte { + return append(LiquidationWhiteListingKeyPrefix, sdk.Uint64ToBigEndian(appId)...) +} From 085f780159da82cda8fe8afd8ef5cefe0cee62fb Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 11 Apr 2023 17:13:44 +0530 Subject: [PATCH 023/155] minor refactor --- .../liquidationsV2/v1beta1/liquidate.proto | 6 +- x/liquidationsV2/keeper/liquidate.go | 9 +- x/liquidationsV2/types/liquidate.pb.go | 177 +++++++++++------- 3 files changed, 120 insertions(+), 72 deletions(-) diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index e9a19dff7..2c45d8d6f 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -113,9 +113,9 @@ message LockedVault { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.moretags) = "yaml:\"fee_to_be_collected\""]; - - - + string structure_type = 17 [ + (gogoproto.customname) = "StructureType", + (gogoproto.moretags) = "yaml:\"structure_type\""]; //updated_amount_out = amount_out + interest_accumulated + opening_fee_accumulated // // + closing_fee_accumulated diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index c02487002..78696bae3 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -151,20 +151,18 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair TargetDebt: AmountOut, LiquidationTimestamp: ctx.BlockTime(), FeeToBeCollected: feesToBeCollected, - type: "vault" IsInternalKeeper: false, InternalKeeperAddress: "", IsExternalKeeper: "", ExternalKeeperAddress: "", + StructureType: "vault", } k.SetLockedVault(ctx, value) k.SetLockedVaultID(ctx, value.LockedVaultId) //Call auction activator //struct for auction will stay same for english and dutch - // based on type recieved from - - + // based on type recieved from return nil } @@ -450,7 +448,6 @@ func (k Keeper) MsgLiquidate(ctx sdk.Context, liquidator string, liqType, id uin return nil } - func (k Keeper) SetLiquidationWhiteListing(ctx sdk.Context, liquidationWhiteListing types.LiquidationWhiteListing) { var ( store = k.Store(ctx) @@ -474,4 +471,4 @@ func (k Keeper) GetLiquidationWhiteListing(ctx sdk.Context, appId uint64) (liqui k.cdc.MustUnmarshal(value, &liquidationWhiteListing) return liquidationWhiteListing, true -} \ No newline at end of file +} diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index be375846f..5ad9c428e 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -30,7 +30,10 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type LiquidationWhiteListing struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + //------------Auction Types defn + // 0 auction type - "dutch" + //1 auction type - "english" AuctionType uint64 `protobuf:"varint,2,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` } @@ -121,6 +124,7 @@ type LockedVault struct { IsExternalKeeper string `protobuf:"bytes,14,opt,name=is_external_keeper,json=isExternalKeeper,proto3" json:"is_external_keeper,omitempty" yaml:"is_external_keeper"` ExternalKeeperAddress string `protobuf:"bytes,15,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` FeeToBeCollected github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,16,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee_to_be_collected" yaml:"fee_to_be_collected"` + StructureType string `protobuf:"bytes,17,opt,name=structure_type,json=structureType,proto3" json:"structure_type,omitempty" yaml:"structure_type"` } func (m *LockedVault) Reset() { *m = LockedVault{} } @@ -167,68 +171,70 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 967 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xbf, 0x6e, 0xdb, 0x46, - 0x18, 0x17, 0xdd, 0xd8, 0xb5, 0x4e, 0x96, 0xad, 0xd0, 0x76, 0xcc, 0x08, 0x31, 0x4f, 0x25, 0x50, - 0xc3, 0x8b, 0xc5, 0x3a, 0x59, 0x8a, 0x76, 0x89, 0xe4, 0xa4, 0xa8, 0x50, 0xa3, 0x0a, 0x08, 0x23, - 0x05, 0x32, 0x94, 0x3d, 0x91, 0x27, 0xf9, 0x60, 0x8a, 0xc7, 0x92, 0xc7, 0xd4, 0x7e, 0x8a, 0xa6, - 0x53, 0x5f, 0xa1, 0x40, 0x5f, 0xa2, 0xa3, 0xc7, 0x8c, 0x45, 0x87, 0x6b, 0x4b, 0x6f, 0x1d, 0xf9, - 0x04, 0x05, 0xef, 0x4e, 0x7f, 0xa8, 0x28, 0x08, 0xb4, 0x58, 0xe6, 0x7d, 0xbf, 0x3f, 0xdf, 0x8f, - 0xfc, 0xf8, 0x81, 0xe0, 0xc4, 0xa3, 0x63, 0x1f, 0x5f, 0xdb, 0x01, 0xf9, 0x31, 0x25, 0x3e, 0x62, - 0x84, 0x86, 0xc9, 0xcb, 0xc7, 0xf6, 0xeb, 0xd3, 0x01, 0x66, 0xe8, 0x74, 0x7a, 0x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0x8e, 0x90, 0xe8, 0x85, 0x39, 0x87, - 0x0d, 0x35, 0x0c, 0x13, 0x51, 0xcb, 0xd9, 0x44, 0xaa, 0xaa, 0x53, 0x00, 0xd4, 0x39, 0x4d, 0x99, - 0xf1, 0xb1, 0x70, 0x7b, 0xb1, 0xb2, 0x5b, 0x55, 0xba, 0xf5, 0x53, 0x96, 0x73, 0x78, 0xbf, 0x64, - 0x47, 0x53, 0x66, 0x39, 0x2a, 0x50, 0x3f, 0x65, 0xfa, 0x1f, 0x1a, 0x80, 0x93, 0xe9, 0xf2, 0x68, - 0x10, 0x20, 0x86, 0x63, 0x14, 0x90, 0x44, 0x8c, 0xa1, 0x1b, 0x17, 0x3f, 0xc6, 0xa6, 0x68, 0xe3, - 0x7a, 0x85, 0x36, 0x9e, 0x61, 0x2f, 0xe3, 0xf0, 0xd1, 0x99, 0x14, 0x3e, 0x53, 0xba, 0x13, 0x59, - 0xa7, 0xf8, 0x9b, 0x73, 0x78, 0x24, 0x3b, 0xfb, 0x80, 0xbd, 0xe5, 0x1c, 0x7a, 0x65, 0x1d, 0x54, - 0x12, 0xd2, 0x7f, 0xd7, 0x40, 0x73, 0xc6, 0x75, 0x19, 0x75, 0x07, 0xd8, 0x55, 0xef, 0x16, 0xf6, - 0x8d, 0xaa, 0xe8, 0x3e, 0x5c, 0xf9, 0x26, 0x1e, 0xcc, 0xec, 0x2e, 0x68, 0x17, 0x77, 0x26, 0x82, - 0x39, 0x87, 0x9f, 0xa8, 0xc6, 0xdf, 0x6b, 0x6a, 0x39, 0x07, 0xde, 0x72, 0xb6, 0x9e, 0x80, 0x1a, - 0x43, 0xf1, 0x08, 0x33, 0xd7, 0xc7, 0x03, 0x66, 0x00, 0xd1, 0x9d, 0xb3, 0x72, 0x77, 0xe0, 0x42, - 0x88, 0x3c, 0xc3, 0x83, 0xe2, 0x19, 0xeb, 0xb2, 0xa1, 0x39, 0x61, 0xcb, 0x01, 0x6c, 0x8a, 0xd0, - 0x7f, 0xd1, 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, 0xcf, 0x1a, 0xd8, 0x1d, 0x62, 0xac, 0xa6, 0xbc, 0x98, 0x6c, - 0xec, 0x31, 0xec, 0x1b, 0x0d, 0xe1, 0xf8, 0xc3, 0xca, 0xc3, 0xdb, 0xf8, 0x0a, 0xe3, 0xe2, 0xad, - 0x38, 0x9b, 0x28, 0xe5, 0x1c, 0x36, 0x65, 0x6b, 0x4b, 0x6c, 0x2c, 0xa7, 0x31, 0x5c, 0xc0, 0x77, - 0x5f, 0xdd, 0xfe, 0x6b, 0x56, 0x7e, 0xcb, 0xcc, 0xca, 0x6d, 0x66, 0x6a, 0x6f, 0x33, 0x53, 0xfb, - 0x27, 0x33, 0xb5, 0x37, 0x77, 0x66, 0xe5, 0xed, 0x9d, 0x59, 0xf9, 0xf3, 0xce, 0xac, 0xbc, 0xfa, - 0xbc, 0xd4, 0x4d, 0xf1, 0xad, 0x71, 0x42, 0x87, 0x43, 0xe2, 0x11, 0x14, 0xa8, 0x6b, 0xfb, 0x9d, - 0x8f, 0x15, 0xd1, 0xe3, 0x60, 0x43, 0xbc, 0x04, 0x4f, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x7d, - 0x57, 0xa4, 0xca, 0xd2, 0x08, 0x00, 0x00, + // 1002 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcd, 0x6e, 0xe3, 0x44, + 0x1c, 0x8f, 0xcb, 0xb6, 0xb4, 0x93, 0x7e, 0xa4, 0xd3, 0x76, 0xeb, 0x8d, 0xb6, 0x9e, 0x62, 0x89, + 0xaa, 0x42, 0x6a, 0x42, 0x77, 0x2f, 0x08, 0x2e, 0xdb, 0x74, 0x17, 0x11, 0x51, 0xd1, 0xc5, 0x54, + 0x8b, 0xb4, 0x07, 0xcc, 0xc4, 0x9e, 0xa4, 0xa3, 0x3a, 0x9e, 0x60, 0x8f, 0x97, 0xf6, 0x29, 0x58, + 0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 0x75, 0x1f, 0xcf, 0x7d, 0x11, 0x77, 0xc7, 0x76, 0x17, 0xac, 0x45, 0x4e, + 0x86, 0x82, 0x85, 0x40, 0x1f, 0x98, 0xc6, 0xdf, 0x69, 0xea, 0x7a, 0xbb, 0xc1, 0x6c, 0x36, 0x4c, + 0x41, 0x95, 0xe3, 0xa4, 0x47, 0xb8, 0x1f, 0x92, 0x0e, 0xb7, 0x81, 0xea, 0xce, 0x9b, 0xbb, 0x3b, + 0x70, 0xa1, 0x44, 0x9e, 0x92, 0x8e, 0xbc, 0xc7, 0x50, 0x37, 0x34, 0x21, 0xec, 0x7a, 0x80, 0x8f, + 0x10, 0xf0, 0x67, 0x0b, 0xec, 0x4c, 0x4c, 0x5a, 0x7f, 0x34, 0x37, 0xed, 0xea, 0xbe, 0x75, 0x58, + 0x7d, 0x54, 0x6f, 0xe8, 0xc9, 0xda, 0x18, 0x4e, 0xd6, 0xc6, 0xc5, 0x10, 0xd1, 0x7a, 0x22, 0x7b, + 0xcb, 0x05, 0xda, 0x9e, 0x98, 0x4f, 0xa3, 0x6a, 0x21, 0xd0, 0x43, 0xed, 0x3d, 0x53, 0xde, 0x7d, + 0xfd, 0x37, 0xb2, 0xbc, 0xed, 0x68, 0x06, 0x13, 0x7e, 0x07, 0x20, 0x4d, 0x7d, 0x1a, 0x73, 0x92, + 0xc8, 0x19, 0x72, 0x45, 0xc8, 0x80, 0x24, 0xf6, 0xea, 0xbe, 0x75, 0xb8, 0xdc, 0xfa, 0x38, 0x17, + 0xa8, 0xd6, 0x4e, 0xdb, 0xa6, 0xf8, 0xa5, 0xaa, 0x15, 0x02, 0xd9, 0x66, 0x84, 0x68, 0xde, 0x98, + 0xe6, 0x7a, 0x35, 0x3a, 0x85, 0x86, 0x29, 0xd8, 0x9d, 0x12, 0xf7, 0x71, 0x18, 0x26, 0x24, 0x4d, + 0xed, 0x35, 0x75, 0xd1, 0x3f, 0xcb, 0x05, 0xda, 0x29, 0x93, 0x4e, 0x34, 0xa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ad, 0xef, 0x1f, 0x15, 0xbb, 0xb3, 0xa4, 0x9e, 0xab, 0xc7, 0xff, 0x05, 0x00, 0x00, + 0xff, 0xff, 0xf0, 0x84, 0x53, 0xe3, 0x25, 0x09, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -312,6 +318,15 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.StructureType) > 0 { + i -= len(m.StructureType) + copy(dAtA[i:], m.StructureType) + i = encodeVarintLiquidate(dAtA, i, uint64(len(m.StructureType))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } { size := m.FeeToBeCollected.Size() i -= size @@ -532,6 +547,10 @@ func (m *LockedVault) Size() (n int) { } l = m.FeeToBeCollected.Size() n += 2 + l + sovLiquidate(uint64(l)) + l = len(m.StructureType) + if l > 0 { + n += 2 + l + sovLiquidate(uint64(l)) + } return n } @@ -1188,6 +1207,38 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StructureType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StructureType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipLiquidate(dAtA[iNdEx:]) From 0b693459e04b714bb47163d18cdf35520c61a040 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Tue, 11 Apr 2023 17:14:51 +0530 Subject: [PATCH 024/155] auction-structuring --- x/auctionsV2/expected/keeper.go | 115 +++++++++++++++++++++++++++ x/auctionsV2/keeper/auctions.go | 9 ++- x/liquidationsV2/keeper/liquidate.go | 4 +- 3 files changed, 124 insertions(+), 4 deletions(-) create mode 100644 x/auctionsV2/expected/keeper.go diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go new file mode 100644 index 000000000..70c960f4e --- /dev/null +++ b/x/auctionsV2/expected/keeper.go @@ -0,0 +1,115 @@ +package expected + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + assettypes "github.com/comdex-official/comdex/x/asset/types" + auctiontypes "github.com/comdex-official/comdex/x/auction/types" + "github.com/comdex-official/comdex/x/collector/types" + esmtypes "github.com/comdex-official/comdex/x/esm/types" + lendtypes "github.com/comdex-official/comdex/x/lend/types" + liquidationtypes "github.com/comdex-official/comdex/x/liquidation/types" + markettypes "github.com/comdex-official/comdex/x/market/types" + vaulttypes "github.com/comdex-official/comdex/x/vault/types" +) + +type AccountKeeper interface { + GetModuleAccount(ctx sdk.Context, name string) authtypes.ModuleAccountI + GetModuleAddress(name string) sdk.AccAddress +} + +type BankKeeper interface { + MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error + BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error + SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin +} + +type MarketKeeper interface { + CalcAssetPrice(ctx sdk.Context, id uint64, amt sdk.Int) (price sdk.Dec, err error) + GetTwa(ctx sdk.Context, id uint64) (twa markettypes.TimeWeightedAverage, found bool) +} + +type LiquidationKeeper interface { + SetFlagIsAuctionInProgress(ctx sdk.Context, appID, id uint64, flag bool) error + SetFlagIsAuctionComplete(ctx sdk.Context, appID, id uint64, flag bool) error + GetLockedVaults(ctx sdk.Context) (lockedVaults []liquidationtypes.LockedVault) + GetLockedVault(ctx sdk.Context, appID, id uint64) (lockedVault liquidationtypes.LockedVault, found bool) + SetLockedVault(ctx sdk.Context, lockedVault liquidationtypes.LockedVault) + DeleteLockedVault(ctx sdk.Context, appID, id uint64) + CreateLockedVaultHistory(ctx sdk.Context, lockedVault liquidationtypes.LockedVault) error + UnLiquidateLockedBorrows(ctx sdk.Context, appID, id uint64, dutchAuction auctiontypes.DutchAuction) error + GetLiquidationWhiteListing(ctx sdk.Context, appID uint64) +} + +type AssetKeeper interface { + GetAsset(ctx sdk.Context, id uint64) (assettypes.Asset, bool) + GetPair(ctx sdk.Context, id uint64) (assettypes.Pair, bool) + GetApps(ctx sdk.Context) (apps []assettypes.AppData, found bool) + GetApp(ctx sdk.Context, id uint64) (app assettypes.AppData, found bool) + GetPairsVault(ctx sdk.Context, id uint64) (pairs assettypes.ExtendedPairVault, found bool) +} + +type VaultKeeper interface { + GetAppExtendedPairVaultMappingData(ctx sdk.Context, appMappingID uint64, pairVaultsID uint64) (appExtendedPairVaultData vaulttypes.AppExtendedPairVaultMappingData, found bool) + SetAppExtendedPairVaultMappingData(ctx sdk.Context, appExtendedPairVaultData vaulttypes.AppExtendedPairVaultMappingData) + UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) + UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) + DeleteUserVaultExtendedPairMapping(ctx sdk.Context, from string, appMapping uint64, extendedPairVault uint64) + CreateNewVault(ctx sdk.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdk.Int, AmountOut sdk.Int) error + GetUserAppExtendedPairMappingData(ctx sdk.Context, from string, appMapping uint64, extendedPairVault uint64) (userVaultAssetData vaulttypes.OwnerAppExtendedPairVaultMappingData, found bool) + GetUserAppMappingData(ctx sdk.Context, from string, appMapping uint64) (userVaultAssetData []vaulttypes.OwnerAppExtendedPairVaultMappingData, found bool) + // CheckUserAppToExtendedPairMapping(ctx sdk.Context, userVaultAssetData vaulttypes.UserVaultAssetMapping, extendedPairVaultID uint64, appMappingID uint64) (vaultID uint64, found bool) + SetVault(ctx sdk.Context, vault vaulttypes.Vault) + GetVault(ctx sdk.Context, id uint64) (vault vaulttypes.Vault, found bool) + GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdk.Dec, amt1 sdk.Int, id2 uint64, rate2 sdk.Dec) (sdk.Dec, sdk.Int, error) + GetLengthOfVault(ctx sdk.Context) uint64 + SetLengthOfVault(ctx sdk.Context, length uint64) +} + +type CollectorKeeper interface { + GetAppidToAssetCollectorMapping(ctx sdk.Context, appID, assetID uint64) (appAssetCollectorData types.AppToAssetIdCollectorMapping, found bool) + UpdateCollector(ctx sdk.Context, appID, assetID uint64, CollectedStabilityFee, CollectedClosingFee, CollectedOpeningFee, LiquidationRewardsCollected sdk.Int) error + // SetCollectorLookupTable(ctx sdk.Context, records ...types.CollectorLookupTable) error + GetCollectorLookupTable(ctx sdk.Context, appID, assetID uint64) (collectorLookup types.CollectorLookupTableData, found bool) + GetAuctionMappingForApp(ctx sdk.Context, appID, assetID uint64) (collectorAuctionLookupTable types.AppAssetIdToAuctionLookupTable, found bool) + GetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64) (netFeeData types.AppAssetIdToFeeCollectedData, found bool) + GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, amount sdk.Int) (sdk.Int, error) + SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdk.Int) error + SetAuctionMappingForApp(ctx sdk.Context, records types.AppAssetIdToAuctionLookupTable) error + GetAllAuctionMappingForApp(ctx sdk.Context) (collectorAuctionLookupTable []types.AppAssetIdToAuctionLookupTable, found bool) +} + +type TokenMintKeeper interface { + MintNewTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, address string, amount sdk.Int) error + BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, amount sdk.Int) error +} + +type EsmKeeper interface { + GetKillSwitchData(ctx sdk.Context, appID uint64) (esmtypes.KillSwitchParams, bool) + GetESMStatus(ctx sdk.Context, id uint64) (esmStatus esmtypes.ESMStatus, found bool) + CalcDollarValueOfToken(ctx sdk.Context, rate uint64, amt sdk.Int, decimals sdk.Int) (price sdk.Dec) + SetAssetToAmount(ctx sdk.Context, assetToAmount esmtypes.AssetToAmount) + GetDataAfterCoolOff(ctx sdk.Context, id uint64) (esmDataAfterCoolOff esmtypes.DataAfterCoolOff, found bool) + SetDataAfterCoolOff(ctx sdk.Context, esmDataAfterCoolOff esmtypes.DataAfterCoolOff) + GetSnapshotOfPrices(ctx sdk.Context, appID, assetID uint64) (price uint64, found bool) +} + +type LendKeeper interface { + GetBorrow(ctx sdk.Context, id uint64) (borrow lendtypes.BorrowAsset, found bool) + GetLendPair(ctx sdk.Context, id uint64) (pair lendtypes.Extended_Pair, found bool) + GetAssetRatesParams(ctx sdk.Context, assetID uint64) (assetRatesStats lendtypes.AssetRatesParams, found bool) + VerifyCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset, liquidationThreshold sdk.Dec) error + CalculateCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset) (sdk.Dec, error) + GetLend(ctx sdk.Context, id uint64) (lend lendtypes.LendAsset, found bool) + GetPool(ctx sdk.Context, id uint64) (pool lendtypes.Pool, found bool) + GetAddAuctionParamsData(ctx sdk.Context, appID uint64) (auctionParams lendtypes.AuctionParams, found bool) + ModuleBalance(ctx sdk.Context, moduleName string, denom string) sdk.Int + UpdateReserveBalances(ctx sdk.Context, assetID uint64, moduleName string, payment sdk.Coin, inc bool) error + SetLend(ctx sdk.Context, lend lendtypes.LendAsset) + SetAllReserveStatsByAssetID(ctx sdk.Context, allReserveStats lendtypes.AllReserveStats) + GetAllReserveStatsByAssetID(ctx sdk.Context, id uint64) (allReserveStats lendtypes.AllReserveStats, found bool) +} diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index f7289e350..70f2d9ac5 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -10,11 +10,16 @@ import( -func (k Keeper) AuctionActivator(ctx sdk.Context,liquidationData liquidationtypes.LockedVault) error { +func (k Keeper) AuctionActivator(ctx sdk.Context,lockedVault liquidationtypes.LockedVault) error { + + //Using app id provided in the lockedVault Struct + // Using the app id to fetch the app data whitelisted in the liquidation module to find the auction type selected by the app. + appWhitelistedData:=k.liquidation.GetLiquidationWhiteListing(ctx,lockedVault.AppId) - auctionType:=liquidationData.AppId + + return nil } \ No newline at end of file diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index c02487002..ffb8d96d0 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -151,7 +151,7 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair TargetDebt: AmountOut, LiquidationTimestamp: ctx.BlockTime(), FeeToBeCollected: feesToBeCollected, - type: "vault" + IsInternalKeeper: false, InternalKeeperAddress: "", IsExternalKeeper: "", @@ -163,7 +163,7 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair //Call auction activator //struct for auction will stay same for english and dutch // based on type recieved from - + return nil From bab634bc319e6257c458afd7761d6f0d3014c0a3 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Tue, 11 Apr 2023 17:20:27 +0530 Subject: [PATCH 025/155] auction-structuring --- x/auctionsV2/keeper/keeper.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index 547801c04..c0f531a84 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -4,22 +4,22 @@ import ( "context" "fmt" - "github.com/tendermint/tendermint/libs/log" - - "github.com/comdex-official/comdex/x/auctionsV2/types" + "github.com/comdex-official/comdex/x/liquidationsV2/expected" + "github.com/comdex-official/comdex/x/liquidationsV2/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/tendermint/tendermint/libs/log" ) type ( Keeper struct { - cdc codec.BinaryCodec - storeKey sdk.StoreKey - memKey sdk.StoreKey - paramstore paramtypes.Subspace - - bankKeeper types.BankKeeper + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey + paramstore paramtypes.Subspace + liquidation expected.LiquidationV2Keeper + bankKeeper types.BankKeeper } ) @@ -33,7 +33,7 @@ func NewKeeper( storeKey, memKey sdk.StoreKey, ps paramtypes.Subspace, - + liquidation expected.LiquidationV2Keeper, bankKeeper types.BankKeeper, ) Keeper { // set KeyTable if it has not already been set @@ -47,6 +47,7 @@ func NewKeeper( storeKey: storeKey, memKey: memKey, paramstore: ps, + liquidation: liquidation, bankKeeper: bankKeeper, } } From 4be820e1c1c7e4e8d3ebae0852ea2c7498193414 Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 11 Apr 2023 17:30:53 +0530 Subject: [PATCH 026/155] updating expected keepers --- x/auctionsV2/expected/keeper.go | 111 +------------------------------- x/auctionsV2/keeper/auctions.go | 20 ++---- x/auctionsV2/keeper/keeper.go | 29 +++++++++ 3 files changed, 37 insertions(+), 123 deletions(-) diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go index 70c960f4e..47e06596f 100644 --- a/x/auctionsV2/expected/keeper.go +++ b/x/auctionsV2/expected/keeper.go @@ -1,115 +1,10 @@ package expected import ( + "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - - assettypes "github.com/comdex-official/comdex/x/asset/types" - auctiontypes "github.com/comdex-official/comdex/x/auction/types" - "github.com/comdex-official/comdex/x/collector/types" - esmtypes "github.com/comdex-official/comdex/x/esm/types" - lendtypes "github.com/comdex-official/comdex/x/lend/types" - liquidationtypes "github.com/comdex-official/comdex/x/liquidation/types" - markettypes "github.com/comdex-official/comdex/x/market/types" - vaulttypes "github.com/comdex-official/comdex/x/vault/types" ) -type AccountKeeper interface { - GetModuleAccount(ctx sdk.Context, name string) authtypes.ModuleAccountI - GetModuleAddress(name string) sdk.AccAddress -} - -type BankKeeper interface { - MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error - BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error - SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin -} - -type MarketKeeper interface { - CalcAssetPrice(ctx sdk.Context, id uint64, amt sdk.Int) (price sdk.Dec, err error) - GetTwa(ctx sdk.Context, id uint64) (twa markettypes.TimeWeightedAverage, found bool) -} - -type LiquidationKeeper interface { - SetFlagIsAuctionInProgress(ctx sdk.Context, appID, id uint64, flag bool) error - SetFlagIsAuctionComplete(ctx sdk.Context, appID, id uint64, flag bool) error - GetLockedVaults(ctx sdk.Context) (lockedVaults []liquidationtypes.LockedVault) - GetLockedVault(ctx sdk.Context, appID, id uint64) (lockedVault liquidationtypes.LockedVault, found bool) - SetLockedVault(ctx sdk.Context, lockedVault liquidationtypes.LockedVault) - DeleteLockedVault(ctx sdk.Context, appID, id uint64) - CreateLockedVaultHistory(ctx sdk.Context, lockedVault liquidationtypes.LockedVault) error - UnLiquidateLockedBorrows(ctx sdk.Context, appID, id uint64, dutchAuction auctiontypes.DutchAuction) error - GetLiquidationWhiteListing(ctx sdk.Context, appID uint64) -} - -type AssetKeeper interface { - GetAsset(ctx sdk.Context, id uint64) (assettypes.Asset, bool) - GetPair(ctx sdk.Context, id uint64) (assettypes.Pair, bool) - GetApps(ctx sdk.Context) (apps []assettypes.AppData, found bool) - GetApp(ctx sdk.Context, id uint64) (app assettypes.AppData, found bool) - GetPairsVault(ctx sdk.Context, id uint64) (pairs assettypes.ExtendedPairVault, found bool) -} - -type VaultKeeper interface { - GetAppExtendedPairVaultMappingData(ctx sdk.Context, appMappingID uint64, pairVaultsID uint64) (appExtendedPairVaultData vaulttypes.AppExtendedPairVaultMappingData, found bool) - SetAppExtendedPairVaultMappingData(ctx sdk.Context, appExtendedPairVaultData vaulttypes.AppExtendedPairVaultMappingData) - UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) - UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) - DeleteUserVaultExtendedPairMapping(ctx sdk.Context, from string, appMapping uint64, extendedPairVault uint64) - CreateNewVault(ctx sdk.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdk.Int, AmountOut sdk.Int) error - GetUserAppExtendedPairMappingData(ctx sdk.Context, from string, appMapping uint64, extendedPairVault uint64) (userVaultAssetData vaulttypes.OwnerAppExtendedPairVaultMappingData, found bool) - GetUserAppMappingData(ctx sdk.Context, from string, appMapping uint64) (userVaultAssetData []vaulttypes.OwnerAppExtendedPairVaultMappingData, found bool) - // CheckUserAppToExtendedPairMapping(ctx sdk.Context, userVaultAssetData vaulttypes.UserVaultAssetMapping, extendedPairVaultID uint64, appMappingID uint64) (vaultID uint64, found bool) - SetVault(ctx sdk.Context, vault vaulttypes.Vault) - GetVault(ctx sdk.Context, id uint64) (vault vaulttypes.Vault, found bool) - GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdk.Dec, amt1 sdk.Int, id2 uint64, rate2 sdk.Dec) (sdk.Dec, sdk.Int, error) - GetLengthOfVault(ctx sdk.Context) uint64 - SetLengthOfVault(ctx sdk.Context, length uint64) -} - -type CollectorKeeper interface { - GetAppidToAssetCollectorMapping(ctx sdk.Context, appID, assetID uint64) (appAssetCollectorData types.AppToAssetIdCollectorMapping, found bool) - UpdateCollector(ctx sdk.Context, appID, assetID uint64, CollectedStabilityFee, CollectedClosingFee, CollectedOpeningFee, LiquidationRewardsCollected sdk.Int) error - // SetCollectorLookupTable(ctx sdk.Context, records ...types.CollectorLookupTable) error - GetCollectorLookupTable(ctx sdk.Context, appID, assetID uint64) (collectorLookup types.CollectorLookupTableData, found bool) - GetAuctionMappingForApp(ctx sdk.Context, appID, assetID uint64) (collectorAuctionLookupTable types.AppAssetIdToAuctionLookupTable, found bool) - GetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64) (netFeeData types.AppAssetIdToFeeCollectedData, found bool) - GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, amount sdk.Int) (sdk.Int, error) - SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdk.Int) error - SetAuctionMappingForApp(ctx sdk.Context, records types.AppAssetIdToAuctionLookupTable) error - GetAllAuctionMappingForApp(ctx sdk.Context) (collectorAuctionLookupTable []types.AppAssetIdToAuctionLookupTable, found bool) -} - -type TokenMintKeeper interface { - MintNewTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, address string, amount sdk.Int) error - BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, amount sdk.Int) error -} - -type EsmKeeper interface { - GetKillSwitchData(ctx sdk.Context, appID uint64) (esmtypes.KillSwitchParams, bool) - GetESMStatus(ctx sdk.Context, id uint64) (esmStatus esmtypes.ESMStatus, found bool) - CalcDollarValueOfToken(ctx sdk.Context, rate uint64, amt sdk.Int, decimals sdk.Int) (price sdk.Dec) - SetAssetToAmount(ctx sdk.Context, assetToAmount esmtypes.AssetToAmount) - GetDataAfterCoolOff(ctx sdk.Context, id uint64) (esmDataAfterCoolOff esmtypes.DataAfterCoolOff, found bool) - SetDataAfterCoolOff(ctx sdk.Context, esmDataAfterCoolOff esmtypes.DataAfterCoolOff) - GetSnapshotOfPrices(ctx sdk.Context, appID, assetID uint64) (price uint64, found bool) -} - -type LendKeeper interface { - GetBorrow(ctx sdk.Context, id uint64) (borrow lendtypes.BorrowAsset, found bool) - GetLendPair(ctx sdk.Context, id uint64) (pair lendtypes.Extended_Pair, found bool) - GetAssetRatesParams(ctx sdk.Context, assetID uint64) (assetRatesStats lendtypes.AssetRatesParams, found bool) - VerifyCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset, liquidationThreshold sdk.Dec) error - CalculateCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset) (sdk.Dec, error) - GetLend(ctx sdk.Context, id uint64) (lend lendtypes.LendAsset, found bool) - GetPool(ctx sdk.Context, id uint64) (pool lendtypes.Pool, found bool) - GetAddAuctionParamsData(ctx sdk.Context, appID uint64) (auctionParams lendtypes.AuctionParams, found bool) - ModuleBalance(ctx sdk.Context, moduleName string, denom string) sdk.Int - UpdateReserveBalances(ctx sdk.Context, assetID uint64, moduleName string, payment sdk.Coin, inc bool) error - SetLend(ctx sdk.Context, lend lendtypes.LendAsset) - SetAllReserveStatsByAssetID(ctx sdk.Context, allReserveStats lendtypes.AllReserveStats) - GetAllReserveStatsByAssetID(ctx sdk.Context, id uint64) (allReserveStats lendtypes.AllReserveStats, found bool) +type LiquidationsV2Keeper interface { + GetLiquidationWhiteListing(ctx sdk.Context, appId uint64) (liquidationWhiteListing types.LiquidationWhiteListing, found bool) } diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 70f2d9ac5..df1353aa9 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,25 +1,15 @@ package keeper -import( - +import ( + // "github.com/comdex-official/comdex/types" liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" - ) +func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtypes.LockedVault) error { + auctionType, _ := k.liquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) -func (k Keeper) AuctionActivator(ctx sdk.Context,lockedVault liquidationtypes.LockedVault) error { - - //Using app id provided in the lockedVault Struct - // Using the app id to fetch the app data whitelisted in the liquidation module to find the auction type selected by the app. - appWhitelistedData:=k.liquidation.GetLiquidationWhiteListing(ctx,lockedVault.AppId) - - - - - - return nil -} \ No newline at end of file +} diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index c0f531a84..f9e9a071b 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -4,8 +4,15 @@ import ( "context" "fmt" +<<<<<<< HEAD "github.com/comdex-official/comdex/x/liquidationsV2/expected" "github.com/comdex-official/comdex/x/liquidationsV2/types" +======= + "github.com/tendermint/tendermint/libs/log" + + "github.com/comdex-official/comdex/x/auctionsV2/expected" + "github.com/comdex-official/comdex/x/auctionsV2/types" +>>>>>>> 6cc24557 (updating expected keepers) "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -14,12 +21,21 @@ import ( type ( Keeper struct { +<<<<<<< HEAD cdc codec.BinaryCodec storeKey sdk.StoreKey memKey sdk.StoreKey paramstore paramtypes.Subspace liquidation expected.LiquidationV2Keeper bankKeeper types.BankKeeper +======= + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey + paramstore paramtypes.Subspace + bankKeeper types.BankKeeper + liquidationsV2 expected.LiquidationsV2Keeper +>>>>>>> 6cc24557 (updating expected keepers) } ) @@ -33,8 +49,12 @@ func NewKeeper( storeKey, memKey sdk.StoreKey, ps paramtypes.Subspace, +<<<<<<< HEAD liquidation expected.LiquidationV2Keeper, +======= +>>>>>>> 6cc24557 (updating expected keepers) bankKeeper types.BankKeeper, + liquidationsV2Keeper expected.LiquidationsV2Keeper, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -43,12 +63,21 @@ func NewKeeper( return Keeper{ +<<<<<<< HEAD cdc: cdc, storeKey: storeKey, memKey: memKey, paramstore: ps, liquidation: liquidation, bankKeeper: bankKeeper, +======= + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + paramstore: ps, + bankKeeper: bankKeeper, + liquidationsV2: liquidationsV2Keeper, +>>>>>>> 6cc24557 (updating expected keepers) } } From 3c085c5f1a8c174bbe3a016abf47bfaad2f2fac5 Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 11 Apr 2023 17:34:14 +0530 Subject: [PATCH 027/155] updating expected keepers --- x/auctionsV2/keeper/keeper.go | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index f9e9a071b..699136b66 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -3,39 +3,23 @@ package keeper import ( "context" "fmt" - -<<<<<<< HEAD - "github.com/comdex-official/comdex/x/liquidationsV2/expected" - "github.com/comdex-official/comdex/x/liquidationsV2/types" -======= "github.com/tendermint/tendermint/libs/log" "github.com/comdex-official/comdex/x/auctionsV2/expected" "github.com/comdex-official/comdex/x/auctionsV2/types" ->>>>>>> 6cc24557 (updating expected keepers) "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/tendermint/tendermint/libs/log" ) type ( Keeper struct { -<<<<<<< HEAD - cdc codec.BinaryCodec - storeKey sdk.StoreKey - memKey sdk.StoreKey - paramstore paramtypes.Subspace - liquidation expected.LiquidationV2Keeper - bankKeeper types.BankKeeper -======= cdc codec.BinaryCodec storeKey sdk.StoreKey memKey sdk.StoreKey paramstore paramtypes.Subspace bankKeeper types.BankKeeper liquidationsV2 expected.LiquidationsV2Keeper ->>>>>>> 6cc24557 (updating expected keepers) } ) @@ -49,10 +33,6 @@ func NewKeeper( storeKey, memKey sdk.StoreKey, ps paramtypes.Subspace, -<<<<<<< HEAD - liquidation expected.LiquidationV2Keeper, -======= ->>>>>>> 6cc24557 (updating expected keepers) bankKeeper types.BankKeeper, liquidationsV2Keeper expected.LiquidationsV2Keeper, ) Keeper { @@ -62,22 +42,12 @@ func NewKeeper( } return Keeper{ - -<<<<<<< HEAD - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - paramstore: ps, - liquidation: liquidation, - bankKeeper: bankKeeper, -======= cdc: cdc, storeKey: storeKey, memKey: memKey, paramstore: ps, bankKeeper: bankKeeper, liquidationsV2: liquidationsV2Keeper, ->>>>>>> 6cc24557 (updating expected keepers) } } From 28e5631c73678a6ce9fc06dd4245c7d27d576e45 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Tue, 11 Apr 2023 18:38:13 +0530 Subject: [PATCH 028/155] updating auction proto --- x/auctionsV2/keeper/auctions.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index df1353aa9..3417afa28 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -11,5 +11,11 @@ func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtyp auctionType, _ := k.liquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) + //Dutch Auction Model Followed for auction type 0 + if auctionType.AuctionType== 0{ + //Trigger Dutch Auction + + } + return nil } From 0b16debc85d24656a316ab13d84cdfdeb4ad2bc0 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:17:09 +0530 Subject: [PATCH 029/155] updating auction proto --- x/auctionsV2/keeper/auctions.go | 5 ++++- x/liquidationsV2/keeper/liquidate.go | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 3417afa28..8231d1ca1 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -12,9 +12,12 @@ func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtyp auctionType, _ := k.liquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) //Dutch Auction Model Followed for auction type 0 - if auctionType.AuctionType== 0{ + if auctionType.AuctionType{ + //Trigger Dutch Auction + }else{ + //Trigger English Auction } return nil diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 78696bae3..1f7adaeb1 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -57,6 +57,7 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { if err != nil { return fmt.Errorf(err.Error()) + //or maybe continue } return nil From cd7adfd1c513dcb6bd0a093b0b773685f96a04d4 Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 11 Apr 2023 22:26:26 +0530 Subject: [PATCH 030/155] updating pb files --- .../liquidationsV2/v1beta1/liquidate.proto | 2 +- x/liquidationsV2/types/liquidate.pb.go | 124 +++++++++--------- 2 files changed, 66 insertions(+), 60 deletions(-) diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index 2c45d8d6f..bb083de72 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -18,7 +18,7 @@ message LiquidationWhiteListing { //------------Auction Types defn // 0 auction type - "dutch" //1 auction type - "english" - uint64 auction_type = 2 [ + bool auction_type = 2 [ (gogoproto.customname) = "AuctionType", (gogoproto.moretags) = "yaml:\"auction_type\""]; } diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index 5ad9c428e..2e6fa963c 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -34,7 +34,7 @@ type LiquidationWhiteListing struct { //------------Auction Types defn // 0 auction type - "dutch" //1 auction type - "english" - AuctionType uint64 `protobuf:"varint,2,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` + AuctionType bool `protobuf:"varint,2,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` } func (m *LiquidationWhiteListing) Reset() { *m = LiquidationWhiteListing{} } @@ -171,9 +171,9 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 1002 bytes of a gzipped FileDescriptorProto + // 1005 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcd, 0x6e, 0xe3, 0x44, - 0x1c, 0x8f, 0xcb, 0xb6, 0xb4, 0x93, 0x7e, 0xa4, 0xd3, 0x76, 0xeb, 0x8d, 0xb6, 0x9e, 0x62, 0x89, + 0x1c, 0x8f, 0x97, 0xb6, 0xb4, 0x93, 0x7e, 0xa4, 0xd3, 0x76, 0xeb, 0x8d, 0xb6, 0x9e, 0x62, 0x89, 0xaa, 0x42, 0x6a, 0x42, 0x77, 0x2f, 0x08, 0x2e, 0xdb, 0x74, 0x17, 0x11, 0x51, 0xd1, 0xc5, 0x54, 0x8b, 0xb4, 0x07, 0xcc, 0xc4, 0x9e, 0xa4, 0xa3, 0x3a, 0x9e, 0x60, 0x8f, 0x97, 0xf6, 0x29, 0x58, 0x4e, 0xbc, 0x02, 0x12, 0xcf, 0x80, 0xc4, 0xb1, 0xc7, 0x3d, 0x22, 0x0e, 0x03, 0xb8, 0x6f, 0xe0, @@ -185,56 +185,56 @@ var fileDescriptor_631048b9d11253bf = []byte{ 0x36, 0x39, 0xed, 0x93, 0x94, 0xe3, 0xfe, 0xc0, 0x00, 0x9c, 0x80, 0xa5, 0x7d, 0x96, 0x36, 0x3b, 0x38, 0x25, 0x23, 0xeb, 0x80, 0xd1, 0x58, 0xd7, 0xdd, 0x5f, 0x2c, 0xb0, 0x7b, 0x36, 0x76, 0xfc, 0xf6, 0x92, 0x72, 0x72, 0x46, 0x53, 0x4e, 0xe3, 0x1e, 0x3c, 0x06, 0x4b, 0x78, 0x30, 0xf0, 0x69, - 0x68, 0x5b, 0xfb, 0xd6, 0xe1, 0xbd, 0x56, 0x3d, 0x17, 0x68, 0xf1, 0x64, 0x30, 0x68, 0x87, 0x85, - 0x40, 0x6b, 0x37, 0xb8, 0x1f, 0x7d, 0xea, 0x6a, 0x80, 0xeb, 0x2d, 0x62, 0xb9, 0x0e, 0xdb, 0x60, - 0x15, 0x67, 0x81, 0x54, 0xf2, 0xf9, 0xcd, 0x80, 0xd8, 0x0b, 0x8a, 0x78, 0x90, 0x0b, 0x54, 0x3d, - 0xd1, 0xeb, 0x17, 0x37, 0x03, 0x52, 0x08, 0xb4, 0x65, 0xe8, 0x13, 0x60, 0xd7, 0xab, 0xe2, 0x31, - 0xc6, 0x7d, 0x52, 0x6a, 0xec, 0xbc, 0xdb, 0x4d, 0x09, 0xff, 0x82, 0x45, 0x21, 0x49, 0xe0, 0x87, - 0x60, 0x3d, 0xc8, 0x92, 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, 0xa1, 0x44, 0x9e, 0x92, 0x8e, 0xbc, 0xc7, 0x50, 0x37, 0x34, 0x21, 0xec, 0x7a, 0x80, 0x8f, - 0x10, 0xf0, 0x67, 0x0b, 0xec, 0x4c, 0x4c, 0x5a, 0x7f, 0x34, 0x37, 0xed, 0xea, 0xbe, 0x75, 0x58, - 0x7d, 0x54, 0x6f, 0xe8, 0xc9, 0xda, 0x18, 0x4e, 0xd6, 0xc6, 0xc5, 0x10, 0xd1, 0x7a, 0x22, 0x7b, - 0xcb, 0x05, 0xda, 0x9e, 0x98, 0x4f, 0xa3, 0x6a, 0x21, 0xd0, 0x43, 0xed, 0x3d, 0x53, 0xde, 0x7d, - 0xfd, 0x37, 0xb2, 0xbc, 0xed, 0x68, 0x06, 0x13, 0x7e, 0x07, 0x20, 0x4d, 0x7d, 0x1a, 0x73, 0x92, - 0xc8, 0x19, 0x72, 0x45, 0xc8, 0x80, 0x24, 0xf6, 0xea, 0xbe, 0x75, 0xb8, 0xdc, 0xfa, 0x38, 0x17, - 0xa8, 0xd6, 0x4e, 0xdb, 0xa6, 0xf8, 0xa5, 0xaa, 0x15, 0x02, 0xd9, 0x66, 0x84, 0x68, 0xde, 0x98, - 0xe6, 0x7a, 0x35, 0x3a, 0x85, 0x86, 0x29, 0xd8, 0x9d, 0x12, 0xf7, 0x71, 0x18, 0x26, 0x24, 0x4d, - 0xed, 0x35, 0x75, 0xd1, 0x3f, 0xcb, 0x05, 0xda, 0x29, 0x93, 0x4e, 0x34, 0xa0, 0x10, 0xc8, 0x31, - 0x4e, 0xb3, 0x15, 0x5c, 0x6f, 0x87, 0xce, 0x22, 0x42, 0x5f, 0x85, 0x92, 0x73, 0x67, 0x32, 0xd4, - 0xba, 0xf2, 0x3b, 0xd6, 0xa1, 0x9e, 0x5d, 0x4f, 0x85, 0x7a, 0x30, 0x0a, 0x35, 0xc5, 0x53, 0xa9, - 0xca, 0x70, 0x99, 0x6a, 0x0a, 0x35, 0x4a, 0xb5, 0x31, 0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 0x73, 0xe7, 0x54, + 0xfe, 0xbc, 0x73, 0x2a, 0x2f, 0x3f, 0x29, 0x05, 0x94, 0x9f, 0x2f, 0x47, 0xac, 0xdb, 0xa5, 0x01, + 0xc5, 0x91, 0x39, 0x6f, 0xbe, 0xf5, 0xfd, 0xa3, 0x62, 0x77, 0x96, 0xd4, 0x73, 0xf5, 0xf8, 0xbf, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xc8, 0xa9, 0x6a, 0x25, 0x09, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -257,8 +257,13 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - if m.AuctionType != 0 { - i = encodeVarintLiquidate(dAtA, i, uint64(m.AuctionType)) + if m.AuctionType { + i-- + if m.AuctionType { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } i-- dAtA[i] = 0x10 } @@ -478,8 +483,8 @@ func (m *LiquidationWhiteListing) Size() (n int) { if m.AppId != 0 { n += 1 + sovLiquidate(uint64(m.AppId)) } - if m.AuctionType != 0 { - n += 1 + sovLiquidate(uint64(m.AuctionType)) + if m.AuctionType { + n += 2 } return n } @@ -612,7 +617,7 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AuctionType", wireType) } - m.AuctionType = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowLiquidate @@ -622,11 +627,12 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.AuctionType |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } + m.AuctionType = bool(v != 0) default: iNdEx = preIndex skippy, err := skipLiquidate(dAtA[iNdEx:]) From d305f23f849b80e7d2f7fa7b5a0a99acd6ba18e2 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Wed, 12 Apr 2023 00:06:07 +0530 Subject: [PATCH 031/155] updating auction proto --- .../liquidationsV2/v1beta1/liquidate.proto | 4 +-- x/auctionsV2/keeper/auctions.go | 15 +++++++-- x/auctionsV2/keeper/keeper.go | 33 ++++++++++--------- x/liquidationsV2/expected/keeper.go | 6 +++- x/liquidationsV2/keeper/keeper.go | 5 +++ x/liquidationsV2/keeper/liquidate.go | 5 +++ 6 files changed, 46 insertions(+), 22 deletions(-) diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index bb083de72..e66663984 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -16,8 +16,8 @@ message LiquidationWhiteListing { (gogoproto.customname) = "AppId", (gogoproto.moretags) = "yaml:\"app_id\""]; //------------Auction Types defn -// 0 auction type - "dutch" -//1 auction type - "english" +// true auction type - "dutch" +//false auction type - "english" bool auction_type = 2 [ (gogoproto.customname) = "AuctionType", (gogoproto.moretags) = "yaml:\"auction_type\""]; diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 8231d1ca1..9b0f157d2 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -12,13 +12,22 @@ func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtyp auctionType, _ := k.liquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) //Dutch Auction Model Followed for auction type 0 - if auctionType.AuctionType{ - + if auctionType.AuctionType { + //Trigger Dutch Auction + err := k.DutchAuctionActivator(ctx, liquidationData) + if err != nil { + + } - }else{ + } else { //Trigger English Auction } return nil } + +func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidationtypes.LockedVault) error { + + return nil +} diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index 699136b66..c0f531a84 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -3,23 +3,23 @@ package keeper import ( "context" "fmt" - "github.com/tendermint/tendermint/libs/log" - "github.com/comdex-official/comdex/x/auctionsV2/expected" - "github.com/comdex-official/comdex/x/auctionsV2/types" + "github.com/comdex-official/comdex/x/liquidationsV2/expected" + "github.com/comdex-official/comdex/x/liquidationsV2/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/tendermint/tendermint/libs/log" ) type ( Keeper struct { - cdc codec.BinaryCodec - storeKey sdk.StoreKey - memKey sdk.StoreKey - paramstore paramtypes.Subspace - bankKeeper types.BankKeeper - liquidationsV2 expected.LiquidationsV2Keeper + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey + paramstore paramtypes.Subspace + liquidation expected.LiquidationV2Keeper + bankKeeper types.BankKeeper } ) @@ -33,8 +33,8 @@ func NewKeeper( storeKey, memKey sdk.StoreKey, ps paramtypes.Subspace, + liquidation expected.LiquidationV2Keeper, bankKeeper types.BankKeeper, - liquidationsV2Keeper expected.LiquidationsV2Keeper, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -42,12 +42,13 @@ func NewKeeper( } return Keeper{ - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - paramstore: ps, - bankKeeper: bankKeeper, - liquidationsV2: liquidationsV2Keeper, + + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + paramstore: ps, + liquidation: liquidation, + bankKeeper: bankKeeper, } } diff --git a/x/liquidationsV2/expected/keeper.go b/x/liquidationsV2/expected/keeper.go index a48877ebc..55b62e6e3 100644 --- a/x/liquidationsV2/expected/keeper.go +++ b/x/liquidationsV2/expected/keeper.go @@ -4,7 +4,7 @@ import ( assettypes "github.com/comdex-official/comdex/x/asset/types" esmtypes "github.com/comdex-official/comdex/x/esm/types" lendtypes "github.com/comdex-official/comdex/x/lend/types" - liquidationtypes "github.com/comdex-official/comdex/x/liquidation/types" + liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" markettypes "github.com/comdex-official/comdex/x/market/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" "github.com/comdex-official/comdex/x/vault/types" @@ -92,3 +92,7 @@ type RewardsKeeper interface { CalculateVaultInterest(ctx sdk.Context, appID, assetID, lockerID uint64, NetBalance sdk.Int, blockHeight int64, lockerBlockTime int64) error DeleteVaultInterestTracker(ctx sdk.Context, vault rewardstypes.VaultInterestTracker) } + +type AuctionKeeper interface { + AuctionActivator(ctx sdk.Context, lockedVault liquidationtypes.LockedVault) error +} diff --git a/x/liquidationsV2/keeper/keeper.go b/x/liquidationsV2/keeper/keeper.go index d882a0c0c..07ad960ae 100644 --- a/x/liquidationsV2/keeper/keeper.go +++ b/x/liquidationsV2/keeper/keeper.go @@ -7,6 +7,8 @@ import ( "github.com/comdex-official/comdex/x/liquidationsV2/expected" "github.com/comdex-official/comdex/x/liquidationsV2/types" + "github.com/comdex-official/comdex/x/auctionsV2/expected" + "github.com/comdex-official/comdex/x/auctionsV2/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -25,6 +27,7 @@ type Keeper struct { esm expected.EsmKeeper rewards expected.RewardsKeeper lend expected.LendKeeper + auctionsV2 expected.AuctionsV2Keeper } func NewKeeper( @@ -40,6 +43,7 @@ func NewKeeper( esm expected.EsmKeeper, rewards expected.RewardsKeeper, lend expected.LendKeeper, + auctionsV2 expected.AuctionsV2Keeper, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -59,6 +63,7 @@ func NewKeeper( esm: esm, rewards: rewards, lend: lend, + auctionsV2: auctionsV2, } } diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 1f7adaeb1..a826ace40 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + assettypes "github.com/comdex-official/comdex/x/asset/types" auctiontypes "github.com/comdex-official/comdex/x/auctionsV2/types" lendtypes "github.com/comdex-official/comdex/x/lend/types" @@ -162,6 +163,10 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair k.SetLockedVault(ctx, value) k.SetLockedVaultID(ctx, value.LockedVaultId) //Call auction activator + err := k.auctionsV2.AuctionActivator(ctx, value) + if err != nil { + return fmt.Errorf("Auction could not be initiated for %d %d", value, err) + } //struct for auction will stay same for english and dutch // based on type recieved from From 482784a0ccb5449e05874ae3692b498465e79583 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Wed, 12 Apr 2023 01:23:55 +0530 Subject: [PATCH 032/155] auction keeper changes --- x/auctionsV2/expected/keeper.go | 4 +-- x/auctionsV2/keeper/auctions.go | 2 +- x/auctionsV2/keeper/keeper.go | 11 +++---- x/liquidationsV2/expected/keeper.go | 2 +- .../keeper/grpc_query_params_test.go | 32 +++++++++---------- x/liquidationsV2/keeper/keeper.go | 7 ++-- x/liquidationsV2/keeper/msg_server_test.go | 24 +++++++------- x/liquidationsV2/keeper/params_test.go | 24 +++++++------- 8 files changed, 52 insertions(+), 54 deletions(-) diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go index 47e06596f..82eae22ad 100644 --- a/x/auctionsV2/expected/keeper.go +++ b/x/auctionsV2/expected/keeper.go @@ -1,10 +1,10 @@ package expected import ( - "github.com/comdex-official/comdex/x/liquidationsV2/types" + liquidationsV2types "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" ) type LiquidationsV2Keeper interface { - GetLiquidationWhiteListing(ctx sdk.Context, appId uint64) (liquidationWhiteListing types.LiquidationWhiteListing, found bool) + GetLiquidationWhiteListing(ctx sdk.Context, appId uint64) (liquidationWhiteListing liquidationsV2types.LiquidationWhiteListing, found bool) } diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 9b0f157d2..968410d28 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -9,7 +9,7 @@ import ( func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtypes.LockedVault) error { - auctionType, _ := k.liquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) + auctionType, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) //Dutch Auction Model Followed for auction type 0 if auctionType.AuctionType { diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index c0f531a84..19c3693b3 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -3,9 +3,8 @@ package keeper import ( "context" "fmt" - - "github.com/comdex-official/comdex/x/liquidationsV2/expected" - "github.com/comdex-official/comdex/x/liquidationsV2/types" + "github.com/comdex-official/comdex/x/auctionsV2/expected" + "github.com/comdex-official/comdex/x/auctionsV2/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -18,7 +17,7 @@ type ( storeKey sdk.StoreKey memKey sdk.StoreKey paramstore paramtypes.Subspace - liquidation expected.LiquidationV2Keeper + LiquidationsV2 expected.LiquidationsV2Keeper bankKeeper types.BankKeeper } ) @@ -33,7 +32,7 @@ func NewKeeper( storeKey, memKey sdk.StoreKey, ps paramtypes.Subspace, - liquidation expected.LiquidationV2Keeper, + LiquidationsV2Keeper expected.LiquidationsV2Keeper, bankKeeper types.BankKeeper, ) Keeper { // set KeyTable if it has not already been set @@ -47,7 +46,7 @@ func NewKeeper( storeKey: storeKey, memKey: memKey, paramstore: ps, - liquidation: liquidation, + LiquidationsV2: LiquidationsV2Keeper, bankKeeper: bankKeeper, } } diff --git a/x/liquidationsV2/expected/keeper.go b/x/liquidationsV2/expected/keeper.go index 55b62e6e3..ef3fafb7f 100644 --- a/x/liquidationsV2/expected/keeper.go +++ b/x/liquidationsV2/expected/keeper.go @@ -93,6 +93,6 @@ type RewardsKeeper interface { DeleteVaultInterestTracker(ctx sdk.Context, vault rewardstypes.VaultInterestTracker) } -type AuctionKeeper interface { +type AuctionsV2Keeper interface { AuctionActivator(ctx sdk.Context, lockedVault liquidationtypes.LockedVault) error } diff --git a/x/liquidationsV2/keeper/grpc_query_params_test.go b/x/liquidationsV2/keeper/grpc_query_params_test.go index 1eb67efe1..6dc3b521d 100644 --- a/x/liquidationsV2/keeper/grpc_query_params_test.go +++ b/x/liquidationsV2/keeper/grpc_query_params_test.go @@ -1,21 +1,21 @@ package keeper_test -import ( - "testing" +// import ( +// "testing" - testkeeper "github.com/comdex-official/comdex/testutil/keeper" - "github.com/comdex-official/comdex/x/liquidationsV2/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" -) +// testkeeper "github.com/comdex-official/comdex/testutil/keeper" +// "github.com/comdex-official/comdex/x/liquidationsV2/types" +// sdk "github.com/cosmos/cosmos-sdk/types" +// "github.com/stretchr/testify/require" +// ) -func TestParamsQuery(t *testing.T) { - keeper, ctx := testkeeper.NewliqKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - params := types.DefaultParams() - keeper.SetParams(ctx, params) +// func TestParamsQuery(t *testing.T) { +// keeper, ctx := testkeeper.NewliqKeeper(t) +// wctx := sdk.WrapSDKContext(ctx) +// params := types.DefaultParams() +// keeper.SetParams(ctx, params) - response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) - require.NoError(t, err) - require.Equal(t, &types.QueryParamsResponse{Params: params}, response) -} +// response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) +// require.NoError(t, err) +// require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +// } diff --git a/x/liquidationsV2/keeper/keeper.go b/x/liquidationsV2/keeper/keeper.go index 07ad960ae..d081bac34 100644 --- a/x/liquidationsV2/keeper/keeper.go +++ b/x/liquidationsV2/keeper/keeper.go @@ -7,8 +7,7 @@ import ( "github.com/comdex-official/comdex/x/liquidationsV2/expected" "github.com/comdex-official/comdex/x/liquidationsV2/types" - "github.com/comdex-official/comdex/x/auctionsV2/expected" - "github.com/comdex-official/comdex/x/auctionsV2/types" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -43,7 +42,7 @@ func NewKeeper( esm expected.EsmKeeper, rewards expected.RewardsKeeper, lend expected.LendKeeper, - auctionsV2 expected.AuctionsV2Keeper, + auctionsV2Keeper expected.AuctionsV2Keeper, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -63,7 +62,7 @@ func NewKeeper( esm: esm, rewards: rewards, lend: lend, - auctionsV2: auctionsV2, + auctionsV2: auctionsV2Keeper, } } diff --git a/x/liquidationsV2/keeper/msg_server_test.go b/x/liquidationsV2/keeper/msg_server_test.go index 66c23c92a..9d74ca71d 100644 --- a/x/liquidationsV2/keeper/msg_server_test.go +++ b/x/liquidationsV2/keeper/msg_server_test.go @@ -1,16 +1,16 @@ package keeper_test -import ( - "context" - "testing" +// import ( +// "context" +// "testing" - keepertest "github.com/comdex-official/comdex/testutil/keeper" - "github.com/comdex-official/comdex/x/liquidationsV2/keeper" - "github.com/comdex-official/comdex/x/liquidationsV2/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) +// keepertest "github.com/comdex-official/comdex/testutil/keeper" +// "github.com/comdex-official/comdex/x/liquidationsV2/keeper" +// "github.com/comdex-official/comdex/x/liquidationsV2/types" +// sdk "github.com/cosmos/cosmos-sdk/types" +// ) -func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { - k, ctx := keepertest.NewliqKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) -} +// func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { +// k, ctx := keepertest.NewliqKeeper(t) +// return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) +// } diff --git a/x/liquidationsV2/keeper/params_test.go b/x/liquidationsV2/keeper/params_test.go index 6cd048c3d..4c5c9eaa9 100644 --- a/x/liquidationsV2/keeper/params_test.go +++ b/x/liquidationsV2/keeper/params_test.go @@ -1,18 +1,18 @@ package keeper_test -import ( - "testing" +// import ( +// "testing" - testkeeper "github.com/comdex-official/comdex/testutil/keeper" - "github.com/comdex-official/comdex/x/liquidationsV2/types" - "github.com/stretchr/testify/require" -) +// testkeeper "github.com/comdex-official/comdex/testutil/keeper" +// "github.com/comdex-official/comdex/x/liquidationsV2/types" +// "github.com/stretchr/testify/require" +// ) -func TestGetParams(t *testing.T) { - k, ctx := testkeeper.NewliqKeeper(t) - params := types.DefaultParams() +// func TestGetParams(t *testing.T) { +// k, ctx := testkeeper.NewliqKeeper(t) +// params := types.DefaultParams() - k.SetParams(ctx, params) +// k.SetParams(ctx, params) - require.EqualValues(t, params, k.GetParams(ctx)) -} +// require.EqualValues(t, params, k.GetParams(ctx)) +// } From 24736d7984a8c61562bdbc4280867f650aec10bf Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sun, 16 Apr 2023 00:21:39 +0530 Subject: [PATCH 033/155] auction keeper changes --- x/auctionsV2/keeper/auctions.go | 1 + 1 file changed, 1 insertion(+) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 968410d28..b9e17a53a 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -28,6 +28,7 @@ func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtyp } func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidationtypes.LockedVault) error { + return nil } From 5919256d322c895dabe167311cc2844b94b9b78a Mon Sep 17 00:00:00 2001 From: Pratik Date: Sun, 16 Apr 2023 00:27:15 +0530 Subject: [PATCH 034/155] updating pb files --- proto/comdex/auctionsV2/v1beta1/auction.proto | 103 ++ proto/comdex/auctionsV2/v1beta1/bid.proto | 3 +- x/auctionsV2/keeper/auctions.go | 3 +- x/auctionsV2/types/auction.pb.go | 1462 +++++++++++++++++ x/auctionsV2/types/bid.pb.go | 154 +- x/liquidationsV2/types/liquidate.pb.go | 4 +- 6 files changed, 1647 insertions(+), 82 deletions(-) create mode 100644 proto/comdex/auctionsV2/v1beta1/auction.proto create mode 100644 x/auctionsV2/types/auction.pb.go diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto new file mode 100644 index 000000000..8a233f66a --- /dev/null +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -0,0 +1,103 @@ +syntax = "proto3"; +package comdex.auctionsV2.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; + +message Auctions{ + uint64 auction_id = 1 [ + (gogoproto.moretags) = "yaml:\"auction_id\"" + ]; + cosmos.base.v1beta1.Coin outflow_token_init_amount = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"outflow_token_init_amount\"", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + cosmos.base.v1beta1.Coin outflow_token_current_amount = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"outflow_token_current_amount\"", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + cosmos.base.v1beta1.Coin inflow_token_target_amount = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"inflow_token_target_amount\"", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + cosmos.base.v1beta1.Coin inflow_token_current_amount = 5 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"inflow_token_current_amount\"", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + uint64 active_bidding_id = 6 [ + (gogoproto.moretags) = "yaml:\"active_bidding_id\"" + ]; + repeated bidOwnerMapping bidding_ids = 7 [ + (gogoproto.moretags) = "yaml:\"bidding_ids\"" + ]; + string bid_factor = 8 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"bid_factor\"" + ]; + // price indicator only for dutch auctions + string outflow_token_initial_price = 9 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"outflow_token_initial_price\"" + ]; + string outflow_token_current_price = 10 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"outflow_token_current_price\"" + ]; + string outflow_token_end_price = 11 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"outflow_token_end_price\"" + ]; + string inflow_token_current_price = 12 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"inflow_token_current_price\"" + ]; + uint64 locked_vault_id = 13 [ + (gogoproto.moretags) = "yaml:\"locked_vault_id\"" + ]; + string vault_owner = 14 [ + (gogoproto.moretags) = "yaml:\"vault_owner\"", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" + ]; + google.protobuf.Timestamp start_time = 15 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; + google.protobuf.Timestamp end_time = 16 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"end_time\"" + ]; + google.protobuf.Timestamp bid_end_time = 17 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"bid_end_time\"" + ]; + uint64 app_id = 18 [ + (gogoproto.moretags) = "yaml:\"app_id\"" + ]; + uint64 auction_mapping_id = 19 [ + (gogoproto.moretags) = "yaml:\"auction_mapping_id\"" + ]; + uint64 auction_status = 20 [ + (gogoproto.moretags) = "yaml:\"auction_status\"" + ]; + +} + +message bidOwnerMapping{ + uint64 bid_id = 1; + string bid_owner = 2; +} \ No newline at end of file diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto index b58b019d4..660dab9b8 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -7,7 +7,7 @@ import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; -message DutchBiddings { +message Bid{ uint64 bidding_id = 1 [ (gogoproto.moretags) = "yaml:\"bidding_id\"" ]; @@ -19,7 +19,6 @@ message DutchBiddings { string auction_status = 3 [ (gogoproto.moretags) = "yaml:\"auction_status\"" ]; - cosmos.base.v1beta1.Coin outflow_token_amount = 4 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outflow_token_amount\"", diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 968410d28..17f1311a5 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -28,6 +28,7 @@ func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtyp } func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidationtypes.LockedVault) error { - + // define opening price and closing price + // set data in generic auction params return nil } diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go new file mode 100644 index 000000000..3e6cec123 --- /dev/null +++ b/x/auctionsV2/types/auction.pb.go @@ -0,0 +1,1462 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/auctionsV2/v1beta1/auction.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/timestamp" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Auctions struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + OutflowTokenInitAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=outflow_token_init_amount,json=outflowTokenInitAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_token_init_amount" yaml:"outflow_token_init_amount"` + OutflowTokenCurrentAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=outflow_token_current_amount,json=outflowTokenCurrentAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_token_current_amount" yaml:"outflow_token_current_amount"` + InflowTokenTargetAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=inflow_token_target_amount,json=inflowTokenTargetAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_target_amount" yaml:"inflow_token_target_amount"` + InflowTokenCurrentAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=inflow_token_current_amount,json=inflowTokenCurrentAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_current_amount" yaml:"inflow_token_current_amount"` + ActiveBiddingId uint64 `protobuf:"varint,6,opt,name=active_bidding_id,json=activeBiddingId,proto3" json:"active_bidding_id,omitempty" yaml:"active_bidding_id"` + BiddingIds []*BidOwnerMapping `protobuf:"bytes,7,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` + BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` + // price indicator only for dutch auctions + OutflowTokenInitialPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=outflow_token_initial_price,json=outflowTokenInitialPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_initial_price" yaml:"outflow_token_initial_price"` + OutflowTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=outflow_token_current_price,json=outflowTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_current_price" yaml:"outflow_token_current_price"` + OutflowTokenEndPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=outflow_token_end_price,json=outflowTokenEndPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_end_price" yaml:"outflow_token_end_price"` + InflowTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=inflow_token_current_price,json=inflowTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflow_token_current_price" yaml:"inflow_token_current_price"` + LockedVaultId uint64 `protobuf:"varint,13,opt,name=locked_vault_id,json=lockedVaultId,proto3" json:"locked_vault_id,omitempty" yaml:"locked_vault_id"` + VaultOwner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,14,opt,name=vault_owner,json=vaultOwner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"vault_owner,omitempty" yaml:"vault_owner"` + StartTime time.Time `protobuf:"bytes,15,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` + EndTime time.Time `protobuf:"bytes,16,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` + BidEndTime time.Time `protobuf:"bytes,17,opt,name=bid_end_time,json=bidEndTime,proto3,stdtime" json:"bid_end_time" yaml:"bid_end_time"` + AppId uint64 `protobuf:"varint,18,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AuctionMappingId uint64 `protobuf:"varint,19,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` + AuctionStatus uint64 `protobuf:"varint,20,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` +} + +func (m *Auctions) Reset() { *m = Auctions{} } +func (m *Auctions) String() string { return proto.CompactTextString(m) } +func (*Auctions) ProtoMessage() {} +func (*Auctions) Descriptor() ([]byte, []int) { + return fileDescriptor_8ee47f5a405fa8ba, []int{0} +} +func (m *Auctions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Auctions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Auctions.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Auctions) XXX_Merge(src proto.Message) { + xxx_messageInfo_Auctions.Merge(m, src) +} +func (m *Auctions) XXX_Size() int { + return m.Size() +} +func (m *Auctions) XXX_DiscardUnknown() { + xxx_messageInfo_Auctions.DiscardUnknown(m) +} + +var xxx_messageInfo_Auctions proto.InternalMessageInfo + +func (m *Auctions) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + +func (m *Auctions) GetOutflowTokenInitAmount() github_com_cosmos_cosmos_sdk_types.Coin { + if m != nil { + return m.OutflowTokenInitAmount + } + return github_com_cosmos_cosmos_sdk_types.Coin{} +} + +func (m *Auctions) GetOutflowTokenCurrentAmount() github_com_cosmos_cosmos_sdk_types.Coin { + if m != nil { + return m.OutflowTokenCurrentAmount + } + return github_com_cosmos_cosmos_sdk_types.Coin{} +} + +func (m *Auctions) GetInflowTokenTargetAmount() github_com_cosmos_cosmos_sdk_types.Coin { + if m != nil { + return m.InflowTokenTargetAmount + } + return github_com_cosmos_cosmos_sdk_types.Coin{} +} + +func (m *Auctions) GetInflowTokenCurrentAmount() github_com_cosmos_cosmos_sdk_types.Coin { + if m != nil { + return m.InflowTokenCurrentAmount + } + return github_com_cosmos_cosmos_sdk_types.Coin{} +} + +func (m *Auctions) GetActiveBiddingId() uint64 { + if m != nil { + return m.ActiveBiddingId + } + return 0 +} + +func (m *Auctions) GetBiddingIds() []*BidOwnerMapping { + if m != nil { + return m.BiddingIds + } + return nil +} + +func (m *Auctions) GetLockedVaultId() uint64 { + if m != nil { + return m.LockedVaultId + } + return 0 +} + +func (m *Auctions) GetVaultOwner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.VaultOwner + } + return "" +} + +func (m *Auctions) GetStartTime() time.Time { + if m != nil { + return m.StartTime + } + return time.Time{} +} + +func (m *Auctions) GetEndTime() time.Time { + if m != nil { + return m.EndTime + } + return time.Time{} +} + +func (m *Auctions) GetBidEndTime() time.Time { + if m != nil { + return m.BidEndTime + } + return time.Time{} +} + +func (m *Auctions) GetAppId() uint64 { + if m != nil { + return m.AppId + } + return 0 +} + +func (m *Auctions) GetAuctionMappingId() uint64 { + if m != nil { + return m.AuctionMappingId + } + return 0 +} + +func (m *Auctions) GetAuctionStatus() uint64 { + if m != nil { + return m.AuctionStatus + } + return 0 +} + +type BidOwnerMapping struct { + BidId uint64 `protobuf:"varint,1,opt,name=bid_id,json=bidId,proto3" json:"bid_id,omitempty"` + BidOwner string `protobuf:"bytes,2,opt,name=bid_owner,json=bidOwner,proto3" json:"bid_owner,omitempty"` +} + +func (m *BidOwnerMapping) Reset() { *m = BidOwnerMapping{} } +func (m *BidOwnerMapping) String() string { return proto.CompactTextString(m) } +func (*BidOwnerMapping) ProtoMessage() {} +func (*BidOwnerMapping) Descriptor() ([]byte, []int) { + return fileDescriptor_8ee47f5a405fa8ba, []int{1} +} +func (m *BidOwnerMapping) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BidOwnerMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BidOwnerMapping.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BidOwnerMapping) XXX_Merge(src proto.Message) { + xxx_messageInfo_BidOwnerMapping.Merge(m, src) +} +func (m *BidOwnerMapping) XXX_Size() int { + return m.Size() +} +func (m *BidOwnerMapping) XXX_DiscardUnknown() { + xxx_messageInfo_BidOwnerMapping.DiscardUnknown(m) +} + +var xxx_messageInfo_BidOwnerMapping proto.InternalMessageInfo + +func (m *BidOwnerMapping) GetBidId() uint64 { + if m != nil { + return m.BidId + } + return 0 +} + +func (m *BidOwnerMapping) GetBidOwner() string { + if m != nil { + return m.BidOwner + } + return "" +} + +func init() { + proto.RegisterType((*Auctions)(nil), "comdex.auctionsV2.v1beta1.Auctions") + proto.RegisterType((*BidOwnerMapping)(nil), "comdex.auctionsV2.v1beta1.bidOwnerMapping") +} + +func init() { + proto.RegisterFile("comdex/auctionsV2/v1beta1/auction.proto", fileDescriptor_8ee47f5a405fa8ba) +} + +var fileDescriptor_8ee47f5a405fa8ba = []byte{ + // 961 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xdd, 0x6e, 0x1b, 0x45, + 0x14, 0xc7, 0xb3, 0xb4, 0x49, 0xe3, 0x71, 0x53, 0xd7, 0xd3, 0x7c, 0xac, 0x9d, 0xd6, 0xeb, 0x2e, + 0x12, 0xb5, 0x90, 0xb2, 0x56, 0x43, 0xaf, 0xb8, 0x22, 0x0e, 0x01, 0x2c, 0x04, 0x54, 0x1b, 0x13, + 0x21, 0x24, 0xb4, 0x9a, 0xdd, 0x19, 0xbb, 0xa3, 0xd8, 0x3b, 0xab, 0xdd, 0x71, 0x4a, 0x9f, 0x80, + 0xdb, 0x48, 0x3c, 0x05, 0x12, 0x12, 0x12, 0x4f, 0xd1, 0xcb, 0x8a, 0x2b, 0xc4, 0xc5, 0x82, 0x92, + 0x37, 0xf0, 0x25, 0x57, 0x68, 0x3e, 0xd6, 0xeb, 0x75, 0x13, 0x1c, 0x0b, 0xae, 0xec, 0x39, 0x73, + 0xe6, 0x7f, 0x7e, 0x33, 0x7b, 0xce, 0x99, 0x01, 0x4f, 0x02, 0x36, 0xc2, 0xe4, 0xfb, 0x36, 0x1a, + 0x07, 0x9c, 0xb2, 0x30, 0x39, 0xd9, 0x6f, 0x9f, 0x3d, 0xf5, 0x09, 0x47, 0x4f, 0x33, 0x93, 0x13, + 0xc5, 0x8c, 0x33, 0x58, 0x53, 0x8e, 0x4e, 0xee, 0xe8, 0x68, 0xc7, 0xfa, 0xe6, 0x80, 0x0d, 0x98, + 0xf4, 0x6a, 0x8b, 0x7f, 0x6a, 0x41, 0xdd, 0x1a, 0x30, 0x36, 0x18, 0x92, 0xb6, 0x1c, 0xf9, 0xe3, + 0x7e, 0x9b, 0xd3, 0x11, 0x49, 0x38, 0x1a, 0x45, 0xda, 0xa1, 0x11, 0xb0, 0x64, 0xc4, 0x92, 0xb6, + 0x8f, 0x12, 0x32, 0x0d, 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 0x5d, 0x34, 0x8c, 0xf3, 0xcb, 0xc6, + 0xca, 0x9b, 0xcb, 0xc6, 0xca, 0xef, 0x97, 0x8d, 0x95, 0x6f, 0x9f, 0x15, 0x32, 0x4c, 0xf4, 0xf6, + 0x3d, 0xd6, 0xef, 0xd3, 0x80, 0xa2, 0xa1, 0x1e, 0xb7, 0x0b, 0xaf, 0x3d, 0x99, 0x73, 0xfe, 0x9a, + 0xfc, 0x20, 0x1f, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0x30, 0xe5, 0xc2, 0x55, 0x0f, 0x0a, 0x00, + 0x00, +} + +func (m *Auctions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Auctions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuctionStatus != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionStatus)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 + } + if m.AuctionMappingId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } + if m.AppId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BidEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BidEndTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintAuction(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintAuction(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintAuction(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x7a + if len(m.VaultOwner) > 0 { + i -= len(m.VaultOwner) + copy(dAtA[i:], m.VaultOwner) + i = encodeVarintAuction(dAtA, i, uint64(len(m.VaultOwner))) + i-- + dAtA[i] = 0x72 + } + if m.LockedVaultId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.LockedVaultId)) + i-- + dAtA[i] = 0x68 + } + { + size := m.InflowTokenCurrentPrice.Size() + i -= size + if _, err := m.InflowTokenCurrentPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + { + size := m.OutflowTokenEndPrice.Size() + i -= size + if _, err := m.OutflowTokenEndPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + { + size := m.OutflowTokenCurrentPrice.Size() + i -= size + if _, err := m.OutflowTokenCurrentPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + { + size := m.OutflowTokenInitialPrice.Size() + i -= size + if _, err := m.OutflowTokenInitialPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + { + size := m.BidFactor.Size() + i -= size + if _, err := m.BidFactor.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + if len(m.BiddingIds) > 0 { + for iNdEx := len(m.BiddingIds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BiddingIds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.ActiveBiddingId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.ActiveBiddingId)) + i-- + dAtA[i] = 0x30 + } + { + size, err := m.InflowTokenCurrentAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size, err := m.InflowTokenTargetAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.OutflowTokenCurrentAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.OutflowTokenInitAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.AuctionId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BidOwnerMapping) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BidOwnerMapping) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BidOwnerMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BidOwner) > 0 { + i -= len(m.BidOwner) + copy(dAtA[i:], m.BidOwner) + i = encodeVarintAuction(dAtA, i, uint64(len(m.BidOwner))) + i-- + dAtA[i] = 0x12 + } + if m.BidId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.BidId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintAuction(dAtA []byte, offset int, v uint64) int { + offset -= sovAuction(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Auctions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovAuction(uint64(m.AuctionId)) + } + l = m.OutflowTokenInitAmount.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.OutflowTokenCurrentAmount.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.InflowTokenTargetAmount.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.InflowTokenCurrentAmount.Size() + n += 1 + l + sovAuction(uint64(l)) + if m.ActiveBiddingId != 0 { + n += 1 + sovAuction(uint64(m.ActiveBiddingId)) + } + if len(m.BiddingIds) > 0 { + for _, e := range m.BiddingIds { + l = e.Size() + n += 1 + l + sovAuction(uint64(l)) + } + } + l = m.BidFactor.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.OutflowTokenInitialPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.OutflowTokenCurrentPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.OutflowTokenEndPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.InflowTokenCurrentPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + if m.LockedVaultId != 0 { + n += 1 + sovAuction(uint64(m.LockedVaultId)) + } + l = len(m.VaultOwner) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) + n += 1 + l + sovAuction(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) + n += 2 + l + sovAuction(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BidEndTime) + n += 2 + l + sovAuction(uint64(l)) + if m.AppId != 0 { + n += 2 + sovAuction(uint64(m.AppId)) + } + if m.AuctionMappingId != 0 { + n += 2 + sovAuction(uint64(m.AuctionMappingId)) + } + if m.AuctionStatus != 0 { + n += 2 + sovAuction(uint64(m.AuctionStatus)) + } + return n +} + +func (m *BidOwnerMapping) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BidId != 0 { + n += 1 + sovAuction(uint64(m.BidId)) + } + l = len(m.BidOwner) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + return n +} + +func sovAuction(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAuction(x uint64) (n int) { + return sovAuction(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Auctions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Auctions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Auctions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenInitAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OutflowTokenInitAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenCurrentAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OutflowTokenCurrentAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenTargetAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InflowTokenTargetAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenCurrentAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InflowTokenCurrentAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveBiddingId", wireType) + } + m.ActiveBiddingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ActiveBiddingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingIds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BiddingIds = append(m.BiddingIds, &BidOwnerMapping{}) + if err := m.BiddingIds[len(m.BiddingIds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidFactor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BidFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenInitialPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OutflowTokenInitialPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenCurrentPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OutflowTokenCurrentPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenEndPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OutflowTokenEndPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenCurrentPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InflowTokenCurrentPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LockedVaultId", wireType) + } + m.LockedVaultId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LockedVaultId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VaultOwner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VaultOwner = github_com_cosmos_cosmos_sdk_types.AccAddress(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidEndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BidEndTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) + } + m.AuctionStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionStatus |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BidOwnerMapping) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: bidOwnerMapping: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: bidOwnerMapping: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BidId", wireType) + } + m.BidId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BidId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidOwner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BidOwner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAuction(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAuction + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAuction + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAuction + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthAuction + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAuction + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAuction + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAuction = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAuction = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAuction = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index c27b349d3..a552350d5 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -29,7 +29,7 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type DutchBiddings struct { +type Bid struct { BiddingId uint64 `protobuf:"varint,1,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` AuctionStatus string `protobuf:"bytes,3,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` @@ -42,18 +42,18 @@ type DutchBiddings struct { AppId uint64 `protobuf:"varint,10,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` } -func (m *DutchBiddings) Reset() { *m = DutchBiddings{} } -func (m *DutchBiddings) String() string { return proto.CompactTextString(m) } -func (*DutchBiddings) ProtoMessage() {} -func (*DutchBiddings) Descriptor() ([]byte, []int) { +func (m *Bid) Reset() { *m = Bid{} } +func (m *Bid) String() string { return proto.CompactTextString(m) } +func (*Bid) ProtoMessage() {} +func (*Bid) Descriptor() ([]byte, []int) { return fileDescriptor_6f6db8f3a6a396ec, []int{0} } -func (m *DutchBiddings) XXX_Unmarshal(b []byte) error { +func (m *Bid) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *DutchBiddings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Bid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_DutchBiddings.Marshal(b, m, deterministic) + return xxx_messageInfo_Bid.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -63,82 +63,82 @@ func (m *DutchBiddings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } -func (m *DutchBiddings) XXX_Merge(src proto.Message) { - xxx_messageInfo_DutchBiddings.Merge(m, src) +func (m *Bid) XXX_Merge(src proto.Message) { + xxx_messageInfo_Bid.Merge(m, src) } -func (m *DutchBiddings) XXX_Size() int { +func (m *Bid) XXX_Size() int { return m.Size() } -func (m *DutchBiddings) XXX_DiscardUnknown() { - xxx_messageInfo_DutchBiddings.DiscardUnknown(m) +func (m *Bid) XXX_DiscardUnknown() { + xxx_messageInfo_Bid.DiscardUnknown(m) } -var xxx_messageInfo_DutchBiddings proto.InternalMessageInfo +var xxx_messageInfo_Bid proto.InternalMessageInfo -func (m *DutchBiddings) GetBiddingId() uint64 { +func (m *Bid) GetBiddingId() uint64 { if m != nil { return m.BiddingId } return 0 } -func (m *DutchBiddings) GetAuctionId() uint64 { +func (m *Bid) GetAuctionId() uint64 { if m != nil { return m.AuctionId } return 0 } -func (m *DutchBiddings) GetAuctionStatus() string { +func (m *Bid) GetAuctionStatus() string { if m != nil { return m.AuctionStatus } return "" } -func (m *DutchBiddings) GetOutflowTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *Bid) GetOutflowTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { return m.OutflowTokenAmount } return github_com_cosmos_cosmos_sdk_types.Coin{} } -func (m *DutchBiddings) GetInflowTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *Bid) GetInflowTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { return m.InflowTokenAmount } return github_com_cosmos_cosmos_sdk_types.Coin{} } -func (m *DutchBiddings) GetBidder() string { +func (m *Bid) GetBidder() string { if m != nil { return m.Bidder } return "" } -func (m *DutchBiddings) GetBiddingTimestamp() time.Time { +func (m *Bid) GetBiddingTimestamp() time.Time { if m != nil { return m.BiddingTimestamp } return time.Time{} } -func (m *DutchBiddings) GetBiddingStatus() string { +func (m *Bid) GetBiddingStatus() string { if m != nil { return m.BiddingStatus } return "" } -func (m *DutchBiddings) GetAuctionMappingId() uint64 { +func (m *Bid) GetAuctionMappingId() uint64 { if m != nil { return m.AuctionMappingId } return 0 } -func (m *DutchBiddings) GetAppId() uint64 { +func (m *Bid) GetAppId() uint64 { if m != nil { return m.AppId } @@ -185,7 +185,7 @@ func (m *DutchAutoBidParams) XXX_DiscardUnknown() { var xxx_messageInfo_DutchAutoBidParams proto.InternalMessageInfo func init() { - proto.RegisterType((*DutchBiddings)(nil), "comdex.auctionsV2.v1beta1.DutchBiddings") + proto.RegisterType((*Bid)(nil), "comdex.auctionsV2.v1beta1.Bid") proto.RegisterType((*DutchAutoBidParams)(nil), "comdex.auctionsV2.v1beta1.DutchAutoBidParams") } @@ -194,52 +194,52 @@ func init() { } var fileDescriptor_6f6db8f3a6a396ec = []byte{ - // 663 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x8e, 0x4b, 0x1b, 0xc8, 0x56, 0xa9, 0x9a, 0xa5, 0x95, 0x92, 0x20, 0xec, 0x6a, 0x41, 0x10, - 0x0e, 0xb5, 0xd5, 0xd2, 0x13, 0x12, 0x12, 0x35, 0x55, 0x51, 0x84, 0x5a, 0x81, 0xa9, 0x38, 0x70, - 0x89, 0xd6, 0xf6, 0x26, 0x5d, 0x35, 0xf6, 0x5a, 0xf1, 0x9a, 0xd2, 0xb7, 0xe8, 0x11, 0x89, 0x77, - 0xe1, 0x5c, 0x6e, 0x3d, 0x22, 0x0e, 0x06, 0xb5, 0x6f, 0x90, 0x23, 0x27, 0xb4, 0x3f, 0x4e, 0xea, - 0x52, 0x09, 0x72, 0xb2, 0x67, 0xe6, 0x9b, 0x6f, 0x66, 0x67, 0xbf, 0x59, 0xf0, 0x20, 0x60, 0x51, - 0x48, 0x3e, 0x39, 0x38, 0x0b, 0x38, 0x65, 0x71, 0xfa, 0x7e, 0xd3, 0xf9, 0xb8, 0xe1, 0x13, 0x8e, - 0x37, 0x1c, 0x9f, 0x86, 0x76, 0x32, 0x62, 0x9c, 0xc1, 0x96, 0x02, 0xd9, 0x53, 0x90, 0xad, 0x41, - 0xed, 0x95, 0x01, 0x1b, 0x30, 0x89, 0x72, 0xc4, 0x9f, 0x4a, 0x68, 0x5b, 0x03, 0xc6, 0x06, 0x43, - 0xe2, 0x48, 0xcb, 0xcf, 0xfa, 0x0e, 0xa7, 0x11, 0x49, 0x39, 0x8e, 0x12, 0x0d, 0x30, 0x03, 0x96, - 0x46, 0x2c, 0x75, 0x7c, 0x9c, 0x92, 0x49, 0xc1, 0x80, 0xd1, 0x58, 0xc5, 0xd1, 0xb7, 0x2a, 0xa8, - 0xef, 0x64, 0x3c, 0x38, 0x74, 0x69, 0x18, 0xd2, 0x78, 0x90, 0xc2, 0x2d, 0x00, 0x7c, 0xf5, 0xdf, - 0xa3, 0x61, 0xd3, 0x58, 0x33, 0x3a, 0xf3, 0xee, 0xea, 0x38, 0xb7, 0x1a, 0x27, 0x38, 0x1a, 0x3e, - 0x43, 0xd3, 0x18, 0xf2, 0x6a, 0xda, 0xe8, 0x86, 0x22, 0x4b, 0x37, 0x2d, 0xb2, 0xe6, 0xae, 0x67, - 0x4d, 0x63, 0xc8, 0xab, 0x69, 0xa3, 0x1b, 0xc2, 0x17, 0x60, 0xa9, 0x88, 0xa4, 0x1c, 0xf3, 0x2c, - 0x6d, 0xde, 0x5a, 0x33, 0x3a, 0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2e, 0x4c, 0xe3, 0xf4, 0xd2, 0xac, 0x9c, 0x5f, 0x9a, 0x95, 0xef, 0x97, 0x66, - 0xe5, 0xc3, 0x56, 0xa9, 0x86, 0x78, 0x23, 0xd7, 0x59, 0xbf, 0x4f, 0x03, 0x8a, 0x87, 0xda, 0x76, - 0x4a, 0x4f, 0xab, 0xac, 0xea, 0x57, 0xa5, 0x2a, 0x9f, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0xd7, - 0x00, 0x5c, 0xc9, 0x7c, 0x05, 0x00, 0x00, -} - -func (m *DutchBiddings) Marshal() (dAtA []byte, err error) { + // 661 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0x8d, 0xfb, 0x93, 0xef, 0xcb, 0x54, 0xa9, 0x9a, 0xa1, 0x95, 0x92, 0x20, 0xec, 0x6a, 0x40, + 0x10, 0x16, 0xb5, 0xd5, 0xd2, 0x15, 0x12, 0x12, 0x35, 0x55, 0x51, 0x84, 0x5a, 0x81, 0xa9, 0x58, + 0xb0, 0x89, 0xc6, 0xf6, 0x24, 0x1d, 0x35, 0xf6, 0x58, 0xf1, 0x98, 0xd2, 0xb7, 0xe8, 0x12, 0x89, + 0x77, 0x81, 0x6d, 0x97, 0x5d, 0x22, 0x16, 0x06, 0xb5, 0x6f, 0x90, 0x25, 0x2b, 0x34, 0x3f, 0x4e, + 0xea, 0x52, 0x09, 0xb2, 0x4a, 0xee, 0xbd, 0xe7, 0x9e, 0x73, 0xe7, 0xce, 0x19, 0x83, 0xfb, 0x01, + 0x8b, 0x42, 0xf2, 0xd1, 0xc1, 0x59, 0xc0, 0x29, 0x8b, 0xd3, 0x77, 0x5b, 0xce, 0x87, 0x4d, 0x9f, + 0x70, 0xbc, 0xe9, 0xf8, 0x34, 0xb4, 0x93, 0x11, 0xe3, 0x0c, 0xb6, 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x45, 0x9c, 0x24, 0xdd, 0x10, 0x7d, 0x99, 0x03, + 0x70, 0x37, 0xe3, 0xc1, 0xd1, 0x4e, 0xc6, 0x99, 0x4b, 0xc3, 0xd7, 0x78, 0x84, 0xa3, 0x14, 0xbe, + 0x01, 0x0b, 0x29, 0x27, 0x89, 0x7c, 0x4a, 0x35, 0xf7, 0x99, 0xd8, 0xca, 0xf7, 0xdc, 0x7a, 0xf8, + 0x0f, 0x77, 0xb7, 0x4b, 0x82, 0x71, 0x6e, 0x2d, 0x29, 0x31, 0xc1, 0x81, 0x3c, 0x49, 0x05, 0x63, + 0xb0, 0x7c, 0x42, 0xf9, 0x51, 0x38, 0xc2, 0x27, 0x78, 0xd8, 0xeb, 0x13, 0x22, 0x5f, 0x5c, 0xcd, + 0x7d, 0x39, 0x33, 0xb9, 0x5e, 0x68, 0x99, 0x0d, 0x79, 0xf5, 0x69, 0x62, 0x8f, 0x10, 0x48, 0xc0, + 0x52, 0x30, 0x64, 0xa9, 0x58, 0x92, 0x10, 0x53, 0x8f, 0x74, 0x77, 0x66, 0x31, 0xa8, 0xc4, 0xae, + 0x51, 0x21, 0x0f, 0xe8, 0x68, 0x8f, 0x10, 0xf7, 0xe0, 0xfc, 0xd2, 0x34, 0x2e, 0x2e, 0x4d, 0xe3, + 0xe7, 0xa5, 0x69, 0x9c, 0x5d, 0x99, 0x95, 0x8b, 0x2b, 0xb3, 0xf2, 0xed, 0xca, 0xac, 0xbc, 0xdf, + 0x2e, 0x69, 0x88, 0x2f, 0xe3, 0x06, 0xeb, 0xf7, 0x69, 0x40, 0xf1, 0x50, 0xc7, 0x4e, 0xe9, 0x83, + 0x2a, 0x55, 0xfd, 0xaa, 0x74, 0xe5, 0x93, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x68, 0xbb, 0xdc, + 0xb1, 0x72, 0x05, 0x00, 0x00, +} + +func (m *Bid) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -249,12 +249,12 @@ func (m *DutchBiddings) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DutchBiddings) MarshalTo(dAtA []byte) (int, error) { +func (m *Bid) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DutchBiddings) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -395,7 +395,7 @@ func encodeVarintBid(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *DutchBiddings) Size() (n int) { +func (m *Bid) Size() (n int) { if m == nil { return 0 } @@ -455,7 +455,7 @@ func sovBid(x uint64) (n int) { func sozBid(x uint64) (n int) { return sovBid(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *DutchBiddings) Unmarshal(dAtA []byte) error { +func (m *Bid) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -478,10 +478,10 @@ func (m *DutchBiddings) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DutchBiddings: wiretype end group for non-group") + return fmt.Errorf("proto: Bid: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DutchBiddings: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Bid: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index 2e6fa963c..2cda76428 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -32,8 +32,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type LiquidationWhiteListing struct { AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` //------------Auction Types defn - // 0 auction type - "dutch" - //1 auction type - "english" + // true auction type - "dutch" + //false auction type - "english" AuctionType bool `protobuf:"varint,2,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` } From 31400570ff1164deb73e2ad8d839b461bbb80282 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sun, 16 Apr 2023 00:27:29 +0530 Subject: [PATCH 035/155] auction keeper changes --- x/auctionsV2/keeper/auctions.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index b9e17a53a..79326a1d5 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -28,7 +28,9 @@ func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtyp } func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidationtypes.LockedVault) error { + //Saving liquidatoin data to the auction struct + return nil } From cbc4975193908068fbb1db9d1a7968f49f894a47 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Wed, 19 Apr 2023 15:22:53 +0530 Subject: [PATCH 036/155] auction keeper changes --- proto/comdex/auctionsV2/v1beta1/auction.proto | 64 ++++++++----------- .../liquidationsV2/v1beta1/liquidate.proto | 9 ++- x/auctionsV2/keeper/auctions.go | 8 ++- 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index 8a233f66a..a00aa06b0 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -11,26 +11,26 @@ message Auctions{ uint64 auction_id = 1 [ (gogoproto.moretags) = "yaml:\"auction_id\"" ]; - cosmos.base.v1beta1.Coin outflow_token_init_amount = 2 [ + cosmos.base.v1beta1.Coin collateral_token = 2 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"outflow_token_init_amount\"", + (gogoproto.moretags) = "yaml:\"collateral_token\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - cosmos.base.v1beta1.Coin outflow_token_current_amount = 3 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"outflow_token_current_amount\"", - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" - ]; - cosmos.base.v1beta1.Coin inflow_token_target_amount = 4 [ + // cosmos.base.v1beta1.Coin outflow_token_current_amount = 3 [ + // (gogoproto.nullable) = false, + // (gogoproto.moretags) = "yaml:\"outflow_token_current_amount\"", + // (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + // ]; + cosmos.base.v1beta1.Coin debt_token = 4 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"inflow_token_target_amount\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - cosmos.base.v1beta1.Coin inflow_token_current_amount = 5 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"inflow_token_current_amount\"", - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" - ]; + // cosmos.base.v1beta1.Coin inflow_token_current_amount = 5 [ + // (gogoproto.nullable) = false, + // (gogoproto.moretags) = "yaml:\"inflow_token_current_amount\"", + // (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + // ]; uint64 active_bidding_id = 6 [ (gogoproto.moretags) = "yaml:\"active_bidding_id\"" ]; @@ -43,22 +43,22 @@ message Auctions{ (gogoproto.moretags) = "yaml:\"bid_factor\"" ]; // price indicator only for dutch auctions - string outflow_token_initial_price = 9 [ + string collateral_token_initial_price = 9 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outflow_token_initial_price\"" ]; - string outflow_token_current_price = 10 [ + string collateral_token_current_price = 10 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outflow_token_current_price\"" ]; - string outflow_token_end_price = 11 [ + string collateral_token_end_price = 11 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outflow_token_end_price\"" ]; - string inflow_token_current_price = 12 [ + string debt_token_current_price = 12 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"inflow_token_current_price\"" @@ -66,10 +66,6 @@ message Auctions{ uint64 locked_vault_id = 13 [ (gogoproto.moretags) = "yaml:\"locked_vault_id\"" ]; - string vault_owner = 14 [ - (gogoproto.moretags) = "yaml:\"vault_owner\"", - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" - ]; google.protobuf.Timestamp start_time = 15 [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true, @@ -80,24 +76,20 @@ message Auctions{ (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"end_time\"" ]; - google.protobuf.Timestamp bid_end_time = 17 [ - (gogoproto.nullable) = false, - (gogoproto.stdtime) = true, - (gogoproto.moretags) = "yaml:\"bid_end_time\"" - ]; + uint64 app_id = 18 [ (gogoproto.moretags) = "yaml:\"app_id\"" ]; - uint64 auction_mapping_id = 19 [ - (gogoproto.moretags) = "yaml:\"auction_mapping_id\"" - ]; - uint64 auction_status = 20 [ - (gogoproto.moretags) = "yaml:\"auction_status\"" - ]; + bool auction_type = 19 [ + (gogoproto.customname) = "AuctionType", + (gogoproto.moretags) = "yaml:\"auction_type\""]; + // uint64 auction_status = 20 [ + // (gogoproto.moretags) = "yaml:\"auction_status\"" + // ]; } -message bidOwnerMapping{ - uint64 bid_id = 1; - string bid_owner = 2; -} \ No newline at end of file +// message bidOwnerMapping{ +// uint64 bid_id = 1; +// string bid_owner = 2; +// } \ No newline at end of file diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index e66663984..ce61c773a 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -113,9 +113,12 @@ message LockedVault { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.moretags) = "yaml:\"fee_to_be_collected\""]; - string structure_type = 17 [ - (gogoproto.customname) = "StructureType", - (gogoproto.moretags) = "yaml:\"structure_type\""]; + string initiator_type = 17 [ + (gogoproto.customname) = "InitiatorType", + (gogoproto.moretags) = "yaml:\"initiator_type\""]; + bool auction_type = 18 [ + (gogoproto.customname) = "AuctionType", + (gogoproto.moretags) = "yaml:\"auction_type\""]; //updated_amount_out = amount_out + interest_accumulated + opening_fee_accumulated // // + closing_fee_accumulated diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 79326a1d5..eb3565bb4 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -28,9 +28,15 @@ func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtyp } func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidationtypes.LockedVault) error { - //Saving liquidatoin data to the auction struct + //Saving liquidation data to the auction struct + return nil } + + +//AUCTIONITERATOR + // -> DUCTHAUCTIONITERATOR + // -> ENGLISHAUCTIONITERATOR \ No newline at end of file From 41dc68f773c9ff745ea982e6ad38715267b56b7f Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 19 Apr 2023 15:26:46 +0530 Subject: [PATCH 037/155] adding pb files --- proto/comdex/auctionsV2/v1beta1/auction.proto | 8 +- x/auctionsV2/types/auction.pb.go | 494 +++++------------- x/liquidationsV2/types/liquidate.pb.go | 181 ++++--- 3 files changed, 240 insertions(+), 443 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index a00aa06b0..430884fe9 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -89,7 +89,7 @@ message Auctions{ } -// message bidOwnerMapping{ -// uint64 bid_id = 1; -// string bid_owner = 2; -// } \ No newline at end of file + message bidOwnerMapping{ + uint64 bid_id = 1; + string bid_owner = 2; + } \ No newline at end of file diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index 3e6cec123..e0873cc9a 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -30,27 +30,32 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Auctions struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` - OutflowTokenInitAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=outflow_token_init_amount,json=outflowTokenInitAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_token_init_amount" yaml:"outflow_token_init_amount"` - OutflowTokenCurrentAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=outflow_token_current_amount,json=outflowTokenCurrentAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_token_current_amount" yaml:"outflow_token_current_amount"` - InflowTokenTargetAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=inflow_token_target_amount,json=inflowTokenTargetAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_target_amount" yaml:"inflow_token_target_amount"` - InflowTokenCurrentAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=inflow_token_current_amount,json=inflowTokenCurrentAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_current_amount" yaml:"inflow_token_current_amount"` - ActiveBiddingId uint64 `protobuf:"varint,6,opt,name=active_bidding_id,json=activeBiddingId,proto3" json:"active_bidding_id,omitempty" yaml:"active_bidding_id"` - BiddingIds []*BidOwnerMapping `protobuf:"bytes,7,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` - BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + CollateralToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=collateral_token,json=collateralToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token" yaml:"collateral_token"` + // cosmos.base.v1beta1.Coin outflow_token_current_amount = 3 [ + // (gogoproto.nullable) = false, + // (gogoproto.moretags) = "yaml:\"outflow_token_current_amount\"", + // (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + // ]; + DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"inflow_token_target_amount"` + // cosmos.base.v1beta1.Coin inflow_token_current_amount = 5 [ + // (gogoproto.nullable) = false, + // (gogoproto.moretags) = "yaml:\"inflow_token_current_amount\"", + // (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + // ]; + ActiveBiddingId uint64 `protobuf:"varint,6,opt,name=active_bidding_id,json=activeBiddingId,proto3" json:"active_bidding_id,omitempty" yaml:"active_bidding_id"` + BiddingIds []*BidOwnerMapping `protobuf:"bytes,7,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` + BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` // price indicator only for dutch auctions - OutflowTokenInitialPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=outflow_token_initial_price,json=outflowTokenInitialPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_initial_price" yaml:"outflow_token_initial_price"` - OutflowTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=outflow_token_current_price,json=outflowTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_current_price" yaml:"outflow_token_current_price"` - OutflowTokenEndPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=outflow_token_end_price,json=outflowTokenEndPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_end_price" yaml:"outflow_token_end_price"` - InflowTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=inflow_token_current_price,json=inflowTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflow_token_current_price" yaml:"inflow_token_current_price"` - LockedVaultId uint64 `protobuf:"varint,13,opt,name=locked_vault_id,json=lockedVaultId,proto3" json:"locked_vault_id,omitempty" yaml:"locked_vault_id"` - VaultOwner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,14,opt,name=vault_owner,json=vaultOwner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"vault_owner,omitempty" yaml:"vault_owner"` - StartTime time.Time `protobuf:"bytes,15,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` - EndTime time.Time `protobuf:"bytes,16,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` - BidEndTime time.Time `protobuf:"bytes,17,opt,name=bid_end_time,json=bidEndTime,proto3,stdtime" json:"bid_end_time" yaml:"bid_end_time"` - AppId uint64 `protobuf:"varint,18,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AuctionMappingId uint64 `protobuf:"varint,19,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` - AuctionStatus uint64 `protobuf:"varint,20,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` + CollateralTokenInitialPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=collateral_token_initial_price,json=collateralTokenInitialPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_initial_price" yaml:"outflow_token_initial_price"` + CollateralTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=collateral_token_current_price,json=collateralTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_current_price" yaml:"outflow_token_current_price"` + CollateralTokenEndPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=collateral_token_end_price,json=collateralTokenEndPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_end_price" yaml:"outflow_token_end_price"` + DebtTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=debt_token_current_price,json=debtTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"debt_token_current_price" yaml:"inflow_token_current_price"` + LockedVaultId uint64 `protobuf:"varint,13,opt,name=locked_vault_id,json=lockedVaultId,proto3" json:"locked_vault_id,omitempty" yaml:"locked_vault_id"` + StartTime time.Time `protobuf:"bytes,15,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` + EndTime time.Time `protobuf:"bytes,16,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` + AppId uint64 `protobuf:"varint,18,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AuctionType bool `protobuf:"varint,19,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` } func (m *Auctions) Reset() { *m = Auctions{} } @@ -93,30 +98,16 @@ func (m *Auctions) GetAuctionId() uint64 { return 0 } -func (m *Auctions) GetOutflowTokenInitAmount() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *Auctions) GetCollateralToken() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { - return m.OutflowTokenInitAmount + return m.CollateralToken } return github_com_cosmos_cosmos_sdk_types.Coin{} } -func (m *Auctions) GetOutflowTokenCurrentAmount() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *Auctions) GetDebtToken() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { - return m.OutflowTokenCurrentAmount - } - return github_com_cosmos_cosmos_sdk_types.Coin{} -} - -func (m *Auctions) GetInflowTokenTargetAmount() github_com_cosmos_cosmos_sdk_types.Coin { - if m != nil { - return m.InflowTokenTargetAmount - } - return github_com_cosmos_cosmos_sdk_types.Coin{} -} - -func (m *Auctions) GetInflowTokenCurrentAmount() github_com_cosmos_cosmos_sdk_types.Coin { - if m != nil { - return m.InflowTokenCurrentAmount + return m.DebtToken } return github_com_cosmos_cosmos_sdk_types.Coin{} } @@ -142,13 +133,6 @@ func (m *Auctions) GetLockedVaultId() uint64 { return 0 } -func (m *Auctions) GetVaultOwner() github_com_cosmos_cosmos_sdk_types.AccAddress { - if m != nil { - return m.VaultOwner - } - return "" -} - func (m *Auctions) GetStartTime() time.Time { if m != nil { return m.StartTime @@ -163,13 +147,6 @@ func (m *Auctions) GetEndTime() time.Time { return time.Time{} } -func (m *Auctions) GetBidEndTime() time.Time { - if m != nil { - return m.BidEndTime - } - return time.Time{} -} - func (m *Auctions) GetAppId() uint64 { if m != nil { return m.AppId @@ -177,18 +154,11 @@ func (m *Auctions) GetAppId() uint64 { return 0 } -func (m *Auctions) GetAuctionMappingId() uint64 { - if m != nil { - return m.AuctionMappingId - } - return 0 -} - -func (m *Auctions) GetAuctionStatus() uint64 { +func (m *Auctions) GetAuctionType() bool { if m != nil { - return m.AuctionStatus + return m.AuctionType } - return 0 + return false } type BidOwnerMapping struct { @@ -253,67 +223,58 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 961 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xdd, 0x6e, 0x1b, 0x45, - 0x14, 0xc7, 0xb3, 0xb4, 0x49, 0xe3, 0x71, 0x53, 0xd7, 0xd3, 0x7c, 0xac, 0x9d, 0xd6, 0xeb, 0x2e, - 0x12, 0xb5, 0x90, 0xb2, 0x56, 0x43, 0xaf, 0xb8, 0x22, 0x0e, 0x01, 0x2c, 0x04, 0x54, 0x1b, 0x13, - 0x21, 0x24, 0xb4, 0x9a, 0xdd, 0x19, 0xbb, 0xa3, 0xd8, 0x3b, 0xab, 0xdd, 0x71, 0x4a, 0x9f, 0x80, - 0xdb, 0x48, 0x3c, 0x05, 0x12, 0x12, 0x12, 0x4f, 0xd1, 0xcb, 0x8a, 0x2b, 0xc4, 0xc5, 0x82, 0x92, - 0x37, 0xf0, 0x25, 0x57, 0x68, 0x3e, 0xd6, 0xeb, 0x75, 0x13, 0x1c, 0x0b, 0xae, 0xec, 0x39, 0x73, - 0xe6, 0x7f, 0x7e, 0x33, 0x7b, 0xce, 0x99, 0x01, 0x4f, 0x02, 0x36, 0xc2, 0xe4, 0xfb, 0x36, 0x1a, - 0x07, 0x9c, 0xb2, 0x30, 0x39, 0xd9, 0x6f, 0x9f, 0x3d, 0xf5, 0x09, 0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d5, 0x26, 0xa9, 0xb5, 0x55, 0x14, 0x52, 0xf3, 0xb6, 0xbb, 0xa1, 0x0d, 0xc7, 0x6a, 0x7c, - 0x04, 0x2a, 0x73, 0x7d, 0x15, 0x6e, 0x81, 0x35, 0xb1, 0xd9, 0xec, 0x59, 0xe3, 0xae, 0xfa, 0x14, - 0x77, 0x31, 0xdc, 0x05, 0xa2, 0xe7, 0xe9, 0xbc, 0x12, 0x4f, 0x95, 0x92, 0xbb, 0x9e, 0x2d, 0xed, - 0x7c, 0xf9, 0xfa, 0xa2, 0x61, 0xbc, 0xb9, 0x68, 0x18, 0x7f, 0x5d, 0x34, 0x8c, 0xf3, 0xcb, 0xc6, - 0xca, 0x9b, 0xcb, 0xc6, 0xca, 0xef, 0x97, 0x8d, 0x95, 0x6f, 0x9f, 0x15, 0x32, 0x4c, 0xf4, 0xf6, - 0x3d, 0xd6, 0xef, 0xd3, 0x80, 0xa2, 0xa1, 0x1e, 0xb7, 0x0b, 0xaf, 0x3d, 0x99, 0x73, 0xfe, 0x9a, - 0xfc, 0x20, 0x1f, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0x30, 0xe5, 0xc2, 0x55, 0x0f, 0x0a, 0x00, + // 817 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0x8f, 0x61, 0x37, 0x9b, 0x4c, 0x5a, 0x65, 0xeb, 0xa5, 0xbb, 0xde, 0x14, 0xec, 0xe0, 0xc3, + 0x6e, 0x84, 0x54, 0x5b, 0x2d, 0x3d, 0x71, 0xc3, 0xa5, 0x88, 0x20, 0x01, 0x95, 0x89, 0x2a, 0xc4, + 0xc5, 0x1a, 0x7b, 0x26, 0x66, 0x54, 0xc7, 0x63, 0xd9, 0x93, 0x96, 0x7e, 0x07, 0x40, 0xbd, 0xf2, + 0x41, 0xf8, 0x0e, 0x3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0xd5, 0x5a, 0x96, 0xd6, 0x2b, 0x89, + 0xdd, 0x04, 0xb0, 0xff, 0x2e, 0xad, 0xb7, 0x31, 0x61, 0x3f, 0xcc, 0x43, 0x27, 0xa2, 0x33, 0x57, + 0x1d, 0x43, 0xfe, 0xec, 0x16, 0xe8, 0xd4, 0x65, 0x17, 0x19, 0x2e, 0x04, 0x96, 0xdf, 0xaf, 0xab, + 0x27, 0xbc, 0x58, 0xff, 0x45, 0x03, 0x00, 0xe1, 0x90, 0x29, 0x31, 0x4f, 0x1e, 0x13, 0x33, 0x51, + 0x62, 0x3e, 0x94, 0x62, 0x48, 0x3a, 0x4d, 0xe8, 0xb9, 0x2c, 0x0e, 0x18, 0xcc, 0x63, 0xcc, 0x02, + 0x38, 0xa3, 0xf3, 0x94, 0xad, 0x25, 0xab, 0xcb, 0x25, 0x48, 0x41, 0x5f, 0x80, 0x2d, 0x18, 0x31, + 0x72, 0x86, 0x83, 0x90, 0x20, 0x44, 0xd2, 0x98, 0x37, 0xb8, 0x2d, 0x1a, 0xfc, 0xfe, 0xb2, 0xb4, + 0x0c, 0xd5, 0xe0, 0x66, 0x8a, 0xed, 0xf7, 0x65, 0xcc, 0x93, 0xa1, 0x31, 0xd2, 0x23, 0xd0, 0xab, + 0xf7, 0x0b, 0xe3, 0xd9, 0xf0, 0xdd, 0x51, 0x6f, 0xff, 0x23, 0xe7, 0x5f, 0x2f, 0x8e, 0x13, 0x12, + 0xf4, 0xcd, 0x79, 0x8a, 0xf3, 0xaf, 0x60, 0x96, 0x91, 0x34, 0xf6, 0x5e, 0x2e, 0x4b, 0x4b, 0x97, + 0x7c, 0x77, 0x80, 0x6c, 0x1f, 0x84, 0x15, 0x47, 0xa1, 0x87, 0x80, 0xaf, 0x82, 0x29, 0x8c, 0x18, + 0xcd, 0x8d, 0xce, 0x50, 0x1b, 0x75, 0xbd, 0x43, 0xde, 0xa3, 0x3f, 0x4a, 0xeb, 0xcd, 0x7f, 0x38, + 0xfe, 0x67, 0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a, 0xdb, 0x13, 0xb6, + 0x45, 0x17, 0x3f, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x96, 0x9c, 0xaf, 0x72, 0x07, 0x00, 0x00, } @@ -337,15 +298,13 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.AuctionStatus != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionStatus)) - i-- - dAtA[i] = 0x1 + if m.AuctionType { i-- - dAtA[i] = 0xa0 - } - if m.AuctionMappingId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionMappingId)) + if m.AuctionType { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } i-- dAtA[i] = 0x1 i-- @@ -358,7 +317,7 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x90 } - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BidEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BidEndTime):]) + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) if err1 != nil { return 0, err1 } @@ -367,41 +326,24 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0x8a - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) + dAtA[i] = 0x82 + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) if err2 != nil { return 0, err2 } i -= n2 i = encodeVarintAuction(dAtA, i, uint64(n2)) i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintAuction(dAtA, i, uint64(n3)) - i-- dAtA[i] = 0x7a - if len(m.VaultOwner) > 0 { - i -= len(m.VaultOwner) - copy(dAtA[i:], m.VaultOwner) - i = encodeVarintAuction(dAtA, i, uint64(len(m.VaultOwner))) - i-- - dAtA[i] = 0x72 - } if m.LockedVaultId != 0 { i = encodeVarintAuction(dAtA, i, uint64(m.LockedVaultId)) i-- dAtA[i] = 0x68 } { - size := m.InflowTokenCurrentPrice.Size() + size := m.DebtTokenCurrentPrice.Size() i -= size - if _, err := m.InflowTokenCurrentPrice.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.DebtTokenCurrentPrice.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintAuction(dAtA, i, uint64(size)) @@ -409,9 +351,9 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x62 { - size := m.OutflowTokenEndPrice.Size() + size := m.CollateralTokenEndPrice.Size() i -= size - if _, err := m.OutflowTokenEndPrice.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.CollateralTokenEndPrice.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintAuction(dAtA, i, uint64(size)) @@ -419,9 +361,9 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x5a { - size := m.OutflowTokenCurrentPrice.Size() + size := m.CollateralTokenCurrentPrice.Size() i -= size - if _, err := m.OutflowTokenCurrentPrice.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.CollateralTokenCurrentPrice.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintAuction(dAtA, i, uint64(size)) @@ -429,9 +371,9 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x52 { - size := m.OutflowTokenInitialPrice.Size() + size := m.CollateralTokenInitialPrice.Size() i -= size - if _, err := m.OutflowTokenInitialPrice.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.CollateralTokenInitialPrice.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintAuction(dAtA, i, uint64(size)) @@ -468,17 +410,7 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x30 } { - size, err := m.InflowTokenCurrentAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size, err := m.InflowTokenTargetAmount.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DebtToken.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -488,17 +420,7 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 { - size, err := m.OutflowTokenCurrentAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.OutflowTokenInitAmount.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.CollateralToken.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -570,13 +492,9 @@ func (m *Auctions) Size() (n int) { if m.AuctionId != 0 { n += 1 + sovAuction(uint64(m.AuctionId)) } - l = m.OutflowTokenInitAmount.Size() + l = m.CollateralToken.Size() n += 1 + l + sovAuction(uint64(l)) - l = m.OutflowTokenCurrentAmount.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.InflowTokenTargetAmount.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.InflowTokenCurrentAmount.Size() + l = m.DebtToken.Size() n += 1 + l + sovAuction(uint64(l)) if m.ActiveBiddingId != 0 { n += 1 + sovAuction(uint64(m.ActiveBiddingId)) @@ -589,35 +507,26 @@ func (m *Auctions) Size() (n int) { } l = m.BidFactor.Size() n += 1 + l + sovAuction(uint64(l)) - l = m.OutflowTokenInitialPrice.Size() + l = m.CollateralTokenInitialPrice.Size() n += 1 + l + sovAuction(uint64(l)) - l = m.OutflowTokenCurrentPrice.Size() + l = m.CollateralTokenCurrentPrice.Size() n += 1 + l + sovAuction(uint64(l)) - l = m.OutflowTokenEndPrice.Size() + l = m.CollateralTokenEndPrice.Size() n += 1 + l + sovAuction(uint64(l)) - l = m.InflowTokenCurrentPrice.Size() + l = m.DebtTokenCurrentPrice.Size() n += 1 + l + sovAuction(uint64(l)) if m.LockedVaultId != 0 { n += 1 + sovAuction(uint64(m.LockedVaultId)) } - l = len(m.VaultOwner) - if l > 0 { - n += 1 + l + sovAuction(uint64(l)) - } l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) n += 1 + l + sovAuction(uint64(l)) l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) n += 2 + l + sovAuction(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BidEndTime) - n += 2 + l + sovAuction(uint64(l)) if m.AppId != 0 { n += 2 + sovAuction(uint64(m.AppId)) } - if m.AuctionMappingId != 0 { - n += 2 + sovAuction(uint64(m.AuctionMappingId)) - } - if m.AuctionStatus != 0 { - n += 2 + sovAuction(uint64(m.AuctionStatus)) + if m.AuctionType { + n += 3 } return n } @@ -694,7 +603,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { } case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenInitAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CollateralToken", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -721,46 +630,13 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.OutflowTokenInitAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenCurrentAmount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.OutflowTokenCurrentAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CollateralToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenTargetAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DebtToken", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -787,40 +663,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.InflowTokenTargetAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenCurrentAmount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InflowTokenCurrentAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DebtToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -913,7 +756,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenInitialPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenInitialPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -941,13 +784,13 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.OutflowTokenInitialPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CollateralTokenInitialPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenCurrentPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenCurrentPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -975,13 +818,13 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.OutflowTokenCurrentPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CollateralTokenCurrentPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenEndPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenEndPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1009,13 +852,13 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.OutflowTokenEndPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CollateralTokenEndPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenCurrentPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenCurrentPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1043,7 +886,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.InflowTokenCurrentPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DebtTokenCurrentPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1066,38 +909,6 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { break } } - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VaultOwner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VaultOwner = github_com_cosmos_cosmos_sdk_types.AccAddress(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 15: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) @@ -1164,39 +975,6 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BidEndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BidEndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 18: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) @@ -1218,28 +996,9 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { } case 19: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 20: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AuctionType", wireType) } - m.AuctionStatus = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuction @@ -1249,11 +1008,12 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.AuctionStatus |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } + m.AuctionType = bool(v != 0) default: iNdEx = preIndex skippy, err := skipAuction(dAtA[iNdEx:]) diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index 2cda76428..2323894b0 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -124,7 +124,8 @@ type LockedVault struct { IsExternalKeeper string `protobuf:"bytes,14,opt,name=is_external_keeper,json=isExternalKeeper,proto3" json:"is_external_keeper,omitempty" yaml:"is_external_keeper"` ExternalKeeperAddress string `protobuf:"bytes,15,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` FeeToBeCollected github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,16,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee_to_be_collected" yaml:"fee_to_be_collected"` - StructureType string `protobuf:"bytes,17,opt,name=structure_type,json=structureType,proto3" json:"structure_type,omitempty" yaml:"structure_type"` + InitiatorType string `protobuf:"bytes,17,opt,name=initiator_type,json=initiatorType,proto3" json:"initiator_type,omitempty" yaml:"initiator_type"` + AuctionType bool `protobuf:"varint,18,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` } func (m *LockedVault) Reset() { *m = LockedVault{} } @@ -171,70 +172,71 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 1005 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcd, 0x6e, 0xe3, 0x44, - 0x1c, 0x8f, 0x97, 0xb6, 0xb4, 0x93, 0x7e, 0xa4, 0xd3, 0x76, 0xeb, 0x8d, 0xb6, 0x9e, 0x62, 0x89, - 0xaa, 0x42, 0x6a, 0x42, 0x77, 0x2f, 0x08, 0x2e, 0xdb, 0x74, 0x17, 0x11, 0x51, 0xd1, 0xc5, 0x54, - 0x8b, 0xb4, 0x07, 0xcc, 0xc4, 0x9e, 0xa4, 0xa3, 0x3a, 0x9e, 0x60, 0x8f, 0x97, 0xf6, 0x29, 0x58, - 0x4e, 0xbc, 0x02, 0x12, 0xcf, 0x80, 0xc4, 0xb1, 0xc7, 0x3d, 0x22, 0x0e, 0x03, 0xb8, 0x6f, 0xe0, - 0x27, 0x40, 0xf3, 0x91, 0x0f, 0x67, 0xb3, 0x42, 0xb9, 0xc4, 0xf1, 0xfc, 0x7f, 0x1f, 0xff, 0x9f, - 0x3d, 0xfe, 0xdb, 0xe0, 0x28, 0x60, 0xfd, 0x90, 0x5c, 0x37, 0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, 0x2e, 0x53, 0x4d, 0xa1, 0x46, 0xa9, 0x36, 0xc6, 0xa9, 0xca, 0xa4, 0xb7, - 0x52, 0xbd, 0x43, 0xc1, 0xf5, 0x76, 0xc8, 0x2c, 0x22, 0xfc, 0xc9, 0x02, 0x5b, 0x5d, 0x42, 0xcc, - 0x2e, 0x97, 0x3b, 0x9b, 0x04, 0x9c, 0x84, 0x76, 0x4d, 0x39, 0x7e, 0x3f, 0xf7, 0xe6, 0xad, 0x7d, - 0x4e, 0x88, 0x7c, 0x2a, 0x4e, 0x87, 0x4a, 0x85, 0x40, 0x75, 0xdd, 0xda, 0x0c, 0x1b, 0xd7, 0xab, - 0x75, 0xa7, 0xf0, 0xf0, 0x6b, 0xb0, 0x9e, 0xf2, 0x24, 0x0b, 0x78, 0x96, 0x10, 0xfd, 0xee, 0xdd, - 0x54, 0xbd, 0x7c, 0x24, 0x5f, 0x74, 0xdf, 0x0c, 0x2b, 0xe6, 0xed, 0xbb, 0xa3, 0xa5, 0xcb, 0x04, - 0xd7, 0x5b, 0x4b, 0x27, 0x71, 0xad, 0x97, 0xb7, 0xff, 0x3a, 0x95, 0x5f, 0x73, 0xa7, 0x72, 0x9b, - 0x3b, 0xd6, 0x9b, 0xdc, 0xb1, 0xfe, 0xc9, 0x1d, 0xeb, 0xf5, 0x9d, 0x53, 0x79, 0x73, 0xe7, 0x54, - 0xfe, 0xbc, 0x73, 0x2a, 0x2f, 0x3f, 0x29, 0x05, 0x94, 0x9f, 0x2f, 0x47, 0xac, 0xdb, 0xa5, 0x01, - 0xc5, 0x91, 0x39, 0x6f, 0xbe, 0xf5, 0xfd, 0xa3, 0x62, 0x77, 0x96, 0xd4, 0x73, 0xf5, 0xf8, 0xbf, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xc8, 0xa9, 0x6a, 0x25, 0x09, 0x00, 0x00, + // 1013 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,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0f, 0x2b, 0xe6, 0xf6, 0xdd, 0x1e, 0x3e, 0xcb, 0x32, + 0xc1, 0xf5, 0x56, 0x69, 0x19, 0x77, 0xe7, 0x32, 0x87, 0xff, 0xfb, 0x32, 0x6f, 0xbd, 0xba, 0xf9, + 0xc7, 0xa9, 0xfc, 0x9a, 0x3b, 0x95, 0x9b, 0xdc, 0xb1, 0xde, 0xe6, 0x8e, 0xf5, 0x77, 0xee, 0x58, + 0x6f, 0x6e, 0x9d, 0xca, 0xdb, 0x5b, 0xa7, 0xf2, 0xc7, 0xad, 0x53, 0x79, 0xf5, 0xc9, 0xc4, 0x5e, + 0xc9, 0x5f, 0x42, 0x87, 0xac, 0xdb, 0xa5, 0x01, 0xc5, 0x91, 0xf9, 0xde, 0xbc, 0xf3, 0x53, 0x4a, + 0xed, 0x60, 0x67, 0x51, 0xbd, 0xa2, 0x4f, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xda, 0x41, 0xa0, + 0xcc, 0x70, 0x09, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -323,10 +325,22 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.StructureType) > 0 { - i -= len(m.StructureType) - copy(dAtA[i:], m.StructureType) - i = encodeVarintLiquidate(dAtA, i, uint64(len(m.StructureType))) + if m.AuctionType { + i-- + if m.AuctionType { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if len(m.InitiatorType) > 0 { + i -= len(m.InitiatorType) + copy(dAtA[i:], m.InitiatorType) + i = encodeVarintLiquidate(dAtA, i, uint64(len(m.InitiatorType))) i-- dAtA[i] = 0x1 i-- @@ -552,10 +566,13 @@ func (m *LockedVault) Size() (n int) { } l = m.FeeToBeCollected.Size() n += 2 + l + sovLiquidate(uint64(l)) - l = len(m.StructureType) + l = len(m.InitiatorType) if l > 0 { n += 2 + l + sovLiquidate(uint64(l)) } + if m.AuctionType { + n += 3 + } return n } @@ -1215,7 +1232,7 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 17: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StructureType", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitiatorType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1243,8 +1260,28 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.StructureType = string(dAtA[iNdEx:postIndex]) + m.InitiatorType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionType", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AuctionType = bool(v != 0) default: iNdEx = preIndex skippy, err := skipLiquidate(dAtA[iNdEx:]) From 122f915cf73c36285e260dd1d8e965fb74bbc62f Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Wed, 19 Apr 2023 16:04:36 +0530 Subject: [PATCH 038/155] auction proto changes --- proto/comdex/auctionsV2/v1beta1/bid.proto | 29 ++++++++------- .../liquidationsV2/v1beta1/liquidate.proto | 3 ++ x/auctionsV2/keeper/auctions.go | 18 ++++++---- x/auctionsV2/keeper/keeper.go | 24 +++++++------ x/auctionsV2/keeper/utils.go | 36 +++++++++++++++++++ x/auctionsV2/types/keys.go | 6 ++-- x/liquidationsV2/keeper/liquidate.go | 9 +++-- x/liquidationsV2/types/keys.go | 2 +- 8 files changed, 91 insertions(+), 36 deletions(-) create mode 100644 x/auctionsV2/keeper/utils.go diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto index 660dab9b8..04ce2ad63 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -15,41 +15,34 @@ message Bid{ uint64 auction_id = 2 [ (gogoproto.moretags) = "yaml:\"auction_id\"" ]; - - string auction_status = 3 [ - (gogoproto.moretags) = "yaml:\"auction_status\"" - ]; - cosmos.base.v1beta1.Coin outflow_token_amount = 4 [ + cosmos.base.v1beta1.Coin collateral_token_amount = 4 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outflow_token_amount\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - cosmos.base.v1beta1.Coin inflow_token_amount = 5 [ + cosmos.base.v1beta1.Coin debt_token_amount = 5 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"inflow_token_amount\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - string bidder = 6 [ + string bidder_address = 6 [ (gogoproto.moretags) = "yaml:\"bidder\"" ]; - google.protobuf.Timestamp bidding_timestamp = 7 [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"bidding_timestamp\"" ]; - string bidding_status = 8 [ + //Market Order Bidding - 0 + //Limit Order Bidding - 1 + bool bidding_type = 8 [ (gogoproto.moretags) = "yaml:\"bidding_status\"" ]; - uint64 auction_mapping_id = 9 [ - (gogoproto.moretags) = "yaml:\"auction_mapping_id\"" - ]; - uint64 app_id = 10 [ (gogoproto.moretags) = "yaml:\"app_id\"" ]; @@ -80,3 +73,13 @@ message DutchAutoBidParams{ ]; } + + + + +// Bidding Structs +//1. Market Bid +//2. ACBI LIMIT ORDER BIDS + + +//Limit Order Bids diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index ce61c773a..780671836 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -21,6 +21,9 @@ message LiquidationWhiteListing { bool auction_type = 2 [ (gogoproto.customname) = "AuctionType", (gogoproto.moretags) = "yaml:\"auction_type\""]; + + //discount + //upar kitna se start hoga } diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index eb3565bb4..3652e1b56 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,8 +1,7 @@ package keeper import ( - - // "github.com/comdex-official/comdex/types" + "github.com/comdex-official/comdex/x/auctionsV2/types" liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -28,15 +27,22 @@ func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtyp } func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidationtypes.LockedVault) error { + + //Getting previous auction ID + auctionID := k.GetAuctionID(ctx) //Saving liquidation data to the auction struct - + auctionData := types.Auctions{ + AuctionId: auctionID+1, + CollateralToken: liquidationData.AmountIn, + + + } return nil } - //AUCTIONITERATOR - // -> DUCTHAUCTIONITERATOR - // -> ENGLISHAUCTIONITERATOR \ No newline at end of file +// -> DUCTHAUCTIONITERATOR +// -> ENGLISHAUCTIONITERATOR diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index 19c3693b3..bc6314e0b 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -3,6 +3,7 @@ package keeper import ( "context" "fmt" + "github.com/comdex-official/comdex/x/auctionsV2/expected" "github.com/comdex-official/comdex/x/auctionsV2/types" "github.com/cosmos/cosmos-sdk/codec" @@ -13,12 +14,12 @@ import ( type ( Keeper struct { - cdc codec.BinaryCodec - storeKey sdk.StoreKey - memKey sdk.StoreKey - paramstore paramtypes.Subspace + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey + paramstore paramtypes.Subspace LiquidationsV2 expected.LiquidationsV2Keeper - bankKeeper types.BankKeeper + bankKeeper types.BankKeeper } ) @@ -42,15 +43,18 @@ func NewKeeper( return Keeper{ - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - paramstore: ps, + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + paramstore: ps, LiquidationsV2: LiquidationsV2Keeper, - bankKeeper: bankKeeper, + bankKeeper: bankKeeper, } } func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } +func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { + return ctx.KVStore(k.storeKey) +} diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go new file mode 100644 index 000000000..3f406f843 --- /dev/null +++ b/x/auctionsV2/keeper/utils.go @@ -0,0 +1,36 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/auctionsV2/types" + sdk "github.com/cosmos/cosmos-sdk/types" + protobuftypes "github.com/gogo/protobuf/types" +) + +func (k Keeper) SetAuctionID(ctx sdk.Context, id uint64) { + var ( + store = k.Store(ctx) + key = types.AuctionIDKey + value = k.cdc.MustMarshal( + &protobuftypes.UInt64Value{ + Value: id, + }, + ) + ) + store.Set(key, value) +} +func (k Keeper) GetAuctionID(ctx sdk.Context) uint64 { + var ( + store = k.Store(ctx) + key = types.AuctionIDKey + value = store.Get(key) + ) + + if value == nil { + return 0 + } + + var id protobuftypes.UInt64Value + k.cdc.MustUnmarshal(value, &id) + + return id.GetValue() +} diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index d78115f58..cbd7a47a0 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -17,6 +17,6 @@ const ( MemStoreKey = "mem_newauc" ) -func KeyPrefix(p string) []byte { - return []byte(p) -} +var ( + AuctionIDKey = []byte{0x01} +) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index a826ace40..e9eeec40c 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -116,9 +116,11 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error } //Calculating Liquidation Fees feesToBeCollected := sdk.NewDecFromInt(totalOut).Mul(extPair.LiquidationPenalty).TruncateInt() + //Getting app whitelisted Data + whitelistingData, _ := k.GetLiquidationWhiteListing(ctx, liquidationData.AppId) //Creating locked vault struct , which will trigger auction - err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, vault.AmountIn, totalOut, vault.AmountIn, totalOut, collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected) + err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, vault.AmountIn, totalOut, vault.AmountIn, totalOut, collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected, "vault", whitelistingData.auctionType) if err != nil { return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for Vault %d", vault.Id) } @@ -137,7 +139,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error return nil } -func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Int, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int) error { +func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Int, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, initiatorType string, auctionType bool) error { lockedVaultID := k.GetLockedVaultID(ctx) value := types.LockedVault{ @@ -157,7 +159,8 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair InternalKeeperAddress: "", IsExternalKeeper: "", ExternalKeeperAddress: "", - StructureType: "vault", + InitiatorType: initiatorType, + AuctionType: auctionType, } k.SetLockedVault(ctx, value) diff --git a/x/liquidationsV2/types/keys.go b/x/liquidationsV2/types/keys.go index 4593e3e8f..d9b7a6b8a 100644 --- a/x/liquidationsV2/types/keys.go +++ b/x/liquidationsV2/types/keys.go @@ -15,7 +15,7 @@ const ( // QuerierRoute defines the module's query routing key QuerierRoute = ModuleName - // MemStoreKey defines the in-memory store key + // MemStoreKey defines the in-memory store key. MemStoreKey = "mem_newliq" ) From eebe1badee44483bb07cf7b5c488eb9282068b00 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 19 Apr 2023 16:13:13 +0530 Subject: [PATCH 039/155] adding pb files --- .../liquidationsV2/v1beta1/liquidate.proto | 36 +-- x/auctionsV2/types/bid.pb.go | 272 ++++++------------ x/liquidationsV2/types/liquidate.pb.go | 226 +++++++-------- 3 files changed, 217 insertions(+), 317 deletions(-) diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index 780671836..891fec6c9 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -5,6 +5,7 @@ import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; + option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; option (gogoproto.equal_all) = false; option (gogoproto.goproto_getters_all) = false; @@ -60,15 +61,14 @@ message LockedVault { (gogoproto.customname) = "Owner", (gogoproto.moretags) = "yaml:\"owner\""]; - string amount_in = 6 [ - (gogoproto.customname) = "AmountIn", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"amount_in\"", - (gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin amount_in = 6 [ + (gogoproto.nullable) = false, + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.moretags) = "yaml:\"amount_in\"" + ]; - string amount_out = 7 [ - (gogoproto.customname) = "AmountOut", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + cosmos.base.v1beta1.Coin amount_out = 7 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.moretags) = "yaml:\"amount_out\"", (gogoproto.nullable) = false]; @@ -77,18 +77,18 @@ message LockedVault { (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"current_collateralisation_ratio\""]; - - string collateral_to_be_auctioned =9 [ + + cosmos.base.v1beta1.Coin collateral_to_be_auctioned =9 [ (gogoproto.nullable) = false, - (gogoproto.customname) = "CollateralToBeAuctioned", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"collateral_to_be_auctioned\""]; - string target_debt =10 [ + (gogoproto.moretags) = "yaml:\"CollateralToBeAuctioned\"", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + cosmos.base.v1beta1.Coin target_debt =10 [ (gogoproto.nullable) = false, - (gogoproto.customname) = "TargetDebt", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"target_debt\""]; - + (gogoproto.moretags) = "yaml:\"target_debt\"", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + google.protobuf.Timestamp liquidation_timestamp = 11 [ (gogoproto.customname) = "LiquidationTimestamp", (gogoproto.nullable) = false, diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index a552350d5..574a4d320 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -30,16 +30,16 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Bid struct { - BiddingId uint64 `protobuf:"varint,1,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` - AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` - AuctionStatus string `protobuf:"bytes,3,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` - OutflowTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=outflow_token_amount,json=outflowTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_token_amount" yaml:"outflow_token_amount"` - InflowTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=inflow_token_amount,json=inflowTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_amount" yaml:"inflow_token_amount"` - Bidder string `protobuf:"bytes,6,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` - BiddingTimestamp time.Time `protobuf:"bytes,7,opt,name=bidding_timestamp,json=biddingTimestamp,proto3,stdtime" json:"bidding_timestamp" yaml:"bidding_timestamp"` - BiddingStatus string `protobuf:"bytes,8,opt,name=bidding_status,json=biddingStatus,proto3" json:"bidding_status,omitempty" yaml:"bidding_status"` - AuctionMappingId uint64 `protobuf:"varint,9,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` - AppId uint64 `protobuf:"varint,10,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + BiddingId uint64 `protobuf:"varint,1,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` + AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + CollateralTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=collateral_token_amount,json=collateralTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token_amount" yaml:"outflow_token_amount"` + DebtTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=debt_token_amount,json=debtTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token_amount" yaml:"inflow_token_amount"` + BidderAddress string `protobuf:"bytes,6,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` + BiddingTimestamp time.Time `protobuf:"bytes,7,opt,name=bidding_timestamp,json=biddingTimestamp,proto3,stdtime" json:"bidding_timestamp" yaml:"bidding_timestamp"` + //Market Order Bidding - 0 + //Limit Order Bidding - 1 + BiddingType bool `protobuf:"varint,8,opt,name=bidding_type,json=biddingType,proto3" json:"bidding_type,omitempty" yaml:"bidding_status"` + AppId uint64 `protobuf:"varint,10,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` } func (m *Bid) Reset() { *m = Bid{} } @@ -89,30 +89,23 @@ func (m *Bid) GetAuctionId() uint64 { return 0 } -func (m *Bid) GetAuctionStatus() string { +func (m *Bid) GetCollateralTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { - return m.AuctionStatus - } - return "" -} - -func (m *Bid) GetOutflowTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { - if m != nil { - return m.OutflowTokenAmount + return m.CollateralTokenAmount } return github_com_cosmos_cosmos_sdk_types.Coin{} } -func (m *Bid) GetInflowTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *Bid) GetDebtTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { - return m.InflowTokenAmount + return m.DebtTokenAmount } return github_com_cosmos_cosmos_sdk_types.Coin{} } -func (m *Bid) GetBidder() string { +func (m *Bid) GetBidderAddress() string { if m != nil { - return m.Bidder + return m.BidderAddress } return "" } @@ -124,18 +117,11 @@ func (m *Bid) GetBiddingTimestamp() time.Time { return time.Time{} } -func (m *Bid) GetBiddingStatus() string { - if m != nil { - return m.BiddingStatus - } - return "" -} - -func (m *Bid) GetAuctionMappingId() uint64 { +func (m *Bid) GetBiddingType() bool { if m != nil { - return m.AuctionMappingId + return m.BiddingType } - return 0 + return false } func (m *Bid) GetAppId() uint64 { @@ -194,49 +180,47 @@ func init() { } var fileDescriptor_6f6db8f3a6a396ec = []byte{ - // 661 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x8d, 0xfb, 0x93, 0xef, 0xcb, 0x54, 0xa9, 0x9a, 0xa1, 0x95, 0x92, 0x20, 0xec, 0x6a, 0x40, - 0x10, 0x16, 0xb5, 0xd5, 0xd2, 0x15, 0x12, 0x12, 0x35, 0x55, 0x51, 0x84, 0x5a, 0x81, 0xa9, 0x58, - 0xb0, 0x89, 0xc6, 0xf6, 0x24, 0x1d, 0x35, 0xf6, 0x58, 0xf1, 0x98, 0xd2, 0xb7, 0xe8, 0x12, 0x89, - 0x77, 0x81, 0x6d, 0x97, 0x5d, 0x22, 0x16, 0x06, 0xb5, 0x6f, 0x90, 0x25, 0x2b, 0x34, 0x3f, 0x4e, - 0xea, 0x52, 0x09, 0xb2, 0x4a, 0xee, 0xbd, 0xe7, 0x9e, 0x73, 0xe7, 0xce, 0x19, 0x83, 0xfb, 0x01, - 0x8b, 0x42, 0xf2, 0xd1, 0xc1, 0x59, 0xc0, 0x29, 0x8b, 0xd3, 0x77, 0x5b, 0xce, 0x87, 0x4d, 0x9f, - 0x70, 0xbc, 0xe9, 0xf8, 0x34, 0xb4, 0x93, 0x11, 0xe3, 0x0c, 0xb6, 0x14, 0xc8, 0x9e, 0x82,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0x10, 0x7d, 0x99, 0x03, - 0x70, 0x37, 0xe3, 0xc1, 0xd1, 0x4e, 0xc6, 0x99, 0x4b, 0xc3, 0xd7, 0x78, 0x84, 0xa3, 0x14, 0xbe, - 0x01, 0x0b, 0x29, 0x27, 0x89, 0x7c, 0x4a, 0x35, 0xf7, 0x99, 0xd8, 0xca, 0xf7, 0xdc, 0x7a, 0xf8, - 0x0f, 0x77, 0xb7, 0x4b, 0x82, 0x71, 0x6e, 0x2d, 0x29, 0x31, 0xc1, 0x81, 0x3c, 0x49, 0x05, 0x63, - 0xb0, 0x7c, 0x42, 0xf9, 0x51, 0x38, 0xc2, 0x27, 0x78, 0xd8, 0xeb, 0x13, 0x22, 0x5f, 0x5c, 0xcd, - 0x7d, 0x39, 0x33, 0xb9, 0x5e, 0x68, 0x99, 0x0d, 0x79, 0xf5, 0x69, 0x62, 0x8f, 0x10, 0x48, 0xc0, - 0x52, 0x30, 0x64, 0xa9, 0x58, 0x92, 0x10, 0x53, 0x8f, 0x74, 0x77, 0x66, 0x31, 0xa8, 0xc4, 0xae, - 0x51, 0x21, 0x0f, 0xe8, 0x68, 0x8f, 0x10, 0xf7, 0xe0, 0xfc, 0xd2, 0x34, 0x2e, 0x2e, 0x4d, 0xe3, - 0xe7, 0xa5, 0x69, 0x9c, 0x5d, 0x99, 0x95, 0x8b, 0x2b, 0xb3, 0xf2, 0xed, 0xca, 0xac, 0xbc, 0xdf, - 0x2e, 0x69, 0x88, 0x2f, 0xe3, 0x06, 0xeb, 0xf7, 0x69, 0x40, 0xf1, 0x50, 0xc7, 0x4e, 0xe9, 0x83, - 0x2a, 0x55, 0xfd, 0xaa, 0x74, 0xe5, 0x93, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x68, 0xbb, 0xdc, - 0xb1, 0x72, 0x05, 0x00, 0x00, + // 635 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0x8d, 0xfb, 0xf7, 0x35, 0x93, 0xaf, 0x85, 0x58, 0x54, 0xa4, 0x41, 0xb2, 0xa3, 0x01, 0x41, + 0x36, 0xb5, 0xd5, 0xd2, 0x05, 0x42, 0xb0, 0xa8, 0xa9, 0x8a, 0xba, 0xa0, 0x02, 0xab, 0x62, 0xc1, + 0x26, 0x1a, 0x7b, 0x26, 0xe9, 0xa8, 0xb6, 0xc7, 0xf2, 0x8c, 0x29, 0x79, 0x8b, 0x2e, 0x78, 0x01, + 0x1e, 0x04, 0xd6, 0x5d, 0x76, 0x89, 0x58, 0x18, 0xd4, 0xbe, 0x41, 0x96, 0xac, 0x90, 0x67, 0x26, + 0x71, 0xcc, 0x06, 0x2a, 0x56, 0xf6, 0x9d, 0x39, 0xf7, 0x9c, 0x73, 0xaf, 0x8f, 0x0c, 0xee, 0x87, + 0x2c, 0xc6, 0xe4, 0x83, 0x8b, 0xf2, 0x50, 0x50, 0x96, 0xf0, 0xb7, 0x3b, 0xee, 0xfb, 0xed, 0x80, + 0x08, 0xb4, 0xed, 0x06, 0x14, 0x3b, 0x69, 0xc6, 0x04, 0x33, 0x37, 0x15, 0xc8, 0xa9, 0x40, 0x8e, + 0x06, 0x75, 0xef, 0x8c, 0xd8, 0x88, 0x49, 0x94, 0x5b, 0xbe, 0xa9, 0x86, 0xae, 0x3d, 0x62, 0x6c, + 0x14, 0x11, 0x57, 0x56, 0x41, 0x3e, 0x74, 0x05, 0x8d, 0x09, 0x17, 0x28, 0x4e, 0x35, 0xc0, 0x0a, + 0x19, 0x8f, 0x19, 0x77, 0x03, 0xc4, 0xc9, 0x4c, 0x30, 0x64, 0x34, 0x51, 0xf7, 0xf0, 0xf3, 0x32, + 0x58, 0xf4, 0x28, 0x36, 0x77, 0x01, 0x08, 0x28, 0xc6, 0x34, 0x19, 0x0d, 0x28, 0xee, 0x18, 0x3d, + 0xa3, 0xbf, 0xe4, 0x6d, 0x4c, 0x0a, 0xbb, 0x3d, 0x46, 0x71, 0xf4, 0x14, 0x56, 0x77, 0xd0, 0x6f, + 0xea, 0xe2, 0x50, 0x76, 0x69, 0xab, 0x65, 0xd7, 0xc2, 0xef, 0x5d, 0xd5, 0x1d, 0xf4, 0x9b, 0xba, + 0x38, 0xc4, 0xe6, 0x27, 0x03, 0xdc, 0x0d, 0x59, 0x14, 0x21, 0x41, 0x32, 0x14, 0x0d, 0x04, 0x3b, + 0x25, 0xc9, 0x00, 0xc5, 0x2c, 0x4f, 0x44, 0x67, 0xa9, 0x67, 0xf4, 0x5b, 0x3b, 0x9b, 0x8e, 0xb2, + 0xed, 0x94, 0xb6, 0xa7, 0x2b, 0x70, 0x5e, 0x30, 0x9a, 0x78, 0x47, 0x17, 0x85, 0xdd, 0x98, 0x14, + 0xf6, 0x3d, 0x25, 0xc1, 0x72, 0x31, 0x8c, 0xd8, 0x59, 0x8d, 0x04, 0xfe, 0x2c, 0xec, 0x47, 0x23, + 0x2a, 0x4e, 0xf2, 0xc0, 0x09, 0x59, 0xec, 0xea, 0x15, 0xa8, 0xc7, 0x16, 0xc7, 0xa7, 0xae, 0x18, + 0xa7, 0x84, 0x4b, 0x3e, 0x7f, 0xa3, 0x72, 0x72, 0x5c, 0x72, 0xec, 0x49, 0x0a, 0xf3, 0xa3, 0x01, + 0xda, 0x98, 0x04, 0xa2, 0xee, 0x6e, 0xf9, 0x4f, 0xee, 0x5e, 0x69, 0x77, 0x5d, 0xe5, 0x8e, 0x26, + 0xff, 0x66, 0xee, 0x56, 0x69, 0x61, 0xde, 0xd6, 0x13, 0xb0, 0x5e, 0x6e, 0x9f, 0x64, 0x03, 0x84, + 0x71, 0x46, 0x38, 0xef, 0xac, 0xf4, 0x8c, 0x7e, 0xd3, 0x6b, 0x4f, 0x0a, 0x7b, 0xad, 0xfa, 0x54, + 0x24, 0x83, 0xfe, 0x9a, 0x7a, 0xd9, 0x53, 0x38, 0x33, 0x06, 0xed, 0xe9, 0x47, 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x66, 0x2a, 0xb1, 0x39, 0x2a, 0xe8, 0x03, 0x5d, 0x1d, 0x10, 0xe2, 0x1d, 0x5d, 0x5c, + 0x59, 0xc6, 0xe5, 0x95, 0x65, 0xfc, 0xb8, 0xb2, 0x8c, 0xf3, 0x6b, 0xab, 0x71, 0x79, 0x6d, 0x35, + 0xbe, 0x5e, 0x5b, 0x8d, 0x77, 0xbb, 0x35, 0x8d, 0xf2, 0xbf, 0xb4, 0xc5, 0x86, 0x43, 0x1a, 0x52, + 0x14, 0xe9, 0xda, 0xad, 0xfd, 0xce, 0xa4, 0x6a, 0xb0, 0x22, 0x43, 0xf4, 0xf8, 0x57, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x12, 0xfa, 0xc4, 0x66, 0xf0, 0x04, 0x00, 0x00, } func (m *Bid) Marshal() (dAtA []byte, err error) { @@ -264,17 +248,15 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x50 } - if m.AuctionMappingId != 0 { - i = encodeVarintBid(dAtA, i, uint64(m.AuctionMappingId)) + if m.BiddingType { i-- - dAtA[i] = 0x48 - } - if len(m.BiddingStatus) > 0 { - i -= len(m.BiddingStatus) - copy(dAtA[i:], m.BiddingStatus) - i = encodeVarintBid(dAtA, i, uint64(len(m.BiddingStatus))) + if m.BiddingType { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } i-- - dAtA[i] = 0x42 + dAtA[i] = 0x40 } n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BiddingTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp):]) if err1 != nil { @@ -284,15 +266,15 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBid(dAtA, i, uint64(n1)) i-- dAtA[i] = 0x3a - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintBid(dAtA, i, uint64(len(m.Bidder))) + if len(m.BidderAddress) > 0 { + i -= len(m.BidderAddress) + copy(dAtA[i:], m.BidderAddress) + i = encodeVarintBid(dAtA, i, uint64(len(m.BidderAddress))) i-- dAtA[i] = 0x32 } { - size, err := m.InflowTokenAmount.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DebtTokenAmount.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -302,7 +284,7 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x2a { - size, err := m.OutflowTokenAmount.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.CollateralTokenAmount.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -311,13 +293,6 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x22 - if len(m.AuctionStatus) > 0 { - i -= len(m.AuctionStatus) - copy(dAtA[i:], m.AuctionStatus) - i = encodeVarintBid(dAtA, i, uint64(len(m.AuctionStatus))) - i-- - dAtA[i] = 0x1a - } if m.AuctionId != 0 { i = encodeVarintBid(dAtA, i, uint64(m.AuctionId)) i-- @@ -407,26 +382,18 @@ func (m *Bid) Size() (n int) { if m.AuctionId != 0 { n += 1 + sovBid(uint64(m.AuctionId)) } - l = len(m.AuctionStatus) - if l > 0 { - n += 1 + l + sovBid(uint64(l)) - } - l = m.OutflowTokenAmount.Size() + l = m.CollateralTokenAmount.Size() n += 1 + l + sovBid(uint64(l)) - l = m.InflowTokenAmount.Size() + l = m.DebtTokenAmount.Size() n += 1 + l + sovBid(uint64(l)) - l = len(m.Bidder) + l = len(m.BidderAddress) if l > 0 { n += 1 + l + sovBid(uint64(l)) } l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp) n += 1 + l + sovBid(uint64(l)) - l = len(m.BiddingStatus) - if l > 0 { - n += 1 + l + sovBid(uint64(l)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovBid(uint64(m.AuctionMappingId)) + if m.BiddingType { + n += 2 } if m.AppId != 0 { n += 1 + sovBid(uint64(m.AppId)) @@ -522,41 +489,9 @@ func (m *Bid) Unmarshal(dAtA []byte) error { break } } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBid - } - 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 ErrInvalidLengthBid - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBid - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AuctionStatus = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenAmount", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -583,13 +518,13 @@ func (m *Bid) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.OutflowTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CollateralTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenAmount", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -616,13 +551,13 @@ func (m *Bid) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.InflowTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DebtTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BidderAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -650,7 +585,7 @@ func (m *Bid) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Bidder = string(dAtA[iNdEx:postIndex]) + m.BidderAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 2 { @@ -686,42 +621,10 @@ func (m *Bid) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingStatus", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBid - } - 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 ErrInvalidLengthBid - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBid - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BiddingStatus = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BiddingType", wireType) } - m.AuctionMappingId = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBid @@ -731,11 +634,12 @@ func (m *Bid) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } + m.BiddingType = bool(v != 0) case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index 2323894b0..f84f3bce4 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -108,24 +108,24 @@ func (m *LiquidationOffsetHolder) XXX_DiscardUnknown() { var xxx_messageInfo_LiquidationOffsetHolder proto.InternalMessageInfo type LockedVault struct { - LockedVaultId uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"id"` - OriginalVaultId uint64 `protobuf:"varint,3,opt,name=original_vault_id,json=originalVaultId,proto3" json:"original_vault_id,omitempty" yaml:"id"` - ExtendedPairId uint64 `protobuf:"varint,4,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` - Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - AmountIn github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=amount_in,json=amountIn,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_in" yaml:"amount_in"` - AmountOut github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=amount_out,json=amountOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount_out" yaml:"amount_out"` - CurrentCollaterlisationRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=current_collateralisation_ratio,json=currentCollateralisationRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"current_collateralisation_ratio" yaml:"current_collateralisation_ratio"` - CollateralToBeAuctioned github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,9,opt,name=collateral_to_be_auctioned,json=collateralToBeAuctioned,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"collateral_to_be_auctioned" yaml:"collateral_to_be_auctioned"` - TargetDebt github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=target_debt,json=targetDebt,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"target_debt" yaml:"target_debt"` - LiquidationTimestamp time.Time `protobuf:"bytes,11,opt,name=liquidation_timestamp,json=liquidationTimestamp,proto3,stdtime" json:"liquidation_timestamp" yaml:"liquidation_timestamp"` - IsInternalKeeper bool `protobuf:"varint,12,opt,name=is_internal_keeper,json=isInternalKeeper,proto3" json:"is_internal_keeper,omitempty" yaml:"is_intenal_keeper"` - InternalKeeperAddress string `protobuf:"bytes,13,opt,name=internal_keeper_address,json=internalKeeperAddress,proto3" json:"internal_keeper_address,omitempty" yaml:"internal_keeper_address"` - IsExternalKeeper string `protobuf:"bytes,14,opt,name=is_external_keeper,json=isExternalKeeper,proto3" json:"is_external_keeper,omitempty" yaml:"is_external_keeper"` - ExternalKeeperAddress string `protobuf:"bytes,15,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` - FeeToBeCollected github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,16,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee_to_be_collected" yaml:"fee_to_be_collected"` - InitiatorType string `protobuf:"bytes,17,opt,name=initiator_type,json=initiatorType,proto3" json:"initiator_type,omitempty" yaml:"initiator_type"` - AuctionType bool `protobuf:"varint,18,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` + LockedVaultId uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" yaml:"id"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"id"` + OriginalVaultId uint64 `protobuf:"varint,3,opt,name=original_vault_id,json=originalVaultId,proto3" json:"original_vault_id,omitempty" yaml:"id"` + ExtendedPairId uint64 `protobuf:"varint,4,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` + Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` + AmountIn github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=amount_in,json=amountIn,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"amount_in" yaml:"amount_in"` + AmountOut github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,7,opt,name=amount_out,json=amountOut,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"amount_out" yaml:"amount_out"` + CurrentCollaterlisationRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=current_collateralisation_ratio,json=currentCollateralisationRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"current_collateralisation_ratio" yaml:"current_collateralisation_ratio"` + CollateralToBeAuctioned github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,9,opt,name=collateral_to_be_auctioned,json=collateralToBeAuctioned,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_to_be_auctioned" yaml:"CollateralToBeAuctioned"` + TargetDebt github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,10,opt,name=target_debt,json=targetDebt,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"target_debt" yaml:"target_debt"` + LiquidationTimestamp time.Time `protobuf:"bytes,11,opt,name=liquidation_timestamp,json=liquidationTimestamp,proto3,stdtime" json:"liquidation_timestamp" yaml:"liquidation_timestamp"` + IsInternalKeeper bool `protobuf:"varint,12,opt,name=is_internal_keeper,json=isInternalKeeper,proto3" json:"is_internal_keeper,omitempty" yaml:"is_intenal_keeper"` + InternalKeeperAddress string `protobuf:"bytes,13,opt,name=internal_keeper_address,json=internalKeeperAddress,proto3" json:"internal_keeper_address,omitempty" yaml:"internal_keeper_address"` + IsExternalKeeper string `protobuf:"bytes,14,opt,name=is_external_keeper,json=isExternalKeeper,proto3" json:"is_external_keeper,omitempty" yaml:"is_external_keeper"` + ExternalKeeperAddress string `protobuf:"bytes,15,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` + FeeToBeCollected github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,16,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee_to_be_collected" yaml:"fee_to_be_collected"` + InitiatorType string `protobuf:"bytes,17,opt,name=initiator_type,json=initiatorType,proto3" json:"initiator_type,omitempty" yaml:"initiator_type"` + AuctionType bool `protobuf:"varint,18,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` } func (m *LockedVault) Reset() { *m = LockedVault{} } @@ -172,71 +172,71 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 1013 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6e, 0xe3, 0x44, - 0x1c, 0x8f, 0x4b, 0x5b, 0xda, 0x49, 0x3f, 0xd2, 0x69, 0xbb, 0xf5, 0x46, 0x5b, 0x4f, 0xb1, 0x44, - 0x55, 0x21, 0x35, 0xa1, 0xbb, 0x17, 0x04, 0x97, 0x6d, 0xba, 0x8b, 0x88, 0xa8, 0xe8, 0x62, 0x55, - 0x8b, 0xb4, 0x07, 0xcc, 0xc4, 0x9e, 0xa4, 0xa3, 0x3a, 0x9e, 0x60, 0x8f, 0x97, 0xf6, 0x0d, 0xb8, - 0xb1, 0x9c, 0x78, 0x05, 0x24, 0x5e, 0x82, 0x63, 0x8f, 0x7b, 0x44, 0x1c, 0x06, 0x70, 0xdf, 0xc0, - 0x4f, 0x80, 0xe6, 0x23, 0x89, 0x93, 0x66, 0x85, 0xca, 0xa5, 0x69, 0xe6, 0xff, 0xfb, 0xf8, 0xff, - 0xc6, 0xe3, 0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0x70, 0x09, 0x00, 0x00, + // 1020 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4f, 0x4f, 0xe3, 0xc6, + 0x1b, 0x8e, 0xf9, 0x01, 0x3f, 0x98, 0xf0, 0x77, 0x80, 0xc5, 0x44, 0x8b, 0x07, 0x59, 0x2a, 0x45, + 0x95, 0x70, 0xca, 0xee, 0xa5, 0x6a, 0x2f, 0x4b, 0x80, 0xaa, 0x51, 0x91, 0xe8, 0x5a, 0x68, 0x2b, + 0xed, 0xa1, 0xee, 0xc4, 0x9e, 0x84, 0x11, 0x8e, 0x27, 0xb5, 0x27, 0x5b, 0x50, 0xa5, 0x4a, 0xfd, + 0x04, 0xdd, 0x9e, 0xfa, 0x15, 0xda, 0x7b, 0x3f, 0x40, 0x8f, 0x1c, 0xf7, 0x58, 0xf5, 0xe0, 0xb6, + 0xe6, 0x1b, 0xe4, 0xd8, 0x53, 0x35, 0x7f, 0x9c, 0xd8, 0x21, 0x2b, 0x4a, 0x2f, 0x04, 0xcf, 0xfb, + 0x3c, 0xcf, 0xfb, 0x3e, 0xe3, 0x77, 0xde, 0x31, 0xd8, 0xf7, 0x59, 0x37, 0x20, 0x57, 0xf5, 0x90, + 0x7e, 0xd5, 0xa7, 0x01, 0xe6, 0x94, 0x45, 0xc9, 0x8b, 0x27, 0xf5, 0x57, 0x07, 0x2d, 0xc2, 0xf1, + 0xc1, 0x70, 0x99, 0x38, 0xbd, 0x98, 0x71, 0x06, 0xb7, 0x15, 0xdc, 0x29, 0xc3, 0x1d, 0x0d, 0xaf, + 0xad, 0x77, 0x58, 0x87, 0x49, 0x64, 0x5d, 0xfc, 0xa7, 0x48, 0x35, 0xd4, 0x61, 0xac, 0x13, 0x92, + 0xba, 0x7c, 0x6a, 0xf5, 0xdb, 0x75, 0x4e, 0xbb, 0x24, 0xe1, 0xb8, 0xdb, 0xd3, 0x00, 0xcb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x85, 0x59, + 0x36, 0x8c, 0x0e, 0x52, 0xf4, 0x58, 0x95, 0x39, 0x51, 0xde, 0x7e, 0xfd, 0x07, 0x32, 0xdc, 0xf5, + 0x70, 0x02, 0x13, 0x7e, 0x01, 0x20, 0x4d, 0x3c, 0x1a, 0x71, 0x12, 0x8b, 0x79, 0x73, 0x49, 0x48, + 0x8f, 0xc4, 0xe6, 0x82, 0x1c, 0xb7, 0xef, 0x67, 0x29, 0x5a, 0x69, 0x26, 0x4d, 0x1d, 0xfc, 0x54, + 0xc6, 0x06, 0x29, 0x32, 0xf5, 0xb8, 0x51, 0xbc, 0x11, 0xcd, 0x76, 0x57, 0xe8, 0x18, 0x1a, 0x26, + 0x60, 0x73, 0x4c, 0xdc, 0xc3, 0x41, 0x10, 0x93, 0x24, 0x31, 0x17, 0x65, 0x77, 0x7f, 0x94, 0xa5, + 0x68, 0xa3, 0x4c, 0x3a, 0x54, 0x80, 0x51, 0x67, 0xbc, 0x45, 0xc1, 0x76, 0x37, 0xe8, 0x24, 0x22, + 0xf4, 0xa4, 0x29, 0x31, 0xa3, 0x8a, 0xa6, 0x96, 0x64, 0xbe, 0x03, 0x65, 0xea, 0xe4, 0x6a, 0xcc, + 0xd4, 0xd6, 0xd0, 0xd4, 0x18, 0x4f, 0xba, 0x2a, 0xc3, 0x85, 0xab, 0x31, 0xd4, 0xd0, 0xd5, 0xf2, + 0xc8, 0x55, 0x99, 0x74, 0xc7, 0xd5, 0x5b, 0x14, 0x6c, 0x77, 0x83, 0x4c, 0x22, 0xc2, 0xef, 0x0d, + 0xb0, 0xd6, 0x26, 0x44, 0x9f, 0x33, 0xd1, 0xe8, 0xc4, 0xe7, 0x24, 0x30, 0x57, 0x64, 0xc6, 0x2f, + 0x1f, 0x30, 0x25, 0x9a, 0x11, 0x17, 0xbb, 0xf0, 0x31, 0x21, 0xe2, 0x90, 0x1c, 0xe5, 0x4a, 0x83, + 0x14, 0xd5, 0x54, 0x69, 0x13, 0xd2, 0xd8, 0xee, 0x4a, 0x7b, 0x0c, 0x0f, 0x9f, 0x83, 0x25, 0x1a, + 0x51, 0x4e, 0x31, 0x67, 0xb1, 0xba, 0xa7, 0x57, 0x65, 0x2d, 0xef, 0x89, 0x4b, 0xb1, 0x99, 0x47, + 0xf4, 0x4d, 0xbd, 0x91, 0xbf, 0xcb, 0x22, 0xc1, 0x76, 0x17, 0x69, 0x11, 0x77, 0xe7, 0xe2, 0x87, + 0xff, 0xf9, 0xe2, 0x6f, 0xbc, 0xbc, 0xf9, 0xcb, 0xaa, 0xfc, 0x94, 0x59, 0x95, 0x9b, 0xcc, 0x32, + 0xde, 0x64, 0x96, 0xf1, 0x67, 0x66, 0x19, 0xaf, 0x6f, 0xad, 0xca, 0x9b, 0x5b, 0xab, 0xf2, 0xdb, + 0xad, 0x55, 0x79, 0xf9, 0x41, 0x69, 0xaf, 0xc4, 0x57, 0xd3, 0x3e, 0x6b, 0xb7, 0xa9, 0x4f, 0x71, + 0xa8, 0x9f, 0xeb, 0x77, 0x3e, 0xbb, 0xe4, 0x0e, 0xb6, 0x66, 0xe5, 0x11, 0x7d, 0xfa, 0x4f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xf2, 0x77, 0xa8, 0x61, 0x9c, 0x09, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -398,21 +398,21 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x5a { - size := m.TargetDebt.Size() - i -= size - if _, err := m.TargetDebt.MarshalTo(dAtA[i:]); err != nil { + size, err := m.TargetDebt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintLiquidate(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x52 { - size := m.CollateralToBeAuctioned.Size() - i -= size - if _, err := m.CollateralToBeAuctioned.MarshalTo(dAtA[i:]); err != nil { + size, err := m.CollateralToBeAuctioned.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintLiquidate(dAtA, i, uint64(size)) } i-- @@ -428,21 +428,21 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x42 { - size := m.AmountOut.Size() - i -= size - if _, err := m.AmountOut.MarshalTo(dAtA[i:]); err != nil { + size, err := m.AmountOut.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintLiquidate(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a { - size := m.AmountIn.Size() - i -= size - if _, err := m.AmountIn.MarshalTo(dAtA[i:]); err != nil { + size, err := m.AmountIn.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintLiquidate(dAtA, i, uint64(size)) } i-- @@ -881,7 +881,7 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AmountIn", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowLiquidate @@ -891,16 +891,15 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthLiquidate } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthLiquidate } @@ -915,7 +914,7 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AmountOut", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowLiquidate @@ -925,16 +924,15 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthLiquidate } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthLiquidate } @@ -983,7 +981,7 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CollateralToBeAuctioned", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowLiquidate @@ -993,16 +991,15 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthLiquidate } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthLiquidate } @@ -1017,7 +1014,7 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TargetDebt", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowLiquidate @@ -1027,16 +1024,15 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthLiquidate } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthLiquidate } From 32f52cca096fc10c51b153e73a67c1b92b533a93 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 19 Apr 2023 16:15:15 +0530 Subject: [PATCH 040/155] adding pb files --- .../liquidationsV2/v1beta1/liquidate.proto | 8 +- x/liquidationsV2/types/liquidate.pb.go | 150 +++++++++--------- 2 files changed, 79 insertions(+), 79 deletions(-) diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index 891fec6c9..d415f1036 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -61,15 +61,15 @@ message LockedVault { (gogoproto.customname) = "Owner", (gogoproto.moretags) = "yaml:\"owner\""]; - cosmos.base.v1beta1.Coin amount_in = 6 [ + cosmos.base.v1beta1.Coin collateral_token = 6 [ (gogoproto.nullable) = false, (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.moretags) = "yaml:\"amount_in\"" + (gogoproto.moretags) = "yaml:\"collateral_token\"" ]; - cosmos.base.v1beta1.Coin amount_out = 7 [ + cosmos.base.v1beta1.Coin debt_token = 7 [ (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.moretags) = "yaml:\"amount_out\"", + (gogoproto.moretags) = "yaml:\"debt_token\"", (gogoproto.nullable) = false]; string current_collateralisation_ratio = 8 [ diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index f84f3bce4..ff6e561a1 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -113,8 +113,8 @@ type LockedVault struct { OriginalVaultId uint64 `protobuf:"varint,3,opt,name=original_vault_id,json=originalVaultId,proto3" json:"original_vault_id,omitempty" yaml:"id"` ExtendedPairId uint64 `protobuf:"varint,4,opt,name=extended_pair_vault_id,json=extendedPairVaultId,proto3" json:"extended_pair_vault_id,omitempty" yaml:"extended_pair_vault_id"` Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - AmountIn github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=amount_in,json=amountIn,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"amount_in" yaml:"amount_in"` - AmountOut github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,7,opt,name=amount_out,json=amountOut,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"amount_out" yaml:"amount_out"` + CollateralToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=collateral_token,json=collateralToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token" yaml:"collateral_token"` + DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,7,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"debt_token"` CurrentCollaterlisationRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=current_collateralisation_ratio,json=currentCollateralisationRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"current_collateralisation_ratio" yaml:"current_collateralisation_ratio"` CollateralToBeAuctioned github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,9,opt,name=collateral_to_be_auctioned,json=collateralToBeAuctioned,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_to_be_auctioned" yaml:"CollateralToBeAuctioned"` TargetDebt github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,10,opt,name=target_debt,json=targetDebt,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"target_debt" yaml:"target_debt"` @@ -172,71 +172,71 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 1020 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4f, 0x4f, 0xe3, 0xc6, - 0x1b, 0x8e, 0xf9, 0x01, 0x3f, 0x98, 0xf0, 0x77, 0x80, 0xc5, 0x44, 0x8b, 0x07, 0x59, 0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, 0xb7, 0xef, 0x67, 0x29, 0x5a, 0x69, 0x26, 0x4d, 0x1d, 0xfc, 0x54, - 0xc6, 0x06, 0x29, 0x32, 0xf5, 0xb8, 0x51, 0xbc, 0x11, 0xcd, 0x76, 0x57, 0xe8, 0x18, 0x1a, 0x26, - 0x60, 0x73, 0x4c, 0xdc, 0xc3, 0x41, 0x10, 0x93, 0x24, 0x31, 0x17, 0x65, 0x77, 0x7f, 0x94, 0xa5, - 0x68, 0xa3, 0x4c, 0x3a, 0x54, 0x80, 0x51, 0x67, 0xbc, 0x45, 0xc1, 0x76, 0x37, 0xe8, 0x24, 0x22, - 0xf4, 0xa4, 0x29, 0x31, 0xa3, 0x8a, 0xa6, 0x96, 0x64, 0xbe, 0x03, 0x65, 0xea, 0xe4, 0x6a, 0xcc, - 0xd4, 0xd6, 0xd0, 0xd4, 0x18, 0x4f, 0xba, 0x2a, 0xc3, 0x85, 0xab, 0x31, 0xd4, 0xd0, 0xd5, 0xf2, - 0xc8, 0x55, 0x99, 0x74, 0xc7, 0xd5, 0x5b, 0x14, 0x6c, 0x77, 0x83, 0x4c, 0x22, 0xc2, 0xef, 0x0d, - 0xb0, 0xd6, 0x26, 0x44, 0x9f, 0x33, 0xd1, 0xe8, 0xc4, 0xe7, 0x24, 0x30, 0x57, 0x64, 0xc6, 0x2f, - 0x1f, 0x30, 0x25, 0x9a, 0x11, 0x17, 0xbb, 0xf0, 0x31, 0x21, 0xe2, 0x90, 0x1c, 0xe5, 0x4a, 0x83, - 0x14, 0xd5, 0x54, 0x69, 0x13, 0xd2, 0xd8, 0xee, 0x4a, 0x7b, 0x0c, 0x0f, 0x9f, 0x83, 0x25, 0x1a, - 0x51, 0x4e, 0x31, 0x67, 0xb1, 0xba, 0xa7, 0x57, 0x65, 0x2d, 0xef, 0x89, 0x4b, 0xb1, 0x99, 0x47, - 0xf4, 0x4d, 0xbd, 0x91, 0xbf, 0xcb, 0x22, 0xc1, 0x76, 0x17, 0x69, 0x11, 0x77, 0xe7, 0xe2, 0x87, - 0xff, 0xf9, 0xe2, 0x6f, 0xbc, 0xbc, 0xf9, 0xcb, 0xaa, 0xfc, 0x94, 0x59, 0x95, 0x9b, 0xcc, 0x32, - 0xde, 0x64, 0x96, 0xf1, 0x67, 0x66, 0x19, 0xaf, 0x6f, 0xad, 0xca, 0x9b, 0x5b, 0xab, 0xf2, 0xdb, - 0xad, 0x55, 0x79, 0xf9, 0x41, 0x69, 0xaf, 0xc4, 0x57, 0xd3, 0x3e, 0x6b, 0xb7, 0xa9, 0x4f, 0x71, - 0xa8, 0x9f, 0xeb, 0x77, 0x3e, 0xbb, 0xe4, 0x0e, 0xb6, 0x66, 0xe5, 0x11, 0x7d, 0xfa, 0x4f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xf2, 0x77, 0xa8, 0x61, 0x9c, 0x09, 0x00, 0x00, + // 1017 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4f, 0x6f, 0xe3, 0x44, + 0x1c, 0x8d, 0x97, 0xb6, 0x6c, 0x27, 0xfd, 0x3b, 0x6d, 0xb7, 0x6e, 0xb4, 0xf5, 0x54, 0x96, 0x28, + 0x15, 0x52, 0x1d, 0xba, 0x7b, 0x41, 0x70, 0xd9, 0xa6, 0x2d, 0x22, 0x50, 0xa9, 0xac, 0x55, 0x2d, + 0xd2, 0x1e, 0x30, 0x13, 0x7b, 0x92, 0x8e, 0xea, 0x78, 0x82, 0x3d, 0x59, 0xda, 0x0b, 0x12, 0x9f, + 0x80, 0x72, 0xe2, 0x2b, 0xc0, 0xb7, 0xe0, 0x58, 0x71, 0xda, 0x23, 0xe2, 0x30, 0x80, 0xfb, 0x0d, + 0x72, 0xe4, 0x84, 0xe6, 0x4f, 0x12, 0x27, 0xcd, 0x52, 0xca, 0xa5, 0xa9, 0x67, 0xde, 0x7b, 0xbf, + 0xf7, 0xc6, 0x3f, 0xff, 0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ff, 0x0d, 0x13, 0xbb, 0x6b, 0xb2, 0x09, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -428,7 +428,7 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x42 { - size, err := m.AmountOut.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DebtToken.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -438,7 +438,7 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x3a { - size, err := m.AmountIn.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.CollateralToken.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -537,9 +537,9 @@ func (m *LockedVault) Size() (n int) { if l > 0 { n += 1 + l + sovLiquidate(uint64(l)) } - l = m.AmountIn.Size() + l = m.CollateralToken.Size() n += 1 + l + sovLiquidate(uint64(l)) - l = m.AmountOut.Size() + l = m.DebtToken.Size() n += 1 + l + sovLiquidate(uint64(l)) l = m.CurrentCollaterlisationRatio.Size() n += 1 + l + sovLiquidate(uint64(l)) @@ -879,7 +879,7 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AmountIn", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CollateralToken", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -906,13 +906,13 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AmountIn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CollateralToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AmountOut", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DebtToken", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -939,7 +939,7 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AmountOut.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DebtToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex From ef095014eeb97dbc1a1f93a36f6f4d1cae2a85b4 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 19 Apr 2023 16:27:01 +0530 Subject: [PATCH 041/155] adding pb files --- proto/comdex/auctionsV2/v1beta1/auction.proto | 9 +- .../liquidationsV2/v1beta1/liquidate.proto | 15 + x/auctionsV2/types/auction.pb.go | 262 +++++++++++++---- x/liquidationsV2/types/liquidate.pb.go | 277 ++++++++++++++---- 4 files changed, 444 insertions(+), 119 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index 430884fe9..eec6d6958 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -92,4 +92,11 @@ message Auctions{ message bidOwnerMapping{ uint64 bid_id = 1; string bid_owner = 2; - } \ No newline at end of file + } + + +message AuctionParams{ + uint64 auction_duration_seconds = 1 [ + (gogoproto.moretags) = "yaml:\"auction_duration_seconds\"" + ]; +} \ No newline at end of file diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index d415f1036..c4ca3709d 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -25,6 +25,21 @@ message LiquidationWhiteListing { //discount //upar kitna se start hoga + string buffer = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"buffer\"" + ]; + string cusp = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"cusp\"" + ]; + string step = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"step\"" + ]; } diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index e0873cc9a..110035ad8 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -213,9 +213,54 @@ func (m *BidOwnerMapping) GetBidOwner() string { return "" } +type AuctionParams struct { + AuctionDurationSeconds uint64 `protobuf:"varint,1,opt,name=auction_duration_seconds,json=auctionDurationSeconds,proto3" json:"auction_duration_seconds,omitempty" yaml:"auction_duration_seconds"` +} + +func (m *AuctionParams) Reset() { *m = AuctionParams{} } +func (m *AuctionParams) String() string { return proto.CompactTextString(m) } +func (*AuctionParams) ProtoMessage() {} +func (*AuctionParams) Descriptor() ([]byte, []int) { + return fileDescriptor_8ee47f5a405fa8ba, []int{2} +} +func (m *AuctionParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuctionParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuctionParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuctionParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuctionParams.Merge(m, src) +} +func (m *AuctionParams) XXX_Size() int { + return m.Size() +} +func (m *AuctionParams) XXX_DiscardUnknown() { + xxx_messageInfo_AuctionParams.DiscardUnknown(m) +} + +var xxx_messageInfo_AuctionParams proto.InternalMessageInfo + +func (m *AuctionParams) GetAuctionDurationSeconds() uint64 { + if m != nil { + return m.AuctionDurationSeconds + } + return 0 +} + func init() { proto.RegisterType((*Auctions)(nil), "comdex.auctionsV2.v1beta1.Auctions") proto.RegisterType((*BidOwnerMapping)(nil), "comdex.auctionsV2.v1beta1.bidOwnerMapping") + proto.RegisterType((*AuctionParams)(nil), "comdex.auctionsV2.v1beta1.AuctionParams") } func init() { @@ -223,59 +268,61 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 817 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0x8f, 0x61, 0x37, 0x9b, 0x4c, 0x5a, 0x65, 0xeb, 0xa5, 0xbb, 0xde, 0x14, 0xec, 0xe0, 0xc3, - 0x6e, 0x84, 0x54, 0x5b, 0x2d, 0x3d, 0x71, 0xc3, 0xa5, 0x88, 0x20, 0x01, 0x95, 0x89, 0x2a, 0xc4, - 0xc5, 0x1a, 0x7b, 0x26, 0x66, 0x54, 0xc7, 0x63, 0xd9, 0x93, 0x96, 0x7e, 0x07, 0x40, 0xbd, 0xf2, - 0x41, 0xf8, 0x0e, 0x3d, 0xf6, 0x88, 0x38, 0x18, 0x94, 0x7e, 0x83, 0x1c, 0x39, 0xa1, 0xf9, 0xe3, - 0xba, 0x71, 0x8b, 0x4a, 0x24, 0x4e, 0xc9, 0xbc, 0x79, 0xef, 0xf7, 0xfb, 0xcd, 0xf3, 0xbc, 0xdf, - 0x80, 0xb7, 0x11, 0x9d, 0x21, 0xfc, 0xa3, 0x0b, 0xe7, 0x11, 0x23, 0x34, 0x2d, 0x4e, 0xf6, 0xdd, - 0xb3, 0xbd, 0x10, 0x33, 0xb8, 0x57, 0x85, 0x9c, 0x2c, 0xa7, 0x8c, 0xea, 0xaf, 0x65, 0xa2, 0x53, - 0x27, 0x3a, 0x2a, 0x71, 0xf0, 0x5e, 0x4c, 0x63, 0x2a, 0xb2, 0x5c, 0xfe, 0x4f, 0x16, 0x0c, 0xac, - 0x98, 0xd2, 0x38, 0xc1, 0xae, 0x58, 0x85, 0xf3, 0xa9, 0xcb, 0xc8, 0x0c, 0x17, 0x0c, 0xce, 0x32, - 0x95, 0x60, 0x46, 0xb4, 0x98, 0xd1, 0xc2, 0x0d, 0x61, 0x81, 0x6f, 0x49, 0x23, 0x4a, 0x14, 0xa3, - 0xfd, 0xdb, 0x06, 0xe8, 0x7c, 0xaa, 0xd8, 0xf4, 0x03, 0x00, 0x14, 0x73, 0x40, 0x90, 0xa1, 0x0d, - 0xb5, 0xd1, 0x13, 0x6f, 0x7b, 0x59, 0x5a, 0x5b, 0x17, 0x70, 0x96, 0x7c, 0x62, 0xd7, 0x7b, 0xb6, - 0xdf, 0x55, 0x8b, 0x31, 0xd2, 0x2f, 0x35, 0xf0, 0x3c, 0xa2, 0x49, 0x02, 0x19, 0xce, 0x61, 0x12, - 0x30, 0x7a, 0x8a, 0x53, 0xe3, 0x9d, 0xa1, 0x36, 0xea, 0xed, 0xbf, 0x76, 0x24, 0xbd, 0xc3, 0xe9, - 0xab, 0xa3, 0x38, 0x87, 0x94, 0xa4, 0xde, 0x97, 0x57, 0xa5, 0xd5, 0x5a, 0x96, 0xd6, 0x2b, 0x89, - 0xdd, 0x04, 0xb0, 0xff, 0x2e, 0xad, 0xb7, 0x31, 0x61, 0x3f, 0xcc, 0x43, 0x27, 0xa2, 0x33, 0x57, - 0x1d, 0x43, 0xfe, 0xec, 0x16, 0xe8, 0xd4, 0x65, 0x17, 0x19, 0x2e, 0x04, 0x96, 0xdf, 0xaf, 0xab, - 0x27, 0xbc, 0x58, 0xff, 0x45, 0x03, 0x00, 0xe1, 0x90, 0x29, 0x31, 0x4f, 0x1e, 0x13, 0x33, 0x51, - 0x62, 0x3e, 0x94, 0x62, 0x48, 0x3a, 0x4d, 0xe8, 0xb9, 0x2c, 0x0e, 0x18, 0xcc, 0x63, 0xcc, 0x02, - 0x38, 0xa3, 0xf3, 0x94, 0xad, 0x25, 0xab, 0xcb, 0x25, 0x48, 0x41, 0x5f, 0x80, 0x2d, 0x18, 0x31, -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d, 0xa2, 0xb4, 0x7a, 0xea, - 0x0d, 0x98, 0x5c, 0x64, 0x78, 0x59, 0x5a, 0x2f, 0x56, 0x0d, 0x9f, 0x27, 0xdb, 0x7e, 0x0f, 0xd6, - 0x39, 0xf6, 0x11, 0xe8, 0x37, 0x8c, 0x45, 0xdf, 0x06, 0x6d, 0x3e, 0xea, 0xd5, 0xcb, 0xe1, 0x3f, - 0x0d, 0x09, 0x1a, 0x23, 0x7d, 0x07, 0xf0, 0xa1, 0x0f, 0x28, 0x4f, 0x15, 0xcf, 0x42, 0xd7, 0xef, - 0x54, 0xa5, 0xde, 0xd7, 0x57, 0x0b, 0x53, 0xbb, 0x5e, 0x98, 0xda, 0x5f, 0x0b, 0x53, 0xbb, 0xbc, - 0x31, 0x5b, 0xd7, 0x37, 0x66, 0xeb, 0xf7, 0x1b, 0xb3, 0xf5, 0xfd, 0xc1, 0xca, 0x5d, 0xe1, 0xe6, - 0xb6, 0x4b, 0xa7, 0x53, 0x12, 0x11, 0x98, 0xa8, 0xb5, 0xbb, 0xf2, 0xa0, 0x8a, 0xdb, 0x13, 0xb6, - 0x45, 0x17, 0x3f, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x96, 0x9c, 0xaf, 0x72, 0x07, 0x00, - 0x00, + // 862 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4d, 0x6f, 0xdc, 0x44, + 0x18, 0x8e, 0xa1, 0x4d, 0x77, 0x67, 0x13, 0x6d, 0xe3, 0x92, 0xd4, 0xdd, 0x80, 0xbd, 0x0c, 0x52, + 0xbb, 0x42, 0xaa, 0xad, 0x86, 0x9e, 0xb8, 0xe1, 0xb4, 0x88, 0x45, 0x02, 0x22, 0x77, 0x55, 0x21, + 0x24, 0x64, 0x8d, 0x3d, 0xb3, 0xcb, 0x28, 0xb6, 0xc7, 0xb2, 0xc7, 0x29, 0xf9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4, 0xeb, 0x89, 0xf6, 0x3c, 0x53, 0x0e, 0xff, 0xeb, 0x97, + 0xe7, 0xb6, 0xf1, 0xea, 0xdc, 0x36, 0xfe, 0x3a, 0xb7, 0x8d, 0xb3, 0x0b, 0x7b, 0xe3, 0xd5, 0x85, + 0xbd, 0xf1, 0xfb, 0x85, 0xbd, 0xf1, 0xdd, 0xe3, 0xb5, 0xbb, 0x29, 0x86, 0xe9, 0x43, 0xb6, 0x5c, + 0xd2, 0x98, 0xa2, 0x44, 0xaf, 0xbd, 0xb5, 0x07, 0x5c, 0xde, 0xd6, 0x68, 0x53, 0x9e, 0xda, 0x27, + 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x92, 0x52, 0xdc, 0xe3, 0xe2, 0x07, 0x00, 0x00, } func (m *Auctions) Marshal() (dAtA []byte, err error) { @@ -472,6 +519,34 @@ func (m *BidOwnerMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *AuctionParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AuctionParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuctionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuctionDurationSeconds != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionDurationSeconds)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintAuction(dAtA []byte, offset int, v uint64) int { offset -= sovAuction(v) base := offset @@ -547,6 +622,18 @@ func (m *BidOwnerMapping) Size() (n int) { return n } +func (m *AuctionParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionDurationSeconds != 0 { + n += 1 + sovAuction(uint64(m.AuctionDurationSeconds)) + } + return n +} + func sovAuction(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1136,6 +1223,75 @@ func (m *BidOwnerMapping) Unmarshal(dAtA []byte) error { } return nil } +func (m *AuctionParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AuctionParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuctionParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionDurationSeconds", wireType) + } + m.AuctionDurationSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionDurationSeconds |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipAuction(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index ff6e561a1..38a667b31 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -35,6 +35,11 @@ type LiquidationWhiteListing struct { // true auction type - "dutch" //false auction type - "english" AuctionType bool `protobuf:"varint,2,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` + //discount + //upar kitna se start hoga + Buffer github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=buffer,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"buffer" yaml:"buffer"` + Cusp github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=cusp,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"cusp" yaml:"cusp"` + Step github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"step" yaml:"step"` } func (m *LiquidationWhiteListing) Reset() { *m = LiquidationWhiteListing{} } @@ -172,71 +177,75 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 1017 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4f, 0x6f, 0xe3, 0x44, - 0x1c, 0x8d, 0x97, 0xb6, 0x6c, 0x27, 0xfd, 0x3b, 0x6d, 0xb7, 0x6e, 0xb4, 0xf5, 0x54, 0x96, 0x28, - 0x15, 0x52, 0x1d, 0xba, 0x7b, 0x41, 0x70, 0xd9, 0xa6, 0x2d, 0x22, 0x50, 0xa9, 0xac, 0x55, 0x2d, - 0xd2, 0x1e, 0x30, 0x13, 0x7b, 0x92, 0x8e, 0xea, 0x78, 0x82, 0x3d, 0x59, 0xda, 0x0b, 0x12, 0x9f, - 0x80, 0x72, 0xe2, 0x2b, 0xc0, 0xb7, 0xe0, 0x58, 0x71, 0xda, 0x23, 0xe2, 0x30, 0x80, 0xfb, 0x0d, - 0x72, 0xe4, 0x84, 0xe6, 0x4f, 0x12, 0x27, 0xcd, 0x52, 0xca, 0xa5, 0xa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a8, 0x47, 0xf4, 0xe9, 0x3f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x0d, 0x13, 0xbb, 0x6b, 0xb2, 0x09, 0x00, 0x00, + // 1079 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0xe3, 0x44, + 0x18, 0x8e, 0x77, 0xdb, 0xb2, 0x9d, 0x6c, 0xbf, 0xa6, 0xed, 0xd6, 0x8d, 0xb6, 0x9e, 0xca, 0x12, + 0xa5, 0x42, 0xaa, 0x43, 0x77, 0x2f, 0x08, 0x84, 0xd8, 0xa6, 0x2d, 0x22, 0x50, 0xa9, 0xd4, 0xaa, + 0x76, 0xa5, 0x3d, 0x60, 0x1c, 0x7b, 0x92, 0x8e, 0xea, 0x78, 0x8c, 0x3d, 0x59, 0xda, 0x0b, 0x12, + 0xbf, 0x80, 0x72, 0xe1, 0x37, 0xc0, 0xbf, 0xe0, 0x58, 0x71, 0xda, 0x23, 0xe2, 0x60, 0xc0, 0xfd, + 0x07, 0x39, 0x72, 0x42, 0xf3, 0xe1, 0xd8, 0x49, 0xb3, 0x94, 0x70, 0x69, 0xea, 0x79, 0x9f, 0xe7, + 0x79, 0x9f, 0x77, 0xde, 0xf9, 0x02, 0x3b, 0x1e, 0xed, 0xfa, 0xf8, 0xa2, 0x1e, 0x90, 0xaf, 0x7b, + 0xc4, 0x77, 0x19, 0xa1, 0x61, 0xf2, 0xfc, 0x49, 0xfd, 0xd5, 0x6e, 0x0b, 0x33, 0x77, 0x77, 0x30, + 0x8c, 0xad, 0x28, 0xa6, 0x8c, 0xc2, 0x0d, 0x09, 0xb7, 0x86, 0xe1, 0x96, 0x82, 0xd7, 0x56, 0x3a, + 0xb4, 0x43, 0x05, 0xb2, 0xce, 0xff, 0x93, 0xa4, 0x1a, 0xea, 0x50, 0xda, 0x09, 0x70, 0x5d, 0x7c, + 0xb5, 0x7a,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xff, 0xff, 0x91, + 0xbf, 0x95, 0x9e, 0xb1, 0x0a, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -259,6 +268,36 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + { + size := m.Step.Size() + i -= size + if _, err := m.Step.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.Cusp.Size() + i -= size + if _, err := m.Cusp.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.Buffer.Size() + i -= size + if _, err := m.Buffer.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a if m.AuctionType { i-- if m.AuctionType { @@ -500,6 +539,12 @@ func (m *LiquidationWhiteListing) Size() (n int) { if m.AuctionType { n += 2 } + l = m.Buffer.Size() + n += 1 + l + sovLiquidate(uint64(l)) + l = m.Cusp.Size() + n += 1 + l + sovLiquidate(uint64(l)) + l = m.Step.Size() + n += 1 + l + sovLiquidate(uint64(l)) return n } @@ -650,6 +695,108 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { } } m.AuctionType = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Buffer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Buffer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cusp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Cusp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Step.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipLiquidate(dAtA[iNdEx:]) From 9334e2e78b685ed1745da9684f8f0c80813b6ed7 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Wed, 19 Apr 2023 16:30:57 +0530 Subject: [PATCH 042/155] auction proto changes --- x/auctionsV2/keeper/auctions.go | 3 ++- x/liquidationsV2/keeper/liquidate.go | 10 ++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 3652e1b56..f9946b654 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -35,9 +35,10 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati auctionData := types.Auctions{ AuctionId: auctionID+1, - CollateralToken: liquidationData.AmountIn, + CollateralToken: liquidationData.CollateralToken, + } return nil diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index e9eeec40c..e22dcb72c 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -87,7 +87,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error } //Checking if app has enabled liquidations or not - _, found = k.GetAppIDByAppForLiquidation(ctx, vault.AppId) + whitelistingData, found := k.GetAppIDByAppForLiquidation(ctx, vault.AppId) if !found { return fmt.Errorf("Liquidation not enabled for App ID %d", vault.AppId) } @@ -116,11 +116,9 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error } //Calculating Liquidation Fees feesToBeCollected := sdk.NewDecFromInt(totalOut).Mul(extPair.LiquidationPenalty).TruncateInt() - //Getting app whitelisted Data - whitelistingData, _ := k.GetLiquidationWhiteListing(ctx, liquidationData.AppId) //Creating locked vault struct , which will trigger auction - err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, vault.AmountIn, totalOut, vault.AmountIn, totalOut, collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected, "vault", whitelistingData.auctionType) + err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, vault.AmountIn, totalOut, vault.AmountIn, totalOut, collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected, "vault", whitelistingData.AuctionType) if err != nil { return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for Vault %d", vault.Id) } @@ -148,8 +146,8 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair OriginalVaultId: OriginalVaultId, ExtendedPairId: ExtendedPairId, Owner: Owner, - AmountIn: AmountIn, - AmountOut: AmountOut, + CollateralToken: AmountIn, + DebtToken: AmountOut, CurrentCollaterlisationRatio: collateralizationRatio, CollateralToBeAuctioned: AmountIn, TargetDebt: AmountOut, From a4ff24bef464202ab9c69ca0d692ef0e4329fd35 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 19 Apr 2023 16:42:27 +0530 Subject: [PATCH 043/155] updating fn parameters --- x/liquidationsV2/keeper/liquidate.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index e22dcb72c..0edcbee91 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -95,6 +95,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error // Checking extended pair vault data for Minimum collateralisation ratio extPair, _ := k.asset.GetPairsVault(ctx, vault.ExtendedPairVaultID) liqRatio := extPair.MinCr + pair, _ := k.asset.GetPair(ctx, extPair.PairId) totalOut := vault.AmountOut.Add(vault.InterestAccumulated).Add(vault.ClosingFeeAccumulated) collateralizationRatio, err := k.vault.CalculateCollateralizationRatio(ctx, vault.ExtendedPairVaultID, vault.AmountIn, totalOut) if err != nil { @@ -118,7 +119,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error feesToBeCollected := sdk.NewDecFromInt(totalOut).Mul(extPair.LiquidationPenalty).TruncateInt() //Creating locked vault struct , which will trigger auction - err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, vault.AmountIn, totalOut, vault.AmountIn, totalOut, collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected, "vault", whitelistingData.AuctionType) + err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected, "vault", whitelistingData.AuctionType) if err != nil { return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for Vault %d", vault.Id) } @@ -136,8 +137,12 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error return nil } +func (k Keeper) ReturnCoin(ctx sdk.Context, assetID uint64, amount sdk.Int) sdk.Coin { + asset, _ := k.asset.GetAsset(ctx, assetID) + return sdk.NewCoin(asset.Denom, amount) +} -func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Int, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, initiatorType string, auctionType bool) error { +func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Coin, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, initiatorType string, auctionType bool) error { lockedVaultID := k.GetLockedVaultID(ctx) value := types.LockedVault{ @@ -335,7 +340,7 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, pool lendtypes.Pool, borrow borrow.IsLiquidated = true k.lend.SetBorrow(ctx, borrow) //updatedLockedVault.CollateralToBeAuctioned = selloffAmount.TruncateInt() - err = k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn.Amount, borrow.AmountOut.Amount, borrow.AmountIn.Amount, sellOffAmt.TruncateInt(), currentCollateralizationRatio, appID, false, false, "", "", bonusToBidderAmount.Add(penaltyToReserveAmount).TruncateInt()) + err = k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, sdk.NewCoin(assetIn.Denom, sellOffAmt.TruncateInt()), currentCollateralizationRatio, appID, false, false, "", "", bonusToBidderAmount.Add(penaltyToReserveAmount).TruncateInt(), "", true) if err != nil { return err } From b80364ea0a31b77642ca05b4c618ac9190dc517e Mon Sep 17 00:00:00 2001 From: Pratik Date: Thu, 20 Apr 2023 10:06:20 +0530 Subject: [PATCH 044/155] updating proto for bids --- proto/comdex/auctionsV2/v1beta1/auction.proto | 7 - proto/comdex/auctionsV2/v1beta1/bid.proto | 61 +- proto/comdex/auctionsV2/v1beta1/gov.proto | 2 +- x/auctionsV2/keeper/bid.go | 9 + x/auctionsV2/types/auction.pb.go | 262 ++----- x/auctionsV2/types/bid.pb.go | 703 ++++++++++++++---- x/auctionsV2/types/gov.pb.go | 42 +- 7 files changed, 686 insertions(+), 400 deletions(-) create mode 100644 x/auctionsV2/keeper/bid.go diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index eec6d6958..e6f9a0ef6 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -93,10 +93,3 @@ message Auctions{ uint64 bid_id = 1; string bid_owner = 2; } - - -message AuctionParams{ - uint64 auction_duration_seconds = 1 [ - (gogoproto.moretags) = "yaml:\"auction_duration_seconds\"" - ]; -} \ No newline at end of file diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto index 04ce2ad63..2bc1cc720 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -7,7 +7,7 @@ import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; -message Bid{ +message MarketBid{ uint64 bidding_id = 1 [ (gogoproto.moretags) = "yaml:\"bidding_id\"" ]; @@ -15,38 +15,58 @@ message Bid{ uint64 auction_id = 2 [ (gogoproto.moretags) = "yaml:\"auction_id\"" ]; - cosmos.base.v1beta1.Coin collateral_token_amount = 4 [ + cosmos.base.v1beta1.Coin collateral_token_amount = 3 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"outflow_token_amount\"", - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + (gogoproto.moretags) = "yaml:\"outflow_token_amount\"", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - cosmos.base.v1beta1.Coin debt_token_amount = 5 [ + cosmos.base.v1beta1.Coin debt_token_amount = 4 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"inflow_token_amount\"", - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + (gogoproto.moretags) = "yaml:\"inflow_token_amount\"", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - string bidder_address = 6 [ + string bidder_address = 5 [ (gogoproto.moretags) = "yaml:\"bidder\"" ]; - google.protobuf.Timestamp bidding_timestamp = 7 [ + google.protobuf.Timestamp bidding_timestamp = 6 [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true, - (gogoproto.moretags) = "yaml:\"bidding_timestamp\"" + (gogoproto.moretags) = "yaml:\"bidding_timestamp\"" ]; - //Market Order Bidding - 0 - //Limit Order Bidding - 1 - bool bidding_type = 8 [ - (gogoproto.moretags) = "yaml:\"bidding_status\"" + uint64 app_id = 7 [ + (gogoproto.moretags) = "yaml:\"app_id\"" ]; - uint64 app_id = 10 [ +} + +message LimitOrderBid{ + uint64 app_id = 1 [ (gogoproto.moretags) = "yaml:\"app_id\"" ]; + string bidder_address = 2 [ + (gogoproto.moretags) = "yaml:\"bidder\"" + ]; + + cosmos.base.v1beta1.Coin collateral_token_amount = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"outflow_token_amount\"", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + + cosmos.base.v1beta1.Coin debt_token_denom = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"debt_token_denom\"", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + + repeated uint64 auction_id = 5 [ + (gogoproto.moretags) = "yaml:\"auction_id\"" + ]; } @@ -55,18 +75,21 @@ message Bid{ // withdrawal fee for taking out bid // Closing fee for taking out collateral parked -message DutchAutoBidParams{ - string step = 1 [ +message AuctionParams{ + uint64 auction_duration_seconds = 1 [ + (gogoproto.moretags) = "yaml:\"auction_duration_seconds\"" + ]; + string step = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"step\"" ]; - string withdrawal_fee = 2 [ + string withdrawal_fee = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"withdrawal_fee\"" ]; - string closing_fee = 3 [ + string closing_fee = 4 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"closing_fee\"" diff --git a/proto/comdex/auctionsV2/v1beta1/gov.proto b/proto/comdex/auctionsV2/v1beta1/gov.proto index ac256ac87..fc2ca179c 100644 --- a/proto/comdex/auctionsV2/v1beta1/gov.proto +++ b/proto/comdex/auctionsV2/v1beta1/gov.proto @@ -9,5 +9,5 @@ option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; message DutchAutoBidParamsProposal { string title = 1 [(gogoproto.moretags) = "yaml:\"title\""]; string description = 2 [(gogoproto.moretags) = "yaml:\"description\""]; - DutchAutoBidParams dutchAutoBidParams = 3 [(gogoproto.nullable) = false]; + AuctionParams auctionParams = 3 [(gogoproto.nullable) = false]; } \ No newline at end of file diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go new file mode 100644 index 000000000..658cba66e --- /dev/null +++ b/x/auctionsV2/keeper/bid.go @@ -0,0 +1,9 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, appID, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin) error { + return nil +} diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index 110035ad8..e0873cc9a 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -213,54 +213,9 @@ func (m *BidOwnerMapping) GetBidOwner() string { return "" } -type AuctionParams struct { - AuctionDurationSeconds uint64 `protobuf:"varint,1,opt,name=auction_duration_seconds,json=auctionDurationSeconds,proto3" json:"auction_duration_seconds,omitempty" yaml:"auction_duration_seconds"` -} - -func (m *AuctionParams) Reset() { *m = AuctionParams{} } -func (m *AuctionParams) String() string { return proto.CompactTextString(m) } -func (*AuctionParams) ProtoMessage() {} -func (*AuctionParams) Descriptor() ([]byte, []int) { - return fileDescriptor_8ee47f5a405fa8ba, []int{2} -} -func (m *AuctionParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuctionParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuctionParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuctionParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuctionParams.Merge(m, src) -} -func (m *AuctionParams) XXX_Size() int { - return m.Size() -} -func (m *AuctionParams) XXX_DiscardUnknown() { - xxx_messageInfo_AuctionParams.DiscardUnknown(m) -} - -var xxx_messageInfo_AuctionParams proto.InternalMessageInfo - -func (m *AuctionParams) GetAuctionDurationSeconds() uint64 { - if m != nil { - return m.AuctionDurationSeconds - } - return 0 -} - func init() { proto.RegisterType((*Auctions)(nil), "comdex.auctionsV2.v1beta1.Auctions") proto.RegisterType((*BidOwnerMapping)(nil), "comdex.auctionsV2.v1beta1.bidOwnerMapping") - proto.RegisterType((*AuctionParams)(nil), "comdex.auctionsV2.v1beta1.AuctionParams") } func init() { @@ -268,61 +223,59 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 862 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4d, 0x6f, 0xdc, 0x44, - 0x18, 0x8e, 0xa1, 0x4d, 0x77, 0x67, 0x13, 0x6d, 0xe3, 0x92, 0xd4, 0xdd, 0x80, 0xbd, 0x0c, 0x52, - 0xbb, 0x42, 0xaa, 0xad, 0x86, 0x9e, 0xb8, 0xe1, 0xb4, 0x88, 0x45, 0x02, 0x22, 0x77, 0x55, 0x21, - 0x24, 0x64, 0x8d, 0x3d, 0xb3, 0xcb, 0x28, 0xb6, 0xc7, 0xb2, 0xc7, 0x29, 0xf9, 0x0f, 0x80, 0x72, - 0xe5, 0x87, 0xf0, 0x1f, 0x7a, 0xec, 0x11, 0x71, 0x30, 0x28, 0xf9, 0x07, 0x3e, 0x72, 0x42, 0xf3, - 0xe1, 0xb8, 0xeb, 0x06, 0x95, 0x48, 0x9c, 0xec, 0x79, 0x3f, 0x9e, 0xe7, 0x99, 0x77, 0xe6, 0x7d, - 0x07, 0x3c, 0x88, 0x59, 0x8a, 0xc9, 0x8f, 0x1e, 0xaa, 0x62, 0x4e, 0x59, 0x56, 0x3e, 0x3f, 0xf0, - 0x4e, 0x1e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xd6, 0x68, 0x53, 0x9e, 0xda, 0x27, - 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x92, 0x52, 0xdc, 0xe3, 0xe2, 0x07, 0x00, 0x00, + // 817 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0x8f, 0x61, 0x37, 0x9b, 0x4c, 0x5a, 0x65, 0xeb, 0xa5, 0xbb, 0xde, 0x14, 0xec, 0xe0, 0xc3, + 0x6e, 0x84, 0x54, 0x5b, 0x2d, 0x3d, 0x71, 0xc3, 0xa5, 0x88, 0x20, 0x01, 0x95, 0x89, 0x2a, 0xc4, + 0xc5, 0x1a, 0x7b, 0x26, 0x66, 0x54, 0xc7, 0x63, 0xd9, 0x93, 0x96, 0x7e, 0x07, 0x40, 0xbd, 0xf2, + 0x41, 0xf8, 0x0e, 0x3d, 0xf6, 0x88, 0x38, 0x18, 0x94, 0x7e, 0x83, 0x1c, 0x39, 0xa1, 0xf9, 0xe3, + 0xba, 0x71, 0x8b, 0x4a, 0x24, 0x4e, 0xc9, 0xbc, 0x79, 0xef, 0xf7, 0xfb, 0xcd, 0xf3, 0xbc, 0xdf, + 0x80, 0xb7, 0x11, 0x9d, 0x21, 0xfc, 0xa3, 0x0b, 0xe7, 0x11, 0x23, 0x34, 0x2d, 0x4e, 0xf6, 0xdd, + 0xb3, 0xbd, 0x10, 0x33, 0xb8, 0x57, 0x85, 0x9c, 0x2c, 0xa7, 0x8c, 0xea, 0xaf, 0x65, 0xa2, 0x53, + 0x27, 0x3a, 0x2a, 0x71, 0xf0, 0x5e, 0x4c, 0x63, 0x2a, 0xb2, 0x5c, 0xfe, 0x4f, 0x16, 0x0c, 0xac, + 0x98, 0xd2, 0x38, 0xc1, 0xae, 0x58, 0x85, 0xf3, 0xa9, 0xcb, 0xc8, 0x0c, 0x17, 0x0c, 0xce, 0x32, + 0x95, 0x60, 0x46, 0xb4, 0x98, 0xd1, 0xc2, 0x0d, 0x61, 0x81, 0x6f, 0x49, 0x23, 0x4a, 0x14, 0xa3, + 0xfd, 0xdb, 0x06, 0xe8, 0x7c, 0xaa, 0xd8, 0xf4, 0x03, 0x00, 0x14, 0x73, 0x40, 0x90, 0xa1, 0x0d, + 0xb5, 0xd1, 0x13, 0x6f, 0x7b, 0x59, 0x5a, 0x5b, 0x17, 0x70, 0x96, 0x7c, 0x62, 0xd7, 0x7b, 0xb6, + 0xdf, 0x55, 0x8b, 0x31, 0xd2, 0x2f, 0x35, 0xf0, 0x3c, 0xa2, 0x49, 0x02, 0x19, 0xce, 0x61, 0x12, + 0x30, 0x7a, 0x8a, 0x53, 0xe3, 0x9d, 0xa1, 0x36, 0xea, 0xed, 0xbf, 0x76, 0x24, 0xbd, 0xc3, 0xe9, + 0xab, 0xa3, 0x38, 0x87, 0x94, 0xa4, 0xde, 0x97, 0x57, 0xa5, 0xd5, 0x5a, 0x96, 0xd6, 0x2b, 0x89, + 0xdd, 0x04, 0xb0, 0xff, 0x2e, 0xad, 0xb7, 0x31, 0x61, 0x3f, 0xcc, 0x43, 0x27, 0xa2, 0x33, 0x57, + 0x1d, 0x43, 0xfe, 0xec, 0x16, 0xe8, 0xd4, 0x65, 0x17, 0x19, 0x2e, 0x04, 0x96, 0xdf, 0xaf, 0xab, + 0x27, 0xbc, 0x58, 0xff, 0x45, 0x03, 0x00, 0xe1, 0x90, 0x29, 0x31, 0x4f, 0x1e, 0x13, 0x33, 0x51, + 0x62, 0x3e, 0x94, 0x62, 0x48, 0x3a, 0x4d, 0xe8, 0xb9, 0x2c, 0x0e, 0x18, 0xcc, 0x63, 0xcc, 0x02, + 0x38, 0xa3, 0xf3, 0x94, 0xad, 0x25, 0xab, 0xcb, 0x25, 0x48, 0x41, 0x5f, 0x80, 0x2d, 0x18, 0x31, + 0x72, 0x86, 0x83, 0x90, 0x20, 0x44, 0xd2, 0x98, 0x37, 0xb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x78, 0x59, 0x5a, 0x2f, 0x56, 0x0d, 0x9f, 0x27, 0xdb, 0x7e, 0x0f, 0xd6, + 0x39, 0xf6, 0x11, 0xe8, 0x37, 0x8c, 0x45, 0xdf, 0x06, 0x6d, 0x3e, 0xea, 0xd5, 0xcb, 0xe1, 0x3f, + 0x0d, 0x09, 0x1a, 0x23, 0x7d, 0x07, 0xf0, 0xa1, 0x0f, 0x28, 0x4f, 0x15, 0xcf, 0x42, 0xd7, 0xef, + 0x54, 0xa5, 0xde, 0xd7, 0x57, 0x0b, 0x53, 0xbb, 0x5e, 0x98, 0xda, 0x5f, 0x0b, 0x53, 0xbb, 0xbc, + 0x31, 0x5b, 0xd7, 0x37, 0x66, 0xeb, 0xf7, 0x1b, 0xb3, 0xf5, 0xfd, 0xc1, 0xca, 0x5d, 0xe1, 0xe6, + 0xb6, 0x4b, 0xa7, 0x53, 0x12, 0x11, 0x98, 0xa8, 0xb5, 0xbb, 0xf2, 0xa0, 0x8a, 0xdb, 0x13, 0xb6, + 0x45, 0x17, 0x3f, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x96, 0x9c, 0xaf, 0x72, 0x07, 0x00, + 0x00, } func (m *Auctions) Marshal() (dAtA []byte, err error) { @@ -519,34 +472,6 @@ func (m *BidOwnerMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *AuctionParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuctionParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuctionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AuctionDurationSeconds != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionDurationSeconds)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func encodeVarintAuction(dAtA []byte, offset int, v uint64) int { offset -= sovAuction(v) base := offset @@ -622,18 +547,6 @@ func (m *BidOwnerMapping) Size() (n int) { return n } -func (m *AuctionParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AuctionDurationSeconds != 0 { - n += 1 + sovAuction(uint64(m.AuctionDurationSeconds)) - } - return n -} - func sovAuction(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1223,75 +1136,6 @@ func (m *BidOwnerMapping) Unmarshal(dAtA []byte) error { } return nil } -func (m *AuctionParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuctionParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuctionParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionDurationSeconds", wireType) - } - m.AuctionDurationSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionDurationSeconds |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipAuction(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuction - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipAuction(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index 574a4d320..6b43b9ae8 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -29,31 +29,28 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type Bid struct { +type MarketBid struct { BiddingId uint64 `protobuf:"varint,1,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` - CollateralTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=collateral_token_amount,json=collateralTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token_amount" yaml:"outflow_token_amount"` - DebtTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=debt_token_amount,json=debtTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token_amount" yaml:"inflow_token_amount"` - BidderAddress string `protobuf:"bytes,6,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` - BiddingTimestamp time.Time `protobuf:"bytes,7,opt,name=bidding_timestamp,json=biddingTimestamp,proto3,stdtime" json:"bidding_timestamp" yaml:"bidding_timestamp"` - //Market Order Bidding - 0 - //Limit Order Bidding - 1 - BiddingType bool `protobuf:"varint,8,opt,name=bidding_type,json=biddingType,proto3" json:"bidding_type,omitempty" yaml:"bidding_status"` - AppId uint64 `protobuf:"varint,10,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` -} - -func (m *Bid) Reset() { *m = Bid{} } -func (m *Bid) String() string { return proto.CompactTextString(m) } -func (*Bid) ProtoMessage() {} -func (*Bid) Descriptor() ([]byte, []int) { + CollateralTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=collateral_token_amount,json=collateralTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token_amount" yaml:"outflow_token_amount"` + DebtTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=debt_token_amount,json=debtTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token_amount" yaml:"inflow_token_amount"` + BidderAddress string `protobuf:"bytes,5,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` + BiddingTimestamp time.Time `protobuf:"bytes,6,opt,name=bidding_timestamp,json=biddingTimestamp,proto3,stdtime" json:"bidding_timestamp" yaml:"bidding_timestamp"` + AppId uint64 `protobuf:"varint,7,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` +} + +func (m *MarketBid) Reset() { *m = MarketBid{} } +func (m *MarketBid) String() string { return proto.CompactTextString(m) } +func (*MarketBid) ProtoMessage() {} +func (*MarketBid) Descriptor() ([]byte, []int) { return fileDescriptor_6f6db8f3a6a396ec, []int{0} } -func (m *Bid) XXX_Unmarshal(b []byte) error { +func (m *MarketBid) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Bid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MarketBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Bid.Marshal(b, m, deterministic) + return xxx_messageInfo_MarketBid.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -63,92 +60,162 @@ func (m *Bid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Bid) XXX_Merge(src proto.Message) { - xxx_messageInfo_Bid.Merge(m, src) +func (m *MarketBid) XXX_Merge(src proto.Message) { + xxx_messageInfo_MarketBid.Merge(m, src) } -func (m *Bid) XXX_Size() int { +func (m *MarketBid) XXX_Size() int { return m.Size() } -func (m *Bid) XXX_DiscardUnknown() { - xxx_messageInfo_Bid.DiscardUnknown(m) +func (m *MarketBid) XXX_DiscardUnknown() { + xxx_messageInfo_MarketBid.DiscardUnknown(m) } -var xxx_messageInfo_Bid proto.InternalMessageInfo +var xxx_messageInfo_MarketBid proto.InternalMessageInfo -func (m *Bid) GetBiddingId() uint64 { +func (m *MarketBid) GetBiddingId() uint64 { if m != nil { return m.BiddingId } return 0 } -func (m *Bid) GetAuctionId() uint64 { +func (m *MarketBid) GetAuctionId() uint64 { if m != nil { return m.AuctionId } return 0 } -func (m *Bid) GetCollateralTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *MarketBid) GetCollateralTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { return m.CollateralTokenAmount } return github_com_cosmos_cosmos_sdk_types.Coin{} } -func (m *Bid) GetDebtTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *MarketBid) GetDebtTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { return m.DebtTokenAmount } return github_com_cosmos_cosmos_sdk_types.Coin{} } -func (m *Bid) GetBidderAddress() string { +func (m *MarketBid) GetBidderAddress() string { if m != nil { return m.BidderAddress } return "" } -func (m *Bid) GetBiddingTimestamp() time.Time { +func (m *MarketBid) GetBiddingTimestamp() time.Time { if m != nil { return m.BiddingTimestamp } return time.Time{} } -func (m *Bid) GetBiddingType() bool { +func (m *MarketBid) GetAppId() uint64 { if m != nil { - return m.BiddingType + return m.AppId + } + return 0 +} + +type LimitOrderBid struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + BidderAddress string `protobuf:"bytes,2,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` + CollateralTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=collateral_token_amount,json=collateralTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token_amount" yaml:"outflow_token_amount"` + DebtTokenDenom github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=debt_token_denom,json=debtTokenDenom,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token_denom" yaml:"debt_token_denom"` + AuctionId []uint64 `protobuf:"varint,5,rep,packed,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` +} + +func (m *LimitOrderBid) Reset() { *m = LimitOrderBid{} } +func (m *LimitOrderBid) String() string { return proto.CompactTextString(m) } +func (*LimitOrderBid) ProtoMessage() {} +func (*LimitOrderBid) Descriptor() ([]byte, []int) { + return fileDescriptor_6f6db8f3a6a396ec, []int{1} +} +func (m *LimitOrderBid) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LimitOrderBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LimitOrderBid.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return false } +func (m *LimitOrderBid) XXX_Merge(src proto.Message) { + xxx_messageInfo_LimitOrderBid.Merge(m, src) +} +func (m *LimitOrderBid) XXX_Size() int { + return m.Size() +} +func (m *LimitOrderBid) XXX_DiscardUnknown() { + xxx_messageInfo_LimitOrderBid.DiscardUnknown(m) +} + +var xxx_messageInfo_LimitOrderBid proto.InternalMessageInfo -func (m *Bid) GetAppId() uint64 { +func (m *LimitOrderBid) GetAppId() uint64 { if m != nil { return m.AppId } return 0 } -type DutchAutoBidParams struct { - Step github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"step" yaml:"step"` - WithdrawalFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=withdrawal_fee,json=withdrawalFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"withdrawal_fee" yaml:"withdrawal_fee"` - ClosingFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=closing_fee,json=closingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"closing_fee" yaml:"closing_fee"` +func (m *LimitOrderBid) GetBidderAddress() string { + if m != nil { + return m.BidderAddress + } + return "" } -func (m *DutchAutoBidParams) Reset() { *m = DutchAutoBidParams{} } -func (m *DutchAutoBidParams) String() string { return proto.CompactTextString(m) } -func (*DutchAutoBidParams) ProtoMessage() {} -func (*DutchAutoBidParams) Descriptor() ([]byte, []int) { - return fileDescriptor_6f6db8f3a6a396ec, []int{1} +func (m *LimitOrderBid) GetCollateralTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { + if m != nil { + return m.CollateralTokenAmount + } + return github_com_cosmos_cosmos_sdk_types.Coin{} +} + +func (m *LimitOrderBid) GetDebtTokenDenom() github_com_cosmos_cosmos_sdk_types.Coin { + if m != nil { + return m.DebtTokenDenom + } + return github_com_cosmos_cosmos_sdk_types.Coin{} +} + +func (m *LimitOrderBid) GetAuctionId() []uint64 { + if m != nil { + return m.AuctionId + } + return nil +} + +type AuctionParams struct { + AuctionDurationSeconds uint64 `protobuf:"varint,1,opt,name=auction_duration_seconds,json=auctionDurationSeconds,proto3" json:"auction_duration_seconds,omitempty" yaml:"auction_duration_seconds"` + Step github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"step" yaml:"step"` + WithdrawalFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=withdrawal_fee,json=withdrawalFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"withdrawal_fee" yaml:"withdrawal_fee"` + ClosingFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=closing_fee,json=closingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"closing_fee" yaml:"closing_fee"` } -func (m *DutchAutoBidParams) XXX_Unmarshal(b []byte) error { + +func (m *AuctionParams) Reset() { *m = AuctionParams{} } +func (m *AuctionParams) String() string { return proto.CompactTextString(m) } +func (*AuctionParams) ProtoMessage() {} +func (*AuctionParams) Descriptor() ([]byte, []int) { + return fileDescriptor_6f6db8f3a6a396ec, []int{2} +} +func (m *AuctionParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *DutchAutoBidParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AuctionParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_DutchAutoBidParams.Marshal(b, m, deterministic) + return xxx_messageInfo_AuctionParams.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -158,21 +225,29 @@ func (m *DutchAutoBidParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *DutchAutoBidParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_DutchAutoBidParams.Merge(m, src) +func (m *AuctionParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuctionParams.Merge(m, src) } -func (m *DutchAutoBidParams) XXX_Size() int { +func (m *AuctionParams) XXX_Size() int { return m.Size() } -func (m *DutchAutoBidParams) XXX_DiscardUnknown() { - xxx_messageInfo_DutchAutoBidParams.DiscardUnknown(m) +func (m *AuctionParams) XXX_DiscardUnknown() { + xxx_messageInfo_AuctionParams.DiscardUnknown(m) } -var xxx_messageInfo_DutchAutoBidParams proto.InternalMessageInfo +var xxx_messageInfo_AuctionParams proto.InternalMessageInfo + +func (m *AuctionParams) GetAuctionDurationSeconds() uint64 { + if m != nil { + return m.AuctionDurationSeconds + } + return 0 +} func init() { - proto.RegisterType((*Bid)(nil), "comdex.auctionsV2.v1beta1.Bid") - proto.RegisterType((*DutchAutoBidParams)(nil), "comdex.auctionsV2.v1beta1.DutchAutoBidParams") + proto.RegisterType((*MarketBid)(nil), "comdex.auctionsV2.v1beta1.MarketBid") + proto.RegisterType((*LimitOrderBid)(nil), "comdex.auctionsV2.v1beta1.LimitOrderBid") + proto.RegisterType((*AuctionParams)(nil), "comdex.auctionsV2.v1beta1.AuctionParams") } func init() { @@ -180,50 +255,55 @@ func init() { } var fileDescriptor_6f6db8f3a6a396ec = []byte{ - // 635 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x8d, 0xfb, 0xf7, 0x35, 0x93, 0xaf, 0x85, 0x58, 0x54, 0xa4, 0x41, 0xb2, 0xa3, 0x01, 0x41, - 0x36, 0xb5, 0xd5, 0xd2, 0x05, 0x42, 0xb0, 0xa8, 0xa9, 0x8a, 0xba, 0xa0, 0x02, 0xab, 0x62, 0xc1, - 0x26, 0x1a, 0x7b, 0x26, 0xe9, 0xa8, 0xb6, 0xc7, 0xf2, 0x8c, 0x29, 0x79, 0x8b, 0x2e, 0x78, 0x01, - 0x1e, 0x04, 0xd6, 0x5d, 0x76, 0x89, 0x58, 0x18, 0xd4, 0xbe, 0x41, 0x96, 0xac, 0x90, 0x67, 0x26, - 0x71, 0xcc, 0x06, 0x2a, 0x56, 0xf6, 0x9d, 0x39, 0xf7, 0x9c, 0x73, 0xaf, 0x8f, 0x0c, 0xee, 0x87, - 0x2c, 0xc6, 0xe4, 0x83, 0x8b, 0xf2, 0x50, 0x50, 0x96, 0xf0, 0xb7, 0x3b, 0xee, 0xfb, 0xed, 0x80, - 0x08, 0xb4, 0xed, 0x06, 0x14, 0x3b, 0x69, 0xc6, 0x04, 0x33, 0x37, 0x15, 0xc8, 0xa9, 0x40, 0x8e, - 0x06, 0x75, 0xef, 0x8c, 0xd8, 0x88, 0x49, 0x94, 0x5b, 0xbe, 0xa9, 0x86, 0xae, 0x3d, 0x62, 0x6c, - 0x14, 0x11, 0x57, 0x56, 0x41, 0x3e, 0x74, 0x05, 0x8d, 0x09, 0x17, 0x28, 0x4e, 0x35, 0xc0, 0x0a, - 0x19, 0x8f, 0x19, 0x77, 0x03, 0xc4, 0xc9, 0x4c, 0x30, 0x64, 0x34, 0x51, 0xf7, 0xf0, 0xf3, 0x32, - 0x58, 0xf4, 0x28, 0x36, 0x77, 0x01, 0x08, 0x28, 0xc6, 0x34, 0x19, 0x0d, 0x28, 0xee, 0x18, 0x3d, - 0xa3, 0xbf, 0xe4, 0x6d, 0x4c, 0x0a, 0xbb, 0x3d, 0x46, 0x71, 0xf4, 0x14, 0x56, 0x77, 0xd0, 0x6f, - 0xea, 0xe2, 0x50, 0x76, 0x69, 0xab, 0x65, 0xd7, 0xc2, 0xef, 0x5d, 0xd5, 0x1d, 0xf4, 0x9b, 0xba, - 0x38, 0xc4, 0xe6, 0x27, 0x03, 0xdc, 0x0d, 0x59, 0x14, 0x21, 0x41, 0x32, 0x14, 0x0d, 0x04, 0x3b, - 0x25, 0xc9, 0x00, 0xc5, 0x2c, 0x4f, 0x44, 0x67, 0xa9, 0x67, 0xf4, 0x5b, 0x3b, 0x9b, 0x8e, 0xb2, - 0xed, 0x94, 0xb6, 0xa7, 0x2b, 0x70, 0x5e, 0x30, 0x9a, 0x78, 0x47, 0x17, 0x85, 0xdd, 0x98, 0x14, - 0xf6, 0x3d, 0x25, 0xc1, 0x72, 0x31, 0x8c, 0xd8, 0x59, 0x8d, 0x04, 0xfe, 0x2c, 0xec, 0x47, 0x23, - 0x2a, 0x4e, 0xf2, 0xc0, 0x09, 0x59, 0xec, 0xea, 0x15, 0xa8, 0xc7, 0x16, 0xc7, 0xa7, 0xae, 0x18, - 0xa7, 0x84, 0x4b, 0x3e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x83, 0xdc, 0xf4, 0x9e, 0x97, - 0x43, 0x7c, 0x2b, 0xec, 0x87, 0x7f, 0xb1, 0xf7, 0x7d, 0x12, 0x4e, 0x0a, 0xbb, 0xa5, 0xc4, 0x4a, - 0x0e, 0xe8, 0x4b, 0x2a, 0x33, 0x01, 0xeb, 0x67, 0x54, 0x9c, 0xe0, 0x0c, 0x9d, 0xa1, 0x68, 0x30, - 0x24, 0x44, 0xe6, 0xbd, 0xe9, 0xbd, 0xbc, 0x31, 0xb9, 0xde, 0x40, 0x9d, 0x0d, 0xfa, 0x6b, 0xd5, - 0xc1, 0x01, 0x21, 0x26, 0x01, 0xad, 0x30, 0x62, 0xbc, 0xdc, 0x51, 0x29, 0xb6, 0x28, 0xc5, 0xf6, - 0x6f, 0x2c, 0x66, 0x2a, 0xb1, 0x39, 0x2a, 0xe8, 0x03, 0x5d, 0x1d, 0x10, 0xe2, 0x1d, 0x5d, 0x5c, - 0x59, 0xc6, 0xe5, 0x95, 0x65, 0xfc, 0xb8, 0xb2, 0x8c, 0xf3, 0x6b, 0xab, 0x71, 0x79, 0x6d, 0x35, - 0xbe, 0x5e, 0x5b, 0x8d, 0x77, 0xbb, 0x35, 0x8d, 0xf2, 0xbf, 0xb4, 0xc5, 0x86, 0x43, 0x1a, 0x52, - 0x14, 0xe9, 0xda, 0xad, 0xfd, 0xce, 0xa4, 0x6a, 0xb0, 0x22, 0x43, 0xf4, 0xf8, 0x57, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x12, 0xfa, 0xc4, 0x66, 0xf0, 0x04, 0x00, 0x00, -} - -func (m *Bid) Marshal() (dAtA []byte, err error) { + // 708 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0x4d, 0x6f, 0x13, 0x3b, + 0x14, 0xcd, 0x34, 0x49, 0x9f, 0xe2, 0x2a, 0x7d, 0xcd, 0xe8, 0xf5, 0x35, 0xc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, 0x9d, 0xcf, 0xce, 0x53, 0xb3, + 0x95, 0x97, 0xec, 0xa1, 0x97, 0xec, 0x83, 0x61, 0x45, 0xeb, 0x7f, 0x7d, 0xa0, 0xea, 0xb4, 0x0f, + 0x46, 0x10, 0xf0, 0xf4, 0xc2, 0x32, 0xdc, 0x25, 0xbd, 0x3f, 0xea, 0x33, 0x9b, 0x60, 0x1e, 0xc5, + 0xb1, 0x74, 0xc5, 0x5f, 0x99, 0x2b, 0x26, 0x04, 0xaa, 0x7d, 0xe8, 0x16, 0x51, 0x1c, 0xef, 0x62, + 0x78, 0x91, 0x07, 0xe5, 0xa7, 0x34, 0xa4, 0xe2, 0x59, 0x82, 0x49, 0x22, 0xbd, 0x38, 0xee, 0x35, + 0x7e, 0xdd, 0xfb, 0x93, 0x71, 0xcc, 0xdd, 0x70, 0x1c, 0x7f, 0x82, 0x07, 0x3f, 0x18, 0x60, 0x69, + 0xc2, 0x83, 0x98, 0x44, 0x2c, 0xbc, 0xde, 0x82, 0x4f, 0xb4, 0xb8, 0x15, 0x25, 0x6e, 0x16, 0xe0, + 0x56, 0xc2, 0x16, 0x47, 0xfe, 0x6b, 0xcb, 0xde, 0x99, 0xf7, 0x5e, 0x6c, 0xe4, 0x6f, 0xf2, 0xde, + 0xe1, 0xa7, 0x3c, 0x28, 0x6f, 0xab, 0xe8, 0x39, 0x4a, 0x50, 0xc8, 0xcd, 0x37, 0xa0, 0x3a, 0xac, + 0xc5, 0xfd, 0x04, 0x65, 0x0b, 0x4e, 0x7c, 0x16, 0x61, 0xae, 0xef, 0x7c, 0x6d, 0x90, 0x5a, 0xd6, + 0x34, 0xea, 0x6c, 0x25, 0x74, 0xff, 0xd5, 0xa9, 0xb6, 0xce, 0xbc, 0x54, 0x09, 0xf3, 0x05, 0x28, + 0x70, 0x41, 0x62, 0x6d, 0x86, 0x87, 0x72, 0x20, 0x5f, 0x53, 0xeb, 0xce, 0x0d, 0x4e, 0xdd, 0x26, + 0xfe, 0x20, 0xb5, 0x16, 0x14, 0xb1, 0xc4, 0x80, 0x6e, 0x06, 0x65, 0x46, 0x60, 0xf1, 0x98, 0x8a, + 0x43, 0x9c, 0xa0, 0x63, 0x14, 0x74, 0xba, 0x84, 0x64, 0x2e, 0x29, 0xb5, 0x1e, 0xdf, 0x1a, 0x7c, + 0x59, 0x81, 0x4f, 0xa3, 0x41, 0xb7, 0x3c, 0xde, 0xd8, 0x21, 0xc4, 0x24, 0x60, 0xc1, 0x0f, 0x18, + 0x97, 0x6f, 0x4d, 0x92, 0x15, 0x32, 0xb2, 0xf6, 0xad, 0xc9, 0x4c, 0x45, 0x36, 0x01, 0x05, 0x5d, + 0xa0, 0xa3, 0x1d, 0x42, 0x5a, 0xfb, 0x67, 0x97, 0x75, 0xe3, 0xfc, 0xb2, 0x6e, 0x7c, 0xbb, 0xac, + 0x1b, 0xa7, 0x57, 0xf5, 0xdc, 0xf9, 0x55, 0x3d, 0xf7, 0xe5, 0xaa, 0x9e, 0x7b, 0xbd, 0x35, 0xc5, + 0x21, 0xbf, 0x4d, 0xeb, 0xac, 0xdb, 0xa5, 0x3e, 0x45, 0x81, 0x8e, 0x9d, 0xa9, 0x4f, 0x5a, 0xc6, + 0xea, 0xcd, 0x67, 0x7f, 0x21, 0xf7, 0x7e, 0x04, 0x00, 0x00, 0xff, 0xff, 0x69, 0x9a, 0x42, 0x4c, + 0xf4, 0x06, 0x00, 0x00, +} + +func (m *MarketBid) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -233,12 +313,12 @@ func (m *Bid) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Bid) MarshalTo(dAtA []byte) (int, error) { +func (m *MarketBid) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MarketBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -246,17 +326,7 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.AppId != 0 { i = encodeVarintBid(dAtA, i, uint64(m.AppId)) i-- - dAtA[i] = 0x50 - } - if m.BiddingType { - i-- - if m.BiddingType { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 + dAtA[i] = 0x38 } n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BiddingTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp):]) if err1 != nil { @@ -265,13 +335,13 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n1 i = encodeVarintBid(dAtA, i, uint64(n1)) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x32 if len(m.BidderAddress) > 0 { i -= len(m.BidderAddress) copy(dAtA[i:], m.BidderAddress) i = encodeVarintBid(dAtA, i, uint64(len(m.BidderAddress))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x2a } { size, err := m.DebtTokenAmount.MarshalToSizedBuffer(dAtA[:i]) @@ -282,7 +352,7 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBid(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 { size, err := m.CollateralTokenAmount.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -292,7 +362,7 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBid(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a if m.AuctionId != 0 { i = encodeVarintBid(dAtA, i, uint64(m.AuctionId)) i-- @@ -306,7 +376,7 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *DutchAutoBidParams) Marshal() (dAtA []byte, err error) { +func (m *LimitOrderBid) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -316,12 +386,85 @@ func (m *DutchAutoBidParams) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DutchAutoBidParams) MarshalTo(dAtA []byte) (int, error) { +func (m *LimitOrderBid) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DutchAutoBidParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *LimitOrderBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AuctionId) > 0 { + dAtA5 := make([]byte, len(m.AuctionId)*10) + var j4 int + for _, num := range m.AuctionId { + for num >= 1<<7 { + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j4++ + } + dAtA5[j4] = uint8(num) + j4++ + } + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintBid(dAtA, i, uint64(j4)) + i-- + dAtA[i] = 0x2a + } + { + size, err := m.DebtTokenDenom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.CollateralTokenAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.BidderAddress) > 0 { + i -= len(m.BidderAddress) + copy(dAtA[i:], m.BidderAddress) + i = encodeVarintBid(dAtA, i, uint64(len(m.BidderAddress))) + i-- + dAtA[i] = 0x12 + } + if m.AppId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AuctionParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AuctionParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuctionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -335,7 +478,7 @@ func (m *DutchAutoBidParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBid(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 { size := m.WithdrawalFee.Size() i -= size @@ -345,7 +488,7 @@ func (m *DutchAutoBidParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBid(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a { size := m.Step.Size() i -= size @@ -355,7 +498,12 @@ func (m *DutchAutoBidParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBid(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + if m.AuctionDurationSeconds != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.AuctionDurationSeconds)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } @@ -370,7 +518,7 @@ func encodeVarintBid(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Bid) Size() (n int) { +func (m *MarketBid) Size() (n int) { if m == nil { return 0 } @@ -392,21 +540,48 @@ func (m *Bid) Size() (n int) { } l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp) n += 1 + l + sovBid(uint64(l)) - if m.BiddingType { - n += 2 + if m.AppId != 0 { + n += 1 + sovBid(uint64(m.AppId)) } + return n +} + +func (m *LimitOrderBid) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l if m.AppId != 0 { n += 1 + sovBid(uint64(m.AppId)) } + l = len(m.BidderAddress) + if l > 0 { + n += 1 + l + sovBid(uint64(l)) + } + l = m.CollateralTokenAmount.Size() + n += 1 + l + sovBid(uint64(l)) + l = m.DebtTokenDenom.Size() + n += 1 + l + sovBid(uint64(l)) + if len(m.AuctionId) > 0 { + l = 0 + for _, e := range m.AuctionId { + l += sovBid(uint64(e)) + } + n += 1 + sovBid(uint64(l)) + l + } return n } -func (m *DutchAutoBidParams) Size() (n int) { +func (m *AuctionParams) Size() (n int) { if m == nil { return 0 } var l int _ = l + if m.AuctionDurationSeconds != 0 { + n += 1 + sovBid(uint64(m.AuctionDurationSeconds)) + } l = m.Step.Size() n += 1 + l + sovBid(uint64(l)) l = m.WithdrawalFee.Size() @@ -422,7 +597,7 @@ func sovBid(x uint64) (n int) { func sozBid(x uint64) (n int) { return sovBid(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Bid) Unmarshal(dAtA []byte) error { +func (m *MarketBid) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -445,10 +620,10 @@ func (m *Bid) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Bid: wiretype end group for non-group") + return fmt.Errorf("proto: MarketBid: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Bid: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MarketBid: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -489,7 +664,7 @@ func (m *Bid) Unmarshal(dAtA []byte) error { break } } - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenAmount", wireType) } @@ -522,7 +697,7 @@ func (m *Bid) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenAmount", wireType) } @@ -555,7 +730,7 @@ func (m *Bid) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BidderAddress", wireType) } @@ -587,7 +762,7 @@ func (m *Bid) Unmarshal(dAtA []byte) error { } m.BidderAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BiddingTimestamp", wireType) } @@ -620,11 +795,11 @@ func (m *Bid) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 8: + case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingType", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) } - var v int + m.AppId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBid @@ -634,13 +809,62 @@ func (m *Bid) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.AppId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.BiddingType = bool(v != 0) - case 10: + default: + iNdEx = preIndex + skippy, err := skipBid(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBid + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LimitOrderBid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LimitOrderBid: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) } @@ -659,6 +883,180 @@ func (m *Bid) Unmarshal(dAtA []byte) error { break } } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidderAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BidderAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBid + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CollateralTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenDenom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBid + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DebtTokenDenom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AuctionId = append(m.AuctionId, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthBid + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.AuctionId) == 0 { + m.AuctionId = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AuctionId = append(m.AuctionId, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } default: iNdEx = preIndex skippy, err := skipBid(dAtA[iNdEx:]) @@ -680,7 +1078,7 @@ func (m *Bid) Unmarshal(dAtA []byte) error { } return nil } -func (m *DutchAutoBidParams) Unmarshal(dAtA []byte) error { +func (m *AuctionParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -703,13 +1101,32 @@ func (m *DutchAutoBidParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DutchAutoBidParams: wiretype end group for non-group") + return fmt.Errorf("proto: AuctionParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DutchAutoBidParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AuctionParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionDurationSeconds", wireType) + } + m.AuctionDurationSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionDurationSeconds |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) } @@ -743,7 +1160,7 @@ func (m *DutchAutoBidParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field WithdrawalFee", wireType) } @@ -777,7 +1194,7 @@ func (m *DutchAutoBidParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ClosingFee", wireType) } diff --git a/x/auctionsV2/types/gov.pb.go b/x/auctionsV2/types/gov.pb.go index 2ffbb8c17..febe11e3e 100644 --- a/x/auctionsV2/types/gov.pb.go +++ b/x/auctionsV2/types/gov.pb.go @@ -24,9 +24,9 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type DutchAutoBidParamsProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - DutchAutoBidParams DutchAutoBidParams `protobuf:"bytes,3,opt,name=dutchAutoBidParams,proto3" json:"dutchAutoBidParams"` + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + AuctionParams AuctionParams `protobuf:"bytes,3,opt,name=auctionParams,proto3" json:"auctionParams"` } func (m *DutchAutoBidParamsProposal) Reset() { *m = DutchAutoBidParamsProposal{} } @@ -76,11 +76,11 @@ func (m *DutchAutoBidParamsProposal) GetDescription() string { return "" } -func (m *DutchAutoBidParamsProposal) GetDutchAutoBidParams() DutchAutoBidParams { +func (m *DutchAutoBidParamsProposal) GetAuctionParams() AuctionParams { if m != nil { - return m.DutchAutoBidParams + return m.AuctionParams } - return DutchAutoBidParams{} + return AuctionParams{} } func init() { @@ -92,25 +92,25 @@ func init() { } var fileDescriptor_11f3d7c5f2a28b27 = []byte{ - // 284 bytes of a gzipped FileDescriptorProto + // 286 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0xcf, 0x4d, 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0xcf, 0x2f, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x84, 0x28, 0xd2, 0x43, 0x28, 0xd2, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, - 0xab, 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0xa4, 0xf0, 0x98, 0x9a, 0x94, 0x99, 0x02, 0x51, 0xa4, 0xf4, - 0x98, 0x91, 0x4b, 0xca, 0xa5, 0xb4, 0x24, 0x39, 0xc3, 0xb1, 0xb4, 0x24, 0xdf, 0x29, 0x33, 0x25, + 0xab, 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0xa4, 0xf0, 0x98, 0x9a, 0x94, 0x99, 0x02, 0x51, 0xa4, 0x74, + 0x85, 0x91, 0x4b, 0xca, 0xa5, 0xb4, 0x24, 0x39, 0xc3, 0xb1, 0xb4, 0x24, 0xdf, 0x29, 0x33, 0x25, 0x20, 0xb1, 0x28, 0x31, 0xb7, 0x38, 0xa0, 0x28, 0xbf, 0x20, 0xbf, 0x38, 0x31, 0x47, 0x48, 0x8d, 0x8b, 0xb5, 0x24, 0xb3, 0x24, 0x27, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, 0x49, 0xe0, 0xd3, 0x3d, 0x79, 0x9e, 0xca, 0xc4, 0xdc, 0x1c, 0x2b, 0x25, 0xb0, 0xb0, 0x52, 0x10, 0x44, 0x5a, 0xc8, 0x82, 0x8b, 0x3b, 0x25, 0xb5, 0x38, 0xb9, 0x28, 0xb3, 0x00, 0x64, 0x95, 0x04, 0x13, 0x58, 0xb5, - 0xd8, 0xa7, 0x7b, 0xf2, 0x42, 0x10, 0xd5, 0x48, 0x92, 0x4a, 0x41, 0xc8, 0x4a, 0x85, 0x92, 0xb9, - 0x84, 0x52, 0x30, 0xec, 0x97, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x36, 0xd2, 0xd5, 0xc3, 0xe9, 0x67, - 0x3d, 0x4c, 0x47, 0x3b, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x84, 0xc5, 0x38, 0x27, 0xbf, 0x13, - 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, - 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x32, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, - 0x02, 0x59, 0xa4, 0x0f, 0xb1, 0x4c, 0x37, 0x3f, 0x2d, 0x2d, 0x33, 0x39, 0x33, 0x31, 0x07, 0xca, - 0xd7, 0x47, 0x09, 0xc1, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0xe0, 0x19, 0x03, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x5c, 0xba, 0x28, 0x64, 0xb9, 0x01, 0x00, 0x00, + 0xd8, 0xa7, 0x7b, 0xf2, 0x42, 0x10, 0xd5, 0x48, 0x92, 0x4a, 0x41, 0xc8, 0x4a, 0x85, 0x42, 0xb8, + 0x78, 0xa1, 0x0e, 0x84, 0x58, 0x2d, 0xc1, 0xac, 0xc0, 0xa8, 0xc1, 0x6d, 0xa4, 0xa1, 0x87, 0xd3, + 0xbb, 0x7a, 0x8e, 0xc8, 0xea, 0x9d, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x42, 0x35, 0xc4, 0xc9, + 0xef, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, + 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x4c, 0xd2, 0x33, 0x4b, 0x32, + 0x4a, 0x93, 0x40, 0xc6, 0xeb, 0x43, 0xac, 0xd0, 0xcd, 0x4f, 0x4b, 0xcb, 0x4c, 0xce, 0x4c, 0xcc, + 0x81, 0xf2, 0xf5, 0x51, 0x82, 0xac, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0x5a, 0xc6, + 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x96, 0x81, 0x80, 0x98, 0xaa, 0x01, 0x00, 0x00, } func (m *DutchAutoBidParamsProposal) Marshal() (dAtA []byte, err error) { @@ -134,7 +134,7 @@ func (m *DutchAutoBidParamsProposal) MarshalToSizedBuffer(dAtA []byte) (int, err var l int _ = l { - size, err := m.DutchAutoBidParams.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.AuctionParams.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -185,7 +185,7 @@ func (m *DutchAutoBidParamsProposal) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } - l = m.DutchAutoBidParams.Size() + l = m.AuctionParams.Size() n += 1 + l + sovGov(uint64(l)) return n } @@ -291,7 +291,7 @@ func (m *DutchAutoBidParamsProposal) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DutchAutoBidParams", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AuctionParams", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -318,7 +318,7 @@ func (m *DutchAutoBidParamsProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.DutchAutoBidParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AuctionParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex From 2fe500afad2d2d63503a1b3ffd69e3edad24a7ff Mon Sep 17 00:00:00 2001 From: Pratik Date: Thu, 20 Apr 2023 12:22:54 +0530 Subject: [PATCH 045/155] updating proto for limit Order bids --- proto/comdex/auctionsV2/v1beta1/bid.proto | 17 +- x/auctionsV2/types/bid.pb.go | 198 +++++++++++++++------- 2 files changed, 154 insertions(+), 61 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto index 2bc1cc720..cdd56a90c 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -48,25 +48,34 @@ message LimitOrderBid{ (gogoproto.moretags) = "yaml:\"app_id\"" ]; - string bidder_address = 2 [ + uint64 bidding_id = 2 [ + (gogoproto.moretags) = "yaml:\"bidding_id\"" + ]; + string bidder_address = 3 [ (gogoproto.moretags) = "yaml:\"bidder\"" ]; - cosmos.base.v1beta1.Coin collateral_token_amount = 3 [ + cosmos.base.v1beta1.Coin collateral_token_amount = 4 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outflow_token_amount\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - cosmos.base.v1beta1.Coin debt_token_denom = 4 [ + cosmos.base.v1beta1.Coin debt_token_denom = 5 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"debt_token_denom\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - repeated uint64 auction_id = 5 [ + repeated uint64 auction_id = 6 [ (gogoproto.moretags) = "yaml:\"auction_id\"" ]; + + string premium_discount = 7 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"premium_discount\"" + ]; } diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index 6b43b9ae8..3ba672d0e 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -123,10 +123,12 @@ func (m *MarketBid) GetAppId() uint64 { type LimitOrderBid struct { AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - BidderAddress string `protobuf:"bytes,2,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` - CollateralTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=collateral_token_amount,json=collateralTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token_amount" yaml:"outflow_token_amount"` - DebtTokenDenom github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=debt_token_denom,json=debtTokenDenom,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token_denom" yaml:"debt_token_denom"` - AuctionId []uint64 `protobuf:"varint,5,rep,packed,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + BiddingId uint64 `protobuf:"varint,2,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` + BidderAddress string `protobuf:"bytes,3,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` + CollateralTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=collateral_token_amount,json=collateralTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token_amount" yaml:"outflow_token_amount"` + DebtTokenDenom github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=debt_token_denom,json=debtTokenDenom,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token_denom" yaml:"debt_token_denom"` + AuctionId []uint64 `protobuf:"varint,6,rep,packed,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + PremiumDiscount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"premium_discount" yaml:"premium_discount"` } func (m *LimitOrderBid) Reset() { *m = LimitOrderBid{} } @@ -169,6 +171,13 @@ func (m *LimitOrderBid) GetAppId() uint64 { return 0 } +func (m *LimitOrderBid) GetBiddingId() uint64 { + if m != nil { + return m.BiddingId + } + return 0 +} + func (m *LimitOrderBid) GetBidderAddress() string { if m != nil { return m.BidderAddress @@ -255,52 +264,54 @@ func init() { } var fileDescriptor_6f6db8f3a6a396ec = []byte{ - // 708 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x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0x28, - 0x70, 0x41, 0x62, 0x6d, 0x86, 0x87, 0x72, 0x20, 0x5f, 0x53, 0xeb, 0xce, 0x0d, 0x4e, 0xdd, 0x26, - 0xfe, 0x20, 0xb5, 0x16, 0x14, 0xb1, 0xc4, 0x80, 0x6e, 0x06, 0x65, 0x46, 0x60, 0xf1, 0x98, 0x8a, - 0x43, 0x9c, 0xa0, 0x63, 0x14, 0x74, 0xba, 0x84, 0x64, 0x2e, 0x29, 0xb5, 0x1e, 0xdf, 0x1a, 0x7c, - 0x59, 0x81, 0x4f, 0xa3, 0x41, 0xb7, 0x3c, 0xde, 0xd8, 0x21, 0xc4, 0x24, 0x60, 0xc1, 0x0f, 0x18, - 0x97, 0x6f, 0x4d, 0x92, 0x15, 0x32, 0xb2, 0xf6, 0xad, 0xc9, 0x4c, 0x45, 0x36, 0x01, 0x05, 0x5d, - 0xa0, 0xa3, 0x1d, 0x42, 0x5a, 0xfb, 0x67, 0x97, 0x75, 0xe3, 0xfc, 0xb2, 0x6e, 0x7c, 0xbb, 0xac, - 0x1b, 0xa7, 0x57, 0xf5, 0xdc, 0xf9, 0x55, 0x3d, 0xf7, 0xe5, 0xaa, 0x9e, 0x7b, 0xbd, 0x35, 0xc5, - 0x21, 0xbf, 0x4d, 0xeb, 0xac, 0xdb, 0xa5, 0x3e, 0x45, 0x81, 0x8e, 0x9d, 0xa9, 0x4f, 0x5a, 0xc6, - 0xea, 0xcd, 0x67, 0x7f, 0x21, 0xf7, 0x7e, 0x04, 0x00, 0x00, 0xff, 0xff, 0x69, 0x9a, 0x42, 0x4c, - 0xf4, 0x06, 0x00, 0x00, + // 749 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x3d, 0x6f, 0xdb, 0x38, + 0x18, 0xb6, 0xe2, 0x8f, 0xc0, 0x0c, 0x9c, 0xc4, 0xc2, 0xe5, 0xe2, 0xf8, 0x00, 0xc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, 0x19, 0x31, 0x44, 0xfd, 0x18, 0x8a, 0x03, 0xc3, 0x1e, 0x0d, 0x11, 0x53, 0xfa, 0xdc, 0x1e, + 0x0e, 0x0c, 0x63, 0x7a, 0x96, 0xd9, 0x4c, 0xd3, 0xf9, 0x5d, 0x85, 0x5a, 0x2a, 0xf2, 0x54, 0x06, + 0xf4, 0x27, 0x20, 0xc7, 0x38, 0x8e, 0x84, 0x78, 0x8b, 0xcd, 0xff, 0x17, 0x1e, 0x6d, 0x45, 0x36, + 0x4e, 0x30, 0x4c, 0x47, 0x40, 0xe9, 0x21, 0x58, 0x3d, 0x27, 0xfc, 0x14, 0xc5, 0xf0, 0x1c, 0xfa, + 0x9d, 0x2e, 0xc6, 0x4a, 0xdf, 0xf7, 0x17, 0x06, 0xdf, 0x90, 0xe0, 0xd3, 0x68, 0xa6, 0x53, 0x4a, + 0x1d, 0x87, 0x18, 0xeb, 0x18, 0xac, 0x78, 0x3e, 0x65, 0xc9, 0x3f, 0x2d, 0x69, 0x96, 0x13, 0xcd, + 0x5a, 0x0b, 0x37, 0xd3, 0x65, 0xb3, 0x09, 0x28, 0xd3, 0x01, 0xca, 0x3a, 0xc4, 0xb8, 0x79, 0x7c, + 0x75, 0x53, 0xd3, 0xae, 0x6f, 0x6a, 0xda, 0x97, 0x9b, 0x9a, 0x76, 0x79, 0x5b, 0xcb, 0x5c, 0xdf, + 0xd6, 0x32, 0x1f, 0x6f, 0x6b, 0x99, 0xe7, 0xfb, 0x53, 0x3d, 0x92, 0xef, 0xe8, 0x0e, 0xed, 0x76, + 0x89, 0x47, 0xa0, 0xaf, 0x6c, 0x7b, 0xea, 0xf3, 0x2b, 0xba, 0xba, 0x05, 0xf1, 0xdc, 0xfd, 0xf3, + 0x2d, 0x00, 0x00, 0xff, 0xff, 0x9c, 0x52, 0x3e, 0x2d, 0xa0, 0x07, 0x00, 0x00, } func (m *MarketBid) Marshal() (dAtA []byte, err error) { @@ -396,6 +407,16 @@ func (m *LimitOrderBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.PremiumDiscount.Size() + i -= size + if _, err := m.PremiumDiscount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a if len(m.AuctionId) > 0 { dAtA5 := make([]byte, len(m.AuctionId)*10) var j4 int @@ -412,7 +433,7 @@ func (m *LimitOrderBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], dAtA5[:j4]) i = encodeVarintBid(dAtA, i, uint64(j4)) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 } { size, err := m.DebtTokenDenom.MarshalToSizedBuffer(dAtA[:i]) @@ -423,7 +444,7 @@ func (m *LimitOrderBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBid(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a { size, err := m.CollateralTokenAmount.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -433,13 +454,18 @@ func (m *LimitOrderBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBid(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 if len(m.BidderAddress) > 0 { i -= len(m.BidderAddress) copy(dAtA[i:], m.BidderAddress) i = encodeVarintBid(dAtA, i, uint64(len(m.BidderAddress))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a + } + if m.BiddingId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.BiddingId)) + i-- + dAtA[i] = 0x10 } if m.AppId != 0 { i = encodeVarintBid(dAtA, i, uint64(m.AppId)) @@ -555,6 +581,9 @@ func (m *LimitOrderBid) Size() (n int) { if m.AppId != 0 { n += 1 + sovBid(uint64(m.AppId)) } + if m.BiddingId != 0 { + n += 1 + sovBid(uint64(m.BiddingId)) + } l = len(m.BidderAddress) if l > 0 { n += 1 + l + sovBid(uint64(l)) @@ -570,6 +599,8 @@ func (m *LimitOrderBid) Size() (n int) { } n += 1 + sovBid(uint64(l)) + l } + l = m.PremiumDiscount.Size() + n += 1 + l + sovBid(uint64(l)) return n } @@ -884,6 +915,25 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { } } case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingId", wireType) + } + m.BiddingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BiddingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BidderAddress", wireType) } @@ -915,7 +965,7 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { } m.BidderAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenAmount", wireType) } @@ -948,7 +998,7 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenDenom", wireType) } @@ -981,7 +1031,7 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 6: if wireType == 0 { var v uint64 for shift := uint(0); ; shift += 7 { @@ -1057,6 +1107,40 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { } else { return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PremiumDiscount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PremiumDiscount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipBid(dAtA[iNdEx:]) From 02ed82d92aa96d1703d4cbeeaa2b21719ede8ef2 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Fri, 28 Apr 2023 00:29:17 +0530 Subject: [PATCH 046/155] auction proto changes --- .../liquidationsV2/v1beta1/liquidate.proto | 124 ++++++++---------- scripts/proto-gen.sh | 2 +- x/asset/types/extendedPairVault.pb.go | 2 +- x/auction/types/auction.pb.go | 2 +- x/auction/types/biddings.pb.go | 2 +- x/auctionsV2/keeper/auctions.go | 16 ++- x/auctionsV2/types/auction.pb.go | 2 +- x/auctionsV2/types/bid.pb.go | 2 +- x/collector/types/collector.pb.go | 2 +- x/esm/types/esm.pb.go | 2 +- x/lend/types/lend.pb.go | 4 +- x/liquidation/types/locked_vault.pb.go | 2 +- x/liquidationsV2/types/gov.pb.go | 2 +- x/liquidationsV2/types/liquidate.pb.go | 2 +- x/liquidationsV2/types/tx.pb.go | 2 +- x/liquidity/types/liquidity.pb.go | 2 +- x/liquidity/types/params.pb.go | 2 +- x/liquidity/types/query.pb.go | 4 +- x/liquidity/types/tx.pb.go | 2 +- x/locker/types/locker.pb.go | 6 +- x/rewards/types/epochs.pb.go | 4 +- x/rewards/types/gauge.pb.go | 4 +- x/rewards/types/rewards.pb.go | 2 +- x/rewards/types/tx.pb.go | 4 +- x/tokenmint/types/mint.pb.go | 4 +- x/tokenmint/types/tx.pb.go | 2 +- x/vault/types/vault.pb.go | 4 +- 27 files changed, 104 insertions(+), 104 deletions(-) diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index c4ca3709d..cc489a490 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -16,33 +16,67 @@ message LiquidationWhiteListing { uint64 app_id = 1 [ (gogoproto.customname) = "AppId", (gogoproto.moretags) = "yaml:\"app_id\""]; -//------------Auction Types defn -// true auction type - "dutch" -//false auction type - "english" - bool auction_type = 2 [ - (gogoproto.customname) = "AuctionType", - (gogoproto.moretags) = "yaml:\"auction_type\""]; - //discount - //upar kitna se start hoga - string buffer = 3 [ + //AuctionTriggerer + //External Apps -------------> If external triggerer , then some params will be used from Comdex base app // If internal app triggerrer then params to be used from base app + //Comdex Apps + //bool param + //true - comdex apps + //false external apps + bool initiator = 6 [ + (gogoproto.customname) = "Initiator", + (gogoproto.moretags) = "yaml:\"initiator\""]; + //Sets of Params for Dutch Auction + bool is_dutch_activated=7 [ + (gogoproto.customname) = "IsDutchActivated", + (gogoproto.moretags) = "yaml:\"is_dutch_activated\""]; + DutchAuctionParam dutch_auction_param=8[ + (gogoproto.customname) = "DutchAuctionParam", + (gogoproto.moretags) = "yaml:\"dutch_auction_param\""]; + //Sets of Params for English Auction + bool is_english_activated=9 [ + (gogoproto.customname) = "IsEnglishActivated", + (gogoproto.moretags) = "yaml:\"is_english_activated\""]; + + EnglishAuctionParam english_auction_param=10[ + (gogoproto.customname) = "EnglishAuctionParam", + (gogoproto.moretags) = "yaml:\"english_auction_param\""]; +//One thing to keep in mind that somehow it should not happen that a void is created where something at level 2 gets triggerred and it has no data saved a level 1 for lookup and it fails . + + + +} + +message DutchAuctionParam{ + + string buffer = 1 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"buffer\"" ]; - string cusp = 4 [ + string cusp = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"cusp\"" ]; - string step = 5 [ + string step = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"step\"" ]; + +} +message EnglishAuctionParam{ + string step = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"step\"" + ]; + } + message LiquidationOffsetHolder { uint64 current_offset = 2; } @@ -110,6 +144,7 @@ message LockedVault { (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"liquidation_timestamp\""]; +// true for internal liquidator through bot , false if abci initiated liquidation bool is_internal_keeper = 12 [ (gogoproto.customname) = "IsInternalKeeper", (gogoproto.moretags) = "yaml:\"is_intenal_keeper\""]; @@ -118,10 +153,11 @@ message LockedVault { (gogoproto.customname) = "InternalKeeperAddress", (gogoproto.moretags) = "yaml:\"internal_keeper_address\""]; - string is_external_keeper = 14 [ + bool is_external_keeper = 14 [ (gogoproto.customname) = "IsExternalKeeper", (gogoproto.moretags) = "yaml:\"is_external_keeper\""]; + //To return funds to the external app back string external_keeper_address = 15 [ (gogoproto.customname) = "ExternalKeeperAddress", (gogoproto.moretags) = "yaml:\"external_keeper_address\""]; @@ -130,52 +166,18 @@ message LockedVault { (gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.moretags) = "yaml:\"fee_to_be_collected\""]; + string bonus_to_be_given = 17 [ + (gogoproto.customname) = "BonusToBeGiven", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"bonus_to_be_given\""]; - string initiator_type = 17 [ + string initiator_type = 18 [ (gogoproto.customname) = "InitiatorType", (gogoproto.moretags) = "yaml:\"initiator_type\""]; - bool auction_type = 18 [ + bool auction_type = 19 [ (gogoproto.customname) = "AuctionType", (gogoproto.moretags) = "yaml:\"auction_type\""]; - -//updated_amount_out = amount_out + interest_accumulated + opening_fee_accumulated -// // + closing_fee_accumulated -// string updated_amount_out = 8 [ -// (gogoproto.customname) = "UpdatedAmountOut", -// (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", -// (gogoproto.moretags) = "yaml:\"updated_amount_out\"", -// (gogoproto.nullable) = false]; - -// string initiator = 9 [ -// (gogoproto.customname) = "Initiator", -// (gogoproto.moretags) = "yaml:\"admin\""]; - -// bool is_auction_complete = 10 [ -// (gogoproto.customname) = "IsAuctionComplete", -// (gogoproto.moretags) = "yaml:\"is_auction_complete\""]; - -// bool is_auction_in_progress = 11 [ -// (gogoproto.customname) = "IsAuctionInProgress", -// (gogoproto.moretags) = "yaml:\"is_auction_in_progress\""]; - -// string cr_at_liquidation = 12 [ -// (gogoproto.customname) = "CrAtLiquidation", -// (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", -// (gogoproto.nullable) = false, -// (gogoproto.moretags) = "yaml:\"cr_at_liquidation\""]; - - -// repeated string selloff_history = 16 [ -// (gogoproto.customname) = "SellOffHistory", -// (gogoproto.moretags) = "yaml:\"selloff_history\""]; - -// string interest_accumulated = 17[ -// (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", -// (gogoproto.moretags) = "yaml:\"interest_accumulated\"", -// (gogoproto.nullable) = false]; -// oneof kind { -// BorrowMetaData borrow_meta_data = 18; -// } } @@ -187,19 +189,3 @@ message LockedVault { -// message BorrowMetaData { -// uint64 lending_id = 1; -// bool is_stable_borrow = 2; -// string stable_borrow_rate = 3 [ -// (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", -// (gogoproto.nullable) = false, -// (gogoproto.moretags) = "yaml:\"stable_borrow_rate\"" -// ]; -// cosmos.base.v1beta1.Coin bridged_asset_amount = 4 [ -// (gogoproto.nullable) = false, -// (gogoproto.moretags) = "yaml:\"bridged_asset_amount\"", -// (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" -// ]; - -// } - diff --git a/scripts/proto-gen.sh b/scripts/proto-gen.sh index 9ee0ef43c..b6650e428 100755 --- a/scripts/proto-gen.sh +++ b/scripts/proto-gen.sh @@ -15,7 +15,7 @@ protoc_gen_gocosmos() { proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) for dir in $proto_dirs; do - buf protoc \ + protoc \ -I "proto" \ -I "third_party/proto" \ --gocosmos_out=plugins=interfacetype+grpc,\ diff --git a/x/asset/types/extendedPairVault.pb.go b/x/asset/types/extendedPairVault.pb.go index 042219a1d..1ff9cd077 100644 --- a/x/asset/types/extendedPairVault.pb.go +++ b/x/asset/types/extendedPairVault.pb.go @@ -9,7 +9,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/auction/types/auction.pb.go b/x/auction/types/auction.pb.go index 87fddf3d9..b3a51395e 100644 --- a/x/auction/types/auction.pb.go +++ b/x/auction/types/auction.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/auction/types/biddings.pb.go b/x/auction/types/biddings.pb.go index 29bceaced..2767b7031 100644 --- a/x/auction/types/biddings.pb.go +++ b/x/auction/types/biddings.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index f9946b654..6b96e6f0f 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -30,15 +30,29 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati //Getting previous auction ID auctionID := k.GetAuctionID(ctx) - //Saving liquidation data to the auction struct + +//Price Calculation Function to determine auction different stage price + //Saving liquidation data to the auction struct auctionData := types.Auctions{ AuctionId: auctionID+1, CollateralToken: liquidationData.CollateralToken, + DebtToken: liquidationData.DebtToken, + CollateralTokenInitialPrice: 0, + CollateralTokenCurrentPrice: 0, + CollateralTokenEndPrice: 0, + DebtTokenCurrentPrice: 0, + LockedVaultId: liquidationData.LockedVaultId, + StartTime: 0, + EndTime: 0, + AppId: liquidationData.AppId, + AuctionType: liquidationData.AuctionType, + + } return nil diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index 110035ad8..6003ce1cb 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index 574a4d320..428b779b6 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/collector/types/collector.pb.go b/x/collector/types/collector.pb.go index a9d25a2e7..32dc2c711 100644 --- a/x/collector/types/collector.pb.go +++ b/x/collector/types/collector.pb.go @@ -9,7 +9,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/esm/types/esm.pb.go b/x/esm/types/esm.pb.go index a3abc6f57..cbea415d0 100644 --- a/x/esm/types/esm.pb.go +++ b/x/esm/types/esm.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/lend/types/lend.pb.go b/x/lend/types/lend.pb.go index 90949f260..69e3c1b5b 100644 --- a/x/lend/types/lend.pb.go +++ b/x/lend/types/lend.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -338,7 +338,7 @@ func (m *Pool) GetAssetData() []*AssetDataPoolMapping { type UserAssetLendBorrowMapping struct { Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - // to check if poool id is needed + //to check if poool id is needed LendId uint64 `protobuf:"varint,2,opt,name=lend_id,json=lendId,proto3" json:"lend_id,omitempty" yaml:"lend_id"` PoolId uint64 `protobuf:"varint,3,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` BorrowId []uint64 `protobuf:"varint,4,rep,packed,name=borrow_id,json=borrowId,proto3" json:"borrow_id,omitempty" yaml:"borrow_id"` diff --git a/x/liquidation/types/locked_vault.pb.go b/x/liquidation/types/locked_vault.pb.go index 5d36d2a92..8d10a9254 100644 --- a/x/liquidation/types/locked_vault.pb.go +++ b/x/liquidation/types/locked_vault.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/liquidationsV2/types/gov.pb.go b/x/liquidationsV2/types/gov.pb.go index bcb05cfa9..dc08a356a 100644 --- a/x/liquidationsV2/types/gov.pb.go +++ b/x/liquidationsV2/types/gov.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index 38a667b31..15354dc5b 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/liquidationsV2/types/tx.pb.go b/x/liquidationsV2/types/tx.pb.go index 48bbb52e0..83043ea24 100644 --- a/x/liquidationsV2/types/tx.pb.go +++ b/x/liquidationsV2/types/tx.pb.go @@ -10,10 +10,10 @@ import ( _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" - _ "github.com/golang/protobuf/ptypes/timestamp" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/liquidity/types/liquidity.pb.go b/x/liquidity/types/liquidity.pb.go index fb267252b..4b74e687d 100644 --- a/x/liquidity/types/liquidity.pb.go +++ b/x/liquidity/types/liquidity.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/liquidity/types/params.pb.go b/x/liquidity/types/params.pb.go index b81de407b..1ce9f40e2 100644 --- a/x/liquidity/types/params.pb.go +++ b/x/liquidity/types/params.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" + _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" math_bits "math/bits" diff --git a/x/liquidity/types/query.pb.go b/x/liquidity/types/query.pb.go index 819f29d5c..c3221d8c9 100644 --- a/x/liquidity/types/query.pb.go +++ b/x/liquidity/types/query.pb.go @@ -13,12 +13,12 @@ import ( grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - _ "github.com/golang/protobuf/ptypes/timestamp" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/liquidity/types/tx.pb.go b/x/liquidity/types/tx.pb.go index fa4276e34..7d5522762 100644 --- a/x/liquidity/types/tx.pb.go +++ b/x/liquidity/types/tx.pb.go @@ -12,10 +12,10 @@ import ( grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" math_bits "math/bits" diff --git a/x/locker/types/locker.pb.go b/x/locker/types/locker.pb.go index cec92c168..3111cbc4c 100644 --- a/x/locker/types/locker.pb.go +++ b/x/locker/types/locker.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -29,7 +29,7 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// locker_id will be the key which will be derived from the LockerLookUpTable +//locker_id will be the key which will be derived from the LockerLookUpTable type Locker struct { LockerId uint64 `protobuf:"varint,1,opt,name=locker_id,json=lockerId,proto3" json:"locker_id,omitempty" yaml:"locker_id"` Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty" yaml:"depositor"` @@ -197,7 +197,7 @@ func (m *LockerLookupTableData) XXX_DiscardUnknown() { var xxx_messageInfo_LockerLookupTableData proto.InternalMessageInfo -// Key is app_mapping_id +//Key is app_mapping_id type LockerProductAssetMapping struct { AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` AssetId uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` diff --git a/x/rewards/types/epochs.pb.go b/x/rewards/types/epochs.pb.go index cd956efdb..361e58b0b 100644 --- a/x/rewards/types/epochs.pb.go +++ b/x/rewards/types/epochs.pb.go @@ -8,8 +8,8 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/rewards/types/gauge.pb.go b/x/rewards/types/gauge.pb.go index 9c03323e5..ec3c14ff3 100644 --- a/x/rewards/types/gauge.pb.go +++ b/x/rewards/types/gauge.pb.go @@ -10,8 +10,8 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/rewards/types/rewards.pb.go b/x/rewards/types/rewards.pb.go index 049fd1cc1..739c2cffa 100644 --- a/x/rewards/types/rewards.pb.go +++ b/x/rewards/types/rewards.pb.go @@ -10,7 +10,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/rewards/types/tx.pb.go b/x/rewards/types/tx.pb.go index 1402580e1..14dbdaecc 100644 --- a/x/rewards/types/tx.pb.go +++ b/x/rewards/types/tx.pb.go @@ -12,11 +12,11 @@ import ( grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - _ "github.com/golang/protobuf/ptypes/timestamp" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" diff --git a/x/tokenmint/types/mint.pb.go b/x/tokenmint/types/mint.pb.go index 6becc9212..e6a0c4721 100644 --- a/x/tokenmint/types/mint.pb.go +++ b/x/tokenmint/types/mint.pb.go @@ -9,7 +9,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -28,7 +28,7 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// app_vault_type_id will be the key for the KVStore for this value. +//app_vault_type_id will be the key for the KVStore for this value. type TokenMint struct { AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` MintedTokens []*MintedTokens `protobuf:"bytes,2,rep,name=minted_tokens,json=mintedTokens,proto3" json:"minted_tokens,omitempty" yaml:"minted_tokens"` diff --git a/x/tokenmint/types/tx.pb.go b/x/tokenmint/types/tx.pb.go index f03b52bb7..bd298c240 100644 --- a/x/tokenmint/types/tx.pb.go +++ b/x/tokenmint/types/tx.pb.go @@ -28,7 +28,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Will become governance proposal- will trigger token minting & sending +//Will become governance proposal- will trigger token minting & sending type MsgMintNewTokensRequest struct { From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` diff --git a/x/vault/types/vault.pb.go b/x/vault/types/vault.pb.go index 06e24f432..b23833d9f 100644 --- a/x/vault/types/vault.pb.go +++ b/x/vault/types/vault.pb.go @@ -9,7 +9,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/timestamp" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -28,7 +28,7 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// app_vault_type_id will be the key for the KVStore for this value. +//app_vault_type_id will be the key for the KVStore for this value. type Vault struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` From adc21619c492d97819ae1244764f78eebfc61d79 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Fri, 28 Apr 2023 02:41:25 +0530 Subject: [PATCH 047/155] auction proto changes --- proto/comdex/auctionsV2/v1beta1/bid.proto | 29 +- x/auctionsV2/keeper/auctions.go | 7 +- x/auctionsV2/types/bid.pb.go | 339 +++++----- x/liquidationsV2/types/liquidate.pb.go | 787 ++++++++++++++++++---- 4 files changed, 847 insertions(+), 315 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto index cdd56a90c..27277ef6b 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -7,7 +7,7 @@ import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; -message MarketBid{ +message Bid{ uint64 bidding_id = 1 [ (gogoproto.moretags) = "yaml:\"bidding_id\"" ]; @@ -40,38 +40,37 @@ message MarketBid{ uint64 app_id = 7 [ (gogoproto.moretags) = "yaml:\"app_id\"" ]; + string bid_type = 8 [ + (gogoproto.moretags) = "yaml:\"bid_type\"" + ]; } message LimitOrderBid{ - uint64 app_id = 1 [ - (gogoproto.moretags) = "yaml:\"app_id\"" + uint64 limit_order_bidding_id = 1 [ + (gogoproto.moretags) = "yaml:\"limit_order_bidding_id\"" ]; - uint64 bidding_id = 2 [ - (gogoproto.moretags) = "yaml:\"bidding_id\"" - ]; - string bidder_address = 3 [ + string bidder_address = 2 [ (gogoproto.moretags) = "yaml:\"bidder\"" ]; - cosmos.base.v1beta1.Coin collateral_token_amount = 4 [ + cosmos.base.v1beta1.Coin collateral_token = 3 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"outflow_token_amount\"", + (gogoproto.moretags) = "yaml:\"outflow_token\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - cosmos.base.v1beta1.Coin debt_token_denom = 5 [ + cosmos.base.v1beta1.Coin debt_token = 4 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"debt_token_denom\"", + (gogoproto.moretags) = "yaml:\"debt_token\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - repeated uint64 auction_id = 6 [ - (gogoproto.moretags) = "yaml:\"auction_id\"" + repeated uint64 bidding_id = 5 [ + (gogoproto.moretags) = "yaml:\"bidding_id\"" ]; - - string premium_discount = 7 [ + string premium_discount = 6 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"premium_discount\"" diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 6b96e6f0f..fdd4371f5 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -34,6 +34,8 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati //Price Calculation Function to determine auction different stage price + + //Saving liquidation data to the auction struct auctionData := types.Auctions{ AuctionId: auctionID+1, @@ -48,11 +50,6 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati EndTime: 0, AppId: liquidationData.AppId, AuctionType: liquidationData.AuctionType, - - - - - } return nil diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index cf4ddf8c1..7d316cca7 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -29,7 +29,7 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type MarketBid struct { +type Bid struct { BiddingId uint64 `protobuf:"varint,1,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` CollateralTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=collateral_token_amount,json=collateralTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token_amount" yaml:"outflow_token_amount"` @@ -37,20 +37,21 @@ type MarketBid struct { BidderAddress string `protobuf:"bytes,5,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` BiddingTimestamp time.Time `protobuf:"bytes,6,opt,name=bidding_timestamp,json=biddingTimestamp,proto3,stdtime" json:"bidding_timestamp" yaml:"bidding_timestamp"` AppId uint64 `protobuf:"varint,7,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + BidType string `protobuf:"bytes,8,opt,name=bid_type,json=bidType,proto3" json:"bid_type,omitempty" yaml:"bid_type"` } -func (m *MarketBid) Reset() { *m = MarketBid{} } -func (m *MarketBid) String() string { return proto.CompactTextString(m) } -func (*MarketBid) ProtoMessage() {} -func (*MarketBid) Descriptor() ([]byte, []int) { +func (m *Bid) Reset() { *m = Bid{} } +func (m *Bid) String() string { return proto.CompactTextString(m) } +func (*Bid) ProtoMessage() {} +func (*Bid) Descriptor() ([]byte, []int) { return fileDescriptor_6f6db8f3a6a396ec, []int{0} } -func (m *MarketBid) XXX_Unmarshal(b []byte) error { +func (m *Bid) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MarketBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Bid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MarketBid.Marshal(b, m, deterministic) + return xxx_messageInfo_Bid.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -60,75 +61,81 @@ func (m *MarketBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *MarketBid) XXX_Merge(src proto.Message) { - xxx_messageInfo_MarketBid.Merge(m, src) +func (m *Bid) XXX_Merge(src proto.Message) { + xxx_messageInfo_Bid.Merge(m, src) } -func (m *MarketBid) XXX_Size() int { +func (m *Bid) XXX_Size() int { return m.Size() } -func (m *MarketBid) XXX_DiscardUnknown() { - xxx_messageInfo_MarketBid.DiscardUnknown(m) +func (m *Bid) XXX_DiscardUnknown() { + xxx_messageInfo_Bid.DiscardUnknown(m) } -var xxx_messageInfo_MarketBid proto.InternalMessageInfo +var xxx_messageInfo_Bid proto.InternalMessageInfo -func (m *MarketBid) GetBiddingId() uint64 { +func (m *Bid) GetBiddingId() uint64 { if m != nil { return m.BiddingId } return 0 } -func (m *MarketBid) GetAuctionId() uint64 { +func (m *Bid) GetAuctionId() uint64 { if m != nil { return m.AuctionId } return 0 } -func (m *MarketBid) GetCollateralTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *Bid) GetCollateralTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { return m.CollateralTokenAmount } return github_com_cosmos_cosmos_sdk_types.Coin{} } -func (m *MarketBid) GetDebtTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *Bid) GetDebtTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { return m.DebtTokenAmount } return github_com_cosmos_cosmos_sdk_types.Coin{} } -func (m *MarketBid) GetBidderAddress() string { +func (m *Bid) GetBidderAddress() string { if m != nil { return m.BidderAddress } return "" } -func (m *MarketBid) GetBiddingTimestamp() time.Time { +func (m *Bid) GetBiddingTimestamp() time.Time { if m != nil { return m.BiddingTimestamp } return time.Time{} } -func (m *MarketBid) GetAppId() uint64 { +func (m *Bid) GetAppId() uint64 { if m != nil { return m.AppId } return 0 } +func (m *Bid) GetBidType() string { + if m != nil { + return m.BidType + } + return "" +} + type LimitOrderBid struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - BiddingId uint64 `protobuf:"varint,2,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` - BidderAddress string `protobuf:"bytes,3,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` - CollateralTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=collateral_token_amount,json=collateralTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token_amount" yaml:"outflow_token_amount"` - DebtTokenDenom github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=debt_token_denom,json=debtTokenDenom,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token_denom" yaml:"debt_token_denom"` - AuctionId []uint64 `protobuf:"varint,6,rep,packed,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` - PremiumDiscount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"premium_discount" yaml:"premium_discount"` + LimitOrderBiddingId uint64 `protobuf:"varint,1,opt,name=limit_order_bidding_id,json=limitOrderBiddingId,proto3" json:"limit_order_bidding_id,omitempty" yaml:"limit_order_bidding_id"` + BidderAddress string `protobuf:"bytes,2,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` + CollateralToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=collateral_token,json=collateralToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token" yaml:"outflow_token"` + DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"debt_token"` + BiddingId []uint64 `protobuf:"varint,5,rep,packed,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` + PremiumDiscount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"premium_discount" yaml:"premium_discount"` } func (m *LimitOrderBid) Reset() { *m = LimitOrderBid{} } @@ -164,16 +171,9 @@ func (m *LimitOrderBid) XXX_DiscardUnknown() { var xxx_messageInfo_LimitOrderBid proto.InternalMessageInfo -func (m *LimitOrderBid) GetAppId() uint64 { +func (m *LimitOrderBid) GetLimitOrderBiddingId() uint64 { if m != nil { - return m.AppId - } - return 0 -} - -func (m *LimitOrderBid) GetBiddingId() uint64 { - if m != nil { - return m.BiddingId + return m.LimitOrderBiddingId } return 0 } @@ -185,23 +185,23 @@ func (m *LimitOrderBid) GetBidderAddress() string { return "" } -func (m *LimitOrderBid) GetCollateralTokenAmount() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *LimitOrderBid) GetCollateralToken() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { - return m.CollateralTokenAmount + return m.CollateralToken } return github_com_cosmos_cosmos_sdk_types.Coin{} } -func (m *LimitOrderBid) GetDebtTokenDenom() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *LimitOrderBid) GetDebtToken() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { - return m.DebtTokenDenom + return m.DebtToken } return github_com_cosmos_cosmos_sdk_types.Coin{} } -func (m *LimitOrderBid) GetAuctionId() []uint64 { +func (m *LimitOrderBid) GetBiddingId() []uint64 { if m != nil { - return m.AuctionId + return m.BiddingId } return nil } @@ -254,7 +254,7 @@ func (m *AuctionParams) GetAuctionDurationSeconds() uint64 { } func init() { - proto.RegisterType((*MarketBid)(nil), "comdex.auctionsV2.v1beta1.MarketBid") + proto.RegisterType((*Bid)(nil), "comdex.auctionsV2.v1beta1.Bid") proto.RegisterType((*LimitOrderBid)(nil), "comdex.auctionsV2.v1beta1.LimitOrderBid") proto.RegisterType((*AuctionParams)(nil), "comdex.auctionsV2.v1beta1.AuctionParams") } @@ -264,57 +264,60 @@ func init() { } var fileDescriptor_6f6db8f3a6a396ec = []byte{ - // 749 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x3d, 0x6f, 0xdb, 0x38, - 0x18, 0xb6, 0xe2, 0x8f, 0xc0, 0x0c, 0x9c, 0xc4, 0xc2, 0xe5, 0xe2, 0xf8, 0x00, 0xcb, 0x50, 0x0e, - 0x77, 0x5e, 0x22, 0x21, 0xb9, 0x0c, 0x87, 0x03, 0x6e, 0x88, 0x6b, 0xa4, 0x70, 0xd1, 0xa4, 0xad, - 0x1a, 0x74, 0x28, 0x50, 0x18, 0x94, 0x48, 0x3b, 0x44, 0x24, 0x51, 0x10, 0x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x54, 0x06, - 0xf4, 0x27, 0x20, 0xc7, 0x38, 0x8e, 0x84, 0x78, 0x8b, 0xcd, 0xff, 0x17, 0x1e, 0x6d, 0x45, 0x36, - 0x4e, 0x30, 0x4c, 0x47, 0x40, 0xe9, 0x21, 0x58, 0x3d, 0x27, 0xfc, 0x14, 0xc5, 0xf0, 0x1c, 0xfa, - 0x9d, 0x2e, 0xc6, 0x4a, 0xdf, 0xf7, 0x17, 0x06, 0xdf, 0x90, 0xe0, 0xd3, 0x68, 0xa6, 0x53, 0x4a, - 0x1d, 0x87, 0x18, 0xeb, 0x18, 0xac, 0x78, 0x3e, 0x65, 0xc9, 0x3f, 0x2d, 0x69, 0x96, 0x13, 0xcd, - 0x5a, 0x0b, 0x37, 0xd3, 0x65, 0xb3, 0x09, 0x28, 0xd3, 0x01, 0xca, 0x3a, 0xc4, 0xb8, 0x79, 0x7c, - 0x75, 0x53, 0xd3, 0xae, 0x6f, 0x6a, 0xda, 0x97, 0x9b, 0x9a, 0x76, 0x79, 0x5b, 0xcb, 0x5c, 0xdf, - 0xd6, 0x32, 0x1f, 0x6f, 0x6b, 0x99, 0xe7, 0xfb, 0x53, 0x3d, 0x92, 0xef, 0xe8, 0x0e, 0xed, 0x76, - 0x89, 0x47, 0xa0, 0xaf, 0x6c, 0x7b, 0xea, 0xf3, 0x2b, 0xba, 0xba, 0x05, 0xf1, 0xdc, 0xfd, 0xf3, - 0x2d, 0x00, 0x00, 0xff, 0xff, 0x9c, 0x52, 0x3e, 0x2d, 0xa0, 0x07, 0x00, 0x00, + // 796 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6e, 0xf3, 0x44, + 0x14, 0x8d, 0xbf, 0xfc, 0x7c, 0xcd, 0x54, 0x69, 0x1b, 0xf7, 0x2f, 0x0d, 0x22, 0x0e, 0x2e, 0x82, + 0x6c, 0x6a, 0xab, 0xa5,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83, 0x01, 0xf1, + 0x09, 0x0c, 0xd4, 0xde, 0x9e, 0xfb, 0xf4, 0x0a, 0x56, 0xaf, 0x22, 0x06, 0xde, 0x47, 0xff, 0x05, + 0x00, 0x00, 0xff, 0xff, 0x73, 0x38, 0xf1, 0x86, 0x9c, 0x07, 0x00, 0x00, } -func (m *MarketBid) Marshal() (dAtA []byte, err error) { +func (m *Bid) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -324,16 +327,23 @@ func (m *MarketBid) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MarketBid) MarshalTo(dAtA []byte) (int, error) { +func (m *Bid) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MarketBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.BidType) > 0 { + i -= len(m.BidType) + copy(dAtA[i:], m.BidType) + i = encodeVarintBid(dAtA, i, uint64(len(m.BidType))) + i-- + dAtA[i] = 0x42 + } if m.AppId != 0 { i = encodeVarintBid(dAtA, i, uint64(m.AppId)) i-- @@ -416,11 +426,11 @@ func (m *LimitOrderBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBid(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a - if len(m.AuctionId) > 0 { - dAtA5 := make([]byte, len(m.AuctionId)*10) + dAtA[i] = 0x32 + if len(m.BiddingId) > 0 { + dAtA5 := make([]byte, len(m.BiddingId)*10) var j4 int - for _, num := range m.AuctionId { + for _, num := range m.BiddingId { for num >= 1<<7 { dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 @@ -433,10 +443,10 @@ func (m *LimitOrderBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], dAtA5[:j4]) i = encodeVarintBid(dAtA, i, uint64(j4)) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x2a } { - size, err := m.DebtTokenDenom.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DebtToken.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -444,9 +454,9 @@ func (m *LimitOrderBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBid(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 { - size, err := m.CollateralTokenAmount.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.CollateralToken.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -454,21 +464,16 @@ func (m *LimitOrderBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBid(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a if len(m.BidderAddress) > 0 { i -= len(m.BidderAddress) copy(dAtA[i:], m.BidderAddress) i = encodeVarintBid(dAtA, i, uint64(len(m.BidderAddress))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } - if m.BiddingId != 0 { - i = encodeVarintBid(dAtA, i, uint64(m.BiddingId)) - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintBid(dAtA, i, uint64(m.AppId)) + if m.LimitOrderBiddingId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.LimitOrderBiddingId)) i-- dAtA[i] = 0x8 } @@ -544,7 +549,7 @@ func encodeVarintBid(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MarketBid) Size() (n int) { +func (m *Bid) Size() (n int) { if m == nil { return 0 } @@ -569,6 +574,10 @@ func (m *MarketBid) Size() (n int) { if m.AppId != 0 { n += 1 + sovBid(uint64(m.AppId)) } + l = len(m.BidType) + if l > 0 { + n += 1 + l + sovBid(uint64(l)) + } return n } @@ -578,23 +587,20 @@ func (m *LimitOrderBid) Size() (n int) { } var l int _ = l - if m.AppId != 0 { - n += 1 + sovBid(uint64(m.AppId)) - } - if m.BiddingId != 0 { - n += 1 + sovBid(uint64(m.BiddingId)) + if m.LimitOrderBiddingId != 0 { + n += 1 + sovBid(uint64(m.LimitOrderBiddingId)) } l = len(m.BidderAddress) if l > 0 { n += 1 + l + sovBid(uint64(l)) } - l = m.CollateralTokenAmount.Size() + l = m.CollateralToken.Size() n += 1 + l + sovBid(uint64(l)) - l = m.DebtTokenDenom.Size() + l = m.DebtToken.Size() n += 1 + l + sovBid(uint64(l)) - if len(m.AuctionId) > 0 { + if len(m.BiddingId) > 0 { l = 0 - for _, e := range m.AuctionId { + for _, e := range m.BiddingId { l += sovBid(uint64(e)) } n += 1 + sovBid(uint64(l)) + l @@ -628,7 +634,7 @@ func sovBid(x uint64) (n int) { func sozBid(x uint64) (n int) { return sovBid(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MarketBid) Unmarshal(dAtA []byte) error { +func (m *Bid) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -651,10 +657,10 @@ func (m *MarketBid) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MarketBid: wiretype end group for non-group") + return fmt.Errorf("proto: Bid: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MarketBid: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Bid: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -845,6 +851,38 @@ func (m *MarketBid) Unmarshal(dAtA []byte) error { break } } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BidType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipBid(dAtA[iNdEx:]) @@ -897,9 +935,9 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderBiddingId", wireType) } - m.AppId = 0 + m.LimitOrderBiddingId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBid @@ -909,31 +947,12 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.AppId |= uint64(b&0x7F) << shift + m.LimitOrderBiddingId |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingId", wireType) - } - m.BiddingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBid - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BiddingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BidderAddress", wireType) } @@ -965,9 +984,9 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { } m.BidderAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CollateralToken", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -994,13 +1013,13 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.CollateralTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CollateralToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenDenom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DebtToken", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1027,11 +1046,11 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.DebtTokenDenom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DebtToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 6: + case 5: if wireType == 0 { var v uint64 for shift := uint(0); ; shift += 7 { @@ -1048,7 +1067,7 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { break } } - m.AuctionId = append(m.AuctionId, v) + m.BiddingId = append(m.BiddingId, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { @@ -1083,8 +1102,8 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { } } elementCount = count - if elementCount != 0 && len(m.AuctionId) == 0 { - m.AuctionId = make([]uint64, 0, elementCount) + if elementCount != 0 && len(m.BiddingId) == 0 { + m.BiddingId = make([]uint64, 0, elementCount) } for iNdEx < postIndex { var v uint64 @@ -1102,12 +1121,12 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { break } } - m.AuctionId = append(m.AuctionId, v) + m.BiddingId = append(m.BiddingId, v) } } else { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BiddingId", wireType) } - case 7: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PremiumDiscount", wireType) } diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index 15354dc5b..f70ac12ef 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -31,15 +31,19 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type LiquidationWhiteListing struct { AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - //------------Auction Types defn - // true auction type - "dutch" - //false auction type - "english" - AuctionType bool `protobuf:"varint,2,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` - //discount - //upar kitna se start hoga - Buffer github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=buffer,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"buffer" yaml:"buffer"` - Cusp github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=cusp,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"cusp" yaml:"cusp"` - Step github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"step" yaml:"step"` + //AuctionTriggerer + //External Apps -------------> If external triggerer , then some params will be used from Comdex base app // If internal app triggerrer then params to be used from base app + //Comdex Apps + //bool param + //true - comdex apps + //false external apps + Initiator bool `protobuf:"varint,6,opt,name=initiator,proto3" json:"initiator,omitempty" yaml:"initiator"` + //Sets of Params for Dutch Auction + IsDutchActivated bool `protobuf:"varint,7,opt,name=is_dutch_activated,json=isDutchActivated,proto3" json:"is_dutch_activated,omitempty" yaml:"is_dutch_activated"` + DutchAuctionParam *DutchAuctionParam `protobuf:"bytes,8,opt,name=dutch_auction_param,json=dutchAuctionParam,proto3" json:"dutch_auction_param,omitempty" yaml:"dutch_auction_param"` + //Sets of Params for English Auction + IsEnglishActivated bool `protobuf:"varint,9,opt,name=is_english_activated,json=isEnglishActivated,proto3" json:"is_english_activated,omitempty" yaml:"is_english_activated"` + EnglishAuctionParam *EnglishAuctionParam `protobuf:"bytes,10,opt,name=english_auction_param,json=englishAuctionParam,proto3" json:"english_auction_param,omitempty" yaml:"english_auction_param"` } func (m *LiquidationWhiteListing) Reset() { *m = LiquidationWhiteListing{} } @@ -75,6 +79,82 @@ func (m *LiquidationWhiteListing) XXX_DiscardUnknown() { var xxx_messageInfo_LiquidationWhiteListing proto.InternalMessageInfo +type DutchAuctionParam struct { + Buffer github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=buffer,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"buffer" yaml:"buffer"` + Cusp github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=cusp,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"cusp" yaml:"cusp"` + Step github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"step" yaml:"step"` +} + +func (m *DutchAuctionParam) Reset() { *m = DutchAuctionParam{} } +func (m *DutchAuctionParam) String() string { return proto.CompactTextString(m) } +func (*DutchAuctionParam) ProtoMessage() {} +func (*DutchAuctionParam) Descriptor() ([]byte, []int) { + return fileDescriptor_631048b9d11253bf, []int{1} +} +func (m *DutchAuctionParam) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DutchAuctionParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DutchAuctionParam.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DutchAuctionParam) XXX_Merge(src proto.Message) { + xxx_messageInfo_DutchAuctionParam.Merge(m, src) +} +func (m *DutchAuctionParam) XXX_Size() int { + return m.Size() +} +func (m *DutchAuctionParam) XXX_DiscardUnknown() { + xxx_messageInfo_DutchAuctionParam.DiscardUnknown(m) +} + +var xxx_messageInfo_DutchAuctionParam proto.InternalMessageInfo + +type EnglishAuctionParam struct { + Step github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"step" yaml:"step"` +} + +func (m *EnglishAuctionParam) Reset() { *m = EnglishAuctionParam{} } +func (m *EnglishAuctionParam) String() string { return proto.CompactTextString(m) } +func (*EnglishAuctionParam) ProtoMessage() {} +func (*EnglishAuctionParam) Descriptor() ([]byte, []int) { + return fileDescriptor_631048b9d11253bf, []int{2} +} +func (m *EnglishAuctionParam) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnglishAuctionParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnglishAuctionParam.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnglishAuctionParam) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnglishAuctionParam.Merge(m, src) +} +func (m *EnglishAuctionParam) XXX_Size() int { + return m.Size() +} +func (m *EnglishAuctionParam) XXX_DiscardUnknown() { + xxx_messageInfo_EnglishAuctionParam.DiscardUnknown(m) +} + +var xxx_messageInfo_EnglishAuctionParam proto.InternalMessageInfo + type LiquidationOffsetHolder struct { CurrentOffset uint64 `protobuf:"varint,2,opt,name=current_offset,json=currentOffset,proto3" json:"current_offset,omitempty"` } @@ -83,7 +163,7 @@ func (m *LiquidationOffsetHolder) Reset() { *m = LiquidationOffsetHolder func (m *LiquidationOffsetHolder) String() string { return proto.CompactTextString(m) } func (*LiquidationOffsetHolder) ProtoMessage() {} func (*LiquidationOffsetHolder) Descriptor() ([]byte, []int) { - return fileDescriptor_631048b9d11253bf, []int{1} + return fileDescriptor_631048b9d11253bf, []int{3} } func (m *LiquidationOffsetHolder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -124,20 +204,23 @@ type LockedVault struct { CollateralToBeAuctioned github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,9,opt,name=collateral_to_be_auctioned,json=collateralToBeAuctioned,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_to_be_auctioned" yaml:"CollateralToBeAuctioned"` TargetDebt github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,10,opt,name=target_debt,json=targetDebt,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"target_debt" yaml:"target_debt"` LiquidationTimestamp time.Time `protobuf:"bytes,11,opt,name=liquidation_timestamp,json=liquidationTimestamp,proto3,stdtime" json:"liquidation_timestamp" yaml:"liquidation_timestamp"` - IsInternalKeeper bool `protobuf:"varint,12,opt,name=is_internal_keeper,json=isInternalKeeper,proto3" json:"is_internal_keeper,omitempty" yaml:"is_intenal_keeper"` - InternalKeeperAddress string `protobuf:"bytes,13,opt,name=internal_keeper_address,json=internalKeeperAddress,proto3" json:"internal_keeper_address,omitempty" yaml:"internal_keeper_address"` - IsExternalKeeper string `protobuf:"bytes,14,opt,name=is_external_keeper,json=isExternalKeeper,proto3" json:"is_external_keeper,omitempty" yaml:"is_external_keeper"` - ExternalKeeperAddress string `protobuf:"bytes,15,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` - FeeToBeCollected github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,16,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee_to_be_collected" yaml:"fee_to_be_collected"` - InitiatorType string `protobuf:"bytes,17,opt,name=initiator_type,json=initiatorType,proto3" json:"initiator_type,omitempty" yaml:"initiator_type"` - AuctionType bool `protobuf:"varint,18,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` + // true for internal liquidator through bot , false if abci initiated liquidation + IsInternalKeeper bool `protobuf:"varint,12,opt,name=is_internal_keeper,json=isInternalKeeper,proto3" json:"is_internal_keeper,omitempty" yaml:"is_intenal_keeper"` + InternalKeeperAddress string `protobuf:"bytes,13,opt,name=internal_keeper_address,json=internalKeeperAddress,proto3" json:"internal_keeper_address,omitempty" yaml:"internal_keeper_address"` + IsExternalKeeper bool `protobuf:"varint,14,opt,name=is_external_keeper,json=isExternalKeeper,proto3" json:"is_external_keeper,omitempty" yaml:"is_external_keeper"` + //To return funds to the external app back + ExternalKeeperAddress string `protobuf:"bytes,15,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` + FeeToBeCollected github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,16,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee_to_be_collected" yaml:"fee_to_be_collected"` + BonusToBeGiven github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,17,opt,name=bonus_to_be_given,json=bonusToBeGiven,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bonus_to_be_given" yaml:"bonus_to_be_given"` + InitiatorType string `protobuf:"bytes,18,opt,name=initiator_type,json=initiatorType,proto3" json:"initiator_type,omitempty" yaml:"initiator_type"` + AuctionType bool `protobuf:"varint,19,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` } func (m *LockedVault) Reset() { *m = LockedVault{} } func (m *LockedVault) String() string { return proto.CompactTextString(m) } func (*LockedVault) ProtoMessage() {} func (*LockedVault) Descriptor() ([]byte, []int) { - return fileDescriptor_631048b9d11253bf, []int{2} + return fileDescriptor_631048b9d11253bf, []int{4} } func (m *LockedVault) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -168,6 +251,8 @@ var xxx_messageInfo_LockedVault proto.InternalMessageInfo func init() { proto.RegisterType((*LiquidationWhiteListing)(nil), "comdex.liquidationsV2.v1beta1.LiquidationWhiteListing") + proto.RegisterType((*DutchAuctionParam)(nil), "comdex.liquidationsV2.v1beta1.DutchAuctionParam") + proto.RegisterType((*EnglishAuctionParam)(nil), "comdex.liquidationsV2.v1beta1.EnglishAuctionParam") proto.RegisterType((*LiquidationOffsetHolder)(nil), "comdex.liquidationsV2.v1beta1.LiquidationOffsetHolder") proto.RegisterType((*LockedVault)(nil), "comdex.liquidationsV2.v1beta1.LockedVault") } @@ -177,75 +262,89 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 1079 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0xe3, 0x44, - 0x18, 0x8e, 0x77, 0xdb, 0xb2, 0x9d, 0x6c, 0xbf, 0xa6, 0xed, 0xd6, 0x8d, 0xb6, 0x9e, 0xca, 0x12, - 0xa5, 0x42, 0xaa, 0x43, 0x77, 0x2f, 0x08, 0x84, 0xd8, 0xa6, 0x2d, 0x22, 0x50, 0xa9, 0xd4, 0xaa, - 0x76, 0xa5, 0x3d, 0x60, 0x1c, 0x7b, 0x92, 0x8e, 0xea, 0x78, 0x8c, 0x3d, 0x59, 0xda, 0x0b, 0x12, - 0xbf, 0x80, 0x72, 0xe1, 0x37, 0xc0, 0xbf, 0xe0, 0x58, 0x71, 0xda, 0x23, 0xe2, 0x60, 0xc0, 0xfd, - 0x07, 0x39, 0x72, 0x42, 0xf3, 0xe1, 0xd8, 0x49, 0xb3, 0x94, 0x70, 0x69, 0xea, 0x79, 0x9f, 0xe7, - 0x79, 0x9f, 0x77, 0xde, 0xf9, 0x02, 0x3b, 0x1e, 0xed, 0xfa, 0xf8, 0xa2, 0x1e, 0x90, 0xaf, 0x7b, - 0xc4, 0x77, 0x19, 0xa1, 0x61, 0xf2, 0xfc, 0x49, 0xfd, 0xd5, 0x6e, 0x0b, 0x33, 0x77, 0x77, 0x30, - 0x8c, 0xad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 0x2f, 0xdf, - 0x1f, 0x9a, 0x2b, 0xfe, 0x94, 0xdc, 0xa1, 0xed, 0x36, 0xf1, 0x88, 0x1b, 0xa8, 0xef, 0xfa, 0xad, - 0xb7, 0xa8, 0x98, 0xc1, 0xd6, 0x8c, 0xd8, 0xa2, 0x4f, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x91, - 0xbf, 0x95, 0x9e, 0xb1, 0x0a, 0x00, 0x00, + // 1309 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcd, 0x6f, 0x1b, 0xc5, + 0x1b, 0xce, 0xa6, 0x49, 0x5a, 0x8f, 0x9b, 0xc4, 0x99, 0x24, 0x8d, 0x9b, 0x5f, 0xeb, 0xc9, 0x6f, + 0x24, 0x4a, 0x85, 0x14, 0xbb, 0x49, 0x85, 0x40, 0x20, 0xd4, 0xc6, 0x49, 0x00, 0x43, 0xa4, 0xb6, + 0xab, 0xaa, 0x95, 0x2a, 0xc4, 0xb2, 0xde, 0x1d, 0x3b, 0xa3, 0x38, 0xbb, 0xcb, 0xee, 0x38, 0xa4, + 0x17, 0x24, 0x4e, 0x1c, 0x69, 0x91, 0x38, 0x73, 0x85, 0xff, 0x82, 0x63, 0x8f, 0x3d, 0x70, 0x40, + 0x1c, 0x06, 0xd8, 0xfc, 0x07, 0x3e, 0x72, 0x42, 0xf3, 0xb1, 0x5f, 0xb6, 0x9b, 0x62, 0x89, 0x4b, + 0x1c, 0xcf, 0xfb, 0x3c, 0xcf, 0xfb, 0xb1, 0xef, 0xbe, 0xf3, 0x1a, 0x6c, 0x3a, 0xfe, 0xb1, 0x4b, + 0x4e, 0x1b, 0x3d, 0xfa, 0x65, 0x9f, 0xba, 0x36, 0xa3, 0xbe, 0x17, 0x3d, 0xda, 0x6e, 0x9c, 0x6c, + 0xb5, 0x09, 0xb3, 0xb7, 0xd2, 0x63, 0x52, 0x0f,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xb6, 0x33, 0x4c, 0xf3, 0xc9, 0x8b, 0xbf, 0x6a, 0x53, 0x3f, 0xc5, 0xb5, 0xa9, 0x17, 0x71, 0xcd, + 0x78, 0x19, 0xd7, 0x8c, 0x3f, 0xe3, 0x9a, 0xf1, 0xec, 0xac, 0x36, 0xf5, 0xf2, 0xac, 0x36, 0xf5, + 0xdb, 0x59, 0x6d, 0xea, 0xc9, 0xbb, 0x85, 0x2a, 0x89, 0x2d, 0x76, 0xd3, 0xef, 0x74, 0xa8, 0x43, + 0xed, 0x9e, 0xfe, 0xde, 0x18, 0xf9, 0x3d, 0x26, 0x6b, 0xd7, 0x9e, 0x93, 0xc3, 0xe2, 0xf6, 0x3f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x21, 0x93, 0x7b, 0x73, 0xb5, 0x0d, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -264,6 +363,88 @@ func (m *LiquidationWhiteListing) MarshalTo(dAtA []byte) (int, error) { } func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EnglishAuctionParam != nil { + { + size, err := m.EnglishAuctionParam.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.IsEnglishActivated { + i-- + if m.IsEnglishActivated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if m.DutchAuctionParam != nil { + { + size, err := m.DutchAuctionParam.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.IsDutchActivated { + i-- + if m.IsDutchActivated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.Initiator { + i-- + if m.Initiator { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.AppId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DutchAuctionParam) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DutchAuctionParam) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DutchAuctionParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -277,7 +458,7 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintLiquidate(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x1a { size := m.Cusp.Size() i -= size @@ -287,7 +468,7 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintLiquidate(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x12 { size := m.Buffer.Size() i -= size @@ -297,22 +478,40 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintLiquidate(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a - if m.AuctionType { - i-- - if m.AuctionType { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EnglishAuctionParam) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - if m.AppId != 0 { - i = encodeVarintLiquidate(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 + return dAtA[:n], nil +} + +func (m *EnglishAuctionParam) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnglishAuctionParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Step.Size() + i -= size + if _, err := m.Step.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLiquidate(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -374,7 +573,7 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0x90 + dAtA[i] = 0x98 } if len(m.InitiatorType) > 0 { i -= len(m.InitiatorType) @@ -383,8 +582,20 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0x8a + dAtA[i] = 0x92 + } + { + size := m.BonusToBeGiven.Size() + i -= size + if _, err := m.BonusToBeGiven.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLiquidate(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a { size := m.FeeToBeCollected.Size() i -= size @@ -404,12 +615,15 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x7a } - if len(m.IsExternalKeeper) > 0 { - i -= len(m.IsExternalKeeper) - copy(dAtA[i:], m.IsExternalKeeper) - i = encodeVarintLiquidate(dAtA, i, uint64(len(m.IsExternalKeeper))) + if m.IsExternalKeeper { i-- - dAtA[i] = 0x72 + if m.IsExternalKeeper { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x70 } if len(m.InternalKeeperAddress) > 0 { i -= len(m.InternalKeeperAddress) @@ -428,12 +642,12 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x60 } - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LiquidationTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LiquidationTimestamp):]) - if err1 != nil { - return 0, err1 + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LiquidationTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LiquidationTimestamp):]) + if err3 != nil { + return 0, err3 } - i -= n1 - i = encodeVarintLiquidate(dAtA, i, uint64(n1)) + i -= n3 + i = encodeVarintLiquidate(dAtA, i, uint64(n3)) i-- dAtA[i] = 0x5a { @@ -536,9 +750,32 @@ func (m *LiquidationWhiteListing) Size() (n int) { if m.AppId != 0 { n += 1 + sovLiquidate(uint64(m.AppId)) } - if m.AuctionType { + if m.Initiator { n += 2 } + if m.IsDutchActivated { + n += 2 + } + if m.DutchAuctionParam != nil { + l = m.DutchAuctionParam.Size() + n += 1 + l + sovLiquidate(uint64(l)) + } + if m.IsEnglishActivated { + n += 2 + } + if m.EnglishAuctionParam != nil { + l = m.EnglishAuctionParam.Size() + n += 1 + l + sovLiquidate(uint64(l)) + } + return n +} + +func (m *DutchAuctionParam) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l l = m.Buffer.Size() n += 1 + l + sovLiquidate(uint64(l)) l = m.Cusp.Size() @@ -548,6 +785,17 @@ func (m *LiquidationWhiteListing) Size() (n int) { return n } +func (m *EnglishAuctionParam) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Step.Size() + n += 1 + l + sovLiquidate(uint64(l)) + return n +} + func (m *LiquidationOffsetHolder) Size() (n int) { if m == nil { return 0 @@ -601,9 +849,8 @@ func (m *LockedVault) Size() (n int) { if l > 0 { n += 1 + l + sovLiquidate(uint64(l)) } - l = len(m.IsExternalKeeper) - if l > 0 { - n += 1 + l + sovLiquidate(uint64(l)) + if m.IsExternalKeeper { + n += 2 } l = len(m.ExternalKeeperAddress) if l > 0 { @@ -611,6 +858,8 @@ func (m *LockedVault) Size() (n int) { } l = m.FeeToBeCollected.Size() n += 2 + l + sovLiquidate(uint64(l)) + l = m.BonusToBeGiven.Size() + n += 2 + l + sovLiquidate(uint64(l)) l = len(m.InitiatorType) if l > 0 { n += 2 + l + sovLiquidate(uint64(l)) @@ -675,9 +924,9 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { break } } - case 2: + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionType", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Initiator", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -694,8 +943,170 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { break } } - m.AuctionType = bool(v != 0) - case 3: + m.Initiator = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsDutchActivated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsDutchActivated = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DutchAuctionParam", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLiquidate + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DutchAuctionParam == nil { + m.DutchAuctionParam = &DutchAuctionParam{} + } + if err := m.DutchAuctionParam.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsEnglishActivated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsEnglishActivated = bool(v != 0) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EnglishAuctionParam", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLiquidate + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.EnglishAuctionParam == nil { + m.EnglishAuctionParam = &EnglishAuctionParam{} + } + if err := m.EnglishAuctionParam.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLiquidate(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLiquidate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DutchAuctionParam) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DutchAuctionParam: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DutchAuctionParam: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Buffer", wireType) } @@ -729,7 +1140,7 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Cusp", wireType) } @@ -763,7 +1174,91 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Step.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLiquidate(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLiquidate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnglishAuctionParam) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EnglishAuctionParam: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EnglishAuctionParam: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) } @@ -1276,9 +1771,29 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { m.InternalKeeperAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 14: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field IsExternalKeeper", wireType) } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsExternalKeeper = bool(v != 0) + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExternalKeeperAddress", wireType) + } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { @@ -1305,11 +1820,11 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IsExternalKeeper = string(dAtA[iNdEx:postIndex]) + m.ExternalKeeperAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 15: + case 16: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExternalKeeperAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeeToBeCollected", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1337,11 +1852,13 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ExternalKeeperAddress = string(dAtA[iNdEx:postIndex]) + if err := m.FeeToBeCollected.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 16: + case 17: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeeToBeCollected", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BonusToBeGiven", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1369,11 +1886,11 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.FeeToBeCollected.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.BonusToBeGiven.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 17: + case 18: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field InitiatorType", wireType) } @@ -1405,7 +1922,7 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } m.InitiatorType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 18: + case 19: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AuctionType", wireType) } From d8c394da5e9b86be96c6e2caf4e04aa785398b9a Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 28 Apr 2023 20:58:25 +0530 Subject: [PATCH 048/155] auction.go updated --- .../liquidationsV2/v1beta1/liquidate.proto | 67 +++++++++--------- x/auctionsV2/expected/keeper.go | 15 ++++ x/auctionsV2/keeper/auctions.go | 50 ++++++++----- x/auctionsV2/keeper/keeper.go | 34 ++++++++- x/auctionsV2/keeper/maths.go | 24 +++++++ x/liquidationsV2/keeper/whitelist.go | 70 ------------------- 6 files changed, 137 insertions(+), 123 deletions(-) create mode 100644 x/auctionsV2/keeper/maths.go delete mode 100644 x/liquidationsV2/keeper/whitelist.go diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index cc489a490..af9df0e3f 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -23,26 +23,25 @@ message LiquidationWhiteListing { //bool param //true - comdex apps //false external apps - bool initiator = 6 [ - (gogoproto.customname) = "Initiator", - (gogoproto.moretags) = "yaml:\"initiator\""]; + bool initiator = 6 [ + (gogoproto.customname) = "Initiator", + (gogoproto.moretags) = "yaml:\"initiator\""]; //Sets of Params for Dutch Auction - bool is_dutch_activated=7 [ - (gogoproto.customname) = "IsDutchActivated", - (gogoproto.moretags) = "yaml:\"is_dutch_activated\""]; - DutchAuctionParam dutch_auction_param=8[ + bool is_dutch_activated = 7 [ + (gogoproto.customname) = "IsDutchActivated", + (gogoproto.moretags) = "yaml:\"is_dutch_activated\""]; + DutchAuctionParam dutch_auction_param = 8[ (gogoproto.customname) = "DutchAuctionParam", (gogoproto.moretags) = "yaml:\"dutch_auction_param\""]; - //Sets of Params for English Auction - bool is_english_activated=9 [ + //Sets of Params for English Auction + bool is_english_activated = 9 [ (gogoproto.customname) = "IsEnglishActivated", (gogoproto.moretags) = "yaml:\"is_english_activated\""]; - EnglishAuctionParam english_auction_param=10[ - (gogoproto.customname) = "EnglishAuctionParam", - (gogoproto.moretags) = "yaml:\"english_auction_param\""]; -//One thing to keep in mind that somehow it should not happen that a void is created where something at level 2 gets triggerred and it has no data saved a level 1 for lookup and it fails . - + EnglishAuctionParam english_auction_param = 10[ + (gogoproto.customname) = "EnglishAuctionParam", + (gogoproto.moretags) = "yaml:\"english_auction_param\""]; + //One thing to keep in mind that somehow it should not happen that a void is created where something at level 2 gets triggerred and it has no data saved a level 1 for lookup and it fails . } @@ -51,26 +50,26 @@ message DutchAuctionParam{ string buffer = 1 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"buffer\"" + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"buffer\"" ]; string cusp = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"cusp\"" + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"cusp\"" ]; string step = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"step\"" + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"step\"" ]; } message EnglishAuctionParam{ string step = 1 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"step\"" + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"step\"" ]; } @@ -79,7 +78,7 @@ message EnglishAuctionParam{ message LiquidationOffsetHolder { uint64 current_offset = 2; -} +} //Internal keepers are bots run by people to liquidate positions of comdex apps @@ -114,7 +113,7 @@ message LockedVault { (gogoproto.nullable) = false, (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.moretags) = "yaml:\"collateral_token\"" - ]; + ]; cosmos.base.v1beta1.Coin debt_token = 7 [ (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", @@ -127,16 +126,16 @@ message LockedVault { (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"current_collateralisation_ratio\""]; - cosmos.base.v1beta1.Coin collateral_to_be_auctioned =9 [ + cosmos.base.v1beta1.Coin collateral_to_be_auctioned = 9 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"CollateralToBeAuctioned\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - cosmos.base.v1beta1.Coin target_debt =10 [ + cosmos.base.v1beta1.Coin target_debt = 10 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"target_debt\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" - ]; + ]; google.protobuf.Timestamp liquidation_timestamp = 11 [ (gogoproto.customname) = "LiquidationTimestamp", @@ -144,7 +143,7 @@ message LockedVault { (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"liquidation_timestamp\""]; -// true for internal liquidator through bot , false if abci initiated liquidation + // true for internal liquidator through bot , false if abci initiated liquidation bool is_internal_keeper = 12 [ (gogoproto.customname) = "IsInternalKeeper", (gogoproto.moretags) = "yaml:\"is_intenal_keeper\""]; @@ -157,7 +156,7 @@ message LockedVault { (gogoproto.customname) = "IsExternalKeeper", (gogoproto.moretags) = "yaml:\"is_external_keeper\""]; - //To return funds to the external app back + //To return funds to the external app back string external_keeper_address = 15 [ (gogoproto.customname) = "ExternalKeeperAddress", (gogoproto.moretags) = "yaml:\"external_keeper_address\""]; @@ -166,11 +165,11 @@ message LockedVault { (gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.moretags) = "yaml:\"fee_to_be_collected\""]; - string bonus_to_be_given = 17 [ - (gogoproto.customname) = "BonusToBeGiven", - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"bonus_to_be_given\""]; + string bonus_to_be_given = 17 [ + (gogoproto.customname) = "BonusToBeGiven", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"bonus_to_be_given\""]; string initiator_type = 18 [ (gogoproto.customname) = "InitiatorType", diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go index 82eae22ad..6121bd977 100644 --- a/x/auctionsV2/expected/keeper.go +++ b/x/auctionsV2/expected/keeper.go @@ -1,10 +1,25 @@ package expected import ( + assettypes "github.com/comdex-official/comdex/x/asset/types" liquidationsV2types "github.com/comdex-official/comdex/x/liquidationsV2/types" + markettypes "github.com/comdex-official/comdex/x/market/types" sdk "github.com/cosmos/cosmos-sdk/types" ) type LiquidationsV2Keeper interface { GetLiquidationWhiteListing(ctx sdk.Context, appId uint64) (liquidationWhiteListing liquidationsV2types.LiquidationWhiteListing, found bool) } + +type MarketKeeper interface { + CalcAssetPrice(ctx sdk.Context, id uint64, amt sdk.Int) (price sdk.Dec, err error) + GetTwa(ctx sdk.Context, id uint64) (twa markettypes.TimeWeightedAverage, found bool) +} + +type AssetKeeper interface { + GetAsset(ctx sdk.Context, id uint64) (assettypes.Asset, bool) + GetPair(ctx sdk.Context, id uint64) (assettypes.Pair, bool) + GetApps(ctx sdk.Context) (apps []assettypes.AppData, found bool) + GetApp(ctx sdk.Context, id uint64) (app assettypes.AppData, found bool) + GetPairsVault(ctx sdk.Context, id uint64) (pairs assettypes.ExtendedPairVault, found bool) +} diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index fdd4371f5..1421eafaf 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,9 +1,11 @@ package keeper import ( + auctiontypes "github.com/comdex-official/comdex/x/auction/types" "github.com/comdex-official/comdex/x/auctionsV2/types" liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" + "time" ) func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtypes.LockedVault) error { @@ -28,28 +30,40 @@ func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtyp func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidationtypes.LockedVault) error { - //Getting previous auction ID + //Getting previous auction ID auctionID := k.GetAuctionID(ctx) - - -//Price Calculation Function to determine auction different stage price - + //Price Calculation Function to determine auction different stage price + dutchAuctionParams, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) + dap := dutchAuctionParams.DutchAuctionParam + extPair, _ := k.asset.GetPairsVault(ctx, liquidationData.ExtendedPairId) + pair, _ := k.asset.GetPair(ctx, extPair.PairId) + twaDataCollateral, found := k.market.GetTwa(ctx, pair.AssetIn) + if !found || !twaDataCollateral.IsPriceActive { + return auctiontypes.ErrorPrices + } + twaDataDebt, found := k.market.GetTwa(ctx, pair.AssetOut) + if !found || !twaDataDebt.IsPriceActive { + return auctiontypes.ErrorPrices + } + CollateralTokenInitialPrice := k.getOutflowTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), dap.Buffer) + CollateralTokenEndPrice := k.getOutflowTokenEndPrice(CollateralTokenInitialPrice, dap.Cusp) + auctionParams, _ := k.GetAuctionParams(ctx) - //Saving liquidation data to the auction struct + //Saving liquidation data to the auction struct auctionData := types.Auctions{ - AuctionId: auctionID+1, - CollateralToken: liquidationData.CollateralToken, - DebtToken: liquidationData.DebtToken, - CollateralTokenInitialPrice: 0, - CollateralTokenCurrentPrice: 0, - CollateralTokenEndPrice: 0, - DebtTokenCurrentPrice: 0, - LockedVaultId: liquidationData.LockedVaultId, - StartTime: 0, - EndTime: 0, - AppId: liquidationData.AppId, - AuctionType: liquidationData.AuctionType, + AuctionId: auctionID + 1, + CollateralToken: liquidationData.CollateralToken, + DebtToken: liquidationData.DebtToken, + CollateralTokenInitialPrice: CollateralTokenInitialPrice, + CollateralTokenCurrentPrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))), + CollateralTokenEndPrice: CollateralTokenEndPrice, + DebtTokenCurrentPrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))), + LockedVaultId: liquidationData.LockedVaultId, + StartTime: ctx.BlockTime(), + EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), + AppId: liquidationData.AppId, + AuctionType: liquidationData.AuctionType, } return nil diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index bc6314e0b..8abaaed57 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -20,6 +20,8 @@ type ( paramstore paramtypes.Subspace LiquidationsV2 expected.LiquidationsV2Keeper bankKeeper types.BankKeeper + market expected.MarketKeeper + asset expected.AssetKeeper } ) @@ -35,6 +37,8 @@ func NewKeeper( ps paramtypes.Subspace, LiquidationsV2Keeper expected.LiquidationsV2Keeper, bankKeeper types.BankKeeper, + marketKeeper expected.MarketKeeper, + assetKeeper expected.AssetKeeper, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -42,13 +46,14 @@ func NewKeeper( } return Keeper{ - cdc: cdc, storeKey: storeKey, memKey: memKey, paramstore: ps, LiquidationsV2: LiquidationsV2Keeper, bankKeeper: bankKeeper, + market: marketKeeper, + asset: assetKeeper, } } @@ -58,3 +63,30 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { return ctx.KVStore(k.storeKey) } + +func (k Keeper) SetAuctionParams(ctx sdk.Context, auctionParams types.AuctionParams) { + var ( + store = k.Store(ctx) + key = types.AuctionParamsKey + value = k.cdc.MustMarshal(&auctionParams) + ) + + store.Set(key, value) +} + +func (k Keeper) GetAuctionParams(ctx sdk.Context) (auctionParams types.AuctionParams, found bool) { + key := types.AuctionParamsKey + + var ( + store = k.Store(ctx) + + value = store.Get(key) + ) + + if value == nil { + return auctionParams, false + } + + k.cdc.MustUnmarshal(value, &auctionParams) + return auctionParams, true +} diff --git a/x/auctionsV2/keeper/maths.go b/x/auctionsV2/keeper/maths.go new file mode 100644 index 000000000..705d8b0ab --- /dev/null +++ b/x/auctionsV2/keeper/maths.go @@ -0,0 +1,24 @@ +package keeper + +import sdk "github.com/cosmos/cosmos-sdk/types" + +func Multiply(a, b sdk.Dec) sdk.Dec { + return a.Mul(b) +} + +func (k Keeper) getOutflowTokenInitialPrice(price sdk.Int, buffer sdk.Dec) sdk.Dec { + result := buffer.Mul(price.ToDec()) + return result +} + +func (k Keeper) getOutflowTokenEndPrice(price, cusp sdk.Dec) sdk.Dec { + result := Multiply(price, cusp) + return result +} + +func (k Keeper) getPriceFromLinearDecreaseFunction(top sdk.Dec, tau, dur sdk.Int) sdk.Dec { + result1 := tau.Sub(dur) + result2 := top.Mul(result1.ToDec()) + result3 := result2.Quo(tau.ToDec()) + return result3 +} diff --git a/x/liquidationsV2/keeper/whitelist.go b/x/liquidationsV2/keeper/whitelist.go deleted file mode 100644 index 293a951c2..000000000 --- a/x/liquidationsV2/keeper/whitelist.go +++ /dev/null @@ -1,70 +0,0 @@ -package keeper - -import ( - "github.com/comdex-official/comdex/x/liquidationsV2/types" - sdk "github.com/cosmos/cosmos-sdk/types" - protobuftypes "github.com/gogo/protobuf/types" -) - -// whitelisted appIds kvs - -func (k Keeper) SetAppIDForLiquidation(ctx sdk.Context, appID uint64) { - var ( - store = k.Store(ctx) - key = types.WhitelistAppKeyByApp(appID) - value = k.cdc.MustMarshal( - &protobuftypes.UInt64Value{ - Value: appID, - }, - ) - ) - - store.Set(key, value) -} - -func (k Keeper) GetAppIDByAppForLiquidation(ctx sdk.Context, appID uint64) (uint64, bool) { - var ( - store = k.Store(ctx) - key = types.WhitelistAppKeyByApp(appID) - value = store.Get(key) - ) - - if value == nil { - return 0, false - } - - var id protobuftypes.UInt64Value - k.cdc.MustUnmarshal(value, &id) - - return id.GetValue(), true -} - -func (k Keeper) GetAppIdsForLiquidation(ctx sdk.Context) (appIds []uint64) { - var ( - store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.AppIdsKeyPrefix) - ) - - defer func(iter sdk.Iterator) { - err := iter.Close() - if err != nil { - return - } - }(iter) - - for ; iter.Valid(); iter.Next() { - var app protobuftypes.UInt64Value - k.cdc.MustUnmarshal(iter.Value(), &app) - appIds = append(appIds, app.Value) - } - return appIds -} - -func (k Keeper) DeleteAppID(ctx sdk.Context, appID uint64) { - var ( - store = k.Store(ctx) - key = types.WhitelistAppKeyByApp(appID) - ) - - store.Delete(key) -} From 53837532b978dec38a924cf2802f54b196c403aa Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sun, 30 Apr 2023 02:49:27 +0530 Subject: [PATCH 049/155] finalising dutch auction --- proto/comdex/auctionsV2/v1beta1/auction.proto | 36 +-- .../liquidationsV2/v1beta1/liquidate.proto | 25 +- x/auctionsV2/keeper/auctions.go | 58 +++- x/auctionsV2/keeper/maths.go | 8 +- x/auctionsV2/keeper/utils.go | 38 +++ x/auctionsV2/types/auction.pb.go | 187 +++++------- x/auctionsV2/types/errors.go | 2 +- x/auctionsV2/types/keys.go | 11 +- x/liquidationsV2/keeper/liquidate.go | 24 +- x/liquidationsV2/types/liquidate.pb.go | 286 +++++++++++------- 10 files changed, 393 insertions(+), 282 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index e6f9a0ef6..3c7d63e88 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -21,7 +21,7 @@ message Auctions{ // (gogoproto.moretags) = "yaml:\"outflow_token_current_amount\"", // (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" // ]; - cosmos.base.v1beta1.Coin debt_token = 4 [ + cosmos.base.v1beta1.Coin debt_token = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"inflow_token_target_amount\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" @@ -31,56 +31,52 @@ message Auctions{ // (gogoproto.moretags) = "yaml:\"inflow_token_current_amount\"", // (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" // ]; - uint64 active_bidding_id = 6 [ + uint64 active_bidding_id = 4 [ (gogoproto.moretags) = "yaml:\"active_bidding_id\"" ]; - repeated bidOwnerMapping bidding_ids = 7 [ + repeated bidOwnerMapping bidding_ids = 5 [ (gogoproto.moretags) = "yaml:\"bidding_ids\"" ]; - string bid_factor = 8 [ + string bid_factor = 6 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"bid_factor\"" ]; // price indicator only for dutch auctions - string collateral_token_initial_price = 9 [ + string collateral_token_auction_price = 7 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"outflow_token_initial_price\"" + (gogoproto.moretags) = "yaml:\"outflow_token_auction_price\"" ]; - string collateral_token_current_price = 10 [ + string collateral_token_oracle_price = 8 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"outflow_token_current_price\"" + (gogoproto.moretags) = "yaml:\"outflow_token_oracle_price\"" ]; - string collateral_token_end_price = 11 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"outflow_token_end_price\"" - ]; - string debt_token_current_price = 12 [ + + string debt_token_oracle_price = 9 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"inflow_token_current_price\"" + (gogoproto.moretags) = "yaml:\"inflow_token_oracle_price\"" ]; - uint64 locked_vault_id = 13 [ + uint64 locked_vault_id = 10 [ (gogoproto.moretags) = "yaml:\"locked_vault_id\"" ]; - google.protobuf.Timestamp start_time = 15 [ + google.protobuf.Timestamp start_time = 11 [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"start_time\"" ]; - google.protobuf.Timestamp end_time = 16 [ + google.protobuf.Timestamp end_time = 12 [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"end_time\"" ]; - uint64 app_id = 18 [ + uint64 app_id = 13 [ (gogoproto.moretags) = "yaml:\"app_id\"" ]; - bool auction_type = 19 [ + bool auction_type = 14 [ (gogoproto.customname) = "AuctionType", (gogoproto.moretags) = "yaml:\"auction_type\""]; // uint64 auction_status = 20 [ diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index af9df0e3f..1e3ed0162 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -48,28 +48,28 @@ message LiquidationWhiteListing { message DutchAuctionParam{ - string buffer = 1 [ + string premium = 1 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"buffer\"" + (gogoproto.moretags) = "yaml:\"premium\"" ]; - string cusp = 2 [ + string discount = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"cusp\"" + (gogoproto.moretags) = "yaml:\"discount\"" ]; - string step = 3 [ + string decrement_factor = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"step\"" + (gogoproto.moretags) = "yaml:\"decrement_factor\"" ]; } message EnglishAuctionParam{ - string step = 1 [ + string decrement_factor = 1 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"step\"" + (gogoproto.moretags) = "yaml:\"decrement_factor\"" ]; } @@ -105,6 +105,8 @@ message LockedVault { (gogoproto.customname) = "ExtendedPairId", (gogoproto.moretags) = "yaml:\"extended_pair_vault_id\""]; + + string owner = 5 [ (gogoproto.customname) = "Owner", (gogoproto.moretags) = "yaml:\"owner\""]; @@ -177,6 +179,13 @@ message LockedVault { bool auction_type = 19 [ (gogoproto.customname) = "AuctionType", (gogoproto.moretags) = "yaml:\"auction_type\""]; + bool is_debt_cmst = 20 [ + (gogoproto.customname) = "IsDebtCmst", + (gogoproto.moretags) = "yaml:\"is_debt_cmst\""]; + + uint64 pair_id = 21 [ + (gogoproto.customname) = "PairId", + (gogoproto.moretags) = "yaml:\"pair_id\""]; } diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 1421eafaf..7c64b5ccf 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,19 +1,18 @@ package keeper import ( + "time" + auctiontypes "github.com/comdex-official/comdex/x/auction/types" "github.com/comdex-official/comdex/x/auctionsV2/types" liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" - "time" ) func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtypes.LockedVault) error { - auctionType, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) - - //Dutch Auction Model Followed for auction type 0 - if auctionType.AuctionType { + //Dutch Auction Model Followed for auction type true + if liquidationData.AuctionType { //Trigger Dutch Auction err := k.DutchAuctionActivator(ctx, liquidationData) @@ -23,6 +22,10 @@ func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtyp } else { //Trigger English Auction + err := k.EnglishAuctionActivator(ctx, liquidationData) + if err != nil { + + } } return nil @@ -34,10 +37,15 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati auctionID := k.GetAuctionID(ctx) //Price Calculation Function to determine auction different stage price - dutchAuctionParams, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) - dap := dutchAuctionParams.DutchAuctionParam - extPair, _ := k.asset.GetPairsVault(ctx, liquidationData.ExtendedPairId) - pair, _ := k.asset.GetPair(ctx, extPair.PairId) + liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) + + if !liquidationWhitelistingAppData.IsDutchActivated { + return types.ErrDutchAuctionDisabled + } + dutchAuctionParams := liquidationWhitelistingAppData.DutchAuctionParam + + pair, _ := k.asset.GetPair(ctx, liquidationData.PairId) + twaDataCollateral, found := k.market.GetTwa(ctx, pair.AssetIn) if !found || !twaDataCollateral.IsPriceActive { return auctiontypes.ErrorPrices @@ -46,8 +54,19 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati if !found || !twaDataDebt.IsPriceActive { return auctiontypes.ErrorPrices } - CollateralTokenInitialPrice := k.getOutflowTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), dap.Buffer) - CollateralTokenEndPrice := k.getOutflowTokenEndPrice(CollateralTokenInitialPrice, dap.Cusp) + //Checking if DEBT token is CMST then setting its price to $1 , else all tokens price will come from oracle. + if liquidationData.IsDebtCmst { + twaDataDebt.Twa = 1000000 + } + + //Some params will come from the specific app and they could be configured by them , + //rest of the params like auction duration and fees and other params will be based on comdex to edit based on governance + //Understanding different Params: + //Premium : Initial Price i.e price of the collateral at which the auction will start + //Discount: Final Price , i.e less than the oracle price of the collateral asset and at this , auction would end + //Decrement Factor: Linear decrease in the price of the collateral every block is governed by this. + CollateralTokenInitialPrice := k.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), dutchAuctionParams.Premium) + // CollateralTokenEndPrice := k.getOutflowTokenEndPrice(CollateralTokenInitialPrice, dutchAuctionParams.Cusp) auctionParams, _ := k.GetAuctionParams(ctx) //Saving liquidation data to the auction struct @@ -55,10 +74,9 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati AuctionId: auctionID + 1, CollateralToken: liquidationData.CollateralToken, DebtToken: liquidationData.DebtToken, - CollateralTokenInitialPrice: CollateralTokenInitialPrice, - CollateralTokenCurrentPrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))), - CollateralTokenEndPrice: CollateralTokenEndPrice, - DebtTokenCurrentPrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))), + CollateralTokenAuctionPrice: CollateralTokenInitialPrice, + CollateralTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))), + DebtTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))), LockedVaultId: liquidationData.LockedVaultId, StartTime: ctx.BlockTime(), EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), @@ -66,9 +84,17 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati AuctionType: liquidationData.AuctionType, } + k.SetAuctionID(ctx, auctionData.AuctionId) + k.SetAuction(ctx, auctionData) + return nil } -//AUCTIONITERATOR +// AUCTIONITERATOR // -> DUCTHAUCTIONITERATOR // -> ENGLISHAUCTIONITERATOR +func (k Keeper) EnglishAuctionActivator(ctx sdk.Context, liquidationData liquidationtypes.LockedVault) error { + + return nil + +} diff --git a/x/auctionsV2/keeper/maths.go b/x/auctionsV2/keeper/maths.go index 705d8b0ab..bcd731c8f 100644 --- a/x/auctionsV2/keeper/maths.go +++ b/x/auctionsV2/keeper/maths.go @@ -6,13 +6,13 @@ func Multiply(a, b sdk.Dec) sdk.Dec { return a.Mul(b) } -func (k Keeper) getOutflowTokenInitialPrice(price sdk.Int, buffer sdk.Dec) sdk.Dec { - result := buffer.Mul(price.ToDec()) +func (k Keeper) GetCollalteralTokenInitialPrice(price sdk.Int, premium sdk.Dec) sdk.Dec { + result := premium.Mul(price.ToDec()) return result } -func (k Keeper) getOutflowTokenEndPrice(price, cusp sdk.Dec) sdk.Dec { - result := Multiply(price, cusp) +func (k Keeper) GetCollalteralTokenEndPrice(price, discount sdk.Dec) sdk.Dec { + result := Multiply(price, discount) return result } diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go index 3f406f843..c4a905abc 100644 --- a/x/auctionsV2/keeper/utils.go +++ b/x/auctionsV2/keeper/utils.go @@ -3,6 +3,7 @@ package keeper import ( "github.com/comdex-official/comdex/x/auctionsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" protobuftypes "github.com/gogo/protobuf/types" ) @@ -34,3 +35,40 @@ func (k Keeper) GetAuctionID(ctx sdk.Context) uint64 { return id.GetValue() } + +func (k Keeper) SetAuction(ctx sdk.Context, auction types.Auctions) error { + + var ( + store = k.Store(ctx) + key = types.AuctionKey(auction.AppId, auction.AuctionId) + value = k.cdc.MustMarshal(&auction) + ) + + store.Set(key, value) + return nil +} + +func (k Keeper) DeleteAuction(ctx sdk.Context, auction types.Auctions) error { + + var ( + store = k.Store(ctx) + key = types.AuctionKey(auction.AppId, auction.AuctionId) + ) + store.Delete(key) + return nil +} + +func (k Keeper) GetAuction(ctx sdk.Context, appID, auctionMappingID, auctionID uint64) (auction types.Auctions, err error) { + var ( + store = k.Store(ctx) + key = types.AuctionKey(appID, auctionID) + value = store.Get(key) + ) + + if value == nil { + return auction, sdkerrors.ErrNotFound + } + + k.cdc.MustUnmarshal(value, &auction) + return auction, nil +} diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index 5566cab65..6f329650e 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -47,10 +47,9 @@ type Auctions struct { BiddingIds []*BidOwnerMapping `protobuf:"bytes,7,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` // price indicator only for dutch auctions - CollateralTokenInitialPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=collateral_token_initial_price,json=collateralTokenInitialPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_initial_price" yaml:"outflow_token_initial_price"` - CollateralTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=collateral_token_current_price,json=collateralTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_current_price" yaml:"outflow_token_current_price"` - CollateralTokenEndPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=collateral_token_end_price,json=collateralTokenEndPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_end_price" yaml:"outflow_token_end_price"` - DebtTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=debt_token_current_price,json=debtTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"debt_token_current_price" yaml:"inflow_token_current_price"` + CollateralTokenAuctionPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=collateral_token_auction_price,json=collateralTokenAuctionPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_auction_price" yaml:"outflow_token_auction_price"` + CollateralTokenOraclePrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=collateral_token_oracle_price,json=collateralTokenOraclePrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_oracle_price" yaml:"outflow_token_oracle_price"` + DebtTokenOraclePrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=debt_token_oracle_price,json=debtTokenOraclePrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"debt_token_oracle_price" yaml:"inflow_token_oracle_price"` LockedVaultId uint64 `protobuf:"varint,13,opt,name=locked_vault_id,json=lockedVaultId,proto3" json:"locked_vault_id,omitempty" yaml:"locked_vault_id"` StartTime time.Time `protobuf:"bytes,15,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` EndTime time.Time `protobuf:"bytes,16,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` @@ -223,59 +222,57 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 817 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0x8f, 0x61, 0x37, 0x9b, 0x4c, 0x5a, 0x65, 0xeb, 0xa5, 0xbb, 0xde, 0x14, 0xec, 0xe0, 0xc3, - 0x6e, 0x84, 0x54, 0x5b, 0x2d, 0x3d, 0x71, 0xc3, 0xa5, 0x88, 0x20, 0x01, 0x95, 0x89, 0x2a, 0xc4, - 0xc5, 0x1a, 0x7b, 0x26, 0x66, 0x54, 0xc7, 0x63, 0xd9, 0x93, 0x96, 0x7e, 0x07, 0x40, 0xbd, 0xf2, - 0x41, 0xf8, 0x0e, 0x3d, 0xf6, 0x88, 0x38, 0x18, 0x94, 0x7e, 0x83, 0x1c, 0x39, 0xa1, 0xf9, 0xe3, - 0xba, 0x71, 0x8b, 0x4a, 0x24, 0x4e, 0xc9, 0xbc, 0x79, 0xef, 0xf7, 0xfb, 0xcd, 0xf3, 0xbc, 0xdf, - 0x80, 0xb7, 0x11, 0x9d, 0x21, 0xfc, 0xa3, 0x0b, 0xe7, 0x11, 0x23, 0x34, 0x2d, 0x4e, 0xf6, 0xdd, - 0xb3, 0xbd, 0x10, 0x33, 0xb8, 0x57, 0x85, 0x9c, 0x2c, 0xa7, 0x8c, 0xea, 0xaf, 0x65, 0xa2, 0x53, - 0x27, 0x3a, 0x2a, 0x71, 0xf0, 0x5e, 0x4c, 0x63, 0x2a, 0xb2, 0x5c, 0xfe, 0x4f, 0x16, 0x0c, 0xac, - 0x98, 0xd2, 0x38, 0xc1, 0xae, 0x58, 0x85, 0xf3, 0xa9, 0xcb, 0xc8, 0x0c, 0x17, 0x0c, 0xce, 0x32, - 0x95, 0x60, 0x46, 0xb4, 0x98, 0xd1, 0xc2, 0x0d, 0x61, 0x81, 0x6f, 0x49, 0x23, 0x4a, 0x14, 0xa3, - 0xfd, 0xdb, 0x06, 0xe8, 0x7c, 0xaa, 0xd8, 0xf4, 0x03, 0x00, 0x14, 0x73, 0x40, 0x90, 0xa1, 0x0d, - 0xb5, 0xd1, 0x13, 0x6f, 0x7b, 0x59, 0x5a, 0x5b, 0x17, 0x70, 0x96, 0x7c, 0x62, 0xd7, 0x7b, 0xb6, - 0xdf, 0x55, 0x8b, 0x31, 0xd2, 0x2f, 0x35, 0xf0, 0x3c, 0xa2, 0x49, 0x02, 0x19, 0xce, 0x61, 0x12, - 0x30, 0x7a, 0x8a, 0x53, 0xe3, 0x9d, 0xa1, 0x36, 0xea, 0xed, 0xbf, 0x76, 0x24, 0xbd, 0xc3, 0xe9, - 0xab, 0xa3, 0x38, 0x87, 0x94, 0xa4, 0xde, 0x97, 0x57, 0xa5, 0xd5, 0x5a, 0x96, 0xd6, 0x2b, 0x89, - 0xdd, 0x04, 0xb0, 0xff, 0x2e, 0xad, 0xb7, 0x31, 0x61, 0x3f, 0xcc, 0x43, 0x27, 0xa2, 0x33, 0x57, - 0x1d, 0x43, 0xfe, 0xec, 0x16, 0xe8, 0xd4, 0x65, 0x17, 0x19, 0x2e, 0x04, 0x96, 0xdf, 0xaf, 0xab, - 0x27, 0xbc, 0x58, 0xff, 0x45, 0x03, 0x00, 0xe1, 0x90, 0x29, 0x31, 0x4f, 0x1e, 0x13, 0x33, 0x51, - 0x62, 0x3e, 0x94, 0x62, 0x48, 0x3a, 0x4d, 0xe8, 0xb9, 0x2c, 0x0e, 0x18, 0xcc, 0x63, 0xcc, 0x02, - 0x38, 0xa3, 0xf3, 0x94, 0xad, 0x25, 0xab, 0xcb, 0x25, 0x48, 0x41, 0x5f, 0x80, 0x2d, 0x18, 0x31, - 0x72, 0x86, 0x83, 0x90, 0x20, 0x44, 0xd2, 0x98, 0x37, 0xb8, 0x2d, 0x1a, 0xfc, 0xfe, 0xb2, 0xb4, - 0x0c, 0xd5, 0x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 0x0f, 0xd6, - 0x39, 0xf6, 0x11, 0xe8, 0x37, 0x8c, 0x45, 0xdf, 0x06, 0x6d, 0x3e, 0xea, 0xd5, 0xcb, 0xe1, 0x3f, - 0x0d, 0x09, 0x1a, 0x23, 0x7d, 0x07, 0xf0, 0xa1, 0x0f, 0x28, 0x4f, 0x15, 0xcf, 0x42, 0xd7, 0xef, - 0x54, 0xa5, 0xde, 0xd7, 0x57, 0x0b, 0x53, 0xbb, 0x5e, 0x98, 0xda, 0x5f, 0x0b, 0x53, 0xbb, 0xbc, - 0x31, 0x5b, 0xd7, 0x37, 0x66, 0xeb, 0xf7, 0x1b, 0xb3, 0xf5, 0xfd, 0xc1, 0xca, 0x5d, 0xe1, 0xe6, - 0xb6, 0x4b, 0xa7, 0x53, 0x12, 0x11, 0x98, 0xa8, 0xb5, 0xbb, 0xf2, 0xa0, 0x8a, 0xdb, 0x13, 0xb6, - 0x45, 0x17, 0x3f, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x96, 0x9c, 0xaf, 0x72, 0x07, 0x00, - 0x00, + // 793 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4d, 0x6f, 0xeb, 0x44, + 0x14, 0x8d, 0xe1, 0xbd, 0xbc, 0x64, 0xf2, 0xaa, 0xbc, 0xfa, 0x7d, 0xd4, 0x4d, 0xa9, 0x9d, 0x7a, + 0xd1, 0x46, 0x48, 0xb5, 0xd5, 0xd2, 0x15, 0x3b, 0x5c, 0x40, 0x04, 0x09, 0x8a, 0x4c, 0x54, 0x21, + 0x36, 0xd6, 0xd8, 0x33, 0x31, 0xa3, 0x3a, 0x1e, 0xcb, 0x9e, 0xb4, 0xf4, 0x27, 0xb0, 0x41, 0x5d, + 0x21, 0xb1, 0xe2, 0xef, 0x74, 0xd9, 0x25, 0x62, 0x61, 0x50, 0xfa, 0x0f, 0xb2, 0x64, 0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0x5d, 0x89, 0x5b, 0x55, 0x4a, 0xd4, 0x17, 0x38, 0x45, 0x02, 0x73, 0x00, 0x9a, + 0x30, 0xcb, 0xf8, 0x43, 0x75, 0xf1, 0xd0, 0xcd, 0x79, 0x69, 0x6d, 0xa8, 0xd1, 0x15, 0x71, 0xdb, + 0x7f, 0x0e, 0xb3, 0x6c, 0x88, 0xf4, 0x21, 0x78, 0x59, 0xf9, 0x8d, 0xb7, 0xda, 0x78, 0xdd, 0xd7, + 0x06, 0x2d, 0x6f, 0x7f, 0x56, 0x5a, 0x1d, 0x65, 0xb4, 0xd1, 0x75, 0x86, 0xe7, 0xa5, 0xf5, 0x7a, + 0x79, 0xb5, 0xf2, 0x64, 0xdb, 0xef, 0xc0, 0x3a, 0xc7, 0xfe, 0x0c, 0x74, 0x57, 0x46, 0x58, 0x7f, + 0x0b, 0x9a, 0x7c, 0xa8, 0xaa, 0x1d, 0xed, 0x3f, 0x0f, 0x09, 0x1a, 0x22, 0x7d, 0x07, 0xf0, 0xf1, + 0x0a, 0x28, 0x4f, 0x15, 0x0b, 0xb8, 0xed, 0xb7, 0xaa, 0x52, 0xef, 0xeb, 0xdb, 0x99, 0xa9, 0xdd, + 0xcd, 0x4c, 0xed, 0xaf, 0x99, 0xa9, 0xdd, 0xdc, 0x9b, 0x8d, 0xbb, 0x7b, 0xb3, 0xf1, 0xfb, 0xbd, + 0xd9, 0xf8, 0xfe, 0x64, 0xc9, 0x29, 0x7c, 0x8d, 0x1c, 0xd2, 0xf1, 0x98, 0x44, 0x04, 0x26, 0xea, + 0xec, 0x2e, 0xfd, 0xeb, 0x12, 0xde, 0x09, 0x9b, 0xa2, 0x8b, 0x1f, 0xfd, 0x13, 0x00, 0x00, 0xff, + 0xff, 0xde, 0xcc, 0x14, 0x95, 0xdc, 0x06, 0x00, 0x00, } func (m *Auctions) Marshal() (dAtA []byte, err error) { @@ -341,9 +338,9 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x68 } { - size := m.DebtTokenCurrentPrice.Size() + size := m.DebtTokenOraclePrice.Size() i -= size - if _, err := m.DebtTokenCurrentPrice.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.DebtTokenOraclePrice.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintAuction(dAtA, i, uint64(size)) @@ -351,19 +348,9 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x62 { - size := m.CollateralTokenEndPrice.Size() + size := m.CollateralTokenOraclePrice.Size() i -= size - if _, err := m.CollateralTokenEndPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - { - size := m.CollateralTokenCurrentPrice.Size() - i -= size - if _, err := m.CollateralTokenCurrentPrice.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.CollateralTokenOraclePrice.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintAuction(dAtA, i, uint64(size)) @@ -371,9 +358,9 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x52 { - size := m.CollateralTokenInitialPrice.Size() + size := m.CollateralTokenAuctionPrice.Size() i -= size - if _, err := m.CollateralTokenInitialPrice.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.CollateralTokenAuctionPrice.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintAuction(dAtA, i, uint64(size)) @@ -507,13 +494,11 @@ func (m *Auctions) Size() (n int) { } l = m.BidFactor.Size() n += 1 + l + sovAuction(uint64(l)) - l = m.CollateralTokenInitialPrice.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.CollateralTokenCurrentPrice.Size() + l = m.CollateralTokenAuctionPrice.Size() n += 1 + l + sovAuction(uint64(l)) - l = m.CollateralTokenEndPrice.Size() + l = m.CollateralTokenOraclePrice.Size() n += 1 + l + sovAuction(uint64(l)) - l = m.DebtTokenCurrentPrice.Size() + l = m.DebtTokenOraclePrice.Size() n += 1 + l + sovAuction(uint64(l)) if m.LockedVaultId != 0 { n += 1 + sovAuction(uint64(m.LockedVaultId)) @@ -756,7 +741,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenInitialPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenAuctionPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -784,47 +769,13 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.CollateralTokenInitialPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CollateralTokenAuctionPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenCurrentPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CollateralTokenCurrentPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenEndPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenOraclePrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -852,13 +803,13 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.CollateralTokenEndPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CollateralTokenOraclePrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenCurrentPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenOraclePrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -886,7 +837,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.DebtTokenCurrentPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DebtTokenOraclePrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index 8fc4b3313..565f924cf 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -8,5 +8,5 @@ import ( // x/auctionsV2 module sentinel errors var ( - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") + ErrDutchAuctionDisabled = sdkerrors.Register(ModuleName, 701, "Dutch auction not enabled for the app") ) diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index cbd7a47a0..b6321bbb4 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -1,5 +1,9 @@ package types +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + const ( // ModuleName defines the module name ModuleName = "auctionsV2" @@ -18,5 +22,10 @@ const ( ) var ( - AuctionIDKey = []byte{0x01} + AuctionIDKey = []byte{0x01} + AuctionKeyPrefix = []byte{0x02} ) + +func AuctionKey(appID uint64, auctionID uint64) []byte { + return append(append(append(AuctionKeyPrefix, sdk.Uint64ToBigEndian(appID)...), sdk.Uint64ToBigEndian(auctionID)...)) +} diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 0edcbee91..e957b846c 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -107,7 +107,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error if err1 != nil { return fmt.Errorf("error Calculating vault interest in Liquidation, liquidate_vaults.go for vaultID %d", vault.Id) } - //Callling vault to use the updated values of the vault + //Calling vault to use the updated values of the vault vault, _ := k.vault.GetVault(ctx, vault.Id) totalOut := vault.AmountOut.Add(vault.InterestAccumulated).Add(vault.ClosingFeeAccumulated) @@ -118,8 +118,15 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error //Calculating Liquidation Fees feesToBeCollected := sdk.NewDecFromInt(totalOut).Mul(extPair.LiquidationPenalty).TruncateInt() + //Calculating auction bonus to be given + auctionBonusToBeGiven := sdk.NewDecFromInt(totalOut).Mul(extPair.LiquidationPenalty).TruncateInt() + + //Checking if the vault getting liquidated is a cmst based vault or not + //This is primarily to infer that primary market will consider cmst at $1 at the time of buying it + isCMST := !extPair.AssetOutOraclePrice + //Creating locked vault struct , which will trigger auction - err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected, "vault", whitelistingData.AuctionType) + err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "vault", whitelistingData.AuctionType, isCMST, extPair.PairId) if err != nil { return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for Vault %d", vault.Id) } @@ -142,7 +149,7 @@ func (k Keeper) ReturnCoin(ctx sdk.Context, assetID uint64, amount sdk.Int) sdk. return sdk.NewCoin(asset.Denom, amount) } -func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Coin, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, initiatorType string, auctionType bool) error { +func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Coin, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, bonusToBeGiven sdk.Int, initiatorType string, auctionType bool, isDebtCmst bool, pairId unit64) error { lockedVaultID := k.GetLockedVaultID(ctx) value := types.LockedVault{ @@ -158,12 +165,15 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair TargetDebt: AmountOut, LiquidationTimestamp: ctx.BlockTime(), FeeToBeCollected: feesToBeCollected, - IsInternalKeeper: false, - InternalKeeperAddress: "", - IsExternalKeeper: "", - ExternalKeeperAddress: "", + BonusToBeGiven: bonusToBeGiven, + IsInternalKeeper: isInternalKeeper, + InternalKeeperAddress: internalKeeperAddress, + IsExternalKeeper: isExternalKeeper, + ExternalKeeperAddress: externalKeeperAddress, InitiatorType: initiatorType, AuctionType: auctionType, + IsDebtCmst: isDebtCmst, + PairId: pairId, } k.SetLockedVault(ctx, value) diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index f70ac12ef..f810e426b 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -80,9 +80,9 @@ func (m *LiquidationWhiteListing) XXX_DiscardUnknown() { var xxx_messageInfo_LiquidationWhiteListing proto.InternalMessageInfo type DutchAuctionParam struct { - Buffer github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=buffer,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"buffer" yaml:"buffer"` - Cusp github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=cusp,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"cusp" yaml:"cusp"` - Step github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"step" yaml:"step"` + Premium github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=premium,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"premium" yaml:"premium"` + Discount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=discount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"discount" yaml:"discount"` + DecrementFactor github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=decrement_factor,json=decrementFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"decrement_factor" yaml:"decrement_factor"` } func (m *DutchAuctionParam) Reset() { *m = DutchAuctionParam{} } @@ -119,7 +119,7 @@ func (m *DutchAuctionParam) XXX_DiscardUnknown() { var xxx_messageInfo_DutchAuctionParam proto.InternalMessageInfo type EnglishAuctionParam struct { - Step github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"step" yaml:"step"` + DecrementFactor github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=decrement_factor,json=decrementFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"decrement_factor" yaml:"decrement_factor"` } func (m *EnglishAuctionParam) Reset() { *m = EnglishAuctionParam{} } @@ -214,6 +214,8 @@ type LockedVault struct { BonusToBeGiven github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,17,opt,name=bonus_to_be_given,json=bonusToBeGiven,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bonus_to_be_given" yaml:"bonus_to_be_given"` InitiatorType string `protobuf:"bytes,18,opt,name=initiator_type,json=initiatorType,proto3" json:"initiator_type,omitempty" yaml:"initiator_type"` AuctionType bool `protobuf:"varint,19,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` + IsDebtCmst bool `protobuf:"varint,20,opt,name=is_debt_cmst,json=isDebtCmst,proto3" json:"is_debt_cmst,omitempty" yaml:"is_debt_cmst"` + PairId uint64 `protobuf:"varint,21,opt,name=pair_id,json=pairId,proto3" json:"pair_id,omitempty" yaml:"pair_id"` } func (m *LockedVault) Reset() { *m = LockedVault{} } @@ -262,89 +264,95 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 1309 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcd, 0x6f, 0x1b, 0xc5, - 0x1b, 0xce, 0xa6, 0x49, 0x5a, 0x8f, 0x9b, 0xc4, 0x99, 0x24, 0x8d, 0x9b, 0x5f, 0xeb, 0xc9, 0x6f, - 0x24, 0x4a, 0x85, 0x14, 0xbb, 0x49, 0x85, 0x40, 0x20, 0xd4, 0xc6, 0x49, 0x00, 0x43, 0xa4, 0xb6, - 0xab, 0xaa, 0x95, 0x2a, 0xc4, 0xb2, 0xde, 0x1d, 0x3b, 0xa3, 0x38, 0xbb, 0xcb, 0xee, 0x38, 0xa4, - 0x17, 0x24, 0x4e, 0x1c, 0x69, 0x91, 0x38, 0x73, 0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 0x05, - 0x36, 0x17, 0xda, 0x05, 0x2c, 0x7c, 0x00, 0x16, 0xd2, 0x55, 0xdc, 0x12, 0xa2, 0x55, 0x28, 0xa3, - 0x78, 0x4b, 0x5c, 0xda, 0xe9, 0x0e, 0xff, 0xf0, 0x69, 0x40, 0x06, 0x1c, 0xad, 0x0e, 0xed, 0xf1, - 0x92, 0x80, 0xcd, 0x79, 0x9a, 0xc7, 0xc1, 0x16, 0xb8, 0x9c, 0xec, 0x7c, 0x52, 0x70, 0x59, 0xb6, - 0xcf, 0x8d, 0x98, 0xa3, 0xb2, 0x1e, 0x2b, 0x5a, 0x6e, 0x59, 0xff, 0xa0, 0xc8, 0x81, 0xb1, 0x59, - 0xb6, 0x33, 0x4c, 0xf3, 0xc9, 0x8b, 0xbf, 0x6a, 0x53, 0x3f, 0xc5, 0xb5, 0xa9, 0x17, 0x71, 0xcd, - 0x78, 0x19, 0xd7, 0x8c, 0x3f, 0xe3, 0x9a, 0xf1, 0xec, 0xac, 0x36, 0xf5, 0xf2, 0xac, 0x36, 0xf5, - 0xdb, 0x59, 0x6d, 0xea, 0xc9, 0xbb, 0x85, 0x2a, 0x89, 0x2d, 0x76, 0xd3, 0xef, 0x74, 0xa8, 0x43, - 0xed, 0x9e, 0xfe, 0xde, 0x18, 0xf9, 0x3d, 0x26, 0x6b, 0xd7, 0x9e, 0x93, 0xc3, 0xe2, 0xf6, 0x3f, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x21, 0x93, 0x7b, 0x73, 0xb5, 0x0d, 0x00, 0x00, + // 1394 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0xa6, 0x4d, 0xd2, 0x8c, 0x13, 0xc7, 0x9e, 0xc4, 0xcd, 0x36, 0xb4, 0x9e, 0xb0, 0x52, + 0x4b, 0x85, 0x14, 0xbb, 0x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 0xbb, 0xdf, 0xb7, 0x88, 0xab, 0x6b, 0x9b, + 0xda, 0xf5, 0xf3, 0x8d, 0x8d, 0x88, 0xa1, 0xb9, 0xdd, 0x7e, 0xbf, 0xe9, 0x0e, 0x19, 0x5a, 0x7e, + 0x62, 0xf7, 0xba, 0xef, 0x19, 0x12, 0x60, 0x98, 0x73, 0x36, 0x5f, 0x87, 0x1f, 0x80, 0x45, 0xe2, + 0x11, 0x4a, 0x6c, 0xea, 0x07, 0xfa, 0xfc, 0xa6, 0x76, 0xfd, 0x42, 0xe3, 0xcd, 0x88, 0xa1, 0xc5, + 0x66, 0xbc, 0x38, 0x64, 0xa8, 0x24, 0x99, 0x09, 0xce, 0x30, 0x53, 0x0e, 0xb4, 0x00, 0x24, 0xa1, + 0xe5, 0x0e, 0xa8, 0x73, 0x64, 0xd9, 0x0e, 0x25, 0x27, 0x36, 0xc5, 0xae, 0xbe, 0x20, 0x94, 0xb6, + 0x23, 0x86, 0x4a, 0xcd, 0x70, 0x9f, 0x6f, 0xee, 0xc6, 0x7b, 0x43, 0x86, 0x2e, 0x29, 0xc1, 0x09, + 0x9e, 0x61, 0x96, 0xc8, 0x18, 0x1c, 0xfe, 0xa0, 0x81, 0x55, 0x05, 0x1b, 0x38, 0x3c, 0x64, 0xab, + 0x6f, 0x07, 0x76, 0x4f, 0xbf, 0xb0, 0xa9, 0x5d, 0x2f, 0xec, 0xdc, 0xa8, 0x9d, 0x79, 0x0b, 0x35, + 0x29, 0x26, 0x89, 0xf7, 0x39, 0xaf, 0x71, 0x33, 0x62, 0xa8, 0x3c, 0xb1, 0x3c, 0x64, 0x68, 0x43, + 0x7a, 0x95, 0x63, 0xcb, 0x30, 0xcb, 0xee, 0x38, 0x01, 0x76, 0xc0, 0x1a, 0x09, 0x2d, 0xec, 0x75, + 0xba, 0x24, 0xcc, 0x86, 0xbe, 0x28, 0x42, 0xbf, 0x15, 0x31, 0x04, 0x9b, 0xe1, 0x81, 0xdc, 0xce, + 0x06, 0x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31, 0xcc, 0xf9, 0xbe, 0xd8, 0x69, 0x3c, 0x7e, 0xfe, 0x77, 0x75, 0xe6, 0xa7, 0xa8, + 0x3a, 0xf3, 0x3c, 0xaa, 0x6a, 0x2f, 0xa2, 0xaa, 0xf6, 0x57, 0x54, 0xd5, 0x9e, 0xbe, 0xac, 0xce, + 0xbc, 0x78, 0x59, 0x9d, 0xf9, 0xfd, 0x65, 0x75, 0xe6, 0xf1, 0xbb, 0x23, 0xb7, 0xc4, 0x67, 0xf3, + 0x2d, 0xbf, 0xdd, 0x26, 0x0e, 0xb1, 0xbb, 0xea, 0x77, 0x7d, 0xe2, 0x2b, 0x53, 0xdc, 0x5d, 0x6b, + 0x5e, 0x14, 0xab, 0x9b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x38, 0x32, 0x19, 0x05, 0x8b, 0x0e, + 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -450,9 +458,9 @@ func (m *DutchAuctionParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size := m.Step.Size() + size := m.DecrementFactor.Size() i -= size - if _, err := m.Step.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.DecrementFactor.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintLiquidate(dAtA, i, uint64(size)) @@ -460,9 +468,9 @@ func (m *DutchAuctionParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a { - size := m.Cusp.Size() + size := m.Discount.Size() i -= size - if _, err := m.Cusp.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.Discount.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintLiquidate(dAtA, i, uint64(size)) @@ -470,9 +478,9 @@ func (m *DutchAuctionParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 { - size := m.Buffer.Size() + size := m.Premium.Size() i -= size - if _, err := m.Buffer.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.Premium.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintLiquidate(dAtA, i, uint64(size)) @@ -503,9 +511,9 @@ func (m *EnglishAuctionParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size := m.Step.Size() + size := m.DecrementFactor.Size() i -= size - if _, err := m.Step.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.DecrementFactor.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintLiquidate(dAtA, i, uint64(size)) @@ -563,6 +571,25 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.PairId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.PairId)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa8 + } + if m.IsDebtCmst { + i-- + if m.IsDebtCmst { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 + } if m.AuctionType { i-- if m.AuctionType { @@ -776,11 +803,11 @@ func (m *DutchAuctionParam) Size() (n int) { } var l int _ = l - l = m.Buffer.Size() + l = m.Premium.Size() n += 1 + l + sovLiquidate(uint64(l)) - l = m.Cusp.Size() + l = m.Discount.Size() n += 1 + l + sovLiquidate(uint64(l)) - l = m.Step.Size() + l = m.DecrementFactor.Size() n += 1 + l + sovLiquidate(uint64(l)) return n } @@ -791,7 +818,7 @@ func (m *EnglishAuctionParam) Size() (n int) { } var l int _ = l - l = m.Step.Size() + l = m.DecrementFactor.Size() n += 1 + l + sovLiquidate(uint64(l)) return n } @@ -867,6 +894,12 @@ func (m *LockedVault) Size() (n int) { if m.AuctionType { n += 3 } + if m.IsDebtCmst { + n += 3 + } + if m.PairId != 0 { + n += 2 + sovLiquidate(uint64(m.PairId)) + } return n } @@ -1108,7 +1141,7 @@ func (m *DutchAuctionParam) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Buffer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Premium", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1136,13 +1169,13 @@ func (m *DutchAuctionParam) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Buffer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Premium.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cusp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Discount", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1170,13 +1203,13 @@ func (m *DutchAuctionParam) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Cusp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Discount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DecrementFactor", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1204,7 +1237,7 @@ func (m *DutchAuctionParam) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Step.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DecrementFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1260,7 +1293,7 @@ func (m *EnglishAuctionParam) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DecrementFactor", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1288,7 +1321,7 @@ func (m *EnglishAuctionParam) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Step.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DecrementFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1942,6 +1975,45 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } } m.AuctionType = bool(v != 0) + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsDebtCmst", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsDebtCmst = bool(v != 0) + case 21: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PairId", wireType) + } + m.PairId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PairId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipLiquidate(dAtA[iNdEx:]) From 1aed3e5038d0530fa81e42a9920bdbe9d96216a5 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Mon, 1 May 2023 02:39:41 +0530 Subject: [PATCH 050/155] finalising dutch auction --- x/liquidationsV2/keeper/liquidate.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index e957b846c..c947a1d76 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -159,13 +159,13 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair ExtendedPairId: ExtendedPairId, Owner: Owner, CollateralToken: AmountIn, - DebtToken: AmountOut, + DebtToken: AmountOut,//just a representation of the total debt the vault had incurred at the time of liquidation. // Target debt is a correct measure of what will get collected in the auction from bidders. CurrentCollaterlisationRatio: collateralizationRatio, CollateralToBeAuctioned: AmountIn, - TargetDebt: AmountOut, + TargetDebt: AmountOut,//to add debt+liquidation+auction bonus here---- LiquidationTimestamp: ctx.BlockTime(), - FeeToBeCollected: feesToBeCollected, - BonusToBeGiven: bonusToBeGiven, + FeeToBeCollected: feesToBeCollected,//just for calculation purpose + BonusToBeGiven: bonusToBeGiven,//just for calculation purpose IsInternalKeeper: isInternalKeeper, InternalKeeperAddress: internalKeeperAddress, IsExternalKeeper: isExternalKeeper, @@ -175,6 +175,15 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair IsDebtCmst: isDebtCmst, PairId: pairId, } + //To understand a condition in which case target debt becomes equal to dollar value of collateral token + //at some point in the auction + //1. what happens in that case + //2. what if the bid on the auction makes the auction lossy, + //should be use the liquidation penalty ? most probably yes to cover the difference. + //what if then liquidation penalty still falls short, should we then reduce the auction bonus from the debt , to make things even? + //will this be enough to make sure auction does not not gets bid due to collateral not being able to cover the debt? + //can a case occur in which liquidation penalty and auction bonus are still not enough? + k.SetLockedVault(ctx, value) k.SetLockedVaultID(ctx, value.LockedVaultId) From f7d2befb0695b1a3b425ea2c95ee82f40750c549 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Thu, 4 May 2023 19:39:35 +0530 Subject: [PATCH 051/155] finalising dutch auction --- x/auctionsV2/keeper/auctions.go | 30 +++++++++++++++++++++++++++- x/auctionsV2/types/errors.go | 1 + x/liquidationsV2/keeper/liquidate.go | 4 ++-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 7c64b5ccf..cdf60463c 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -73,7 +73,7 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati auctionData := types.Auctions{ AuctionId: auctionID + 1, CollateralToken: liquidationData.CollateralToken, - DebtToken: liquidationData.DebtToken, + DebtToken: liquidationData.TargetDebt, CollateralTokenAuctionPrice: CollateralTokenInitialPrice, CollateralTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))), DebtTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))), @@ -95,6 +95,34 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati // -> ENGLISHAUCTIONITERATOR func (k Keeper) EnglishAuctionActivator(ctx sdk.Context, liquidationData liquidationtypes.LockedVault) error { + //Getting previous auction ID + auctionID := k.GetAuctionID(ctx) + + //Price Calculation Function to determine auction different stage price + liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) + + if !liquidationWhitelistingAppData.IsEnglishActivated { + return types.ErrEnglishAuctionDisabled + } + // englishAuctionParams := liquidationWhitelistingAppData.EnglishAuctionParam + auctionParams, _ := k.GetAuctionParams(ctx) + + auctionData := types.Auctions{ + AuctionId: auctionID + 1, + CollateralToken: liquidationData.CollateralToken, + DebtToken: liquidationData.TargetDebt, + // CollateralTokenAuctionPrice: CollateralTokenInitialPrice, + // CollateralTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))), + // DebtTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))), + LockedVaultId: liquidationData.LockedVaultId, + StartTime: ctx.BlockTime(), + EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), + AppId: liquidationData.AppId, + AuctionType: liquidationData.AuctionType, + } + k.SetAuctionID(ctx, auctionData.AuctionId) + k.SetAuction(ctx, auctionData) + return nil } diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index 565f924cf..0069ce0dc 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -9,4 +9,5 @@ import ( // x/auctionsV2 module sentinel errors var ( ErrDutchAuctionDisabled = sdkerrors.Register(ModuleName, 701, "Dutch auction not enabled for the app") + ErrEnglishAuctionDisabled = sdkerrors.Register(ModuleName, 702, "English auction not enabled for the app") ) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index c947a1d76..c75643339 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -162,7 +162,7 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair DebtToken: AmountOut,//just a representation of the total debt the vault had incurred at the time of liquidation. // Target debt is a correct measure of what will get collected in the auction from bidders. CurrentCollaterlisationRatio: collateralizationRatio, CollateralToBeAuctioned: AmountIn, - TargetDebt: AmountOut,//to add debt+liquidation+auction bonus here---- + TargetDebt: AmountOut.Add(sdk.NewCoin(AmountOut.Denom,feesToBeCollected)).Add(sdk.NewCoin(AmountOut.Denom,bonusToBeGiven)),//to add debt+liquidation+auction bonus here---- LiquidationTimestamp: ctx.BlockTime(), FeeToBeCollected: feesToBeCollected,//just for calculation purpose BonusToBeGiven: bonusToBeGiven,//just for calculation purpose @@ -183,7 +183,7 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair //what if then liquidation penalty still falls short, should we then reduce the auction bonus from the debt , to make things even? //will this be enough to make sure auction does not not gets bid due to collateral not being able to cover the debt? //can a case occur in which liquidation penalty and auction bonus are still not enough? - + k.SetLockedVault(ctx, value) k.SetLockedVaultID(ctx, value.LockedVaultId) From 29629caa7efdc279b391128005b67ac893684c1e Mon Sep 17 00:00:00 2001 From: Pratik Date: Thu, 4 May 2023 19:43:24 +0530 Subject: [PATCH 052/155] dutch auction -price updation --- x/auctionsV2/expected/keeper.go | 2 + x/auctionsV2/keeper/auctions.go | 86 ++++++++++++++++++++++++++++++++- x/auctionsV2/keeper/maths.go | 5 ++ x/auctionsV2/keeper/utils.go | 22 +++++++++ 4 files changed, 113 insertions(+), 2 deletions(-) diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go index 6121bd977..c84c15438 100644 --- a/x/auctionsV2/expected/keeper.go +++ b/x/auctionsV2/expected/keeper.go @@ -9,6 +9,7 @@ import ( type LiquidationsV2Keeper interface { GetLiquidationWhiteListing(ctx sdk.Context, appId uint64) (liquidationWhiteListing liquidationsV2types.LiquidationWhiteListing, found bool) + GetLockedVault(ctx sdk.Context, appID, id uint64) (lockedVault liquidationsV2types.LockedVault, found bool) } type MarketKeeper interface { @@ -22,4 +23,5 @@ type AssetKeeper interface { GetApps(ctx sdk.Context) (apps []assettypes.AppData, found bool) GetApp(ctx sdk.Context, id uint64) (app assettypes.AppData, found bool) GetPairsVault(ctx sdk.Context, id uint64) (pairs assettypes.ExtendedPairVault, found bool) + GetAssetForDenom(ctx sdk.Context, denom string) (asset assettypes.Asset, found bool) } diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index cdf60463c..aeefa54f1 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,6 +1,7 @@ package keeper import ( + utils "github.com/comdex-official/comdex/types" "time" auctiontypes "github.com/comdex-official/comdex/x/auction/types" @@ -85,7 +86,10 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati } k.SetAuctionID(ctx, auctionData.AuctionId) - k.SetAuction(ctx, auctionData) + err := k.SetAuction(ctx, auctionData) + if err != nil { + return err + } return nil } @@ -121,8 +125,86 @@ func (k Keeper) EnglishAuctionActivator(ctx sdk.Context, liquidationData liquida AuctionType: liquidationData.AuctionType, } k.SetAuctionID(ctx, auctionData.AuctionId) - k.SetAuction(ctx, auctionData) + err := k.SetAuction(ctx, auctionData) + if err != nil { + return err + } + + return nil + +} +// DutchAuctionsIterator iterates over existing active dutch auctions and does 2 main job +// First: if auction time is comple and target not reached with collateral available then Restart +// Second: if not restarting update the price +func (k Keeper) DutchAuctionsIterator(ctx sdk.Context) error { + dutchAuctions := k.GetAuctions(ctx) + // SET current price of inflow token and outflow token + + for _, dutchAuction := range dutchAuctions { + _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { + // First case to check if we have to restart the auction + if ctx.BlockTime().After(dutchAuction.EndTime) { + // restart + + } else { + // Second case to only reduce the price + err := k.UpdateDutchAuctionsPrice(ctx, dutchAuction) + if err != nil { + return err + } + } + return nil + }) + } return nil +} + +func (k Keeper) UpdateDutchAuctionsPrice(ctx sdk.Context, dutchAuction types.Auctions) error { + lockedVault, found := k.LiquidationsV2.GetLockedVault(ctx, dutchAuction.AppId, dutchAuction.LockedVaultId) + if !found { + return auctiontypes.ErrorInvalidLockedVault + } + auctionParams, _ := k.GetAuctionParams(ctx) + liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, dutchAuction.AppId) + + if !liquidationWhitelistingAppData.IsDutchActivated { + return types.ErrDutchAuctionDisabled + } + dutchAuctionParams := liquidationWhitelistingAppData.DutchAuctionParam + + // TODO: if internal apps then check idf price to be taken from ext pair else direct market call + var debtTokenOraclePrice uint64 + debtToken, _ := k.asset.GetAssetForDenom(ctx, lockedVault.DebtToken.Denom) + ExtendedPairVault, found := k.asset.GetPairsVault(ctx, lockedVault.ExtendedPairId) + if !found { + return auctiontypes.ErrorInvalidExtendedPairVault + } + if lockedVault.IsInternalKeeper && !ExtendedPairVault.AssetOutOraclePrice { + debtTokenOraclePrice = ExtendedPairVault.AssetOutPrice + } else { + twaData, found := k.market.GetTwa(ctx, debtToken.Id) + if !found || !twaData.IsPriceActive { + return auctiontypes.ErrorPrices + } + debtTokenOraclePrice = twaData.Twa + } + + numerator := dutchAuction.CollateralTokenAuctionPrice.Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) //cmdx + CollateralTokenAuctionEndPrice := k.getOutflowTokenEndPrice(dutchAuction.CollateralTokenAuctionPrice, dutchAuctionParams.Discount) + + denominator := dutchAuction.CollateralTokenAuctionPrice.Sub(CollateralTokenAuctionEndPrice) + resultant := numerator.Quo(denominator) + tau := sdk.NewInt(resultant.TruncateInt64()) + dur := ctx.BlockTime().Sub(dutchAuction.StartTime) + seconds := sdk.NewInt(int64(dur.Seconds())) + collateralTokenAuctionPrice := k.getPriceFromLinearDecreaseFunction(dutchAuction.CollateralTokenAuctionPrice, tau, seconds) + dutchAuction.DebtTokenOraclePrice = sdk.NewDec(int64(debtTokenOraclePrice)) + dutchAuction.CollateralTokenAuctionPrice = collateralTokenAuctionPrice + err := k.SetAuction(ctx, dutchAuction) + if err != nil { + return err + } + return nil } diff --git a/x/auctionsV2/keeper/maths.go b/x/auctionsV2/keeper/maths.go index bcd731c8f..0e8b83c34 100644 --- a/x/auctionsV2/keeper/maths.go +++ b/x/auctionsV2/keeper/maths.go @@ -22,3 +22,8 @@ func (k Keeper) getPriceFromLinearDecreaseFunction(top sdk.Dec, tau, dur sdk.Int result3 := result2.Quo(tau.ToDec()) return result3 } + +func (k Keeper) getOutflowTokenEndPrice(price, cusp sdk.Dec) sdk.Dec { + result := Multiply(price, cusp) + return result +} diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go index c4a905abc..e3f7f8b3b 100644 --- a/x/auctionsV2/keeper/utils.go +++ b/x/auctionsV2/keeper/utils.go @@ -72,3 +72,25 @@ func (k Keeper) GetAuction(ctx sdk.Context, appID, auctionMappingID, auctionID u k.cdc.MustUnmarshal(value, &auction) return auction, nil } + +func (k Keeper) GetAuctions(ctx sdk.Context) (auctions []types.Auctions) { + var ( + store = k.Store(ctx) + iter = sdk.KVStorePrefixIterator(store, types.AuctionKeyPrefix) + ) + + defer func(iter sdk.Iterator) { + err := iter.Close() + if err != nil { + return + } + }(iter) + + for ; iter.Valid(); iter.Next() { + var auction types.Auctions + k.cdc.MustUnmarshal(iter.Value(), &auction) + auctions = append(auctions, auction) + } + + return auctions +} From f2af94007bc613326f822fa4cd70bc7aa0a6f41f Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 5 May 2023 10:12:57 +0530 Subject: [PATCH 053/155] updating dutch iterator --- x/auctionsV2/expected/keeper.go | 11 +++++ x/auctionsV2/keeper/auctions.go | 85 +++++++++++++++++++++++---------- x/auctionsV2/keeper/keeper.go | 3 ++ x/auctionsV2/keeper/maths.go | 9 +--- 4 files changed, 77 insertions(+), 31 deletions(-) diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go index c84c15438..ce1abd853 100644 --- a/x/auctionsV2/expected/keeper.go +++ b/x/auctionsV2/expected/keeper.go @@ -2,6 +2,7 @@ package expected import ( assettypes "github.com/comdex-official/comdex/x/asset/types" + esmtypes "github.com/comdex-official/comdex/x/esm/types" liquidationsV2types "github.com/comdex-official/comdex/x/liquidationsV2/types" markettypes "github.com/comdex-official/comdex/x/market/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -25,3 +26,13 @@ type AssetKeeper interface { GetPairsVault(ctx sdk.Context, id uint64) (pairs assettypes.ExtendedPairVault, found bool) GetAssetForDenom(ctx sdk.Context, denom string) (asset assettypes.Asset, found bool) } + +type EsmKeeper interface { + GetKillSwitchData(ctx sdk.Context, appID uint64) (esmtypes.KillSwitchParams, bool) + GetESMStatus(ctx sdk.Context, id uint64) (esmStatus esmtypes.ESMStatus, found bool) + CalcDollarValueOfToken(ctx sdk.Context, rate uint64, amt sdk.Int, decimals sdk.Int) (price sdk.Dec) + SetAssetToAmount(ctx sdk.Context, assetToAmount esmtypes.AssetToAmount) + GetDataAfterCoolOff(ctx sdk.Context, id uint64) (esmDataAfterCoolOff esmtypes.DataAfterCoolOff, found bool) + SetDataAfterCoolOff(ctx sdk.Context, esmDataAfterCoolOff esmtypes.DataAfterCoolOff) + GetSnapshotOfPrices(ctx sdk.Context, appID, assetID uint64) (price uint64, found bool) +} diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index aeefa54f1..1f805fb50 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -135,21 +135,29 @@ func (k Keeper) EnglishAuctionActivator(ctx sdk.Context, liquidationData liquida } // DutchAuctionsIterator iterates over existing active dutch auctions and does 2 main job -// First: if auction time is comple and target not reached with collateral available then Restart +// First: if auction time is complete and target not reached with collateral available then Restart // Second: if not restarting update the price func (k Keeper) DutchAuctionsIterator(ctx sdk.Context) error { dutchAuctions := k.GetAuctions(ctx) // SET current price of inflow token and outflow token for _, dutchAuction := range dutchAuctions { + lockedVault, found := k.LiquidationsV2.GetLockedVault(ctx, dutchAuction.AppId, dutchAuction.LockedVaultId) + if !found { + return auctiontypes.ErrorInvalidLockedVault + } _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { // First case to check if we have to restart the auction if ctx.BlockTime().After(dutchAuction.EndTime) { // restart + err := k.RestartDutchAuctions(ctx, dutchAuction, lockedVault) + if err != nil { + return err + } } else { // Second case to only reduce the price - err := k.UpdateDutchAuctionsPrice(ctx, dutchAuction) + err := k.UpdateDutchAuctionsPrice(ctx, dutchAuction, lockedVault) if err != nil { return err } @@ -160,12 +168,19 @@ func (k Keeper) DutchAuctionsIterator(ctx sdk.Context) error { return nil } -func (k Keeper) UpdateDutchAuctionsPrice(ctx sdk.Context, dutchAuction types.Auctions) error { - lockedVault, found := k.LiquidationsV2.GetLockedVault(ctx, dutchAuction.AppId, dutchAuction.LockedVaultId) - if !found { - return auctiontypes.ErrorInvalidLockedVault - } +func (k Keeper) RestartDutchAuctions(ctx sdk.Context, dutchAuction types.Auctions, lockedVault liquidationtypes.LockedVault) error { + esmStatus, found := k.esm.GetESMStatus(ctx, dutchAuction.AppId) auctionParams, _ := k.GetAuctionParams(ctx) + status := false + if found { + status = esmStatus.Status + } + if lockedVault.IsInternalKeeper { + if status { + // code goes here for collateral redemption in case of esm + return nil + } + } liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, dutchAuction.AppId) if !liquidationWhitelistingAppData.IsDutchActivated { @@ -173,34 +188,56 @@ func (k Keeper) UpdateDutchAuctionsPrice(ctx sdk.Context, dutchAuction types.Auc } dutchAuctionParams := liquidationWhitelistingAppData.DutchAuctionParam - // TODO: if internal apps then check idf price to be taken from ext pair else direct market call - var debtTokenOraclePrice uint64 - debtToken, _ := k.asset.GetAssetForDenom(ctx, lockedVault.DebtToken.Denom) - ExtendedPairVault, found := k.asset.GetPairsVault(ctx, lockedVault.ExtendedPairId) - if !found { - return auctiontypes.ErrorInvalidExtendedPairVault + pair, _ := k.asset.GetPair(ctx, lockedVault.PairId) + twaDataCollateral, found := k.market.GetTwa(ctx, pair.AssetIn) + if !found || !twaDataCollateral.IsPriceActive { + return auctiontypes.ErrorPrices } - if lockedVault.IsInternalKeeper && !ExtendedPairVault.AssetOutOraclePrice { - debtTokenOraclePrice = ExtendedPairVault.AssetOutPrice - } else { - twaData, found := k.market.GetTwa(ctx, debtToken.Id) - if !found || !twaData.IsPriceActive { - return auctiontypes.ErrorPrices - } - debtTokenOraclePrice = twaData.Twa + collateralTokenCurrentPrice := twaDataCollateral.Twa + timeNow := ctx.BlockTime() + dutchAuction.StartTime = timeNow + dutchAuction.EndTime = timeNow.Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)) + collateralTokenInitialPrice := k.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(collateralTokenCurrentPrice), dutchAuctionParams.Premium) + dutchAuction.CollateralTokenAuctionPrice = collateralTokenInitialPrice + err := k.SetAuction(ctx, dutchAuction) + if err != nil { + return err + } + + return nil +} + +func (k Keeper) UpdateDutchAuctionsPrice(ctx sdk.Context, dutchAuction types.Auctions, lockedVault liquidationtypes.LockedVault) error { + + auctionParams, _ := k.GetAuctionParams(ctx) + liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, dutchAuction.AppId) + + if !liquidationWhitelistingAppData.IsDutchActivated { + return types.ErrDutchAuctionDisabled + } + dutchAuctionParams := liquidationWhitelistingAppData.DutchAuctionParam + + pair, _ := k.asset.GetPair(ctx, lockedVault.PairId) + twaDataDebt, found := k.market.GetTwa(ctx, pair.AssetOut) + if !found || !twaDataDebt.IsPriceActive { + return auctiontypes.ErrorPrices + } + //Checking if DEBT token is CMST then setting its price to $1 , else all tokens price will come from oracle. + if lockedVault.IsDebtCmst { + twaDataDebt.Twa = 1000000 } numerator := dutchAuction.CollateralTokenAuctionPrice.Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) //cmdx - CollateralTokenAuctionEndPrice := k.getOutflowTokenEndPrice(dutchAuction.CollateralTokenAuctionPrice, dutchAuctionParams.Discount) + CollateralTokenAuctionEndPrice := k.GetCollateralTokenEndPrice(dutchAuction.CollateralTokenAuctionPrice, dutchAuctionParams.Discount) denominator := dutchAuction.CollateralTokenAuctionPrice.Sub(CollateralTokenAuctionEndPrice) resultant := numerator.Quo(denominator) tau := sdk.NewInt(resultant.TruncateInt64()) dur := ctx.BlockTime().Sub(dutchAuction.StartTime) seconds := sdk.NewInt(int64(dur.Seconds())) - collateralTokenAuctionPrice := k.getPriceFromLinearDecreaseFunction(dutchAuction.CollateralTokenAuctionPrice, tau, seconds) - dutchAuction.DebtTokenOraclePrice = sdk.NewDec(int64(debtTokenOraclePrice)) + collateralTokenAuctionPrice := k.GetPriceFromLinearDecreaseFunction(dutchAuction.CollateralTokenAuctionPrice, tau, seconds) + dutchAuction.DebtTokenOraclePrice = sdk.NewDec(int64(twaDataDebt.Twa)) dutchAuction.CollateralTokenAuctionPrice = collateralTokenAuctionPrice err := k.SetAuction(ctx, dutchAuction) if err != nil { diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index 8abaaed57..085961eb3 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -22,6 +22,7 @@ type ( bankKeeper types.BankKeeper market expected.MarketKeeper asset expected.AssetKeeper + esm expected.EsmKeeper } ) @@ -39,6 +40,7 @@ func NewKeeper( bankKeeper types.BankKeeper, marketKeeper expected.MarketKeeper, assetKeeper expected.AssetKeeper, + esm expected.EsmKeeper, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -54,6 +56,7 @@ func NewKeeper( bankKeeper: bankKeeper, market: marketKeeper, asset: assetKeeper, + esm: esm, } } diff --git a/x/auctionsV2/keeper/maths.go b/x/auctionsV2/keeper/maths.go index 0e8b83c34..c2d484641 100644 --- a/x/auctionsV2/keeper/maths.go +++ b/x/auctionsV2/keeper/maths.go @@ -11,19 +11,14 @@ func (k Keeper) GetCollalteralTokenInitialPrice(price sdk.Int, premium sdk.Dec) return result } -func (k Keeper) GetCollalteralTokenEndPrice(price, discount sdk.Dec) sdk.Dec { - result := Multiply(price, discount) - return result -} - -func (k Keeper) getPriceFromLinearDecreaseFunction(top sdk.Dec, tau, dur sdk.Int) sdk.Dec { +func (k Keeper) GetPriceFromLinearDecreaseFunction(top sdk.Dec, tau, dur sdk.Int) sdk.Dec { result1 := tau.Sub(dur) result2 := top.Mul(result1.ToDec()) result3 := result2.Quo(tau.ToDec()) return result3 } -func (k Keeper) getOutflowTokenEndPrice(price, cusp sdk.Dec) sdk.Dec { +func (k Keeper) GetCollateralTokenEndPrice(price, cusp sdk.Dec) sdk.Dec { result := Multiply(price, cusp) return result } From 989f969f9ac75e55026ceb338587c3c78dfa8be9 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Fri, 5 May 2023 18:36:46 +0530 Subject: [PATCH 054/155] finalising dutch auction --- x/liquidationsV2/keeper/liquidate.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index c75643339..ad8b31393 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -87,7 +87,9 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error } //Checking if app has enabled liquidations or not - whitelistingData, found := k.GetAppIDByAppForLiquidation(ctx, vault.AppId) + // whitelistingData, found := k.GetAppIDByAppForLiquidation(ctx, vault.AppId) + whitelistingData, found := k.GetLiquidationWhiteListing(ctx, vault.AppId) + if !found { return fmt.Errorf("Liquidation not enabled for App ID %d", vault.AppId) } @@ -149,7 +151,7 @@ func (k Keeper) ReturnCoin(ctx sdk.Context, assetID uint64, amount sdk.Int) sdk. return sdk.NewCoin(asset.Denom, amount) } -func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Coin, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, bonusToBeGiven sdk.Int, initiatorType string, auctionType bool, isDebtCmst bool, pairId unit64) error { +func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Coin, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, bonusToBeGiven sdk.Int, initiatorType string, auctionType bool, isDebtCmst bool, pairId uint64) error { lockedVaultID := k.GetLockedVaultID(ctx) value := types.LockedVault{ From d8834abce1088364787f4b7d3f1d7c3fe689951e Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sun, 7 May 2023 02:24:51 +0530 Subject: [PATCH 055/155] refactoring auction-iterator --- proto/comdex/auctionsV2/v1beta1/auction.proto | 8 + x/auctionsV2/abci.go | 108 ++++++++ x/auctionsV2/keeper/auctions.go | 195 +++++++++---- x/auctionsV2/keeper/utils.go | 28 ++ x/auctionsV2/types/auction.pb.go | 262 +++++++++++------- x/liquidationsV2/keeper/liquidate.go | 24 +- 6 files changed, 462 insertions(+), 163 deletions(-) create mode 100644 x/auctionsV2/abci.go diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index 3c7d63e88..9b8d544fd 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -83,6 +83,14 @@ message Auctions{ // (gogoproto.moretags) = "yaml:\"auction_status\"" // ]; + uint64 collateral_asset_id = 15 [ + (gogoproto.moretags) = "yaml:\"collateral_asset_id\"" + ]; + uint64 debt_asset_id = 16 [ + (gogoproto.moretags) = "yaml:\"debt_asset_id\"" + ]; + + } message bidOwnerMapping{ diff --git a/x/auctionsV2/abci.go b/x/auctionsV2/abci.go new file mode 100644 index 000000000..1ee076556 --- /dev/null +++ b/x/auctionsV2/abci.go @@ -0,0 +1,108 @@ +package auction + +import ( + "fmt" + + "github.com/comdex-official/comdex/x/auction/expected" + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + + utils "github.com/comdex-official/comdex/types" + "github.com/comdex-official/comdex/x/auctionsV2/keeper" + "github.com/comdex-official/comdex/x/auctionsV2/types" +) + +func BeginBlocker(ctx sdk.Context, k keeper.Keeper, assetKeeper expected.AssetKeeper, collectorKeeper expected.CollectorKeeper, esmKeeper expected.EsmKeeper) { + + // defer telemetry.ModuleMeasureSince(types.ModuleName, ctx.BlockTime(), telemetry.MetricKeyBeginBlocker) + + + + k.AuctionIterator(ctx) + + // // auctionMapData, auctionMappingFound := collectorKeeper.GetAllAuctionMappingForApp(ctx) + // if auctionMappingFound { + // for _, data := range auctionMapData { + // killSwitchParams, _ := esmKeeper.GetKillSwitchData(ctx, data.AppId) + // esmStatus, found := esmKeeper.GetESMStatus(ctx, data.AppId) + // status := false + // if found { + // status = esmStatus.Status + // } + // _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { + // err1 := k.SurplusActivator(ctx, data, killSwitchParams, status) + // if err1 != nil { + // ctx.EventManager().EmitEvent( + // sdk.NewEvent( + // types.EventTypeSurplusActivatorErr, + // sdk.NewAttribute(types.DataAppID, fmt.Sprintf("%d", data.AppId)), + // sdk.NewAttribute(types.DataAssetID, fmt.Sprintf("%d", data.AssetId)), + // sdk.NewAttribute(types.DataAssetOutOraclePrice, fmt.Sprintf("%t", data.AssetOutOraclePrice)), + // sdk.NewAttribute(types.DataAssetOutPrice, fmt.Sprintf("%d", data.AssetOutPrice)), + // sdk.NewAttribute(types.DatIsAuctionActive, fmt.Sprintf("%t", data.IsAuctionActive)), + // sdk.NewAttribute(types.DataIsDebtAuction, fmt.Sprintf("%t", data.IsDebtAuction)), + // sdk.NewAttribute(types.DataIsDistributor, fmt.Sprintf("%t", data.IsDistributor)), + // sdk.NewAttribute(types.DataIsSurplusAuction, fmt.Sprintf("%t", data.IsSurplusAuction)), + // sdk.NewAttribute(types.KillSwitchParamsBreakerEnabled, fmt.Sprintf("%t", killSwitchParams.BreakerEnable)), + // sdk.NewAttribute(types.Status, fmt.Sprintf("%t", status)), + // ), + // ) + // ctx.Logger().Error("error in surplus activator") + // return err1 + // } + // return nil + // }) + // _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { + // err2 := k.DebtActivator(ctx, data, killSwitchParams, status) + // if err2 != nil { + // ctx.EventManager().EmitEvent( + // sdk.NewEvent( + // types.EventTypeDebtActivatorErr, + // sdk.NewAttribute(types.DataAppID, fmt.Sprintf("%d", data.AppId)), + // sdk.NewAttribute(types.DataAssetID, fmt.Sprintf("%d", data.AssetId)), + // sdk.NewAttribute(types.DataAssetOutOraclePrice, fmt.Sprintf("%t", data.AssetOutOraclePrice)), + // sdk.NewAttribute(types.DataAssetOutPrice, fmt.Sprintf("%d", data.AssetOutPrice)), + // sdk.NewAttribute(types.DatIsAuctionActive, fmt.Sprintf("%t", data.IsAuctionActive)), + // sdk.NewAttribute(types.DataIsDebtAuction, fmt.Sprintf("%t", data.IsDebtAuction)), + // sdk.NewAttribute(types.DataIsDistributor, fmt.Sprintf("%t", data.IsDistributor)), + // sdk.NewAttribute(types.DataIsSurplusAuction, fmt.Sprintf("%t", data.IsSurplusAuction)), + // sdk.NewAttribute(types.KillSwitchParamsBreakerEnabled, fmt.Sprintf("%t", killSwitchParams.BreakerEnable)), + // sdk.NewAttribute(types.Status, fmt.Sprintf("%t", status)), + // ), + // ) + // ctx.Logger().Error("error in debt activator") + // return err2 + // } + // return nil + // }) + // } + // } + + // apps, appsFound := assetKeeper.GetApps(ctx) + + // if appsFound { + // for _, app := range apps { + // err4 := k.RestartDutch(ctx, app.Id) + // if err4 != nil { + // ctx.EventManager().EmitEvent( + // sdk.NewEvent( + // types.EventTypeRestartDutchErr, + // sdk.NewAttribute(types.DataAppID, fmt.Sprintf("%d", app.Id)), + // ), + // ) + // ctx.Logger().Error("error in restart dutch activator") + // } + + // err6 := k.RestartLendDutch(ctx, app.Id) + // if err6 != nil { + // ctx.EventManager().EmitEvent( + // sdk.NewEvent( + // types.EventTypeRestartLendDutchErr, + // sdk.NewAttribute(types.DataAppID, fmt.Sprintf("%d", app.Id)), + // ), + // ) + // ctx.Logger().Error("error in restart lend dutch activator") + // } + // } + // } +} diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 1f805fb50..bde136ff8 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,9 +1,10 @@ package keeper import ( - utils "github.com/comdex-official/comdex/types" "time" + utils "github.com/comdex-official/comdex/types" + auctiontypes "github.com/comdex-official/comdex/x/auction/types" "github.com/comdex-official/comdex/x/auctionsV2/types" liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" @@ -83,6 +84,8 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), AppId: liquidationData.AppId, AuctionType: liquidationData.AuctionType, + CollateralAssetId: pair.AssetIn, + DebtAssetId: pair.AssetOut, } k.SetAuctionID(ctx, auctionData.AuctionId) @@ -110,7 +113,6 @@ func (k Keeper) EnglishAuctionActivator(ctx sdk.Context, liquidationData liquida } // englishAuctionParams := liquidationWhitelistingAppData.EnglishAuctionParam auctionParams, _ := k.GetAuctionParams(ctx) - auctionData := types.Auctions{ AuctionId: auctionID + 1, CollateralToken: liquidationData.CollateralToken, @@ -129,78 +131,151 @@ func (k Keeper) EnglishAuctionActivator(ctx sdk.Context, liquidationData liquida if err != nil { return err } - return nil - } -// DutchAuctionsIterator iterates over existing active dutch auctions and does 2 main job -// First: if auction time is complete and target not reached with collateral available then Restart -// Second: if not restarting update the price -func (k Keeper) DutchAuctionsIterator(ctx sdk.Context) error { - dutchAuctions := k.GetAuctions(ctx) - // SET current price of inflow token and outflow token - - for _, dutchAuction := range dutchAuctions { - lockedVault, found := k.LiquidationsV2.GetLockedVault(ctx, dutchAuction.AppId, dutchAuction.LockedVaultId) - if !found { - return auctiontypes.ErrorInvalidLockedVault - } +func (k Keeper) AuctionIterator(ctx sdk.Context) error { + + auctions := k.GetAuctions(ctx) + //Dutch Auction Model Followed for auction type true + for _, auction := range auctions { _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { - // First case to check if we have to restart the auction - if ctx.BlockTime().After(dutchAuction.EndTime) { - // restart - err := k.RestartDutchAuctions(ctx, dutchAuction, lockedVault) - if err != nil { - return err + + //Dutch Auction= true + if auction.AuctionType { + + esmStatus, found := k.esm.GetESMStatus(ctx, auction.AppId) + + if found && esmStatus.Status { + //Checking if auction price is supposed to be reduced or restared + + //Checking condition + + if ctx.BlockTime().After(auction.EndTime) { + //If restart - DO ESM specific operation + //MOst Probably Close Auction + + } else { + //Else reduce - normal operation + err := k.UpdateDutchAuctionPrice(ctx, auction) + if err != nil { + return err + } + + } + + } else if !found { + //This app is not eligible for ESM + //Continue normal operation + + //DO update + //then check if to be restarred , then restart + + if ctx.BlockTime().After(auction.EndTime) { + //Restart + err := k.RestartDutchAuctions(ctx, auction) + if err != nil { + return err + } + + } else { + //Else udate price params + err := k.UpdateDutchAuctionPrice(ctx, auction) + if err != nil { + return err + } + + } + } } else { - // Second case to only reduce the price - err := k.UpdateDutchAuctionsPrice(ctx, dutchAuction, lockedVault) - if err != nil { - return err - } + //English Auction=false + //Check if auction time has ended, then close auction + //English auction does not require price so no important operation + } return nil }) } + return nil } -func (k Keeper) RestartDutchAuctions(ctx sdk.Context, dutchAuction types.Auctions, lockedVault liquidationtypes.LockedVault) error { - esmStatus, found := k.esm.GetESMStatus(ctx, dutchAuction.AppId) +// DutchAuctionsIterator iterates over existing active dutch auctions and does 2 main job +// First: if auction time is complete and target not reached with collateral available then Restart +// Second: if not restarting update the price +// func (k Keeper) DutchAuctionsIterator(ctx sdk.Context) error { +// dutchAuctions := k.GetAuctions(ctx) +// // SET current price of inflow token and outflow token + +// for _, dutchAuction := range dutchAuctions { +// lockedVault, found := k.LiquidationsV2.GetLockedVault(ctx, dutchAuction.AppId, dutchAuction.LockedVaultId) +// if !found { +// return auctiontypes.ErrorInvalidLockedVault +// } +// _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { +// // First case to check if we have to restart the auction +// if ctx.BlockTime().After(dutchAuction.EndTime) { +// // restart +// err := k.RestartDutchAuctions(ctx, dutchAuction, lockedVault) +// if err != nil { +// return err +// } + +// } else { +// // Second case to only reduce the price +// err := k.UpdateDutchAuctionPrice(ctx, dutchAuction) +// if err != nil { +// return err +// } +// } +// return nil +// }) +// } +// return nil +// } + +func (k Keeper) RestartDutchAuctions(ctx sdk.Context, dutchAuction types.Auctions) error { auctionParams, _ := k.GetAuctionParams(ctx) - status := false - if found { - status = esmStatus.Status - } - if lockedVault.IsInternalKeeper { - if status { - // code goes here for collateral redemption in case of esm - return nil - } - } liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, dutchAuction.AppId) - if !liquidationWhitelistingAppData.IsDutchActivated { - return types.ErrDutchAuctionDisabled - } dutchAuctionParams := liquidationWhitelistingAppData.DutchAuctionParam - pair, _ := k.asset.GetPair(ctx, lockedVault.PairId) - twaDataCollateral, found := k.market.GetTwa(ctx, pair.AssetIn) + twaDataCollateral, found := k.market.GetTwa(ctx, dutchAuction.CollateralAssetId) if !found || !twaDataCollateral.IsPriceActive { return auctiontypes.ErrorPrices } + twaDataDebt, found := k.market.GetTwa(ctx, dutchAuction.DebtAssetId) + if !found || !twaDataDebt.IsPriceActive { + return auctiontypes.ErrorPrices + } + liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, dutchAuction.AppId, dutchAuction.LockedVaultId) + //Checking if DEBT token is CMST then setting its price to $1 , else all tokens price will come from oracle. + if liquidationData.IsDebtCmst { + twaDataDebt.Twa = 1000000 + } - collateralTokenCurrentPrice := twaDataCollateral.Twa - timeNow := ctx.BlockTime() - dutchAuction.StartTime = timeNow - dutchAuction.EndTime = timeNow.Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)) - collateralTokenInitialPrice := k.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(collateralTokenCurrentPrice), dutchAuctionParams.Premium) - dutchAuction.CollateralTokenAuctionPrice = collateralTokenInitialPrice - err := k.SetAuction(ctx, dutchAuction) + //Some params will come from the specific app and they could be configured by them , + //rest of the params like auction duration and fees and other params will be based on comdex to edit based on governance + //Understanding different Params: + //Premium : Initial Price i.e price of the collateral at which the auction will start + //Discount: Final Price , i.e less than the oracle price of the collateral asset and at this , auction would end + //Decrement Factor: Linear decrease in the price of the collateral every block is governed by this. + CollateralTokenInitialPrice := k.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), dutchAuctionParams.Premium) + // CollateralTokenEndPrice := k.getOutflowTokenEndPrice(CollateralTokenInitialPrice, dutchAuctionParams.Cusp) + + //Saving liquidation data to the auction struct + auctionData := types.Auctions{ + CollateralToken: liquidationData.CollateralToken, + DebtToken: liquidationData.TargetDebt, + CollateralTokenAuctionPrice: CollateralTokenInitialPrice, + CollateralTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))), + DebtTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))), + StartTime: ctx.BlockTime(), + EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), + } + err := k.SetAuction(ctx, auctionData) if err != nil { return err } @@ -208,26 +283,28 @@ func (k Keeper) RestartDutchAuctions(ctx sdk.Context, dutchAuction types.Auction return nil } -func (k Keeper) UpdateDutchAuctionsPrice(ctx sdk.Context, dutchAuction types.Auctions, lockedVault liquidationtypes.LockedVault) error { - +func (k Keeper) UpdateDutchAuctionPrice(ctx sdk.Context, dutchAuction types.Auctions) error { auctionParams, _ := k.GetAuctionParams(ctx) liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, dutchAuction.AppId) - if !liquidationWhitelistingAppData.IsDutchActivated { - return types.ErrDutchAuctionDisabled - } dutchAuctionParams := liquidationWhitelistingAppData.DutchAuctionParam - pair, _ := k.asset.GetPair(ctx, lockedVault.PairId) - twaDataDebt, found := k.market.GetTwa(ctx, pair.AssetOut) + twaDataCollateral, found := k.market.GetTwa(ctx, dutchAuction.CollateralAssetId) + if !found || !twaDataCollateral.IsPriceActive { + return auctiontypes.ErrorPrices + } + twaDataDebt, found := k.market.GetTwa(ctx, dutchAuction.DebtAssetId) if !found || !twaDataDebt.IsPriceActive { return auctiontypes.ErrorPrices } + liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, dutchAuction.AppId, dutchAuction.LockedVaultId) //Checking if DEBT token is CMST then setting its price to $1 , else all tokens price will come from oracle. - if lockedVault.IsDebtCmst { + if liquidationData.IsDebtCmst { twaDataDebt.Twa = 1000000 } + //Now calculating the auction price of the COllateral Token + numerator := dutchAuction.CollateralTokenAuctionPrice.Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) //cmdx CollateralTokenAuctionEndPrice := k.GetCollateralTokenEndPrice(dutchAuction.CollateralTokenAuctionPrice, dutchAuctionParams.Discount) diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go index e3f7f8b3b..5c9098204 100644 --- a/x/auctionsV2/keeper/utils.go +++ b/x/auctionsV2/keeper/utils.go @@ -1,7 +1,10 @@ package keeper import ( + "time" + "github.com/comdex-official/comdex/x/auctionsV2/types" + liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" protobuftypes "github.com/gogo/protobuf/types" @@ -48,6 +51,31 @@ func (k Keeper) SetAuction(ctx sdk.Context, auction types.Auctions) error { return nil } +// func (k Keeper) AddAuctionParams(ctx sdk.Context, liquidationData liquidationtypes.LockedVault,auctionID uint64) (auction types.Auctions, err error) { + +// auctionData := types.Auctions{ +// AuctionId: auctionID + 1, +// CollateralToken: liquidationData.CollateralToken, +// DebtToken: liquidationData.TargetDebt, +// CollateralTokenAuctionPrice: CollateralTokenInitialPrice, +// CollateralTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))), +// DebtTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))), +// LockedVaultId: liquidationData.LockedVaultId, +// StartTime: ctx.BlockTime(), +// EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), +// AppId: liquidationData.AppId, +// AuctionType: liquidationData.AuctionType, +// } + +// err := k.SetAuction(ctx, auctionData) +// if err != nil { +// return auction, err +// } + +// return auctionData, nil + +// } + func (k Keeper) DeleteAuction(ctx sdk.Context, auction types.Auctions) error { var ( diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index 6f329650e..041622d04 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -37,24 +37,26 @@ type Auctions struct { // (gogoproto.moretags) = "yaml:\"outflow_token_current_amount\"", // (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" // ]; - DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"inflow_token_target_amount"` + DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"inflow_token_target_amount"` // cosmos.base.v1beta1.Coin inflow_token_current_amount = 5 [ // (gogoproto.nullable) = false, // (gogoproto.moretags) = "yaml:\"inflow_token_current_amount\"", // (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" // ]; - ActiveBiddingId uint64 `protobuf:"varint,6,opt,name=active_bidding_id,json=activeBiddingId,proto3" json:"active_bidding_id,omitempty" yaml:"active_bidding_id"` - BiddingIds []*BidOwnerMapping `protobuf:"bytes,7,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` - BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` + ActiveBiddingId uint64 `protobuf:"varint,4,opt,name=active_bidding_id,json=activeBiddingId,proto3" json:"active_bidding_id,omitempty" yaml:"active_bidding_id"` + BiddingIds []*BidOwnerMapping `protobuf:"bytes,5,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` + BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` // price indicator only for dutch auctions - CollateralTokenAuctionPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=collateral_token_auction_price,json=collateralTokenAuctionPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_auction_price" yaml:"outflow_token_auction_price"` - CollateralTokenOraclePrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=collateral_token_oracle_price,json=collateralTokenOraclePrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_oracle_price" yaml:"outflow_token_oracle_price"` - DebtTokenOraclePrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=debt_token_oracle_price,json=debtTokenOraclePrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"debt_token_oracle_price" yaml:"inflow_token_oracle_price"` - LockedVaultId uint64 `protobuf:"varint,13,opt,name=locked_vault_id,json=lockedVaultId,proto3" json:"locked_vault_id,omitempty" yaml:"locked_vault_id"` - StartTime time.Time `protobuf:"bytes,15,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` - EndTime time.Time `protobuf:"bytes,16,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` - AppId uint64 `protobuf:"varint,18,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AuctionType bool `protobuf:"varint,19,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` + CollateralTokenAuctionPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=collateral_token_auction_price,json=collateralTokenAuctionPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_auction_price" yaml:"outflow_token_auction_price"` + CollateralTokenOraclePrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=collateral_token_oracle_price,json=collateralTokenOraclePrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_oracle_price" yaml:"outflow_token_oracle_price"` + DebtTokenOraclePrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=debt_token_oracle_price,json=debtTokenOraclePrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"debt_token_oracle_price" yaml:"inflow_token_oracle_price"` + LockedVaultId uint64 `protobuf:"varint,10,opt,name=locked_vault_id,json=lockedVaultId,proto3" json:"locked_vault_id,omitempty" yaml:"locked_vault_id"` + StartTime time.Time `protobuf:"bytes,11,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` + EndTime time.Time `protobuf:"bytes,12,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` + AppId uint64 `protobuf:"varint,13,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AuctionType bool `protobuf:"varint,14,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` + CollateralAssetId uint64 `protobuf:"varint,15,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` + DebtAssetId uint64 `protobuf:"varint,16,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` } func (m *Auctions) Reset() { *m = Auctions{} } @@ -160,6 +162,20 @@ func (m *Auctions) GetAuctionType() bool { return false } +func (m *Auctions) GetCollateralAssetId() uint64 { + if m != nil { + return m.CollateralAssetId + } + return 0 +} + +func (m *Auctions) GetDebtAssetId() uint64 { + if m != nil { + return m.DebtAssetId + } + return 0 +} + type BidOwnerMapping struct { BidId uint64 `protobuf:"varint,1,opt,name=bid_id,json=bidId,proto3" json:"bid_id,omitempty"` BidOwner string `protobuf:"bytes,2,opt,name=bid_owner,json=bidOwner,proto3" json:"bid_owner,omitempty"` @@ -222,57 +238,61 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 793 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4d, 0x6f, 0xeb, 0x44, - 0x14, 0x8d, 0xe1, 0xbd, 0xbc, 0x64, 0xf2, 0xaa, 0xbc, 0xfa, 0x7d, 0xd4, 0x4d, 0xa9, 0x9d, 0x7a, - 0xd1, 0x46, 0x48, 0xb5, 0xd5, 0xd2, 0x15, 0x3b, 0x5c, 0x40, 0x04, 0x09, 0x8a, 0x4c, 0x54, 0x21, - 0x36, 0xd6, 0xd8, 0x33, 0x31, 0xa3, 0x3a, 0x1e, 0xcb, 0x9e, 0xb4, 0xf4, 0x27, 0xb0, 0x41, 0x5d, - 0x21, 0xb1, 0xe2, 0xef, 0x74, 0xd9, 0x25, 0x62, 0x61, 0x50, 0xfa, 0x0f, 0xb2, 0x64, 0x85, 0xe6, - 0xc3, 0x75, 0x12, 0x8a, 0x4a, 0x56, 0xcd, 0xdc, 0xb9, 0xf7, 0x9c, 0x33, 0xd7, 0xe7, 0xde, 0x82, - 0x83, 0x88, 0x4e, 0x10, 0xfe, 0xd1, 0x85, 0xd3, 0x88, 0x11, 0x9a, 0x16, 0xe7, 0xc7, 0xee, 0xe5, - 0x51, 0x88, 0x19, 0x3c, 0xaa, 0x42, 0x4e, 0x96, 0x53, 0x46, 0xf5, 0x6d, 0x99, 0xe8, 0xd4, 0x89, - 0x8e, 0x4a, 0xec, 0xbd, 0x89, 0x69, 0x4c, 0x45, 0x96, 0xcb, 0x7f, 0xc9, 0x82, 0x9e, 0x15, 0x53, - 0x1a, 0x27, 0xd8, 0x15, 0xa7, 0x70, 0x3a, 0x76, 0x19, 0x99, 0xe0, 0x82, 0xc1, 0x49, 0xa6, 0x12, - 0xcc, 0x88, 0x16, 0x13, 0x5a, 0xb8, 0x21, 0x2c, 0xf0, 0x03, 0x69, 0x44, 0x89, 0x62, 0xb4, 0x7f, - 0xeb, 0x80, 0xd6, 0x27, 0x8a, 0x4d, 0x3f, 0x01, 0x40, 0x31, 0x07, 0x04, 0x19, 0x5a, 0x5f, 0x1b, - 0x3c, 0xf3, 0xde, 0xce, 0x4b, 0x6b, 0xf3, 0x1a, 0x4e, 0x92, 0x8f, 0xed, 0xfa, 0xce, 0xf6, 0xdb, - 0xea, 0x30, 0x44, 0xfa, 0x8d, 0x06, 0x5e, 0x45, 0x34, 0x49, 0x20, 0xc3, 0x39, 0x4c, 0x02, 0x46, - 0x2f, 0x70, 0x6a, 0xbc, 0xd7, 0xd7, 0x06, 0x9d, 0xe3, 0x6d, 0x47, 0xd2, 0x3b, 0x9c, 0xbe, 0x7a, - 0x8a, 0x73, 0x4a, 0x49, 0xea, 0x7d, 0x79, 0x5b, 0x5a, 0x8d, 0x79, 0x69, 0x6d, 0x49, 0xec, 0x55, - 0x00, 0xfb, 0xef, 0xd2, 0x3a, 0x88, 0x09, 0xfb, 0x61, 0x1a, 0x3a, 0x11, 0x9d, 0xb8, 0xea, 0x19, - 0xf2, 0xcf, 0x61, 0x81, 0x2e, 0x5c, 0x76, 0x9d, 0xe1, 0x42, 0x60, 0xf9, 0xdd, 0xba, 0x7a, 0xc4, - 0x8b, 0xf5, 0x9f, 0x35, 0x00, 0x10, 0x0e, 0x99, 0x12, 0xf3, 0xec, 0x29, 0x31, 0x23, 0x25, 0x66, - 0x4f, 0x8a, 0x21, 0xe9, 0x38, 0xa1, 0x57, 0xb2, 0x38, 0x60, 0x30, 0x8f, 0x31, 0x0b, 0xe0, 0x84, - 0x4e, 0x53, 0xb6, 0x96, 0xac, 0x36, 0x97, 0x20, 0x05, 0x7d, 0x01, 0x36, 0x61, 0xc4, 0xc8, 0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, 0x74, 0x57, 0x46, 0x58, 0x7f, - 0x0b, 0x9a, 0x7c, 0xa8, 0xaa, 0x1d, 0xed, 0x3f, 0x0f, 0x09, 0x1a, 0x22, 0x7d, 0x07, 0xf0, 0xf1, - 0x0a, 0x28, 0x4f, 0x15, 0x0b, 0xb8, 0xed, 0xb7, 0xaa, 0x52, 0xef, 0xeb, 0xdb, 0x99, 0xa9, 0xdd, - 0xcd, 0x4c, 0xed, 0xaf, 0x99, 0xa9, 0xdd, 0xdc, 0x9b, 0x8d, 0xbb, 0x7b, 0xb3, 0xf1, 0xfb, 0xbd, - 0xd9, 0xf8, 0xfe, 0x64, 0xc9, 0x29, 0x7c, 0x8d, 0x1c, 0xd2, 0xf1, 0x98, 0x44, 0x04, 0x26, 0xea, - 0xec, 0x2e, 0xfd, 0xeb, 0x12, 0xde, 0x09, 0x9b, 0xa2, 0x8b, 0x1f, 0xfd, 0x13, 0x00, 0x00, 0xff, - 0xff, 0xde, 0xcc, 0x14, 0x95, 0xdc, 0x06, 0x00, 0x00, + // 852 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4f, 0x8f, 0xdb, 0x44, + 0x14, 0x5f, 0xd3, 0xee, 0x36, 0x99, 0xec, 0x92, 0xae, 0xbb, 0x6d, 0xdd, 0x2c, 0xb5, 0xd3, 0x39, + 0xb4, 0x11, 0x52, 0x6d, 0x75, 0xe9, 0x09, 0x71, 0xa9, 0x0b, 0x88, 0x20, 0xd1, 0xa2, 0x21, 0xaa, + 0x10, 0x17, 0x6b, 0xec, 0x99, 0x84, 0xd1, 0x3a, 0x1e, 0xcb, 0x9e, 0x6c, 0xd9, 0x8f, 0xc0, 0x05, + 0xed, 0x09, 0x89, 0x0f, 0xc1, 0xf7, 0xe8, 0xb1, 0x47, 0xc4, 0xc1, 0xa0, 0xdd, 0x6f, 0xe0, 0x23, + 0x27, 0x34, 0x7f, 0xb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x3c, 0x5d, 0xf1, + 0xad, 0x1c, 0x6a, 0x8f, 0xf9, 0x74, 0xca, 0x12, 0x86, 0x53, 0xb3, 0x0e, 0x56, 0x1e, 0x52, 0xe5, + 0xe4, 0x78, 0x47, 0x7d, 0xd3, 0x4f, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x43, 0x35, 0x4d, + 0x6a, 0x07, 0x00, 0x00, } func (m *Auctions) Marshal() (dAtA []byte, err error) { @@ -295,6 +315,18 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.DebtAssetId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.DebtAssetId)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.CollateralAssetId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.CollateralAssetId)) + i-- + dAtA[i] = 0x78 + } if m.AuctionType { i-- if m.AuctionType { @@ -303,16 +335,12 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x98 + dAtA[i] = 0x70 } if m.AppId != 0 { i = encodeVarintAuction(dAtA, i, uint64(m.AppId)) i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x90 + dAtA[i] = 0x68 } n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) if err1 != nil { @@ -321,9 +349,7 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n1 i = encodeVarintAuction(dAtA, i, uint64(n1)) i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 + dAtA[i] = 0x62 n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) if err2 != nil { return 0, err2 @@ -331,11 +357,11 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n2 i = encodeVarintAuction(dAtA, i, uint64(n2)) i-- - dAtA[i] = 0x7a + dAtA[i] = 0x5a if m.LockedVaultId != 0 { i = encodeVarintAuction(dAtA, i, uint64(m.LockedVaultId)) i-- - dAtA[i] = 0x68 + dAtA[i] = 0x50 } { size := m.DebtTokenOraclePrice.Size() @@ -346,7 +372,7 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x62 + dAtA[i] = 0x4a { size := m.CollateralTokenOraclePrice.Size() i -= size @@ -356,7 +382,7 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x52 + dAtA[i] = 0x42 { size := m.CollateralTokenAuctionPrice.Size() i -= size @@ -366,7 +392,7 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x4a + dAtA[i] = 0x3a { size := m.BidFactor.Size() i -= size @@ -376,7 +402,7 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x42 + dAtA[i] = 0x32 if len(m.BiddingIds) > 0 { for iNdEx := len(m.BiddingIds) - 1; iNdEx >= 0; iNdEx-- { { @@ -388,13 +414,13 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a + dAtA[i] = 0x2a } } if m.ActiveBiddingId != 0 { i = encodeVarintAuction(dAtA, i, uint64(m.ActiveBiddingId)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x20 } { size, err := m.DebtToken.MarshalToSizedBuffer(dAtA[:i]) @@ -405,7 +431,7 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a { size, err := m.CollateralToken.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -506,12 +532,18 @@ func (m *Auctions) Size() (n int) { l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) n += 1 + l + sovAuction(uint64(l)) l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) - n += 2 + l + sovAuction(uint64(l)) + n += 1 + l + sovAuction(uint64(l)) if m.AppId != 0 { - n += 2 + sovAuction(uint64(m.AppId)) + n += 1 + sovAuction(uint64(m.AppId)) } if m.AuctionType { - n += 3 + n += 2 + } + if m.CollateralAssetId != 0 { + n += 1 + sovAuction(uint64(m.CollateralAssetId)) + } + if m.DebtAssetId != 0 { + n += 2 + sovAuction(uint64(m.DebtAssetId)) } return n } @@ -619,7 +651,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DebtToken", wireType) } @@ -652,7 +684,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ActiveBiddingId", wireType) } @@ -671,7 +703,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { break } } - case 7: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BiddingIds", wireType) } @@ -705,7 +737,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 8: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BidFactor", wireType) } @@ -739,7 +771,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 9: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenAuctionPrice", wireType) } @@ -773,7 +805,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 10: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenOraclePrice", wireType) } @@ -807,7 +839,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 12: + case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenOraclePrice", wireType) } @@ -841,7 +873,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 13: + case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field LockedVaultId", wireType) } @@ -860,7 +892,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { break } } - case 15: + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) } @@ -893,7 +925,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 16: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) } @@ -926,7 +958,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 18: + case 13: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) } @@ -945,7 +977,7 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { break } } - case 19: + case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AuctionType", wireType) } @@ -965,6 +997,44 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { } } m.AuctionType = bool(v != 0) + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralAssetId", wireType) + } + m.CollateralAssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CollateralAssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtAssetId", wireType) + } + m.DebtAssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DebtAssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipAuction(dAtA[iNdEx:]) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index ad8b31393..e24f493be 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -128,7 +128,14 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error isCMST := !extPair.AssetOutOraclePrice //Creating locked vault struct , which will trigger auction - err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "vault", whitelistingData.AuctionType, isCMST, extPair.PairId) + //This function will only triggger dutch auction + //before creating locked vault, checking that dutch auction is already there in the whitelisted liquidation data + if !whitelistingData.IsDutchActivated { + return fmt.Errorf("Error , dutch auction not activated by the app, this function is only to trigger dutch auctions %d", whitelistingData.IsDutchActivated) + + } + + err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "vault",whitelistingData.IsDutchActivated , isCMST, extPair.PairId) if err != nil { return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for Vault %d", vault.Id) } @@ -161,13 +168,13 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair ExtendedPairId: ExtendedPairId, Owner: Owner, CollateralToken: AmountIn, - DebtToken: AmountOut,//just a representation of the total debt the vault had incurred at the time of liquidation. // Target debt is a correct measure of what will get collected in the auction from bidders. + DebtToken: AmountOut, //just a representation of the total debt the vault had incurred at the time of liquidation. // Target debt is a correct measure of what will get collected in the auction from bidders. CurrentCollaterlisationRatio: collateralizationRatio, CollateralToBeAuctioned: AmountIn, - TargetDebt: AmountOut.Add(sdk.NewCoin(AmountOut.Denom,feesToBeCollected)).Add(sdk.NewCoin(AmountOut.Denom,bonusToBeGiven)),//to add debt+liquidation+auction bonus here---- + TargetDebt: AmountOut.Add(sdk.NewCoin(AmountOut.Denom, feesToBeCollected)).Add(sdk.NewCoin(AmountOut.Denom, bonusToBeGiven)), //to add debt+liquidation+auction bonus here---- LiquidationTimestamp: ctx.BlockTime(), - FeeToBeCollected: feesToBeCollected,//just for calculation purpose - BonusToBeGiven: bonusToBeGiven,//just for calculation purpose + FeeToBeCollected: feesToBeCollected, //just for calculation purpose + BonusToBeGiven: bonusToBeGiven, //just for calculation purpose IsInternalKeeper: isInternalKeeper, InternalKeeperAddress: internalKeeperAddress, IsExternalKeeper: isExternalKeeper, @@ -177,16 +184,15 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair IsDebtCmst: isDebtCmst, PairId: pairId, } - //To understand a condition in which case target debt becomes equal to dollar value of collateral token + //To understand a condition in which case target debt becomes equal to dollar value of collateral token //at some point in the auction //1. what happens in that case - //2. what if the bid on the auction makes the auction lossy, + //2. what if the bid on the auction makes the auction lossy, //should be use the liquidation penalty ? most probably yes to cover the difference. //what if then liquidation penalty still falls short, should we then reduce the auction bonus from the debt , to make things even? //will this be enough to make sure auction does not not gets bid due to collateral not being able to cover the debt? //can a case occur in which liquidation penalty and auction bonus are still not enough? - k.SetLockedVault(ctx, value) k.SetLockedVaultID(ctx, value.LockedVaultId) //Call auction activator @@ -200,6 +206,8 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair return nil } +// + func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { borrows, found := k.lend.GetBorrows(ctx) params := k.GetParams(ctx) From f3ef7547e9c2d9f86cccc9f6b861d852ec75aeb5 Mon Sep 17 00:00:00 2001 From: Pratik Date: Sun, 7 May 2023 02:36:01 +0530 Subject: [PATCH 056/155] updating liquidate borrow -> complete liquidations --- x/liquidationsV2/keeper/liquidate.go | 188 +++++---------------------- 1 file changed, 32 insertions(+), 156 deletions(-) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index c75643339..2a62eafde 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -3,8 +3,6 @@ package keeper import ( "fmt" - assettypes "github.com/comdex-official/comdex/x/asset/types" - auctiontypes "github.com/comdex-official/comdex/x/auctionsV2/types" lendtypes "github.com/comdex-official/comdex/x/lend/types" utils "github.com/comdex-official/comdex/types" @@ -87,7 +85,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error } //Checking if app has enabled liquidations or not - whitelistingData, found := k.GetAppIDByAppForLiquidation(ctx, vault.AppId) + whitelistingData, found := k.GetLiquidationWhiteListing(ctx, vault.AppId) if !found { return fmt.Errorf("Liquidation not enabled for App ID %d", vault.AppId) } @@ -149,7 +147,7 @@ func (k Keeper) ReturnCoin(ctx sdk.Context, assetID uint64, amount sdk.Int) sdk. return sdk.NewCoin(asset.Denom, amount) } -func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Coin, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, bonusToBeGiven sdk.Int, initiatorType string, auctionType bool, isDebtCmst bool, pairId unit64) error { +func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Coin, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, bonusToBeGiven sdk.Int, initiatorType string, auctionType bool, isDebtCmst bool, pairId uint64) error { lockedVaultID := k.GetLockedVaultID(ctx) value := types.LockedVault{ @@ -159,13 +157,13 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair ExtendedPairId: ExtendedPairId, Owner: Owner, CollateralToken: AmountIn, - DebtToken: AmountOut,//just a representation of the total debt the vault had incurred at the time of liquidation. // Target debt is a correct measure of what will get collected in the auction from bidders. + DebtToken: AmountOut, //just a representation of the total debt the vault had incurred at the time of liquidation. // Target debt is a correct measure of what will get collected in the auction from bidders. CurrentCollaterlisationRatio: collateralizationRatio, CollateralToBeAuctioned: AmountIn, - TargetDebt: AmountOut.Add(sdk.NewCoin(AmountOut.Denom,feesToBeCollected)).Add(sdk.NewCoin(AmountOut.Denom,bonusToBeGiven)),//to add debt+liquidation+auction bonus here---- + TargetDebt: AmountOut.Add(sdk.NewCoin(AmountOut.Denom, feesToBeCollected)).Add(sdk.NewCoin(AmountOut.Denom, bonusToBeGiven)), //to add debt+liquidation+auction bonus here---- LiquidationTimestamp: ctx.BlockTime(), - FeeToBeCollected: feesToBeCollected,//just for calculation purpose - BonusToBeGiven: bonusToBeGiven,//just for calculation purpose + FeeToBeCollected: feesToBeCollected, //just for calculation purpose + BonusToBeGiven: bonusToBeGiven, //just for calculation purpose IsInternalKeeper: isInternalKeeper, InternalKeeperAddress: internalKeeperAddress, IsExternalKeeper: isExternalKeeper, @@ -175,16 +173,15 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair IsDebtCmst: isDebtCmst, PairId: pairId, } - //To understand a condition in which case target debt becomes equal to dollar value of collateral token + //To understand a condition in which case target debt becomes equal to dollar value of collateral token //at some point in the auction //1. what happens in that case - //2. what if the bid on the auction makes the auction lossy, + //2. what if the bid on the auction makes the auction lossy, //should be use the liquidation penalty ? most probably yes to cover the difference. //what if then liquidation penalty still falls short, should we then reduce the auction bonus from the debt , to make things even? //will this be enough to make sure auction does not not gets bid due to collateral not being able to cover the debt? //can a case occur in which liquidation penalty and auction bonus are still not enough? - k.SetLockedVault(ctx, value) k.SetLockedVaultID(ctx, value.LockedVaultId) //Call auction activator @@ -218,99 +215,10 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { } newBorrowIDs := borrowIDs[start:end] for l := range newBorrowIDs { - _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { - borrowPos, found := k.lend.GetBorrow(ctx, newBorrowIDs[l]) - if !found { - return nil - } - if borrowPos.IsLiquidated { - return nil - } - - lendPair, _ := k.lend.GetLendPair(ctx, borrowPos.PairID) - lendPos, found := k.lend.GetLend(ctx, borrowPos.LendingID) - if !found { - return fmt.Errorf("lend Pos Not Found in Liquidation, liquidate_borrow.go for ID %d", borrowPos.LendingID) - } - pool, _ := k.lend.GetPool(ctx, lendPos.PoolID) - assetIn, _ := k.asset.GetAsset(ctx, lendPair.AssetIn) - assetOut, _ := k.asset.GetAsset(ctx, lendPair.AssetOut) - liqThreshold, _ := k.lend.GetAssetRatesParams(ctx, lendPair.AssetIn) - killSwitchParams, _ := k.esm.GetKillSwitchData(ctx, lendPos.AppID) - if killSwitchParams.BreakerEnable { - return fmt.Errorf("kill Switch is enabled in Liquidation, liquidate_borrow.go for ID %d", lendPos.AppID) - } - // calculating and updating the interest accumulated before checking for liquidations - borrowPos, err := k.lend.CalculateBorrowInterestForLiquidation(ctx, borrowPos.ID) - if err != nil { - return fmt.Errorf("error in calculating Borrow Interest before liquidation") - } - if !borrowPos.StableBorrowRate.Equal(sdk.ZeroDec()) { - borrowPos, err = k.lend.ReBalanceStableRates(ctx, borrowPos) - if err != nil { - return fmt.Errorf("error in re-balance stable rate check before liquidation") - } - } - - var currentCollateralizationRatio sdk.Dec - var firstTransitAssetID, secondTransitAssetID uint64 - // for getting transit assets details - for _, data := range pool.AssetData { - if data.AssetTransitType == 2 { - firstTransitAssetID = data.AssetID - } - if data.AssetTransitType == 3 { - secondTransitAssetID = data.AssetID - } - } - - liqThresholdBridgedAssetOne, _ := k.lend.GetAssetRatesParams(ctx, firstTransitAssetID) - liqThresholdBridgedAssetTwo, _ := k.lend.GetAssetRatesParams(ctx, secondTransitAssetID) - firstBridgedAsset, _ := k.asset.GetAsset(ctx, firstTransitAssetID) - - // there are three possible cases - // a. if borrow is from same pool - // b. if borrow is from first transit asset - // c. if borrow is from second transit asset - if borrowPos.BridgedAssetAmount.Amount.Equal(sdk.ZeroInt()) { // first condition - currentCollateralizationRatio, err = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) - if err != nil { - return err - } - if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold) { - err = k.UpdateLockedBorrows(ctx, pool, borrowPos, lendPos.Owner, liqThreshold, assetIn, assetOut, firstBridgedAsset, lendPos.AppID, currentCollateralizationRatio) - if err != nil { - return fmt.Errorf("error in first condition UpdateLockedBorrows in UpdateLockedBorrows , liquidate_borrow.go for ID ") - } - } - } else { - if borrowPos.BridgedAssetAmount.Denom == firstBridgedAsset.Denom { - currentCollateralizationRatio, err = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) - if err != nil { - return err - } - if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetOne.LiquidationThreshold)) { - err = k.UpdateLockedBorrows(ctx, pool, borrowPos, lendPos.Owner, liqThreshold, assetIn, assetOut, firstBridgedAsset, lendPos.AppID, currentCollateralizationRatio) - if err != nil { - return fmt.Errorf("error in second condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") - } - } - } else { - currentCollateralizationRatio, err = k.lend.CalculateCollateralizationRatio(ctx, borrowPos.AmountIn.Amount, assetIn, borrowPos.AmountOut.Amount.Add(borrowPos.InterestAccumulated.TruncateInt()), assetOut) - if err != nil { - return err - } - - if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetTwo.LiquidationThreshold)) { - err = k.UpdateLockedBorrows(ctx, pool, borrowPos, lendPos.Owner, liqThreshold, assetIn, assetOut, firstBridgedAsset, lendPos.AppID, currentCollateralizationRatio) - if err != nil { - return fmt.Errorf("error in third condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") - } - } - } - } - return nil - }) + err := k.LiquidateIndividualBorrow(ctx, newBorrowIDs[l]) + if err != nil { + return err + } } liquidationOffsetHolder.CurrentOffset = uint64(end) k.SetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix, liquidationOffsetHolder) @@ -318,55 +226,6 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { return nil } -func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, pool lendtypes.Pool, borrow lendtypes.BorrowAsset, owner string, assetRatesStats lendtypes.AssetRatesParams, assetIn, assetOut, firstBridgeAsset assettypes.Asset, appID uint64, currentCollateralizationRatio sdk.Dec) error { - firstBridgeAssetStats, _ := k.lend.GetAssetRatesParams(ctx, firstBridgeAsset.Id) - secondBridgeAssetStats, _ := k.lend.GetAssetRatesParams(ctx, firstBridgeAsset.Id) - - assetInTotal, _ := k.market.CalcAssetPrice(ctx, assetIn.Id, borrow.AmountIn.Amount) - assetOutTotal, _ := k.market.CalcAssetPrice(ctx, assetOut.Id, borrow.AmountOut.Amount) - - deductionPercentage, _ := sdk.NewDecFromStr("1.0") - - var c sdk.Dec - if !borrow.BridgedAssetAmount.Amount.Equal(sdk.ZeroInt()) { - if borrow.BridgedAssetAmount.Denom == firstBridgeAsset.Denom { - c = assetRatesStats.Ltv.Mul(firstBridgeAssetStats.Ltv) - } else { - c = assetRatesStats.Ltv.Mul(secondBridgeAssetStats.Ltv) - } - } else { - c = assetRatesStats.Ltv - } - // calculations for finding selloff amount and liquidationDeductionAmount - b := deductionPercentage.Add(assetRatesStats.LiquidationPenalty.Add(assetRatesStats.LiquidationBonus)) - totalIn := assetInTotal - totalOut := assetOutTotal - factor1 := c.Mul(totalIn) - factor2 := b.Mul(c) - numerator := totalOut.Sub(factor1) - denominator := deductionPercentage.Sub(factor2) - selloffAmount := numerator.Quo(denominator) // Dollar Value - aip, _ := k.market.CalcAssetPrice(ctx, assetIn.Id, sdk.OneInt()) - aop, _ := k.market.CalcAssetPrice(ctx, assetOut.Id, sdk.OneInt()) - bonusToBidderAmount := (selloffAmount.Mul(assetRatesStats.LiquidationBonus)).Quo(aop) - penaltyToReserveAmount := (selloffAmount.Mul(assetRatesStats.LiquidationPenalty)).Quo(aop) - sellOffAmt := selloffAmount.Quo(aip) - //TODO: sellOffAmt At oracle price currently - err := k.bank.SendCoinsFromModuleToModule(ctx, pool.ModuleName, auctiontypes.ModuleName, sdk.NewCoins(sdk.NewCoin(assetIn.Denom, sellOffAmt.TruncateInt()))) - if err != nil { - return err - } - borrow.IsLiquidated = true - k.lend.SetBorrow(ctx, borrow) - //updatedLockedVault.CollateralToBeAuctioned = selloffAmount.TruncateInt() - err = k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, sdk.NewCoin(assetIn.Denom, sellOffAmt.TruncateInt()), currentCollateralizationRatio, appID, false, false, "", "", bonusToBidderAmount.Add(penaltyToReserveAmount).TruncateInt(), "", true) - if err != nil { - return err - } - - return nil -} - func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) error { borrowPos, found := k.lend.GetBorrow(ctx, borrowID) if !found { @@ -427,7 +286,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro return err } if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold) { - err = k.UpdateLockedBorrows(ctx, pool, borrowPos, lendPos.Owner, liqThreshold, assetIn, assetOut, firstBridgedAsset, lendPos.AppID, currentCollateralizationRatio) + err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold) if err != nil { return fmt.Errorf("error in first condition UpdateLockedBorrows in UpdateLockedBorrows , liquidate_borrow.go for ID ") } @@ -439,7 +298,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro return err } if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetOne.LiquidationThreshold)) { - err = k.UpdateLockedBorrows(ctx, pool, borrowPos, lendPos.Owner, liqThreshold, assetIn, assetOut, firstBridgedAsset, lendPos.AppID, currentCollateralizationRatio) + err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold) if err != nil { return fmt.Errorf("error in second condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") } @@ -451,7 +310,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro } if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetTwo.LiquidationThreshold)) { - err = k.UpdateLockedBorrows(ctx, pool, borrowPos, lendPos.Owner, liqThreshold, assetIn, assetOut, firstBridgedAsset, lendPos.AppID, currentCollateralizationRatio) + err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold) if err != nil { return fmt.Errorf("error in third condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") } @@ -461,6 +320,23 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro return nil } +func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsset, owner string, appID uint64, currentCollateralizationRatio sdk.Dec, assetRatesStats lendtypes.AssetRatesParams) error { + borrow.IsLiquidated = true + k.lend.SetBorrow(ctx, borrow) + //Calculating Liquidation Fees + feesToBeCollected := sdk.NewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationPenalty).TruncateInt() + + //Calculating auction bonus to be given + auctionBonusToBeGiven := sdk.NewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationBonus).TruncateInt() + + err := k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, true, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "lend", true, false, 0) + if err != nil { + return err + } + + return nil +} + func (k Keeper) MsgLiquidate(ctx sdk.Context, liquidator string, liqType, id uint64) error { if liqType == 0 { err := k.LiquidateIndividualVault(ctx, id) From 125b3299589d1336d9c680e350a559bb21ce130e Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sun, 7 May 2023 13:41:22 +0530 Subject: [PATCH 057/155] refactoring auction-iterator --- x/auctionsV2/keeper/auctions.go | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index bde136ff8..6d84668e2 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -191,7 +191,7 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { } else { //English Auction=false - //Check if auction time has ended, then close auction + //Check if auction time has ended, then close auction - if there is at least a single bid //English auction does not require price so no important operation } @@ -266,16 +266,15 @@ func (k Keeper) RestartDutchAuctions(ctx sdk.Context, dutchAuction types.Auction // CollateralTokenEndPrice := k.getOutflowTokenEndPrice(CollateralTokenInitialPrice, dutchAuctionParams.Cusp) //Saving liquidation data to the auction struct - auctionData := types.Auctions{ - CollateralToken: liquidationData.CollateralToken, - DebtToken: liquidationData.TargetDebt, - CollateralTokenAuctionPrice: CollateralTokenInitialPrice, - CollateralTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))), - DebtTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))), - StartTime: ctx.BlockTime(), - EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), - } - err := k.SetAuction(ctx, auctionData) + //Only updating necessary params + + dutchAuction.CollateralTokenAuctionPrice = CollateralTokenInitialPrice + dutchAuction.CollateralTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))) + dutchAuction.DebtTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))) + dutchAuction.StartTime = ctx.BlockTime() + dutchAuction.EndTime = ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)) + + err := k.SetAuction(ctx, dutchAuction) if err != nil { return err } @@ -303,7 +302,14 @@ func (k Keeper) UpdateDutchAuctionPrice(ctx sdk.Context, dutchAuction types.Auct twaDataDebt.Twa = 1000000 } - //Now calculating the auction price of the COllateral Token + //Now calculating the auction price of the Collateral Token + + + + dutchAuction.CollateralTokenAuctionPrice = CollateralTokenInitialPrice + dutchAuction.CollateralTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))) + dutchAuction.DebtTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))) + numerator := dutchAuction.CollateralTokenAuctionPrice.Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) //cmdx CollateralTokenAuctionEndPrice := k.GetCollateralTokenEndPrice(dutchAuction.CollateralTokenAuctionPrice, dutchAuctionParams.Discount) @@ -316,6 +322,7 @@ func (k Keeper) UpdateDutchAuctionPrice(ctx sdk.Context, dutchAuction types.Auct collateralTokenAuctionPrice := k.GetPriceFromLinearDecreaseFunction(dutchAuction.CollateralTokenAuctionPrice, tau, seconds) dutchAuction.DebtTokenOraclePrice = sdk.NewDec(int64(twaDataDebt.Twa)) dutchAuction.CollateralTokenAuctionPrice = collateralTokenAuctionPrice + err := k.SetAuction(ctx, dutchAuction) if err != nil { return err From 249ff182803dbef4e08ae1a387397988d8addccb Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sun, 7 May 2023 21:28:24 +0530 Subject: [PATCH 058/155] refactoring english0-auction-iterator --- x/auctionsV2/keeper/auctions.go | 57 +++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 6d84668e2..0170aa5b7 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -145,9 +145,10 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { if auction.AuctionType { esmStatus, found := k.esm.GetESMStatus(ctx, auction.AppId) - + //FOr esm , can also check vault as initiator exists or not just to be sure if found && esmStatus.Status { //Checking if auction price is supposed to be reduced or restared + //Check here if initiator is vault , then for vault do esm trigger option accordingly //Checking condition @@ -157,7 +158,7 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { } else { //Else reduce - normal operation - err := k.UpdateDutchAuctionPrice(ctx, auction) + err := k.UpdateDutchAuction(ctx, auction) if err != nil { return err } @@ -173,14 +174,14 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { if ctx.BlockTime().After(auction.EndTime) { //Restart - err := k.RestartDutchAuctions(ctx, auction) + err := k.RestartDutchAuction(ctx, auction) if err != nil { return err } } else { //Else udate price params - err := k.UpdateDutchAuctionPrice(ctx, auction) + err := k.UpdateDutchAuction(ctx, auction) if err != nil { return err } @@ -193,6 +194,24 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { //English Auction=false //Check if auction time has ended, then close auction - if there is at least a single bid //English auction does not require price so no important operation + if ctx.BlockTime().After(auction.EndTime) { + + if auction.ActiveBiddingId != nil { + //If atleast there is one bidding on the auction + err := k.CloseEnglishAuction(ctx, auction) + if err != nil { + return err + } + + } else { + //Restart the auction by updating the end time param + err := k.RestartEnglishAuction(ctx, auction) + if err != nil { + return err + } + } + + } } return nil @@ -236,7 +255,7 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { // return nil // } -func (k Keeper) RestartDutchAuctions(ctx sdk.Context, dutchAuction types.Auctions) error { +func (k Keeper) RestartDutchAuction(ctx sdk.Context, dutchAuction types.Auctions) error { auctionParams, _ := k.GetAuctionParams(ctx) liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, dutchAuction.AppId) @@ -271,7 +290,7 @@ func (k Keeper) RestartDutchAuctions(ctx sdk.Context, dutchAuction types.Auction dutchAuction.CollateralTokenAuctionPrice = CollateralTokenInitialPrice dutchAuction.CollateralTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))) dutchAuction.DebtTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))) - dutchAuction.StartTime = ctx.BlockTime() + // dutchAuction.StartTime = ctx.BlockTime() dutchAuction.EndTime = ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)) err := k.SetAuction(ctx, dutchAuction) @@ -282,7 +301,7 @@ func (k Keeper) RestartDutchAuctions(ctx sdk.Context, dutchAuction types.Auction return nil } -func (k Keeper) UpdateDutchAuctionPrice(ctx sdk.Context, dutchAuction types.Auctions) error { +func (k Keeper) UpdateDutchAuction(ctx sdk.Context, dutchAuction types.Auctions) error { auctionParams, _ := k.GetAuctionParams(ctx) liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, dutchAuction.AppId) @@ -304,13 +323,10 @@ func (k Keeper) UpdateDutchAuctionPrice(ctx sdk.Context, dutchAuction types.Auct //Now calculating the auction price of the Collateral Token - - dutchAuction.CollateralTokenAuctionPrice = CollateralTokenInitialPrice dutchAuction.CollateralTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))) dutchAuction.DebtTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))) - numerator := dutchAuction.CollateralTokenAuctionPrice.Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) //cmdx CollateralTokenAuctionEndPrice := k.GetCollateralTokenEndPrice(dutchAuction.CollateralTokenAuctionPrice, dutchAuctionParams.Discount) @@ -329,3 +345,24 @@ func (k Keeper) UpdateDutchAuctionPrice(ctx sdk.Context, dutchAuction types.Auct } return nil } + +func (k Keeper) RestartEnglishAuction(ctx sdk.Context, englishAuction types.Auctions) error { + + auctionParams, _ := k.GetAuctionParams(ctx) + englishAuction.EndTime = ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)) + err := k.SetAuction(ctx, englishAuction) + if err != nil { + return err + } + return nil + +} + +func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctions) error { + + //Send Collateral To the user + //Delete Auction Data + + return nil + +} From 13cfd57e2187cb19976d80c0badaa9fdff56cf93 Mon Sep 17 00:00:00 2001 From: Pratik Date: Sun, 7 May 2023 23:23:42 +0530 Subject: [PATCH 059/155] updating price dec function --- x/auctionsV2/keeper/auctions.go | 22 +++++++++++++++------- x/auctionsV2/keeper/maths.go | 10 +++++----- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 0170aa5b7..7d618d14f 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -329,13 +329,21 @@ func (k Keeper) UpdateDutchAuction(ctx sdk.Context, dutchAuction types.Auctions) numerator := dutchAuction.CollateralTokenAuctionPrice.Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) //cmdx CollateralTokenAuctionEndPrice := k.GetCollateralTokenEndPrice(dutchAuction.CollateralTokenAuctionPrice, dutchAuctionParams.Discount) - denominator := dutchAuction.CollateralTokenAuctionPrice.Sub(CollateralTokenAuctionEndPrice) - resultant := numerator.Quo(denominator) - tau := sdk.NewInt(resultant.TruncateInt64()) - dur := ctx.BlockTime().Sub(dutchAuction.StartTime) - seconds := sdk.NewInt(int64(dur.Seconds())) - collateralTokenAuctionPrice := k.GetPriceFromLinearDecreaseFunction(dutchAuction.CollateralTokenAuctionPrice, tau, seconds) + timeToReachZeroPrice := numerator.Quo(denominator) + timeElapsed := ctx.BlockTime().Sub(dutchAuction.StartTime) + // Example: CollateralTokenAuctionPrice = 1.2 + // AuctionDurationSeconds = 10 unit + // numerator = 1.2*10 = 12, CollateralTokenAuctionEndPrice = 1.2*0.7 = 0.84 + // denominator = 1.2- 0.84 = 0.36 + // timeToReachZeroPrice = 12/0.36 = 33.3 unit + // now assuming auction just started + // timeElapsed = 0 + // collateralTokenAuctionPrice = GetPriceFromLinearDecreaseFunction(1.2, 33.3, 0) + // timeDifference = 33.3- 0 = 33.3 + // resultantPrice = 1.2 *33.3 + // currentPrice = 1.2*33.3/33.3 = 1.2 unit + collateralTokenAuctionPrice := k.GetPriceFromLinearDecreaseFunction(dutchAuction.CollateralTokenAuctionPrice, sdk.NewInt(timeToReachZeroPrice.TruncateInt64()), sdk.NewInt(int64(timeElapsed.Seconds()))) dutchAuction.DebtTokenOraclePrice = sdk.NewDec(int64(twaDataDebt.Twa)) dutchAuction.CollateralTokenAuctionPrice = collateralTokenAuctionPrice @@ -360,7 +368,7 @@ func (k Keeper) RestartEnglishAuction(ctx sdk.Context, englishAuction types.Auct func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctions) error { - //Send Collateral To the user + //Send Collateral To the user //Delete Auction Data return nil diff --git a/x/auctionsV2/keeper/maths.go b/x/auctionsV2/keeper/maths.go index c2d484641..0a0b0fa2a 100644 --- a/x/auctionsV2/keeper/maths.go +++ b/x/auctionsV2/keeper/maths.go @@ -11,11 +11,11 @@ func (k Keeper) GetCollalteralTokenInitialPrice(price sdk.Int, premium sdk.Dec) return result } -func (k Keeper) GetPriceFromLinearDecreaseFunction(top sdk.Dec, tau, dur sdk.Int) sdk.Dec { - result1 := tau.Sub(dur) - result2 := top.Mul(result1.ToDec()) - result3 := result2.Quo(tau.ToDec()) - return result3 +func (k Keeper) GetPriceFromLinearDecreaseFunction(CollateralTokenAuctionPrice sdk.Dec, timeToReachZeroPrice, timeElapsed sdk.Int) sdk.Dec { + timeDifference := timeToReachZeroPrice.Sub(timeElapsed) + resultantPrice := CollateralTokenAuctionPrice.Mul(timeDifference.ToDec()) + currentPrice := resultantPrice.Quo(timeToReachZeroPrice.ToDec()) + return currentPrice } func (k Keeper) GetCollateralTokenEndPrice(price, cusp sdk.Dec) sdk.Dec { From 0f8c31955215c46a2817718ea695a4b038e17a11 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Mon, 8 May 2023 01:58:02 +0530 Subject: [PATCH 060/155] refactoring market-order-bids --- proto/comdex/auctionsV2/v1beta1/tx.proto | 21 +- x/auctionsV2/handler.go | 12 +- x/auctionsV2/keeper/auctions.go | 6 +- x/auctionsV2/keeper/bid.go | 7 +- x/auctionsV2/keeper/msg_server.go | 35 ++ x/auctionsV2/keeper/utils.go | 8 +- x/auctionsV2/types/keys.go | 4 +- x/auctionsV2/types/tx.pb.go | 543 ++++++++++++++++++++++- 8 files changed, 606 insertions(+), 30 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/tx.proto b/proto/comdex/auctionsV2/v1beta1/tx.proto index 57b3e17ad..ed8c4acff 100644 --- a/proto/comdex/auctionsV2/v1beta1/tx.proto +++ b/proto/comdex/auctionsV2/v1beta1/tx.proto @@ -4,5 +4,24 @@ package comdex.auctionsV2.v1beta1; option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; -service Msg { + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option (gogoproto.equal_all) = false; +option (gogoproto.goproto_getters_all) = false; + + +message MsgPlaceMarketBidRequest { + uint64 auction_id = 1; + string bidder = 2; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; } + +message MsgPlaceMarketBidResponse{} + +service Msg { + rpc MsgPlaceMarketBid(MsgPlaceMarketBidRequest) returns (MsgPlaceMarketBidResponse); + + } + \ No newline at end of file diff --git a/x/auctionsV2/handler.go b/x/auctionsV2/handler.go index efc6cbd58..3c5756fdf 100644 --- a/x/auctionsV2/handler.go +++ b/x/auctionsV2/handler.go @@ -9,18 +9,20 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -// NewHandler ... + func NewHandler(k keeper.Keeper) sdk.Handler { - // this line is used by starport scaffolding # handler/msgServer + server := keeper.NewMsgServiceServer(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { - // this line is used by starport scaffolding # 1 + case *types.MsgPlaceMarketBid: + res, err := server.MsgPlaceMarketBid(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + return nil, sdkerrors.Wrapf(types.ErrorUnknownMsgType, "%T", msg) } } } diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 7d618d14f..c4b43c96a 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -322,8 +322,6 @@ func (k Keeper) UpdateDutchAuction(ctx sdk.Context, dutchAuction types.Auctions) } //Now calculating the auction price of the Collateral Token - - dutchAuction.CollateralTokenAuctionPrice = CollateralTokenInitialPrice dutchAuction.CollateralTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))) dutchAuction.DebtTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))) @@ -344,7 +342,6 @@ func (k Keeper) UpdateDutchAuction(ctx sdk.Context, dutchAuction types.Auctions) // resultantPrice = 1.2 *33.3 // currentPrice = 1.2*33.3/33.3 = 1.2 unit collateralTokenAuctionPrice := k.GetPriceFromLinearDecreaseFunction(dutchAuction.CollateralTokenAuctionPrice, sdk.NewInt(timeToReachZeroPrice.TruncateInt64()), sdk.NewInt(int64(timeElapsed.Seconds()))) - dutchAuction.DebtTokenOraclePrice = sdk.NewDec(int64(twaDataDebt.Twa)) dutchAuction.CollateralTokenAuctionPrice = collateralTokenAuctionPrice err := k.SetAuction(ctx, dutchAuction) @@ -361,7 +358,8 @@ func (k Keeper) RestartEnglishAuction(ctx sdk.Context, englishAuction types.Auct err := k.SetAuction(ctx, englishAuction) if err != nil { return err - } + }so gya kya? + return nil } diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 658cba66e..1c48ba981 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -1,9 +1,14 @@ package keeper import ( + "github.com/comdex-official/comdex/x/auctionsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" ) -func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, appID, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin) error { +func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auctions) error { + return nil +} + +func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auctions) error { return nil } diff --git a/x/auctionsV2/keeper/msg_server.go b/x/auctionsV2/keeper/msg_server.go index 403b9a8ed..de16dfbaa 100644 --- a/x/auctionsV2/keeper/msg_server.go +++ b/x/auctionsV2/keeper/msg_server.go @@ -1,7 +1,10 @@ package keeper import ( + "context" + "github.com/comdex-official/comdex/x/auctionsV2/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) type msgServer struct { @@ -15,3 +18,35 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { } var _ types.MsgServer = msgServer{} + +func (k msgServer) MsgPlaceMarketBid(goCtx context.Context, msg *types.MsgPlaceMarketBidRequest) (*types.MsgPlaceMarketBidResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + bidder, err := sdk.AccAddressFromBech32(msg.Bidder) + if err != nil { + return nil, err + } + auctionData, err := k.GetAuction(ctx, msg.AuctionId) + if err != nil { + + return nil, err + } + //From auction ID, checking the whether its an english or a dutch auction + //If true triggering Dutch Auction Bid Request + if auctionData.AuctionType { + + err = k.PlaceDutchAuctionBid(ctx, msg.AuctionId, bidder, msg.Amount, auctionData) + if err != nil { + return nil, err + } + + } else { + //Else ENGLISH - triggering English Auction Bid Request + err = k.PlaceEnglishAuctionBid(ctx, msg.AuctionId, bidder, msg.Amount, auctionData) + if err != nil { + return nil, err + } + } + + // ctx.GasMeter().ConsumeGas(types.DutchBidGas, "DutchBidGas") + return &types.MsgPlaceMarketBidResponse{}, nil +} diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go index 5c9098204..7b8dcdc6e 100644 --- a/x/auctionsV2/keeper/utils.go +++ b/x/auctionsV2/keeper/utils.go @@ -43,7 +43,7 @@ func (k Keeper) SetAuction(ctx sdk.Context, auction types.Auctions) error { var ( store = k.Store(ctx) - key = types.AuctionKey(auction.AppId, auction.AuctionId) + key = types.AuctionKey(auction.AuctionId) value = k.cdc.MustMarshal(&auction) ) @@ -80,16 +80,16 @@ func (k Keeper) DeleteAuction(ctx sdk.Context, auction types.Auctions) error { var ( store = k.Store(ctx) - key = types.AuctionKey(auction.AppId, auction.AuctionId) + key = types.AuctionKey(auction.AuctionId) ) store.Delete(key) return nil } -func (k Keeper) GetAuction(ctx sdk.Context, appID, auctionMappingID, auctionID uint64) (auction types.Auctions, err error) { +func (k Keeper) GetAuction(ctx sdk.Context, auctionID uint64) (auction types.Auctions, err error) { var ( store = k.Store(ctx) - key = types.AuctionKey(appID, auctionID) + key = types.AuctionKey(auctionID) value = store.Get(key) ) diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index b6321bbb4..8959d7baa 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -26,6 +26,6 @@ var ( AuctionKeyPrefix = []byte{0x02} ) -func AuctionKey(appID uint64, auctionID uint64) []byte { - return append(append(append(AuctionKeyPrefix, sdk.Uint64ToBigEndian(appID)...), sdk.Uint64ToBigEndian(auctionID)...)) +func AuctionKey(auctionID uint64) []byte { + return append(append(AuctionKeyPrefix, sdk.Uint64ToBigEndian(auctionID)...)) } diff --git a/x/auctionsV2/types/tx.pb.go b/x/auctionsV2/types/tx.pb.go index e96bb52ed..1b2395167 100644 --- a/x/auctionsV2/types/tx.pb.go +++ b/x/auctionsV2/types/tx.pb.go @@ -6,10 +6,16 @@ package types import ( context "context" fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -23,21 +29,113 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type MsgPlaceMarketBidRequest struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` +} + +func (m *MsgPlaceMarketBidRequest) Reset() { *m = MsgPlaceMarketBidRequest{} } +func (m *MsgPlaceMarketBidRequest) String() string { return proto.CompactTextString(m) } +func (*MsgPlaceMarketBidRequest) ProtoMessage() {} +func (*MsgPlaceMarketBidRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2c216a24ef98c1b4, []int{0} +} +func (m *MsgPlaceMarketBidRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPlaceMarketBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPlaceMarketBidRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPlaceMarketBidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPlaceMarketBidRequest.Merge(m, src) +} +func (m *MsgPlaceMarketBidRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgPlaceMarketBidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPlaceMarketBidRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPlaceMarketBidRequest proto.InternalMessageInfo + +type MsgPlaceMarketBidResponse struct { +} + +func (m *MsgPlaceMarketBidResponse) Reset() { *m = MsgPlaceMarketBidResponse{} } +func (m *MsgPlaceMarketBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPlaceMarketBidResponse) ProtoMessage() {} +func (*MsgPlaceMarketBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2c216a24ef98c1b4, []int{1} +} +func (m *MsgPlaceMarketBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPlaceMarketBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPlaceMarketBidResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPlaceMarketBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPlaceMarketBidResponse.Merge(m, src) +} +func (m *MsgPlaceMarketBidResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPlaceMarketBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPlaceMarketBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPlaceMarketBidResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgPlaceMarketBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceMarketBidRequest") + proto.RegisterType((*MsgPlaceMarketBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceMarketBidResponse") +} + func init() { proto.RegisterFile("comdex/auctionsV2/v1beta1/tx.proto", fileDescriptor_2c216a24ef98c1b4) } var fileDescriptor_2c216a24ef98c1b4 = []byte{ - // 144 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, - 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, - 0x84, 0xa8, 0xd1, 0x43, 0xa8, 0xd1, 0x83, 0xaa, 0x31, 0x62, 0xe5, 0x62, 0xf6, 0x2d, 0x4e, 0x77, - 0xf2, 0x3b, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, - 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x93, 0xf4, 0xcc, 0x92, - 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, 0x31, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, - 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0x8a, 0xe5, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, - 0x8b, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xeb, 0xa1, 0xe8, 0xb6, 0x9e, 0x00, 0x00, 0x00, + // 328 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0xbf, 0x4f, 0x3a, 0x31, + 0x14, 0xc0, 0xaf, 0x5f, 0x08, 0x09, 0xfd, 0x4e, 0x5e, 0x8c, 0x39, 0x30, 0x56, 0xc2, 0xc4, 0x62, + 0x1b, 0x7e, 0x24, 0xee, 0x38, 0x39, 0x90, 0x98, 0x1b, 0x18, 0x5c, 0x4c, 0xaf, 0x2d, 0x67, 0x23, + 0xdc, 0x43, 0xda, 0x33, 0xb8, 0xb8, 0xb9, 0x38, 0xf9, 0x67, 0xf8, 0xa7, 0x30, 0x32, 0x3a, 0x19, + 0x3d, 0xfe, 0x11, 0x03, 0xad, 0x1a, 0xa3, 0x0c, 0x6e, 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0xbf, 0x25, 0x39, + 0x8f, 0xfe, 0x70, 0xf1, 0x46, 0x82, 0xa7, 0x82, 0x04, 0x8b, 0x82, 0xa0, 0x65, 0x41, 0xd0, 0x6b, + 0x41, 0xd0, 0xe3, 0x8a, 0x04, 0xcb, 0x15, 0x09, 0x9e, 0x57, 0x24, 0x38, 0xef, 0xa5, 0xda, 0x5e, + 0xe6, 0xc9, 0xba, 0x3a, 0x73, 0x1d, 0x8e, 0x60, 0x34, 0xd2, 0x42, 0xf3, 0xb1, 0x8f, 0xd9, 0xb7, + 0x2d, 0xdb, 0xdb, 0xa9, 0x32, 0x49, 0x65, 0xb3, 0x90, 0xee, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x18, 0x49, 0xe5, 0xa4, 0x07, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -52,6 +150,7 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { + MsgPlaceMarketBid(ctx context.Context, in *MsgPlaceMarketBidRequest, opts ...grpc.CallOption) (*MsgPlaceMarketBidResponse, error) } type msgClient struct { @@ -62,22 +161,440 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) MsgPlaceMarketBid(ctx context.Context, in *MsgPlaceMarketBidRequest, opts ...grpc.CallOption) (*MsgPlaceMarketBidResponse, error) { + out := new(MsgPlaceMarketBidResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgPlaceMarketBid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { + MsgPlaceMarketBid(context.Context, *MsgPlaceMarketBidRequest) (*MsgPlaceMarketBidResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) MsgPlaceMarketBid(ctx context.Context, req *MsgPlaceMarketBidRequest) (*MsgPlaceMarketBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgPlaceMarketBid not implemented") +} + func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_MsgPlaceMarketBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPlaceMarketBidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgPlaceMarketBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgPlaceMarketBid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgPlaceMarketBid(ctx, req.(*MsgPlaceMarketBidRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.auctionsV2.v1beta1.Msg", HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{}, - Metadata: "comdex/auctionsV2/v1beta1/tx.proto", + Methods: []grpc.MethodDesc{ + { + MethodName: "MsgPlaceMarketBid", + Handler: _Msg_MsgPlaceMarketBid_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "comdex/auctionsV2/v1beta1/tx.proto", +} + +func (m *MsgPlaceMarketBidRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPlaceMarketBidRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPlaceMarketBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x12 + } + if m.AuctionId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgPlaceMarketBidResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPlaceMarketBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPlaceMarketBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgPlaceMarketBidRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovTx(uint64(m.AuctionId)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgPlaceMarketBidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MsgPlaceMarketBidRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPlaceMarketBidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPlaceMarketBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPlaceMarketBidResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPlaceMarketBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPlaceMarketBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) From 323be2023da2217f24e81cadbd852c077546928e Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Mon, 8 May 2023 01:59:03 +0530 Subject: [PATCH 061/155] refactoring market-order-bids --- x/auctionsV2/keeper/auctions.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index c4b43c96a..c0cd0f2e1 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -358,8 +358,7 @@ func (k Keeper) RestartEnglishAuction(ctx sdk.Context, englishAuction types.Auct err := k.SetAuction(ctx, englishAuction) if err != nil { return err - }so gya kya? - + } return nil } From b55640f825f8c1a6e191d149727374c0c37b8244 Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 8 May 2023 10:08:51 +0530 Subject: [PATCH 062/155] add proposal liquidation_whitelisting --- app/app.go | 3 +- proto/comdex/liquidationsV2/v1beta1/gov.proto | 2 +- x/liquidationsV2/client/cli/flags.go | 64 +++++++++++ x/liquidationsV2/client/cli/parse.go | 53 ++++++++++ x/liquidationsV2/client/cli/tx.go | 100 ++++++++++++++++++ x/liquidationsV2/client/proposal_handler.go | 11 ++ x/liquidationsV2/client/rest/tx.go | 29 +++++ x/liquidationsV2/handler.go | 16 +++ x/liquidationsV2/keeper/gov.go | 10 ++ x/liquidationsV2/keeper/liquidate.go | 6 +- x/liquidationsV2/types/errors.go | 5 +- x/liquidationsV2/types/gov.go | 55 ++++++++++ x/liquidationsV2/types/gov.pb.go | 89 ++++++++-------- 13 files changed, 393 insertions(+), 50 deletions(-) create mode 100644 x/liquidationsV2/client/cli/flags.go create mode 100644 x/liquidationsV2/client/cli/parse.go create mode 100644 x/liquidationsV2/client/proposal_handler.go create mode 100644 x/liquidationsV2/client/rest/tx.go create mode 100644 x/liquidationsV2/keeper/gov.go create mode 100644 x/liquidationsV2/types/gov.go diff --git a/app/app.go b/app/app.go index 068e8f256..d768c1104 100644 --- a/app/app.go +++ b/app/app.go @@ -805,7 +805,8 @@ func New( AddRoute(bandoraclemoduletypes.RouterKey, bandoraclemodule.NewFetchPriceHandler(app.BandoracleKeeper)). AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IbcKeeper.ClientKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IbcKeeper.ClientKeeper)). - AddRoute(liquiditytypes.RouterKey, liquidity.NewLiquidityProposalHandler(app.LiquidityKeeper)) + AddRoute(liquiditytypes.RouterKey, liquidity.NewLiquidityProposalHandler(app.LiquidityKeeper)). + AddRoute(newliqtypes.RouterKey, liquidationsV2.NewLiquidationsV2Handler(app.NewliqKeeper)) if len(wasmEnabledProposals) != 0 { govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, wasmEnabledProposals)) diff --git a/proto/comdex/liquidationsV2/v1beta1/gov.proto b/proto/comdex/liquidationsV2/v1beta1/gov.proto index 3af8e9ff1..40e895fbe 100644 --- a/proto/comdex/liquidationsV2/v1beta1/gov.proto +++ b/proto/comdex/liquidationsV2/v1beta1/gov.proto @@ -10,7 +10,7 @@ option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; option (gogoproto.equal_all) = false; option (gogoproto.goproto_getters_all) = false; -message WhitelistAppProposal { +message WhitelistLiquidationProposal { string title = 1 [(gogoproto.moretags) = "yaml:\"title\""]; string description = 2 [(gogoproto.moretags) = "yaml:\"description\""]; LiquidationWhiteListing whitelisting = 3 [(gogoproto.nullable) = false]; diff --git a/x/liquidationsV2/client/cli/flags.go b/x/liquidationsV2/client/cli/flags.go new file mode 100644 index 000000000..c3c38e1f3 --- /dev/null +++ b/x/liquidationsV2/client/cli/flags.go @@ -0,0 +1,64 @@ +package cli + +import ( + flag "github.com/spf13/pflag" + "strings" +) + +const ( + FlagWhitelistLiquidation = "add-liquidation-whitelisting" +) + +func ParseBoolFromString(s string) bool { + switch s { + case "1": + return true + default: + return false + } +} + +//func ParseUint64SliceFromString(s string, separator string) ([]uint64, error) { +// var parsedInts []uint64 +// for _, s := range strings.Split(s, separator) { +// s = strings.TrimSpace(s) +// +// parsed, err := strconv.ParseUint(s, 10, 64) +// if err != nil { +// return []uint64{}, err +// } +// parsedInts = append(parsedInts, parsed) +// } +// return parsedInts, nil +//} + +func ParseStringFromString(s string, separator string) ([]string, error) { + var parsedStrings []string + for _, s := range strings.Split(s, separator) { + s = strings.TrimSpace(s) + + parsedStrings = append(parsedStrings, s) + } + return parsedStrings, nil +} + +func FlagSetWhitelistLiquidation() *flag.FlagSet { + fs := flag.NewFlagSet("", flag.ContinueOnError) + + fs.String(FlagWhitelistLiquidation, "", "add liquidation whitelisting json file path") + return fs +} + +type createWhitelistLiquidationInputs struct { + AppId string `json:"app_id"` + Initiator string `json:"initiator"` + IsDutchActivated string `json:"is_dutch_activated"` + Premium string `json:"premium"` + Discount string `json:"discount"` + DecrementFactor string `json:"decrement_factor"` + IsEnglishActivated string `json:"is_english_activated"` + DecrementFactorEnglish string `json:"decrement_factor_english"` + Title string + Description string + Deposit string +} diff --git a/x/liquidationsV2/client/cli/parse.go b/x/liquidationsV2/client/cli/parse.go new file mode 100644 index 000000000..12da0fd36 --- /dev/null +++ b/x/liquidationsV2/client/cli/parse.go @@ -0,0 +1,53 @@ +package cli + +import ( + "bytes" + "encoding/json" + "fmt" + "github.com/spf13/pflag" + "os" +) + +type ( + XCreateWhitelistLiquidationMappingInputs createWhitelistLiquidationInputs +) + +type XCreateWhitelistLiquidationInputsExceptions struct { + XCreateWhitelistLiquidationMappingInputs + Other *string // Other won't raise an error +} + +func parseLiquidationWhitelistingFlags(fs *pflag.FlagSet) (*createWhitelistLiquidationInputs, error) { + whitelistLiquidation := &createWhitelistLiquidationInputs{} + whitelistLiquidationFile, _ := fs.GetString(FlagWhitelistLiquidation) + + if whitelistLiquidationFile == "" { + return nil, fmt.Errorf("must pass in add asset mapping json using the --%s flag", whitelistLiquidationFile) + } + + contents, err := os.ReadFile(whitelistLiquidationFile) + if err != nil { + return nil, err + } + + // make exception if unknown field exists + err = whitelistLiquidation.UnmarshalJSON(contents) + if err != nil { + return nil, err + } + + return whitelistLiquidation, nil +} + +func (release *createWhitelistLiquidationInputs) UnmarshalJSON(data []byte) error { + var createWhitelistLiquidationInputsE XCreateWhitelistLiquidationInputsExceptions + dec := json.NewDecoder(bytes.NewReader(data)) + dec.DisallowUnknownFields() // Force + + if err := dec.Decode(&createWhitelistLiquidationInputsE); err != nil { + return err + } + + *release = createWhitelistLiquidationInputs(createWhitelistLiquidationInputsE.XCreateWhitelistLiquidationMappingInputs) + return nil +} diff --git a/x/liquidationsV2/client/cli/tx.go b/x/liquidationsV2/client/cli/tx.go index fa2291c7f..f17367d05 100644 --- a/x/liquidationsV2/client/cli/tx.go +++ b/x/liquidationsV2/client/cli/tx.go @@ -4,6 +4,10 @@ import ( "fmt" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/client/cli" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + flag "github.com/spf13/pflag" "strconv" "time" @@ -73,3 +77,99 @@ func txLiquidateInternalKeeper() *cobra.Command { flags.AddTxFlagsToCmd(cmd) return cmd } + +func NewCmdSubmitWhitelistingLiquidationProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "add-liquidation-whitelisting [flags]", + Args: cobra.ExactArgs(0), + Short: "Submit liquidation whitelisting proposal", + Long: `Must provide path to a add liquidation whitelisting in JSON file (--add-liquidation-whitelisting) describing the it in an app to be created`, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + + txf, msg, err := WhitelistLiquidation(clientCtx, txf, cmd.Flags()) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) + }, + } + + cmd.Flags().AddFlagSet(FlagSetWhitelistLiquidation()) + cmd.Flags().String(cli.FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") + + return cmd +} + +func WhitelistLiquidation(clientCtx client.Context, txf tx.Factory, fs *flag.FlagSet) (tx.Factory, sdk.Msg, error) { + liquidationWhitelisting, err := parseLiquidationWhitelistingFlags(fs) + if err != nil { + return txf, nil, fmt.Errorf("failed to parse liquidationWhitelisting: %w", err) + } + from := clientCtx.GetFromAddress() + + appId, err := strconv.ParseUint(liquidationWhitelisting.AppId, 10, 64) + if err != nil { + return txf, nil, fmt.Errorf("failed to parse appId: %w", err) + } + + premium, err := sdk.NewDecFromStr(liquidationWhitelisting.Premium) + if err != nil { + return txf, nil, err + } + + discount, err := sdk.NewDecFromStr(liquidationWhitelisting.Discount) + if err != nil { + return txf, nil, err + } + + decrementFactor, err := strconv.ParseInt(liquidationWhitelisting.DecrementFactor, 10, 64) + if err != nil { + return txf, nil, fmt.Errorf("failed to parse decrementFactor: %w", err) + } + + decrementFactorEnglish, err := strconv.ParseInt(liquidationWhitelisting.DecrementFactorEnglish, 10, 64) + if err != nil { + return txf, nil, fmt.Errorf("failed to parse decrementFactor: %w", err) + } + + dutchAuctionParam := types.DutchAuctionParam{ + Premium: premium, + Discount: discount, + DecrementFactor: sdk.NewInt(decrementFactor), + } + englishAuctionParam := types.EnglishAuctionParam{DecrementFactor: sdk.NewInt(decrementFactorEnglish)} + + liquidationWhitelistingStruct := types.LiquidationWhiteListing{ + AppId: appId, + Initiator: ParseBoolFromString(liquidationWhitelisting.Initiator), + IsDutchActivated: ParseBoolFromString(liquidationWhitelisting.IsDutchActivated), + DutchAuctionParam: &dutchAuctionParam, + IsEnglishActivated: ParseBoolFromString(liquidationWhitelisting.IsEnglishActivated), + EnglishAuctionParam: &englishAuctionParam, + } + + deposit, err := sdk.ParseCoinsNormalized(liquidationWhitelisting.Deposit) + if err != nil { + return txf, nil, err + } + + content := types.NewLiquidationWhiteListingProposal(liquidationWhitelisting.Title, liquidationWhitelisting.Description, liquidationWhitelistingStruct) + + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return txf, nil, err + } + + if err = msg.ValidateBasic(); err != nil { + return txf, nil, err + } + + return txf, msg, nil +} diff --git a/x/liquidationsV2/client/proposal_handler.go b/x/liquidationsV2/client/proposal_handler.go new file mode 100644 index 000000000..2db6adcc5 --- /dev/null +++ b/x/liquidationsV2/client/proposal_handler.go @@ -0,0 +1,11 @@ +package client + +import ( + "github.com/comdex-official/comdex/x/liquidationsV2/client/cli" + "github.com/comdex-official/comdex/x/liquidationsV2/client/rest" + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" +) + +var LiquidationsV2Handler = []govclient.ProposalHandler{ + govclient.NewProposalHandler(cli.NewCmdSubmitWhitelistingLiquidationProposal, rest.AddNewWhitelistingLiquidationRESTHandler), +} diff --git a/x/liquidationsV2/client/rest/tx.go b/x/liquidationsV2/client/rest/tx.go new file mode 100644 index 000000000..5536b81a5 --- /dev/null +++ b/x/liquidationsV2/client/rest/tx.go @@ -0,0 +1,29 @@ +package rest + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/types/rest" + govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest" + "net/http" +) + +type ( + WhitelistingLiquidationRequest struct{} +) + +func AddNewWhitelistingLiquidationRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "add-liquidation-whitelisting", + Handler: WhitelistingLiquidationRequestRESTHandler(clientCtx), + } +} + +func WhitelistingLiquidationRequestRESTHandler(clientCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req WhitelistingLiquidationRequest + + if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) { + return + } + } +} diff --git a/x/liquidationsV2/handler.go b/x/liquidationsV2/handler.go index 90f808169..7dbf74f1f 100644 --- a/x/liquidationsV2/handler.go +++ b/x/liquidationsV2/handler.go @@ -5,6 +5,7 @@ import ( "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) // NewHandler ... @@ -23,3 +24,18 @@ func NewHandler(k keeper.Keeper) sdk.Handler { } } } + +func NewLiquidationsV2Handler(k keeper.Keeper) govtypes.Handler { + return func(ctx sdk.Context, content govtypes.Content) error { + switch c := content.(type) { + case *types.WhitelistLiquidationProposal: + return handleWhitelistLiquidationProposal(ctx, k, c) + default: + return sdkerrors.Wrapf(types.ErrorUnknownProposalType, "%T", c) + } + } +} + +func handleWhitelistLiquidationProposal(ctx sdk.Context, k keeper.Keeper, p *types.WhitelistLiquidationProposal) error { + return k.HandleWhitelistLiquidationProposal(ctx, p) +} diff --git a/x/liquidationsV2/keeper/gov.go b/x/liquidationsV2/keeper/gov.go new file mode 100644 index 000000000..4f581c912 --- /dev/null +++ b/x/liquidationsV2/keeper/gov.go @@ -0,0 +1,10 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/liquidationsV2/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) HandleWhitelistLiquidationProposal(ctx sdk.Context, p *types.WhitelistLiquidationProposal) error { + return k.WhitelistLiquidation(ctx, p.Whitelisting) +} diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index df8c1421b..92e915b72 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - lendtypes "github.com/comdex-official/comdex/x/lend/types" utils "github.com/comdex-official/comdex/types" @@ -390,3 +389,8 @@ func (k Keeper) GetLiquidationWhiteListing(ctx sdk.Context, appId uint64) (liqui k.cdc.MustUnmarshal(value, &liquidationWhiteListing) return liquidationWhiteListing, true } + +func (k Keeper) WhitelistLiquidation(ctx sdk.Context, msg types.LiquidationWhiteListing) error { + k.SetLiquidationWhiteListing(ctx, msg) + return nil +} diff --git a/x/liquidationsV2/types/errors.go b/x/liquidationsV2/types/errors.go index 976466c36..4a59c9449 100644 --- a/x/liquidationsV2/types/errors.go +++ b/x/liquidationsV2/types/errors.go @@ -8,6 +8,7 @@ import ( // x/liquidationsV2 module sentinel errors var ( - ErrVaultIDInvalid = sdkerrors.Register(ModuleName, 1501, "Vault Id invalid") - ErrorUnknownMsgType = sdkerrors.Register(ModuleName, 1502, "Unknown msg type") + ErrVaultIDInvalid = sdkerrors.Register(ModuleName, 1501, "Vault Id invalid") + ErrorUnknownMsgType = sdkerrors.Register(ModuleName, 1502, "Unknown msg type") + ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 1503, "unknown proposal type") ) diff --git a/x/liquidationsV2/types/gov.go b/x/liquidationsV2/types/gov.go new file mode 100644 index 000000000..e16671d00 --- /dev/null +++ b/x/liquidationsV2/types/gov.go @@ -0,0 +1,55 @@ +package types + +import ( + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +const ( + ProposalWhitelistLiquidation = "AddWhitelistLiquidation" +) + +func init() { + govtypes.RegisterProposalType(ProposalWhitelistLiquidation) + govtypes.RegisterProposalTypeCodec(&WhitelistLiquidationProposal{}, "comdex/AddWhitelistLiquidation") +} + +var ( + _ govtypes.Content = &WhitelistLiquidationProposal{} +) + +func NewLiquidationWhiteListingProposal(title, description string, liquidationWhiteListing LiquidationWhiteListing) govtypes.Content { + return &WhitelistLiquidationProposal{ + Title: title, + Description: description, + Whitelisting: liquidationWhiteListing, + } +} + +func (p *WhitelistLiquidationProposal) GetTitle() string { + return p.Title +} + +func (p *WhitelistLiquidationProposal) GetDescription() string { + return p.Description +} +func (p *WhitelistLiquidationProposal) ProposalRoute() string { return RouterKey } + +func (p *WhitelistLiquidationProposal) ProposalType() string { return ProposalWhitelistLiquidation } + +func (p *WhitelistLiquidationProposal) ValidateBasic() error { + err := govtypes.ValidateAbstract(p) + if err != nil { + return err + } + + if err := p.Whitelisting.Validate(); err != nil { + return err + } + + return nil +} + +func (m *LiquidationWhiteListing) Validate() error { + //TODO: add conditions + return nil +} diff --git a/x/liquidationsV2/types/gov.pb.go b/x/liquidationsV2/types/gov.pb.go index dc08a356a..575d93ae7 100644 --- a/x/liquidationsV2/types/gov.pb.go +++ b/x/liquidationsV2/types/gov.pb.go @@ -25,24 +25,24 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type WhitelistAppProposal struct { +type WhitelistLiquidationProposal struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` Whitelisting LiquidationWhiteListing `protobuf:"bytes,3,opt,name=whitelisting,proto3" json:"whitelisting"` } -func (m *WhitelistAppProposal) Reset() { *m = WhitelistAppProposal{} } -func (m *WhitelistAppProposal) String() string { return proto.CompactTextString(m) } -func (*WhitelistAppProposal) ProtoMessage() {} -func (*WhitelistAppProposal) Descriptor() ([]byte, []int) { +func (m *WhitelistLiquidationProposal) Reset() { *m = WhitelistLiquidationProposal{} } +func (m *WhitelistLiquidationProposal) String() string { return proto.CompactTextString(m) } +func (*WhitelistLiquidationProposal) ProtoMessage() {} +func (*WhitelistLiquidationProposal) Descriptor() ([]byte, []int) { return fileDescriptor_4fbf1b0be7d4e97b, []int{0} } -func (m *WhitelistAppProposal) XXX_Unmarshal(b []byte) error { +func (m *WhitelistLiquidationProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *WhitelistAppProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *WhitelistLiquidationProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_WhitelistAppProposal.Marshal(b, m, deterministic) + return xxx_messageInfo_WhitelistLiquidationProposal.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -52,20 +52,20 @@ func (m *WhitelistAppProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *WhitelistAppProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_WhitelistAppProposal.Merge(m, src) +func (m *WhitelistLiquidationProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_WhitelistLiquidationProposal.Merge(m, src) } -func (m *WhitelistAppProposal) XXX_Size() int { +func (m *WhitelistLiquidationProposal) XXX_Size() int { return m.Size() } -func (m *WhitelistAppProposal) XXX_DiscardUnknown() { - xxx_messageInfo_WhitelistAppProposal.DiscardUnknown(m) +func (m *WhitelistLiquidationProposal) XXX_DiscardUnknown() { + xxx_messageInfo_WhitelistLiquidationProposal.DiscardUnknown(m) } -var xxx_messageInfo_WhitelistAppProposal proto.InternalMessageInfo +var xxx_messageInfo_WhitelistLiquidationProposal proto.InternalMessageInfo func init() { - proto.RegisterType((*WhitelistAppProposal)(nil), "comdex.liquidationsV2.v1beta1.WhitelistAppProposal") + proto.RegisterType((*WhitelistLiquidationProposal)(nil), "comdex.liquidationsV2.v1beta1.WhitelistLiquidationProposal") } func init() { @@ -73,32 +73,31 @@ func init() { } var fileDescriptor_4fbf1b0be7d4e97b = []byte{ - // 339 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xcd, 0x4e, 0x3a, 0x31, - 0x14, 0xc5, 0xa7, 0xff, 0x0f, 0x13, 0x07, 0x16, 0x66, 0x42, 0x0c, 0x21, 0xb1, 0x43, 0x66, 0xa1, - 0x6c, 0x98, 0x06, 0x4c, 0x0c, 0x71, 0x27, 0x6b, 0x16, 0x86, 0x85, 0x26, 0xac, 0xec, 0x0c, 0xa5, - 0x34, 0xe9, 0x70, 0x2b, 0x2d, 0x28, 0x6f, 0xe1, 0x63, 0xf8, 0x28, 0x2c, 0x59, 0x1a, 0x17, 0x44, - 0x87, 0x37, 0xe0, 0x09, 0x0c, 0xd3, 0x41, 0x21, 0x26, 0xec, 0x7a, 0xcf, 0xf9, 0xdd, 0x9e, 0x9b, - 0xe3, 0x5e, 0xc4, 0x90, 0xf4, 0xd9, 0x33, 0x91, 0xe2, 0x71, 0x22, 0xf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0x5e, 0x53, 0xec, 0xcc, 0x53, 0x8c, 0x16, 0x29, 0x46, 0x1f, 0x29, 0x46, 0x2f, 0x2b, - 0xec, 0x2c, 0x56, 0xd8, 0x79, 0x5b, 0x61, 0xa7, 0xd7, 0xe2, 0xc2, 0x0c, 0x27, 0xd1, 0x26, 0x93, - 0xd8, 0xdc, 0x3a, 0x0c, 0x06, 0x22, 0x16, 0x54, 0xe6, 0x33, 0xf9, 0x55, 0xa5, 0x99, 0x29, 0xa6, - 0xa3, 0xa3, 0xac, 0xbf, 0xcb, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xca, 0x11, 0x85, 0x46, 0x0f, - 0x02, 0x00, 0x00, + // 336 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xcd, 0x4e, 0xc2, 0x40, + 0x14, 0x85, 0x5b, 0xff, 0x12, 0x0b, 0x0b, 0xd3, 0x18, 0x43, 0x88, 0x4e, 0x49, 0x17, 0xca, 0x86, + 0x4e, 0xc0, 0xc4, 0x10, 0x97, 0xac, 0x59, 0x18, 0x16, 0x9a, 0xb0, 0x72, 0x5a, 0x86, 0xe1, 0x26, + 0x53, 0x6e, 0x65, 0x06, 0x94, 0xb7, 0xf0, 0x31, 0x7c, 0x14, 0x96, 0x2c, 0x5d, 0x11, 0x2d, 0x6f, + 0xc0, 0x13, 0x18, 0x3a, 0x45, 0x21, 0x26, 0xec, 0xe6, 0xde, 0xfb, 0x9d, 0x39, 0x27, 0xc7, 0xb9, + 0x89, 0x30, 0xee, 0xf1, 0x37, 0x2a, 0xe1, 0x65, 0x0c, 0x3d, 0xa6, 0x01, 0x87, 0xea, 0xb1, 0x41, + 0x27, 0xf5, 0x90, 0x6b, 0x56, 0xa7, 0x02, 0x27, 0x41, 0x32, 0x42, 0x8d, 0xee, 0x95, 0x01, 0x83, + 0x5d, 0x30, 0xc8, 0xc1, 0xf2, 0x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0x71, 0xb8, 0xf6, 0xa4, 0xc6, 0xb7, + 0x86, 0xfd, 0x3e, 0x44, 0xc0, 0x64, 0x3e, 0xd3, 0x7f, 0x95, 0xea, 0x69, 0xc2, 0x55, 0x78, 0x92, + 0xf5, 0x78, 0xfb, 0x13, 0x00, 0x00, 0xff, 0xff, 0xff, 0x8d, 0x3e, 0x86, 0x17, 0x02, 0x00, 0x00, } -func (m *WhitelistAppProposal) Marshal() (dAtA []byte, err error) { +func (m *WhitelistLiquidationProposal) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -108,12 +107,12 @@ func (m *WhitelistAppProposal) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *WhitelistAppProposal) MarshalTo(dAtA []byte) (int, error) { +func (m *WhitelistLiquidationProposal) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WhitelistAppProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WhitelistLiquidationProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -156,7 +155,7 @@ func encodeVarintGov(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *WhitelistAppProposal) Size() (n int) { +func (m *WhitelistLiquidationProposal) Size() (n int) { if m == nil { return 0 } @@ -181,7 +180,7 @@ func sovGov(x uint64) (n int) { func sozGov(x uint64) (n int) { return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *WhitelistAppProposal) Unmarshal(dAtA []byte) error { +func (m *WhitelistLiquidationProposal) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -204,10 +203,10 @@ func (m *WhitelistAppProposal) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WhitelistAppProposal: wiretype end group for non-group") + return fmt.Errorf("proto: WhitelistLiquidationProposal: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WhitelistAppProposal: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WhitelistLiquidationProposal: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: From 88bfea42f14e4994b11fc762704ee0d6e6ca7810 Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 9 May 2023 05:39:08 +0530 Subject: [PATCH 063/155] updating limit order bid --- proto/comdex/auctionsV2/v1beta1/tx.proto | 38 +- x/auctionsV2/abci.go | 11 +- x/auctionsV2/client/cli/tx.go | 154 ++- x/auctionsV2/expected/keeper.go | 9 + x/auctionsV2/handler.go | 21 +- x/auctionsV2/keeper/bid.go | 67 + x/auctionsV2/keeper/keeper.go | 4 +- x/auctionsV2/keeper/msg_server.go | 35 + x/auctionsV2/types/codec.go | 32 +- x/auctionsV2/types/expected_keepers.go | 22 - x/auctionsV2/types/keys.go | 10 +- x/auctionsV2/types/tx.go | 152 +++ x/auctionsV2/types/tx.pb.go | 1464 +++++++++++++++++++++- 13 files changed, 1910 insertions(+), 109 deletions(-) delete mode 100644 x/auctionsV2/types/expected_keepers.go create mode 100644 x/auctionsV2/types/tx.go diff --git a/proto/comdex/auctionsV2/v1beta1/tx.proto b/proto/comdex/auctionsV2/v1beta1/tx.proto index ed8c4acff..aca610398 100644 --- a/proto/comdex/auctionsV2/v1beta1/tx.proto +++ b/proto/comdex/auctionsV2/v1beta1/tx.proto @@ -20,8 +20,38 @@ message MsgPlaceMarketBidRequest { message MsgPlaceMarketBidResponse{} +message MsgPlaceLimitBidRequest { + uint64 collateral_token_id = 1; + uint64 debt_token_id = 2; + string premium_discount = 3; + string bidder = 4; + cosmos.base.v1beta1.Coin amount = 5 [(gogoproto.nullable) = false]; +} + +message MsgPlaceLimitBidResponse{} + +message MsgCancelLimitBidRequest { + uint64 collateral_token_id = 1; + uint64 debt_token_id = 2; + string premium_discount = 3; + string bidder = 4; +} + +message MsgCancelLimitBidResponse{} + +message MsgWithdrawLimitBidRequest { + uint64 collateral_token_id = 1; + uint64 debt_token_id = 2; + string premium_discount = 3; + string bidder = 4; + cosmos.base.v1beta1.Coin amount = 5 [(gogoproto.nullable) = false]; +} + +message MsgWithdrawLimitBidResponse{} + service Msg { - rpc MsgPlaceMarketBid(MsgPlaceMarketBidRequest) returns (MsgPlaceMarketBidResponse); - - } - \ No newline at end of file + rpc MsgPlaceMarketBid(MsgPlaceMarketBidRequest) returns (MsgPlaceMarketBidResponse); + rpc MsgPlaceLimitBid(MsgPlaceLimitBidRequest) returns (MsgPlaceLimitBidResponse); + rpc MsgCancelLimitBid(MsgCancelLimitBidRequest) returns (MsgCancelLimitBidResponse); + rpc MsgWithdrawLimitBid(MsgWithdrawLimitBidRequest) returns (MsgWithdrawLimitBidResponse); +} \ No newline at end of file diff --git a/x/auctionsV2/abci.go b/x/auctionsV2/abci.go index 1ee076556..6678dd6ab 100644 --- a/x/auctionsV2/abci.go +++ b/x/auctionsV2/abci.go @@ -1,24 +1,17 @@ -package auction +package auctionsV2 import ( - "fmt" - "github.com/comdex-official/comdex/x/auction/expected" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" - utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/auctionsV2/keeper" - "github.com/comdex-official/comdex/x/auctionsV2/types" ) func BeginBlocker(ctx sdk.Context, k keeper.Keeper, assetKeeper expected.AssetKeeper, collectorKeeper expected.CollectorKeeper, esmKeeper expected.EsmKeeper) { // defer telemetry.ModuleMeasureSince(types.ModuleName, ctx.BlockTime(), telemetry.MetricKeyBeginBlocker) - - - k.AuctionIterator(ctx) + k.AuctionIterator(ctx) // // auctionMapData, auctionMappingFound := collectorKeeper.GetAllAuctionMappingForApp(ctx) // if auctionMappingFound { diff --git a/x/auctionsV2/client/cli/tx.go b/x/auctionsV2/client/cli/tx.go index 44b03a934..5a47bbdac 100644 --- a/x/auctionsV2/client/cli/tx.go +++ b/x/auctionsV2/client/cli/tx.go @@ -2,6 +2,10 @@ package cli import ( "fmt" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "strconv" "time" "github.com/spf13/cobra" @@ -23,14 +27,158 @@ const ( // GetTxCmd returns the transaction commands for this module func GetTxCmd() *cobra.Command { cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + Use: "auctionsV2", + Short: "AuctionsV2 module sub-commands", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, RunE: client.ValidateCmd, } - // this line is used by starport scaffolding # 1 + cmd.AddCommand( + txPlaceMarketDutchBid(), + txPlaceLimitDutchBid(), + txCancelLimitDutchBid(), + txWithdrawLimitDutchBid(), + ) return cmd } + +func txPlaceMarketDutchBid() *cobra.Command { + cmd := &cobra.Command{ + Use: "market-bid-request [auction-id] [bid-amount]", + Short: "Place a market bid on a dutch auction", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + id, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return fmt.Errorf("auction-id '%s' not a valid uint", args[0]) + } + + amt, err := sdk.ParseCoinNormalized(args[1]) + if err != nil { + return err + } + + msg := types.NewMsgPlaceMarketBid(clientCtx.GetFromAddress().String(), id, amt) + err = msg.ValidateBasic() + if err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + flags.AddTxFlagsToCmd(cmd) + return cmd +} + +func txPlaceLimitDutchBid() *cobra.Command { + cmd := &cobra.Command{ + Use: "limit-bid-request [collateral-token-id] [debt-token-id] [discount] [bid-amount]", + Short: "Place a limit bid on a dutch auction", + Args: cobra.ExactArgs(4), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + collateralTokenID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return fmt.Errorf("collateralTokenID '%s' not a valid uint", args[0]) + } + debtTokenID, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return fmt.Errorf("debtTokenID '%s' not a valid uint", args[1]) + } + + amt, err := sdk.ParseCoinNormalized(args[3]) + if err != nil { + return err + } + + msg := types.NewMsgPlaceLimitBid(clientCtx.GetFromAddress().String(), collateralTokenID, debtTokenID, args[2], amt) + err = msg.ValidateBasic() + if err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + flags.AddTxFlagsToCmd(cmd) + return cmd +} + +func txCancelLimitDutchBid() *cobra.Command { + cmd := &cobra.Command{ + Use: "cancel-limit-bid-request [collateral-token-id] [debt-token-id] [discount]", + Short: "Cancel a limit bid on a dutch auction", + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + collateralTokenID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return fmt.Errorf("collateralTokenID '%s' not a valid uint", args[0]) + } + debtTokenID, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return fmt.Errorf("debtTokenID '%s' not a valid uint", args[1]) + } + + msg := types.NewMsgCancelLimitBid(clientCtx.GetFromAddress().String(), collateralTokenID, debtTokenID, args[2]) + err = msg.ValidateBasic() + if err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + flags.AddTxFlagsToCmd(cmd) + return cmd +} + +func txWithdrawLimitDutchBid() *cobra.Command { + cmd := &cobra.Command{ + Use: "withdraw-limit-bid-request [collateral-token-id] [debt-token-id] [discount] [bid-amount]", + Short: "Withdraw a limit bid on a dutch auction", + Args: cobra.ExactArgs(4), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + collateralTokenID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return fmt.Errorf("collateralTokenID '%s' not a valid uint", args[0]) + } + debtTokenID, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return fmt.Errorf("debtTokenID '%s' not a valid uint", args[1]) + } + + amt, err := sdk.ParseCoinNormalized(args[3]) + if err != nil { + return err + } + + msg := types.NewMsgWithdrawLimitBid(clientCtx.GetFromAddress().String(), collateralTokenID, debtTokenID, args[2], amt) + err = msg.ValidateBasic() + if err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + flags.AddTxFlagsToCmd(cmd) + return cmd +} diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go index ce1abd853..6af720699 100644 --- a/x/auctionsV2/expected/keeper.go +++ b/x/auctionsV2/expected/keeper.go @@ -36,3 +36,12 @@ type EsmKeeper interface { SetDataAfterCoolOff(ctx sdk.Context, esmDataAfterCoolOff esmtypes.DataAfterCoolOff) GetSnapshotOfPrices(ctx sdk.Context, appID, assetID uint64) (price uint64, found bool) } + +type BankKeeper interface { + MintCoins(ctx sdk.Context, name string, coins sdk.Coins) error + BurnCoins(ctx sdk.Context, name string, coins sdk.Coins) error + SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin +} diff --git a/x/auctionsV2/handler.go b/x/auctionsV2/handler.go index 3c5756fdf..1d58563c0 100644 --- a/x/auctionsV2/handler.go +++ b/x/auctionsV2/handler.go @@ -1,28 +1,37 @@ package auctionsV2 import ( - "fmt" - "github.com/comdex-official/comdex/x/auctionsV2/keeper" "github.com/comdex-official/comdex/x/auctionsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) - func NewHandler(k keeper.Keeper) sdk.Handler { - server := keeper.NewMsgServiceServer(k) + server := keeper.NewMsgServerImpl(k) return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { - case *types.MsgPlaceMarketBid: + case *types.MsgPlaceMarketBidRequest: res, err := server.MsgPlaceMarketBid(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgPlaceLimitBidRequest: + res, err := server.MsgPlaceLimitBid(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + + case *types.MsgCancelLimitBidRequest: + res, err := server.MsgCancelLimitBid(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + + case *types.MsgWithdrawLimitBidRequest: + res, err := server.MsgWithdrawLimitBid(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + default: - return nil, sdkerrors.Wrapf(types.ErrorUnknownMsgType, "%T", msg) + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "%T", msg) } } } diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 1c48ba981..1518bfd39 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -3,6 +3,7 @@ package keeper import ( "github.com/comdex-official/comdex/x/auctionsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" + protobuftypes "github.com/gogo/protobuf/types" ) func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auctions) error { @@ -12,3 +13,69 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auctions) error { return nil } + +func (k Keeper) SetLimitAuctionBidID(ctx sdk.Context, id uint64) { + var ( + store = k.Store(ctx) + key = types.LimitAuctionBidIDKey + value = k.cdc.MustMarshal( + &protobuftypes.UInt64Value{ + Value: id, + }, + ) + ) + + store.Set(key, value) +} + +func (k Keeper) GetLimitAuctionBidID(ctx sdk.Context) uint64 { + var ( + store = k.Store(ctx) + key = types.LimitAuctionBidIDKey + value = store.Get(key) + ) + + if value == nil { + return 0 + } + + var id protobuftypes.UInt64Value + k.cdc.MustUnmarshal(value, &id) + + return id.GetValue() +} + +func (k Keeper) PlaceLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount string, amount sdk.Coin) error { + id := k.GetLimitAuctionBidID(ctx) + bidderAddr, err := sdk.AccAddressFromBech32(bidder) + if err != nil { + return nil + } + err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, types.ModuleName, sdk.NewCoins(amount)) + if err != nil { + return err + } + premiumDiscount, err := sdk.NewDecFromStr(PremiumDiscount) + if err != nil { + return err + } + + limitBid := types.LimitOrderBid{ + LimitOrderBiddingId: id + 1, + BidderAddress: bidder, + CollateralToken: sdk.Coin{}, + DebtToken: sdk.Coin{}, + BiddingId: nil, + PremiumDiscount: premiumDiscount, + } + k.SetLimitAuctionBidID(ctx, limitBid.LimitOrderBiddingId) + return nil +} + +func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder sdk.AccAddress, CollateralTokenId, DebtTokenId uint64) error { + return nil +} + +func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder sdk.AccAddress, CollateralTokenId, DebtTokenId uint64, PremiumDiscount string) error { + return nil +} diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index 085961eb3..666a5f391 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -19,7 +19,7 @@ type ( memKey sdk.StoreKey paramstore paramtypes.Subspace LiquidationsV2 expected.LiquidationsV2Keeper - bankKeeper types.BankKeeper + bankKeeper expected.BankKeeper market expected.MarketKeeper asset expected.AssetKeeper esm expected.EsmKeeper @@ -37,7 +37,7 @@ func NewKeeper( memKey sdk.StoreKey, ps paramtypes.Subspace, LiquidationsV2Keeper expected.LiquidationsV2Keeper, - bankKeeper types.BankKeeper, + bankKeeper expected.BankKeeper, marketKeeper expected.MarketKeeper, assetKeeper expected.AssetKeeper, esm expected.EsmKeeper, diff --git a/x/auctionsV2/keeper/msg_server.go b/x/auctionsV2/keeper/msg_server.go index de16dfbaa..1af5de19f 100644 --- a/x/auctionsV2/keeper/msg_server.go +++ b/x/auctionsV2/keeper/msg_server.go @@ -50,3 +50,38 @@ func (k msgServer) MsgPlaceMarketBid(goCtx context.Context, msg *types.MsgPlaceM // ctx.GasMeter().ConsumeGas(types.DutchBidGas, "DutchBidGas") return &types.MsgPlaceMarketBidResponse{}, nil } + +func (k msgServer) MsgPlaceLimitBid(goCtx context.Context, msg *types.MsgPlaceLimitBidRequest) (*types.MsgPlaceLimitBidResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + err := k.PlaceLimitAuctionBid(ctx, msg.Bidder, msg.CollateralTokenId, msg.DebtTokenId, msg.PremiumDiscount, msg.Amount) + if err != nil { + return nil, err + } + return &types.MsgPlaceLimitBidResponse{}, nil +} + +func (k msgServer) MsgCancelLimitBid(goCtx context.Context, msg *types.MsgCancelLimitBidRequest) (*types.MsgCancelLimitBidResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + bidder, err := sdk.AccAddressFromBech32(msg.Bidder) + if err != nil { + return nil, err + } + err = k.CancelLimitAuctionBid(ctx, bidder, msg.CollateralTokenId, msg.DebtTokenId) + if err != nil { + return nil, err + } + return &types.MsgCancelLimitBidResponse{}, nil +} + +func (k msgServer) MsgWithdrawLimitBid(goCtx context.Context, msg *types.MsgWithdrawLimitBidRequest) (*types.MsgWithdrawLimitBidResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + bidder, err := sdk.AccAddressFromBech32(msg.Bidder) + if err != nil { + return nil, err + } + err = k.WithdrawLimitAuctionBid(ctx, bidder, msg.CollateralTokenId, msg.DebtTokenId, msg.PremiumDiscount) + if err != nil { + return nil, err + } + return &types.MsgWithdrawLimitBidResponse{}, nil +} diff --git a/x/auctionsV2/types/codec.go b/x/auctionsV2/types/codec.go index fb6871d22..a62b774f4 100644 --- a/x/auctionsV2/types/codec.go +++ b/x/auctionsV2/types/codec.go @@ -2,22 +2,38 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - // this line is used by starport scaffolding # 1 + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) -func RegisterCodec(cdc *codec.LegacyAmino) { - // this line is used by starport scaffolding # 2 -} +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgPlaceMarketBidRequest{}, "comdex/auctionsV2/MsgPlaceMarketBidRequest", nil) + cdc.RegisterConcrete(&MsgPlaceLimitBidRequest{}, "comdex/auctionsV2/MsgPlaceLimitBidRequest", nil) + cdc.RegisterConcrete(&MsgCancelLimitBidRequest{}, "comdex/auctionsV2/MsgCancelLimitBidRequest", nil) + cdc.RegisterConcrete(&MsgWithdrawLimitBidRequest{}, "comdex/auctionsV2/MsgWithdrawLimitBidRequest", nil) +} func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - // this line is used by starport scaffolding # 3 + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgPlaceMarketBidRequest{}, + &MsgPlaceLimitBidRequest{}, + &MsgCancelLimitBidRequest{}, + &MsgWithdrawLimitBidRequest{}, + ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } var ( - Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewAminoCodec(amino) ) + +func init() { + RegisterLegacyAminoCodec(amino) + cryptocodec.RegisterCrypto(amino) + amino.Seal() +} diff --git a/x/auctionsV2/types/expected_keepers.go b/x/auctionsV2/types/expected_keepers.go deleted file mode 100644 index bcb4371f8..000000000 --- a/x/auctionsV2/types/expected_keepers.go +++ /dev/null @@ -1,22 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" -) - - - - - -// AccountKeeper defines the expected account keeper used for simulations (noalias) -type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI - // Methods imported from account should be defined here -} - -// BankKeeper defines the expected interface needed to retrieve account balances. -type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - // Methods imported from bank should be defined here -} \ No newline at end of file diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index 8959d7baa..d7bdadaea 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -22,8 +22,14 @@ const ( ) var ( - AuctionIDKey = []byte{0x01} - AuctionKeyPrefix = []byte{0x02} + TypePlaceMarketBidRequest = ModuleName + ":market-bid-request" + TypePlaceLimitBidRequest = ModuleName + ":limit-bid-request" + TypeCancelLimitBidRequest = ModuleName + ":cancel-limit-bid-request" + TypeWithdrawLimitBidRequest = ModuleName + ":withdraw-limit-bid-request" + AuctionIDKey = []byte{0x01} + AuctionKeyPrefix = []byte{0x02} + LimitAuctionBidIDKey = []byte{0x03} + AuctionParamsKey = []byte{0x04} ) func AuctionKey(auctionID uint64) []byte { diff --git a/x/auctionsV2/types/tx.go b/x/auctionsV2/types/tx.go new file mode 100644 index 000000000..22d18708e --- /dev/null +++ b/x/auctionsV2/types/tx.go @@ -0,0 +1,152 @@ +package types + +import ( + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func NewMsgPlaceMarketBid(bidder string, auctionId uint64, amount sdk.Coin) *MsgPlaceMarketBidRequest { + return &MsgPlaceMarketBidRequest{ + AuctionId: auctionId, + Bidder: bidder, + Amount: amount, + } +} + +func (msg MsgPlaceMarketBidRequest) Route() string { return ModuleName } +func (msg MsgPlaceMarketBidRequest) Type() string { return TypePlaceMarketBidRequest } + +func (msg *MsgPlaceMarketBidRequest) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Bidder) + if err != nil { + return err + } + if msg.AuctionId == 0 { + return fmt.Errorf("Auction id should not be 0: %d ", msg.AuctionId) + } + if msg.Amount.Amount.IsNegative() || msg.Amount.Amount.IsZero() { + return fmt.Errorf("invalid coin amount: %s < 0", msg.Amount.Amount) + } + return nil +} + +func (msg *MsgPlaceMarketBidRequest) GetSigners() []sdk.AccAddress { + Bidder, _ := sdk.AccAddressFromBech32(msg.Bidder) + return []sdk.AccAddress{Bidder} +} + +// GetSignBytes get the bytes for the message signer to sign on. +func (msg *MsgPlaceMarketBidRequest) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func NewMsgPlaceLimitBid(bidder string, collateralTokenId, debtTokenId uint64, premiumDiscount string, amount sdk.Coin) *MsgPlaceLimitBidRequest { + return &MsgPlaceLimitBidRequest{ + CollateralTokenId: collateralTokenId, + DebtTokenId: debtTokenId, + PremiumDiscount: premiumDiscount, + Bidder: bidder, + Amount: amount, + } +} + +func (msg MsgPlaceLimitBidRequest) Route() string { return ModuleName } +func (msg MsgPlaceLimitBidRequest) Type() string { return TypePlaceLimitBidRequest } + +func (msg *MsgPlaceLimitBidRequest) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Bidder) + if err != nil { + return err + } + if msg.CollateralTokenId == 0 || msg.DebtTokenId == 0 { + return fmt.Errorf("CollateralToken id or DebtToken should not be 0: %d ", msg.CollateralTokenId) + } + if msg.Amount.Amount.IsNegative() || msg.Amount.Amount.IsZero() { + return fmt.Errorf("invalid coin amount: %s < 0", msg.Amount.Amount) + } + return nil +} + +func (msg *MsgPlaceLimitBidRequest) GetSigners() []sdk.AccAddress { + Bidder, _ := sdk.AccAddressFromBech32(msg.Bidder) + return []sdk.AccAddress{Bidder} +} + +// GetSignBytes get the bytes for the message signer to sign on. +func (msg *MsgPlaceLimitBidRequest) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func NewMsgCancelLimitBid(bidder string, collateralTokenId, debtTokenId uint64, premiumDiscount string) *MsgCancelLimitBidRequest { + return &MsgCancelLimitBidRequest{ + CollateralTokenId: collateralTokenId, + DebtTokenId: debtTokenId, + PremiumDiscount: premiumDiscount, + Bidder: bidder, + } +} + +func (msg MsgCancelLimitBidRequest) Route() string { return ModuleName } +func (msg MsgCancelLimitBidRequest) Type() string { return TypeCancelLimitBidRequest } + +func (msg *MsgCancelLimitBidRequest) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Bidder) + if err != nil { + return err + } + if msg.CollateralTokenId == 0 || msg.DebtTokenId == 0 { + return fmt.Errorf("CollateralToken id or DebtToken should not be 0: %d ", msg.CollateralTokenId) + } + return nil +} + +func (msg *MsgCancelLimitBidRequest) GetSigners() []sdk.AccAddress { + Bidder, _ := sdk.AccAddressFromBech32(msg.Bidder) + return []sdk.AccAddress{Bidder} +} + +// GetSignBytes get the bytes for the message signer to sign on. +func (msg *MsgCancelLimitBidRequest) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func NewMsgWithdrawLimitBid(bidder string, collateralTokenId, debtTokenId uint64, premiumDiscount string, amount sdk.Coin) *MsgWithdrawLimitBidRequest { + return &MsgWithdrawLimitBidRequest{ + CollateralTokenId: collateralTokenId, + DebtTokenId: debtTokenId, + PremiumDiscount: premiumDiscount, + Bidder: bidder, + Amount: amount, + } +} + +func (msg MsgWithdrawLimitBidRequest) Route() string { return ModuleName } +func (msg MsgWithdrawLimitBidRequest) Type() string { return TypeWithdrawLimitBidRequest } + +func (msg *MsgWithdrawLimitBidRequest) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Bidder) + if err != nil { + return err + } + if msg.CollateralTokenId == 0 || msg.DebtTokenId == 0 { + return fmt.Errorf("CollateralToken id or DebtToken should not be 0: %d ", msg.CollateralTokenId) + } + if msg.Amount.Amount.IsNegative() || msg.Amount.Amount.IsZero() { + return fmt.Errorf("invalid coin amount: %s < 0", msg.Amount.Amount) + } + return nil +} + +func (msg *MsgWithdrawLimitBidRequest) GetSigners() []sdk.AccAddress { + Bidder, _ := sdk.AccAddressFromBech32(msg.Bidder) + return []sdk.AccAddress{Bidder} +} + +// GetSignBytes get the bytes for the message signer to sign on. +func (msg *MsgWithdrawLimitBidRequest) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} diff --git a/x/auctionsV2/types/tx.pb.go b/x/auctionsV2/types/tx.pb.go index 1b2395167..7285e4d38 100644 --- a/x/auctionsV2/types/tx.pb.go +++ b/x/auctionsV2/types/tx.pb.go @@ -104,9 +104,245 @@ func (m *MsgPlaceMarketBidResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgPlaceMarketBidResponse proto.InternalMessageInfo +type MsgPlaceLimitBidRequest struct { + CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` + DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` + PremiumDiscount string `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3" json:"premium_discount,omitempty"` + Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` + Amount types.Coin `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount"` +} + +func (m *MsgPlaceLimitBidRequest) Reset() { *m = MsgPlaceLimitBidRequest{} } +func (m *MsgPlaceLimitBidRequest) String() string { return proto.CompactTextString(m) } +func (*MsgPlaceLimitBidRequest) ProtoMessage() {} +func (*MsgPlaceLimitBidRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2c216a24ef98c1b4, []int{2} +} +func (m *MsgPlaceLimitBidRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPlaceLimitBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPlaceLimitBidRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPlaceLimitBidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPlaceLimitBidRequest.Merge(m, src) +} +func (m *MsgPlaceLimitBidRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgPlaceLimitBidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPlaceLimitBidRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPlaceLimitBidRequest proto.InternalMessageInfo + +type MsgPlaceLimitBidResponse struct { +} + +func (m *MsgPlaceLimitBidResponse) Reset() { *m = MsgPlaceLimitBidResponse{} } +func (m *MsgPlaceLimitBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPlaceLimitBidResponse) ProtoMessage() {} +func (*MsgPlaceLimitBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2c216a24ef98c1b4, []int{3} +} +func (m *MsgPlaceLimitBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPlaceLimitBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPlaceLimitBidResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPlaceLimitBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPlaceLimitBidResponse.Merge(m, src) +} +func (m *MsgPlaceLimitBidResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPlaceLimitBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPlaceLimitBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPlaceLimitBidResponse proto.InternalMessageInfo + +type MsgCancelLimitBidRequest struct { + CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` + DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` + PremiumDiscount string `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3" json:"premium_discount,omitempty"` + Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` +} + +func (m *MsgCancelLimitBidRequest) Reset() { *m = MsgCancelLimitBidRequest{} } +func (m *MsgCancelLimitBidRequest) String() string { return proto.CompactTextString(m) } +func (*MsgCancelLimitBidRequest) ProtoMessage() {} +func (*MsgCancelLimitBidRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2c216a24ef98c1b4, []int{4} +} +func (m *MsgCancelLimitBidRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelLimitBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelLimitBidRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCancelLimitBidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelLimitBidRequest.Merge(m, src) +} +func (m *MsgCancelLimitBidRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelLimitBidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelLimitBidRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelLimitBidRequest proto.InternalMessageInfo + +type MsgCancelLimitBidResponse struct { +} + +func (m *MsgCancelLimitBidResponse) Reset() { *m = MsgCancelLimitBidResponse{} } +func (m *MsgCancelLimitBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCancelLimitBidResponse) ProtoMessage() {} +func (*MsgCancelLimitBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2c216a24ef98c1b4, []int{5} +} +func (m *MsgCancelLimitBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelLimitBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelLimitBidResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCancelLimitBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelLimitBidResponse.Merge(m, src) +} +func (m *MsgCancelLimitBidResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelLimitBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelLimitBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelLimitBidResponse proto.InternalMessageInfo + +type MsgWithdrawLimitBidRequest struct { + CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` + DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` + PremiumDiscount string `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3" json:"premium_discount,omitempty"` + Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` + Amount types.Coin `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount"` +} + +func (m *MsgWithdrawLimitBidRequest) Reset() { *m = MsgWithdrawLimitBidRequest{} } +func (m *MsgWithdrawLimitBidRequest) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawLimitBidRequest) ProtoMessage() {} +func (*MsgWithdrawLimitBidRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2c216a24ef98c1b4, []int{6} +} +func (m *MsgWithdrawLimitBidRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawLimitBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawLimitBidRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgWithdrawLimitBidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawLimitBidRequest.Merge(m, src) +} +func (m *MsgWithdrawLimitBidRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawLimitBidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawLimitBidRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawLimitBidRequest proto.InternalMessageInfo + +type MsgWithdrawLimitBidResponse struct { +} + +func (m *MsgWithdrawLimitBidResponse) Reset() { *m = MsgWithdrawLimitBidResponse{} } +func (m *MsgWithdrawLimitBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawLimitBidResponse) ProtoMessage() {} +func (*MsgWithdrawLimitBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2c216a24ef98c1b4, []int{7} +} +func (m *MsgWithdrawLimitBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawLimitBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawLimitBidResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgWithdrawLimitBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawLimitBidResponse.Merge(m, src) +} +func (m *MsgWithdrawLimitBidResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawLimitBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawLimitBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawLimitBidResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgPlaceMarketBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceMarketBidRequest") proto.RegisterType((*MsgPlaceMarketBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceMarketBidResponse") + proto.RegisterType((*MsgPlaceLimitBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceLimitBidRequest") + proto.RegisterType((*MsgPlaceLimitBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceLimitBidResponse") + proto.RegisterType((*MsgCancelLimitBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgCancelLimitBidRequest") + proto.RegisterType((*MsgCancelLimitBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgCancelLimitBidResponse") + proto.RegisterType((*MsgWithdrawLimitBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgWithdrawLimitBidRequest") + proto.RegisterType((*MsgWithdrawLimitBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgWithdrawLimitBidResponse") } func init() { @@ -114,28 +350,40 @@ func init() { } var fileDescriptor_2c216a24ef98c1b4 = []byte{ - // 328 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0xbf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1, 0x13, 0xc8, 0x33, 0x1b, 0x95, 0x1a, 0xa8, 0xf5, 0xbf, 0x53, 0xa3, 0x4e, 0x82, 0xae, - 0x25, 0x3e, 0x7c, 0xe9, 0x09, 0xe8, 0xac, 0x5f, 0x5e, 0xbc, 0x1c, 0x06, 0xb1, 0xc7, 0x9b, 0xfb, - 0xb8, 0xf6, 0x8b, 0x8b, 0x99, 0x42, 0x66, 0x54, 0xe7, 0x1e, 0xe1, 0xd2, 0xc0, 0xa4, 0xe1, 0x1d, - 0xde, 0xf9, 0x01, 0x85, 0x5d, 0xba, 0x75, 0x30, 0x74, 0xdb, 0xf7, 0xea, 0xbd, 0xbf, 0x25, 0x39, - 0x8f, 0xfe, 0x70, 0xf1, 0x46, 0x82, 0xa7, 0x82, 0x04, 0x8b, 0x82, 0xa0, 0x65, 0x41, 0xd0, 0x6b, - 0x41, 0xd0, 0xe3, 0x8a, 0x04, 0xcb, 0x15, 0x09, 0x9e, 0x57, 0x24, 0x38, 0xef, 0xa5, 0xda, 0x5e, - 0xe6, 0xc9, 0xba, 0x3a, 0x73, 0x1d, 0x8e, 0x60, 0x34, 0xd2, 0x42, 0xf3, 0xb1, 0x8f, 0xd9, 0xb7, - 0x2d, 0xdb, 0xdb, 0xa9, 0x32, 0x49, 0x65, 0xb3, 0x90, 0xee, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x18, 0x49, 0xe5, 0xa4, 0x07, 0x02, 0x00, 0x00, + // 524 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x55, 0x3f, 0x6f, 0xd3, 0x40, + 0x14, 0xf7, 0xb5, 0x21, 0x52, 0xae, 0x42, 0xb4, 0x57, 0x04, 0x89, 0xab, 0x9a, 0x28, 0x53, 0x18, + 0xb0, 0xd5, 0xa4, 0xc0, 0x9e, 0xb2, 0x54, 0x22, 0x12, 0xb2, 0x50, 0x91, 0x58, 0xa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 0xbb, 0x2b, 0xc5, 0x98, 0xe2, 0x5a, + 0xfc, 0xe5, 0x7d, 0xb9, 0x4a, 0x7c, 0xe9, 0x41, 0x5c, 0x25, 0xbe, 0x7c, 0x25, 0xd1, 0x3b, 0x00, + 0xb7, 0x4b, 0x86, 0x84, 0xee, 0xff, 0x39, 0xdb, 0x92, 0x15, 0xb6, 0x1f, 0xac, 0x1a, 0xa6, 0x69, + 0xf4, 0x8e, 0x46, 0xdf, 0x1d, 0xeb, 0xd3, 0xd8, 0xb1, 0x46, 0x63, 0x07, 0x9c, 0x8f, 0x1d, 0xf0, + 0x6d, 0xec, 0x80, 0x8f, 0x13, 0xc7, 0x3a, 0x9f, 0x38, 0xd6, 0x97, 0x89, 0x63, 0x3d, 0xdf, 0x0f, + 0xb9, 0x3a, 0xc9, 0x82, 0x3c, 0xbf, 0xa7, 0x6b, 0xdc, 0x13, 0xc7, 0xc7, 0x9c, 0x70, 0x1c, 0x99, + 0xb7, 0x77, 0xe9, 0x83, 0xa2, 0x5e, 0x0f, 0x99, 0x0c, 0xaa, 0xd3, 0xff, 0xfe, 0xee, 0xaf, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x75, 0x98, 0x33, 0x44, 0x72, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -151,6 +399,9 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { MsgPlaceMarketBid(ctx context.Context, in *MsgPlaceMarketBidRequest, opts ...grpc.CallOption) (*MsgPlaceMarketBidResponse, error) + MsgPlaceLimitBid(ctx context.Context, in *MsgPlaceLimitBidRequest, opts ...grpc.CallOption) (*MsgPlaceLimitBidResponse, error) + MsgCancelLimitBid(ctx context.Context, in *MsgCancelLimitBidRequest, opts ...grpc.CallOption) (*MsgCancelLimitBidResponse, error) + MsgWithdrawLimitBid(ctx context.Context, in *MsgWithdrawLimitBidRequest, opts ...grpc.CallOption) (*MsgWithdrawLimitBidResponse, error) } type msgClient struct { @@ -170,9 +421,39 @@ func (c *msgClient) MsgPlaceMarketBid(ctx context.Context, in *MsgPlaceMarketBid return out, nil } +func (c *msgClient) MsgPlaceLimitBid(ctx context.Context, in *MsgPlaceLimitBidRequest, opts ...grpc.CallOption) (*MsgPlaceLimitBidResponse, error) { + out := new(MsgPlaceLimitBidResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgPlaceLimitBid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) MsgCancelLimitBid(ctx context.Context, in *MsgCancelLimitBidRequest, opts ...grpc.CallOption) (*MsgCancelLimitBidResponse, error) { + out := new(MsgCancelLimitBidResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgCancelLimitBid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) MsgWithdrawLimitBid(ctx context.Context, in *MsgWithdrawLimitBidRequest, opts ...grpc.CallOption) (*MsgWithdrawLimitBidResponse, error) { + out := new(MsgWithdrawLimitBidResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgWithdrawLimitBid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { MsgPlaceMarketBid(context.Context, *MsgPlaceMarketBidRequest) (*MsgPlaceMarketBidResponse, error) + MsgPlaceLimitBid(context.Context, *MsgPlaceLimitBidRequest) (*MsgPlaceLimitBidResponse, error) + MsgCancelLimitBid(context.Context, *MsgCancelLimitBidRequest) (*MsgCancelLimitBidResponse, error) + MsgWithdrawLimitBid(context.Context, *MsgWithdrawLimitBidRequest) (*MsgWithdrawLimitBidResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -182,6 +463,15 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) MsgPlaceMarketBid(ctx context.Context, req *MsgPlaceMarketBidRequest) (*MsgPlaceMarketBidResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MsgPlaceMarketBid not implemented") } +func (*UnimplementedMsgServer) MsgPlaceLimitBid(ctx context.Context, req *MsgPlaceLimitBidRequest) (*MsgPlaceLimitBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgPlaceLimitBid not implemented") +} +func (*UnimplementedMsgServer) MsgCancelLimitBid(ctx context.Context, req *MsgCancelLimitBidRequest) (*MsgCancelLimitBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgCancelLimitBid not implemented") +} +func (*UnimplementedMsgServer) MsgWithdrawLimitBid(ctx context.Context, req *MsgWithdrawLimitBidRequest) (*MsgWithdrawLimitBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgWithdrawLimitBid not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -205,6 +495,60 @@ func _Msg_MsgPlaceMarketBid_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Msg_MsgPlaceLimitBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPlaceLimitBidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgPlaceLimitBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgPlaceLimitBid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgPlaceLimitBid(ctx, req.(*MsgPlaceLimitBidRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_MsgCancelLimitBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCancelLimitBidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgCancelLimitBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgCancelLimitBid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgCancelLimitBid(ctx, req.(*MsgCancelLimitBidRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_MsgWithdrawLimitBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawLimitBidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgWithdrawLimitBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgWithdrawLimitBid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgWithdrawLimitBid(ctx, req.(*MsgWithdrawLimitBidRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.auctionsV2.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -213,6 +557,18 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MsgPlaceMarketBid", Handler: _Msg_MsgPlaceMarketBid_Handler, }, + { + MethodName: "MsgPlaceLimitBid", + Handler: _Msg_MsgPlaceLimitBid_Handler, + }, + { + MethodName: "MsgCancelLimitBid", + Handler: _Msg_MsgCancelLimitBid_Handler, + }, + { + MethodName: "MsgWithdrawLimitBid", + Handler: _Msg_MsgWithdrawLimitBid_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/auctionsV2/v1beta1/tx.proto", @@ -286,46 +642,376 @@ func (m *MsgPlaceMarketBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgPlaceLimitBidRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgPlaceMarketBidRequest) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgPlaceLimitBidRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPlaceLimitBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.AuctionId != 0 { - n += 1 + sovTx(uint64(m.AuctionId)) + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + i-- + dAtA[i] = 0x2a + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x22 } - l = m.Amount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgPlaceMarketBidResponse) Size() (n int) { - if m == nil { - return 0 + if len(m.PremiumDiscount) > 0 { + i -= len(m.PremiumDiscount) + copy(dAtA[i:], m.PremiumDiscount) + i = encodeVarintTx(dAtA, i, uint64(len(m.PremiumDiscount))) + i-- + dAtA[i] = 0x1a } - var l int - _ = l - return n + if m.DebtTokenId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.DebtTokenId)) + i-- + dAtA[i] = 0x10 + } + if m.CollateralTokenId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CollateralTokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *MsgPlaceLimitBidResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPlaceLimitBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPlaceLimitBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCancelLimitBidRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCancelLimitBidRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelLimitBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x22 + } + if len(m.PremiumDiscount) > 0 { + i -= len(m.PremiumDiscount) + copy(dAtA[i:], m.PremiumDiscount) + i = encodeVarintTx(dAtA, i, uint64(len(m.PremiumDiscount))) + i-- + dAtA[i] = 0x1a + } + if m.DebtTokenId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.DebtTokenId)) + i-- + dAtA[i] = 0x10 + } + if m.CollateralTokenId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CollateralTokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgCancelLimitBidResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCancelLimitBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelLimitBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawLimitBidRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgWithdrawLimitBidRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawLimitBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x22 + } + if len(m.PremiumDiscount) > 0 { + i -= len(m.PremiumDiscount) + copy(dAtA[i:], m.PremiumDiscount) + i = encodeVarintTx(dAtA, i, uint64(len(m.PremiumDiscount))) + i-- + dAtA[i] = 0x1a + } + if m.DebtTokenId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.DebtTokenId)) + i-- + dAtA[i] = 0x10 + } + if m.CollateralTokenId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CollateralTokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawLimitBidResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgWithdrawLimitBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawLimitBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgPlaceMarketBidRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovTx(uint64(m.AuctionId)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgPlaceMarketBidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgPlaceLimitBidRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CollateralTokenId != 0 { + n += 1 + sovTx(uint64(m.CollateralTokenId)) + } + if m.DebtTokenId != 0 { + n += 1 + sovTx(uint64(m.DebtTokenId)) + } + l = len(m.PremiumDiscount) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgPlaceLimitBidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCancelLimitBidRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CollateralTokenId != 0 { + n += 1 + sovTx(uint64(m.CollateralTokenId)) + } + if m.DebtTokenId != 0 { + n += 1 + sovTx(uint64(m.DebtTokenId)) + } + l = len(m.PremiumDiscount) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCancelLimitBidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgWithdrawLimitBidRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CollateralTokenId != 0 { + n += 1 + sovTx(uint64(m.CollateralTokenId)) + } + if m.DebtTokenId != 0 { + n += 1 + sovTx(uint64(m.DebtTokenId)) + } + l = len(m.PremiumDiscount) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgWithdrawLimitBidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 } func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -514,6 +1200,678 @@ func (m *MsgPlaceMarketBidResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgPlaceLimitBidRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPlaceLimitBidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPlaceLimitBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenId", wireType) + } + m.CollateralTokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CollateralTokenId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenId", wireType) + } + m.DebtTokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DebtTokenId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PremiumDiscount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PremiumDiscount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPlaceLimitBidResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPlaceLimitBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPlaceLimitBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCancelLimitBidRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCancelLimitBidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelLimitBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenId", wireType) + } + m.CollateralTokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CollateralTokenId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenId", wireType) + } + m.DebtTokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DebtTokenId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PremiumDiscount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PremiumDiscount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCancelLimitBidResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCancelLimitBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelLimitBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgWithdrawLimitBidRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawLimitBidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawLimitBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenId", wireType) + } + m.CollateralTokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CollateralTokenId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenId", wireType) + } + m.DebtTokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DebtTokenId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PremiumDiscount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PremiumDiscount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgWithdrawLimitBidResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawLimitBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawLimitBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From fa6fdcf7815b174ca79fc4005d6bd58698e82d8d Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Tue, 9 May 2023 12:45:24 +0530 Subject: [PATCH 064/155] refactoring market-order-bids --- x/auctionsV2/keeper/bid.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 1c48ba981..98a2888bc 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -6,6 +6,10 @@ import ( ) func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auctions) error { + + + + return nil } From 4e8cafce710f41bd79f3472456afffbba59f4918 Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 9 May 2023 13:29:23 +0530 Subject: [PATCH 065/155] updating keys --- proto/comdex/auctionsV2/v1beta1/tx.proto | 6 +- x/auctionsV2/handler.go | 4 +- x/auctionsV2/keeper/bid.go | 58 +++++-- x/auctionsV2/keeper/msg_server.go | 12 +- x/auctionsV2/types/codec.go | 4 +- x/auctionsV2/types/keys.go | 21 ++- x/auctionsV2/types/tx.go | 14 +- x/auctionsV2/types/tx.pb.go | 184 +++++++++++------------ 8 files changed, 170 insertions(+), 133 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/tx.proto b/proto/comdex/auctionsV2/v1beta1/tx.proto index aca610398..10b88ed60 100644 --- a/proto/comdex/auctionsV2/v1beta1/tx.proto +++ b/proto/comdex/auctionsV2/v1beta1/tx.proto @@ -20,7 +20,7 @@ message MsgPlaceMarketBidRequest { message MsgPlaceMarketBidResponse{} -message MsgPlaceLimitBidRequest { +message MsgDepositLimitBidRequest { uint64 collateral_token_id = 1; uint64 debt_token_id = 2; string premium_discount = 3; @@ -28,7 +28,7 @@ message MsgPlaceLimitBidRequest { cosmos.base.v1beta1.Coin amount = 5 [(gogoproto.nullable) = false]; } -message MsgPlaceLimitBidResponse{} +message MsgDepositLimitBidResponse{} message MsgCancelLimitBidRequest { uint64 collateral_token_id = 1; @@ -51,7 +51,7 @@ message MsgWithdrawLimitBidResponse{} service Msg { rpc MsgPlaceMarketBid(MsgPlaceMarketBidRequest) returns (MsgPlaceMarketBidResponse); - rpc MsgPlaceLimitBid(MsgPlaceLimitBidRequest) returns (MsgPlaceLimitBidResponse); + rpc MsgDepositLimitBid(MsgDepositLimitBidRequest) returns (MsgDepositLimitBidResponse); rpc MsgCancelLimitBid(MsgCancelLimitBidRequest) returns (MsgCancelLimitBidResponse); rpc MsgWithdrawLimitBid(MsgWithdrawLimitBidRequest) returns (MsgWithdrawLimitBidResponse); } \ No newline at end of file diff --git a/x/auctionsV2/handler.go b/x/auctionsV2/handler.go index 1d58563c0..bebdfa7d2 100644 --- a/x/auctionsV2/handler.go +++ b/x/auctionsV2/handler.go @@ -18,8 +18,8 @@ func NewHandler(k keeper.Keeper) sdk.Handler { res, err := server.MsgPlaceMarketBid(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgPlaceLimitBidRequest: - res, err := server.MsgPlaceLimitBid(sdk.WrapSDKContext(ctx), msg) + case *types.MsgDepositLimitBidRequest: + res, err := server.MsgDepositLimitBid(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) case *types.MsgCancelLimitBidRequest: diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 1518bfd39..f87a25e0c 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -1,6 +1,7 @@ package keeper import ( + assettypes "github.com/comdex-official/comdex/x/asset/types" "github.com/comdex-official/comdex/x/auctionsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" protobuftypes "github.com/gogo/protobuf/types" @@ -45,7 +46,32 @@ func (k Keeper) GetLimitAuctionBidID(ctx sdk.Context) uint64 { return id.GetValue() } -func (k Keeper) PlaceLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount string, amount sdk.Coin) error { +func (k Keeper) SetUserLimitBidData(ctx sdk.Context, mappingData types.LimitOrderBid, collateralTokenID uint64, debtTokenID uint64) { + var ( + store = k.Store(ctx) + key = types.UserLimitBidKey(mappingData.BidderAddress, collateralTokenID, debtTokenID) + value = k.cdc.MustMarshal(&mappingData) + ) + + store.Set(key, value) +} + +func (k Keeper) GetUserLimitBidData(ctx sdk.Context, address string, collateralTokenID uint64, debtTokenID uint64) (mappingData types.LimitOrderBid, found bool) { + var ( + store = k.Store(ctx) + key = types.UserLimitBidKey(address, collateralTokenID, debtTokenID) + value = store.Get(key) + ) + + if value == nil { + return mappingData, false + } + + k.cdc.MustUnmarshal(value, &mappingData) + return mappingData, true +} + +func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount string, amount sdk.Coin) error { id := k.GetLimitAuctionBidID(ctx) bidderAddr, err := sdk.AccAddressFromBech32(bidder) if err != nil { @@ -59,16 +85,26 @@ func (k Keeper) PlaceLimitAuctionBid(ctx sdk.Context, bidder string, CollateralT if err != nil { return err } - - limitBid := types.LimitOrderBid{ - LimitOrderBiddingId: id + 1, - BidderAddress: bidder, - CollateralToken: sdk.Coin{}, - DebtToken: sdk.Coin{}, - BiddingId: nil, - PremiumDiscount: premiumDiscount, + collateralAsset, found := k.asset.GetAsset(ctx, CollateralTokenId) + if !found { + return assettypes.ErrorAssetDoesNotExist } - k.SetLimitAuctionBidID(ctx, limitBid.LimitOrderBiddingId) + collateralAssetToken := sdk.NewCoin(collateralAsset.Denom, sdk.NewInt(0)) + userLimitBid, found := k.GetUserLimitBidData(ctx, bidder, CollateralTokenId, DebtTokenId) + if !found { + userLimitBid = types.LimitOrderBid{ + LimitOrderBiddingId: id + 1, + BidderAddress: bidder, + CollateralToken: collateralAssetToken, // zero + DebtToken: amount, // user's balance + BiddingId: nil, + PremiumDiscount: premiumDiscount, + } + } else { + userLimitBid.CollateralToken = userLimitBid.CollateralToken.Add(amount) + } + + k.SetLimitAuctionBidID(ctx, userLimitBid.LimitOrderBiddingId) return nil } @@ -76,6 +112,6 @@ func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder sdk.AccAddress, Co return nil } -func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder sdk.AccAddress, CollateralTokenId, DebtTokenId uint64, PremiumDiscount string) error { +func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64) error { return nil } diff --git a/x/auctionsV2/keeper/msg_server.go b/x/auctionsV2/keeper/msg_server.go index 1af5de19f..b869a2272 100644 --- a/x/auctionsV2/keeper/msg_server.go +++ b/x/auctionsV2/keeper/msg_server.go @@ -51,13 +51,13 @@ func (k msgServer) MsgPlaceMarketBid(goCtx context.Context, msg *types.MsgPlaceM return &types.MsgPlaceMarketBidResponse{}, nil } -func (k msgServer) MsgPlaceLimitBid(goCtx context.Context, msg *types.MsgPlaceLimitBidRequest) (*types.MsgPlaceLimitBidResponse, error) { +func (k msgServer) MsgDepositLimitBid(goCtx context.Context, msg *types.MsgDepositLimitBidRequest) (*types.MsgDepositLimitBidResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - err := k.PlaceLimitAuctionBid(ctx, msg.Bidder, msg.CollateralTokenId, msg.DebtTokenId, msg.PremiumDiscount, msg.Amount) + err := k.DepositLimitAuctionBid(ctx, msg.Bidder, msg.CollateralTokenId, msg.DebtTokenId, msg.PremiumDiscount, msg.Amount) if err != nil { return nil, err } - return &types.MsgPlaceLimitBidResponse{}, nil + return &types.MsgDepositLimitBidResponse{}, nil } func (k msgServer) MsgCancelLimitBid(goCtx context.Context, msg *types.MsgCancelLimitBidRequest) (*types.MsgCancelLimitBidResponse, error) { @@ -75,11 +75,7 @@ func (k msgServer) MsgCancelLimitBid(goCtx context.Context, msg *types.MsgCancel func (k msgServer) MsgWithdrawLimitBid(goCtx context.Context, msg *types.MsgWithdrawLimitBidRequest) (*types.MsgWithdrawLimitBidResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - bidder, err := sdk.AccAddressFromBech32(msg.Bidder) - if err != nil { - return nil, err - } - err = k.WithdrawLimitAuctionBid(ctx, bidder, msg.CollateralTokenId, msg.DebtTokenId, msg.PremiumDiscount) + err := k.WithdrawLimitAuctionBid(ctx, msg.Bidder, msg.CollateralTokenId, msg.DebtTokenId) if err != nil { return nil, err } diff --git a/x/auctionsV2/types/codec.go b/x/auctionsV2/types/codec.go index a62b774f4..2dcc7cab7 100644 --- a/x/auctionsV2/types/codec.go +++ b/x/auctionsV2/types/codec.go @@ -10,7 +10,7 @@ import ( func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgPlaceMarketBidRequest{}, "comdex/auctionsV2/MsgPlaceMarketBidRequest", nil) - cdc.RegisterConcrete(&MsgPlaceLimitBidRequest{}, "comdex/auctionsV2/MsgPlaceLimitBidRequest", nil) + cdc.RegisterConcrete(&MsgDepositLimitBidRequest{}, "comdex/auctionsV2/MsgPlaceLimitBidRequest", nil) cdc.RegisterConcrete(&MsgCancelLimitBidRequest{}, "comdex/auctionsV2/MsgCancelLimitBidRequest", nil) cdc.RegisterConcrete(&MsgWithdrawLimitBidRequest{}, "comdex/auctionsV2/MsgWithdrawLimitBidRequest", nil) } @@ -19,7 +19,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgPlaceMarketBidRequest{}, - &MsgPlaceLimitBidRequest{}, + &MsgDepositLimitBidRequest{}, &MsgCancelLimitBidRequest{}, &MsgWithdrawLimitBidRequest{}, ) diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index d7bdadaea..1a55142b1 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -22,16 +22,21 @@ const ( ) var ( - TypePlaceMarketBidRequest = ModuleName + ":market-bid-request" - TypePlaceLimitBidRequest = ModuleName + ":limit-bid-request" - TypeCancelLimitBidRequest = ModuleName + ":cancel-limit-bid-request" - TypeWithdrawLimitBidRequest = ModuleName + ":withdraw-limit-bid-request" - AuctionIDKey = []byte{0x01} - AuctionKeyPrefix = []byte{0x02} - LimitAuctionBidIDKey = []byte{0x03} - AuctionParamsKey = []byte{0x04} + TypePlaceMarketBidRequest = ModuleName + ":market-bid-request" + TypePlaceLimitBidRequest = ModuleName + ":limit-bid-request" + TypeCancelLimitBidRequest = ModuleName + ":cancel-limit-bid-request" + TypeWithdrawLimitBidRequest = ModuleName + ":withdraw-limit-bid-request" + AuctionIDKey = []byte{0x01} + AuctionKeyPrefix = []byte{0x02} + LimitAuctionBidIDKey = []byte{0x03} + AuctionParamsKey = []byte{0x04} + UserLimitBidMappingKeyPrefix = []byte{0x05} ) func AuctionKey(auctionID uint64) []byte { return append(append(AuctionKeyPrefix, sdk.Uint64ToBigEndian(auctionID)...)) } + +func UserLimitBidKey(address string, collateralTokenID, debtTokenID uint64) []byte { + return append(append(append(UserLimitBidMappingKeyPrefix, address...), sdk.Uint64ToBigEndian(collateralTokenID)...), sdk.Uint64ToBigEndian(debtTokenID)...) +} diff --git a/x/auctionsV2/types/tx.go b/x/auctionsV2/types/tx.go index 22d18708e..15876332e 100644 --- a/x/auctionsV2/types/tx.go +++ b/x/auctionsV2/types/tx.go @@ -41,8 +41,8 @@ func (msg *MsgPlaceMarketBidRequest) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -func NewMsgPlaceLimitBid(bidder string, collateralTokenId, debtTokenId uint64, premiumDiscount string, amount sdk.Coin) *MsgPlaceLimitBidRequest { - return &MsgPlaceLimitBidRequest{ +func NewMsgDepositLimitBid(bidder string, collateralTokenId, debtTokenId uint64, premiumDiscount string, amount sdk.Coin) *MsgDepositLimitBidRequest { + return &MsgDepositLimitBidRequest{ CollateralTokenId: collateralTokenId, DebtTokenId: debtTokenId, PremiumDiscount: premiumDiscount, @@ -51,10 +51,10 @@ func NewMsgPlaceLimitBid(bidder string, collateralTokenId, debtTokenId uint64, p } } -func (msg MsgPlaceLimitBidRequest) Route() string { return ModuleName } -func (msg MsgPlaceLimitBidRequest) Type() string { return TypePlaceLimitBidRequest } +func (msg MsgDepositLimitBidRequest) Route() string { return ModuleName } +func (msg MsgDepositLimitBidRequest) Type() string { return TypePlaceLimitBidRequest } -func (msg *MsgPlaceLimitBidRequest) ValidateBasic() error { +func (msg *MsgDepositLimitBidRequest) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Bidder) if err != nil { return err @@ -68,13 +68,13 @@ func (msg *MsgPlaceLimitBidRequest) ValidateBasic() error { return nil } -func (msg *MsgPlaceLimitBidRequest) GetSigners() []sdk.AccAddress { +func (msg *MsgDepositLimitBidRequest) GetSigners() []sdk.AccAddress { Bidder, _ := sdk.AccAddressFromBech32(msg.Bidder) return []sdk.AccAddress{Bidder} } // GetSignBytes get the bytes for the message signer to sign on. -func (msg *MsgPlaceLimitBidRequest) GetSignBytes() []byte { +func (msg *MsgDepositLimitBidRequest) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(msg) return sdk.MustSortJSON(bz) } diff --git a/x/auctionsV2/types/tx.pb.go b/x/auctionsV2/types/tx.pb.go index 7285e4d38..330975d1b 100644 --- a/x/auctionsV2/types/tx.pb.go +++ b/x/auctionsV2/types/tx.pb.go @@ -104,7 +104,7 @@ func (m *MsgPlaceMarketBidResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgPlaceMarketBidResponse proto.InternalMessageInfo -type MsgPlaceLimitBidRequest struct { +type MsgDepositLimitBidRequest struct { CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` PremiumDiscount string `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3" json:"premium_discount,omitempty"` @@ -112,18 +112,18 @@ type MsgPlaceLimitBidRequest struct { Amount types.Coin `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount"` } -func (m *MsgPlaceLimitBidRequest) Reset() { *m = MsgPlaceLimitBidRequest{} } -func (m *MsgPlaceLimitBidRequest) String() string { return proto.CompactTextString(m) } -func (*MsgPlaceLimitBidRequest) ProtoMessage() {} -func (*MsgPlaceLimitBidRequest) Descriptor() ([]byte, []int) { +func (m *MsgDepositLimitBidRequest) Reset() { *m = MsgDepositLimitBidRequest{} } +func (m *MsgDepositLimitBidRequest) String() string { return proto.CompactTextString(m) } +func (*MsgDepositLimitBidRequest) ProtoMessage() {} +func (*MsgDepositLimitBidRequest) Descriptor() ([]byte, []int) { return fileDescriptor_2c216a24ef98c1b4, []int{2} } -func (m *MsgPlaceLimitBidRequest) XXX_Unmarshal(b []byte) error { +func (m *MsgDepositLimitBidRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgPlaceLimitBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgDepositLimitBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgPlaceLimitBidRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgDepositLimitBidRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -133,33 +133,33 @@ func (m *MsgPlaceLimitBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *MsgPlaceLimitBidRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgPlaceLimitBidRequest.Merge(m, src) +func (m *MsgDepositLimitBidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDepositLimitBidRequest.Merge(m, src) } -func (m *MsgPlaceLimitBidRequest) XXX_Size() int { +func (m *MsgDepositLimitBidRequest) XXX_Size() int { return m.Size() } -func (m *MsgPlaceLimitBidRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MsgPlaceLimitBidRequest.DiscardUnknown(m) +func (m *MsgDepositLimitBidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDepositLimitBidRequest.DiscardUnknown(m) } -var xxx_messageInfo_MsgPlaceLimitBidRequest proto.InternalMessageInfo +var xxx_messageInfo_MsgDepositLimitBidRequest proto.InternalMessageInfo -type MsgPlaceLimitBidResponse struct { +type MsgDepositLimitBidResponse struct { } -func (m *MsgPlaceLimitBidResponse) Reset() { *m = MsgPlaceLimitBidResponse{} } -func (m *MsgPlaceLimitBidResponse) String() string { return proto.CompactTextString(m) } -func (*MsgPlaceLimitBidResponse) ProtoMessage() {} -func (*MsgPlaceLimitBidResponse) Descriptor() ([]byte, []int) { +func (m *MsgDepositLimitBidResponse) Reset() { *m = MsgDepositLimitBidResponse{} } +func (m *MsgDepositLimitBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDepositLimitBidResponse) ProtoMessage() {} +func (*MsgDepositLimitBidResponse) Descriptor() ([]byte, []int) { return fileDescriptor_2c216a24ef98c1b4, []int{3} } -func (m *MsgPlaceLimitBidResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgDepositLimitBidResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgPlaceLimitBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgDepositLimitBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgPlaceLimitBidResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgDepositLimitBidResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -169,17 +169,17 @@ func (m *MsgPlaceLimitBidResponse) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *MsgPlaceLimitBidResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgPlaceLimitBidResponse.Merge(m, src) +func (m *MsgDepositLimitBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDepositLimitBidResponse.Merge(m, src) } -func (m *MsgPlaceLimitBidResponse) XXX_Size() int { +func (m *MsgDepositLimitBidResponse) XXX_Size() int { return m.Size() } -func (m *MsgPlaceLimitBidResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgPlaceLimitBidResponse.DiscardUnknown(m) +func (m *MsgDepositLimitBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDepositLimitBidResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgPlaceLimitBidResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgDepositLimitBidResponse proto.InternalMessageInfo type MsgCancelLimitBidRequest struct { CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` @@ -337,8 +337,8 @@ var xxx_messageInfo_MsgWithdrawLimitBidResponse proto.InternalMessageInfo func init() { proto.RegisterType((*MsgPlaceMarketBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceMarketBidRequest") proto.RegisterType((*MsgPlaceMarketBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceMarketBidResponse") - proto.RegisterType((*MsgPlaceLimitBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceLimitBidRequest") - proto.RegisterType((*MsgPlaceLimitBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceLimitBidResponse") + proto.RegisterType((*MsgDepositLimitBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgDepositLimitBidRequest") + proto.RegisterType((*MsgDepositLimitBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgDepositLimitBidResponse") proto.RegisterType((*MsgCancelLimitBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgCancelLimitBidRequest") proto.RegisterType((*MsgCancelLimitBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgCancelLimitBidResponse") proto.RegisterType((*MsgWithdrawLimitBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgWithdrawLimitBidRequest") @@ -350,40 +350,40 @@ func init() { } var fileDescriptor_2c216a24ef98c1b4 = []byte{ - // 524 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x55, 0x3f, 0x6f, 0xd3, 0x40, - 0x14, 0xf7, 0xb5, 0x21, 0x52, 0xae, 0x42, 0xb4, 0x57, 0x04, 0x89, 0xab, 0x9a, 0x28, 0x53, 0x18, - 0xb0, 0xd5, 0xa4, 0xc0, 0x9e, 0xb2, 0x54, 0x22, 0x12, 0xb2, 0x50, 0x91, 0x58, 0xa2, 0xf3, 0xdd, - 0xd5, 0x3d, 0xd5, 0xf6, 0x05, 0xdf, 0x19, 0x8a, 0x90, 0x98, 0x58, 0x60, 0xe2, 0x63, 0xb0, 0xf2, - 0x2d, 0x32, 0x76, 0x64, 0x42, 0x90, 0x4c, 0x48, 0x7c, 0x08, 0xe4, 0xdc, 0xa5, 0x4e, 0x83, 0x43, - 0xc9, 0x08, 0x5b, 0xee, 0xbd, 0xdf, 0x7b, 0xef, 0xf7, 0x7b, 0x7f, 0x62, 0xd8, 0x22, 0x22, 0xa6, - 0xec, 0xcc, 0xc3, 0x19, 0x51, 0x5c, 0x24, 0xf2, 0xa8, 0xe3, 0xbd, 0xdc, 0x0b, 0x98, 0xc2, 0x7b, - 0x9e, 0x3a, 0x73, 0x87, 0xa9, 0x50, 0x02, 0x35, 0x34, 0xc6, 0x2d, 0x30, 0xae, 0xc1, 0xd8, 0x37, - 0x43, 0x11, 0x8a, 0x29, 0xca, 0xcb, 0x7f, 0xe9, 0x00, 0xdb, 0x21, 0x42, 0xc6, 0x42, 0x7a, 0x01, - 0x96, 0xec, 0x22, 0x1d, 0x11, 0x3c, 0xd1, 0xfe, 0xd6, 0x07, 0x00, 0xeb, 0x7d, 0x19, 0x3e, 0x89, - 0x30, 0x61, 0x7d, 0x9c, 0x9e, 0x32, 0xd5, 0xe3, 0xd4, 0x67, 0x2f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, 0x33, 0xae, 0x4e, 0x68, 0x8a, 0x5f, 0xfd, 0xef, 0xb3, 0xdd, 0x85, 0x3b, 0xa5, 0x6a, - 0x75, 0x37, 0x3a, 0xef, 0x2b, 0x70, 0xbd, 0x2f, 0x43, 0xf4, 0x16, 0x6e, 0xfd, 0x76, 0x0b, 0xa8, - 0xeb, 0x2e, 0xbd, 0x7f, 0x77, 0xd9, 0x15, 0xdb, 0xfb, 0xab, 0x05, 0x69, 0x1e, 0xe8, 0x0d, 0xdc, - 0x5c, 0x5c, 0x41, 0xd4, 0xf9, 0x8b, 0x4c, 0x0b, 0xe3, 0xb3, 0xbb, 0x2b, 0xc5, 0x98, 0xe2, 0x5a, - 0xfc, 0xe5, 0x7d, 0xb9, 0x4a, 0x7c, 0xe9, 0x41, 0x5c, 0x25, 0xbe, 0x7c, 0x25, 0xd1, 0x3b, 0x00, - 0xb7, 0x4b, 0x86, 0x84, 0xee, 0xff, 0x39, 0xdb, 0x92, 0x15, 0xb6, 0x1f, 0xac, 0x1a, 0xa6, 0x69, - 0xf4, 0x8e, 0x46, 0xdf, 0x1d, 0xeb, 0xd3, 0xd8, 0xb1, 0x46, 0x63, 0x07, 0x9c, 0x8f, 0x1d, 0xf0, - 0x6d, 0xec, 0x80, 0x8f, 0x13, 0xc7, 0x3a, 0x9f, 0x38, 0xd6, 0x97, 0x89, 0x63, 0x3d, 0xdf, 0x0f, - 0xb9, 0x3a, 0xc9, 0x82, 0x3c, 0xbf, 0xa7, 0x6b, 0xdc, 0x13, 0xc7, 0xc7, 0x9c, 0x70, 0x1c, 0x99, - 0xb7, 0x77, 0xe9, 0x83, 0xa2, 0x5e, 0x0f, 0x99, 0x0c, 0xaa, 0xd3, 0xff, 0xfe, 0xee, 0xaf, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x75, 0x98, 0x33, 0x44, 0x72, 0x06, 0x00, 0x00, + // 523 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x55, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0x8e, 0xb7, 0x32, 0xa9, 0x9e, 0x10, 0xcc, 0x43, 0xa8, 0xcd, 0x58, 0xa8, 0x72, 0x2a, 0x07, + 0x12, 0xad, 0x1b, 0x70, 0xef, 0x76, 0x99, 0x44, 0x25, 0x14, 0xa1, 0x21, 0x71, 0xa9, 0x1c, 0xdb, + 0xcb, 0xac, 0x25, 0x71, 0x88, 0x1d, 0x18, 0x17, 0x24, 0x24, 0x4e, 0x9c, 0xf6, 0x33, 0xb8, 0xf2, + 0x2f, 0x7a, 0xdc, 0x91, 0x13, 0x82, 0xf6, 0x08, 0x3f, 0x02, 0x25, 0xf6, 0xd6, 0x8e, 0xa5, 0xaa, + 0x7a, 0x84, 0x5b, 0xfc, 0xde, 0xf7, 0x9e, 0xbf, 0xf7, 0xbd, 0xf7, 0x62, 0xe8, 0x12, 0x91, 0x50, + 0x76, 0xe6, 0xe3, 0x82, 0x28, 0x2e, 0x52, 0x79, 0xd4, 0xf3, 0xdf, 0xee, 0x84, 0x4c, 0xe1, 0x1d, + 0x5f, 0x9d, 0x79, 0x59, 0x2e, 0x94, 0x40, 0x6d, 0x8d, 0xf1, 0xa6, 0x18, 0xcf, 0x60, 0xec, 0x7b, + 0x91, 0x88, 0x44, 0x85, 0xf2, 0xcb, 0x2f, 0x1d, 0x60, 0x3b, 0x44, 0xc8, 0x44, 0x48, 0x3f, 0xc4, + 0x92, 0x5d, 0xa5, 0x23, 0x82, 0xa7, 0xda, 0xef, 0x7e, 0x06, 0xb0, 0x35, 0x90, 0xd1, 0x8b, 0x18, + 0x13, 0x36, 0xc0, 0xf9, 0x29, 0x53, 0x7d, 0x4e, 0x03, 0xf6, 0xa6, 0x60, 0x52, 0xa1, 0x6d, 0x08, + 0xcd, 0x45, 0x43, 0x4e, 0x5b, 0xa0, 0x03, 0xba, 0x8d, 0xa0, 0x69, 0x2c, 0x87, 0x14, 0x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3, 0x06, 0x5c, 0x1d, 0xc8, 0x08, 0x7d, 0x80, 0x1b, 0x37, 0xf6, 0x01, + 0xed, 0x7a, 0x73, 0xff, 0x01, 0xde, 0xbc, 0x4d, 0xb6, 0xf7, 0x96, 0x0b, 0xd2, 0x3c, 0xd0, 0x47, + 0x00, 0xd1, 0xcd, 0x29, 0x44, 0x0b, 0x92, 0xd5, 0x6f, 0xa8, 0xfd, 0x64, 0xc9, 0x28, 0xc3, 0x41, + 0x6b, 0x70, 0x7d, 0x6c, 0x16, 0x69, 0x50, 0xbb, 0x17, 0x8b, 0x34, 0xa8, 0x9f, 0x4c, 0xf4, 0x09, + 0xc0, 0xcd, 0x9a, 0x5e, 0xa1, 0x05, 0xe5, 0xcc, 0x99, 0x64, 0xfb, 0xe9, 0xb2, 0x61, 0x9a, 0x46, + 0xff, 0x68, 0xf4, 0xd3, 0xb1, 0xbe, 0x8c, 0x1d, 0x6b, 0x34, 0x76, 0xc0, 0xc5, 0xd8, 0x01, 0x3f, + 0xc6, 0x0e, 0x38, 0x9f, 0x38, 0xd6, 0xc5, 0xc4, 0xb1, 0xbe, 0x4d, 0x1c, 0xeb, 0xf5, 0x5e, 0xc4, + 0xd5, 0x49, 0x11, 0x96, 0xf9, 0x7d, 0x7d, 0xc7, 0x63, 0x71, 0x7c, 0xcc, 0x09, 0xc7, 0xb1, 0x39, + 0xfb, 0xd7, 0xde, 0x16, 0xf5, 0x3e, 0x63, 0x32, 0x5c, 0xab, 0x9e, 0x81, 0xdd, 0x3f, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xae, 0xb8, 0xda, 0xe7, 0x7d, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -399,7 +399,7 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { MsgPlaceMarketBid(ctx context.Context, in *MsgPlaceMarketBidRequest, opts ...grpc.CallOption) (*MsgPlaceMarketBidResponse, error) - MsgPlaceLimitBid(ctx context.Context, in *MsgPlaceLimitBidRequest, opts ...grpc.CallOption) (*MsgPlaceLimitBidResponse, error) + MsgDepositLimitBid(ctx context.Context, in *MsgDepositLimitBidRequest, opts ...grpc.CallOption) (*MsgDepositLimitBidResponse, error) MsgCancelLimitBid(ctx context.Context, in *MsgCancelLimitBidRequest, opts ...grpc.CallOption) (*MsgCancelLimitBidResponse, error) MsgWithdrawLimitBid(ctx context.Context, in *MsgWithdrawLimitBidRequest, opts ...grpc.CallOption) (*MsgWithdrawLimitBidResponse, error) } @@ -421,9 +421,9 @@ func (c *msgClient) MsgPlaceMarketBid(ctx context.Context, in *MsgPlaceMarketBid return out, nil } -func (c *msgClient) MsgPlaceLimitBid(ctx context.Context, in *MsgPlaceLimitBidRequest, opts ...grpc.CallOption) (*MsgPlaceLimitBidResponse, error) { - out := new(MsgPlaceLimitBidResponse) - err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgPlaceLimitBid", in, out, opts...) +func (c *msgClient) MsgDepositLimitBid(ctx context.Context, in *MsgDepositLimitBidRequest, opts ...grpc.CallOption) (*MsgDepositLimitBidResponse, error) { + out := new(MsgDepositLimitBidResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgDepositLimitBid", in, out, opts...) if err != nil { return nil, err } @@ -451,7 +451,7 @@ func (c *msgClient) MsgWithdrawLimitBid(ctx context.Context, in *MsgWithdrawLimi // MsgServer is the server API for Msg service. type MsgServer interface { MsgPlaceMarketBid(context.Context, *MsgPlaceMarketBidRequest) (*MsgPlaceMarketBidResponse, error) - MsgPlaceLimitBid(context.Context, *MsgPlaceLimitBidRequest) (*MsgPlaceLimitBidResponse, error) + MsgDepositLimitBid(context.Context, *MsgDepositLimitBidRequest) (*MsgDepositLimitBidResponse, error) MsgCancelLimitBid(context.Context, *MsgCancelLimitBidRequest) (*MsgCancelLimitBidResponse, error) MsgWithdrawLimitBid(context.Context, *MsgWithdrawLimitBidRequest) (*MsgWithdrawLimitBidResponse, error) } @@ -463,8 +463,8 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) MsgPlaceMarketBid(ctx context.Context, req *MsgPlaceMarketBidRequest) (*MsgPlaceMarketBidResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MsgPlaceMarketBid not implemented") } -func (*UnimplementedMsgServer) MsgPlaceLimitBid(ctx context.Context, req *MsgPlaceLimitBidRequest) (*MsgPlaceLimitBidResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MsgPlaceLimitBid not implemented") +func (*UnimplementedMsgServer) MsgDepositLimitBid(ctx context.Context, req *MsgDepositLimitBidRequest) (*MsgDepositLimitBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgDepositLimitBid not implemented") } func (*UnimplementedMsgServer) MsgCancelLimitBid(ctx context.Context, req *MsgCancelLimitBidRequest) (*MsgCancelLimitBidResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MsgCancelLimitBid not implemented") @@ -495,20 +495,20 @@ func _Msg_MsgPlaceMarketBid_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } -func _Msg_MsgPlaceLimitBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgPlaceLimitBidRequest) +func _Msg_MsgDepositLimitBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDepositLimitBidRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).MsgPlaceLimitBid(ctx, in) + return srv.(MsgServer).MsgDepositLimitBid(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgPlaceLimitBid", + FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgDepositLimitBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).MsgPlaceLimitBid(ctx, req.(*MsgPlaceLimitBidRequest)) + return srv.(MsgServer).MsgDepositLimitBid(ctx, req.(*MsgDepositLimitBidRequest)) } return interceptor(ctx, in, info, handler) } @@ -558,8 +558,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_MsgPlaceMarketBid_Handler, }, { - MethodName: "MsgPlaceLimitBid", - Handler: _Msg_MsgPlaceLimitBid_Handler, + MethodName: "MsgDepositLimitBid", + Handler: _Msg_MsgDepositLimitBid_Handler, }, { MethodName: "MsgCancelLimitBid", @@ -642,7 +642,7 @@ func (m *MsgPlaceMarketBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *MsgPlaceLimitBidRequest) Marshal() (dAtA []byte, err error) { +func (m *MsgDepositLimitBidRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -652,12 +652,12 @@ func (m *MsgPlaceLimitBidRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgPlaceLimitBidRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgDepositLimitBidRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgPlaceLimitBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgDepositLimitBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -699,7 +699,7 @@ func (m *MsgPlaceLimitBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *MsgPlaceLimitBidResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgDepositLimitBidResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -709,12 +709,12 @@ func (m *MsgPlaceLimitBidResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgPlaceLimitBidResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgDepositLimitBidResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgPlaceLimitBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgDepositLimitBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -910,7 +910,7 @@ func (m *MsgPlaceMarketBidResponse) Size() (n int) { return n } -func (m *MsgPlaceLimitBidRequest) Size() (n int) { +func (m *MsgDepositLimitBidRequest) Size() (n int) { if m == nil { return 0 } @@ -935,7 +935,7 @@ func (m *MsgPlaceLimitBidRequest) Size() (n int) { return n } -func (m *MsgPlaceLimitBidResponse) Size() (n int) { +func (m *MsgDepositLimitBidResponse) Size() (n int) { if m == nil { return 0 } @@ -1200,7 +1200,7 @@ func (m *MsgPlaceMarketBidResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgPlaceLimitBidRequest) Unmarshal(dAtA []byte) error { +func (m *MsgDepositLimitBidRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1223,10 +1223,10 @@ func (m *MsgPlaceLimitBidRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgPlaceLimitBidRequest: wiretype end group for non-group") + return fmt.Errorf("proto: MsgDepositLimitBidRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPlaceLimitBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgDepositLimitBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1385,7 +1385,7 @@ func (m *MsgPlaceLimitBidRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgPlaceLimitBidResponse) Unmarshal(dAtA []byte) error { +func (m *MsgDepositLimitBidResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1408,10 +1408,10 @@ func (m *MsgPlaceLimitBidResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgPlaceLimitBidResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgDepositLimitBidResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPlaceLimitBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgDepositLimitBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: From c806040b4b0e494a592fde17f18374c9c18bd620 Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 9 May 2023 17:49:46 +0530 Subject: [PATCH 066/155] updating cancel and withdraw limit bid function --- x/auctionsV2/client/cli/tx.go | 8 +-- x/auctionsV2/keeper/bid.go | 83 +++++++++++++++++++++++++------ x/auctionsV2/keeper/msg_server.go | 8 +-- x/auctionsV2/keeper/utils.go | 3 -- x/auctionsV2/types/keys.go | 6 +-- 5 files changed, 76 insertions(+), 32 deletions(-) diff --git a/x/auctionsV2/client/cli/tx.go b/x/auctionsV2/client/cli/tx.go index 5a47bbdac..2f61f435d 100644 --- a/x/auctionsV2/client/cli/tx.go +++ b/x/auctionsV2/client/cli/tx.go @@ -36,7 +36,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand( txPlaceMarketDutchBid(), - txPlaceLimitDutchBid(), + txDepositLimitDutchBid(), txCancelLimitDutchBid(), txWithdrawLimitDutchBid(), ) @@ -77,9 +77,9 @@ func txPlaceMarketDutchBid() *cobra.Command { return cmd } -func txPlaceLimitDutchBid() *cobra.Command { +func txDepositLimitDutchBid() *cobra.Command { cmd := &cobra.Command{ - Use: "limit-bid-request [collateral-token-id] [debt-token-id] [discount] [bid-amount]", + Use: "deposit-limit-bid-request [collateral-token-id] [debt-token-id] [discount] [bid-amount]", Short: "Place a limit bid on a dutch auction", Args: cobra.ExactArgs(4), RunE: func(cmd *cobra.Command, args []string) error { @@ -102,7 +102,7 @@ func txPlaceLimitDutchBid() *cobra.Command { return err } - msg := types.NewMsgPlaceLimitBid(clientCtx.GetFromAddress().String(), collateralTokenID, debtTokenID, args[2], amt) + msg := types.NewMsgDepositLimitBid(clientCtx.GetFromAddress().String(), collateralTokenID, debtTokenID, args[2], amt) err = msg.ValidateBasic() if err != nil { return err diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 77adb62e5..b6e6d32ea 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -8,9 +8,6 @@ import ( ) func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auctions) error { - - - return nil } @@ -50,20 +47,20 @@ func (k Keeper) GetLimitAuctionBidID(ctx sdk.Context) uint64 { return id.GetValue() } -func (k Keeper) SetUserLimitBidData(ctx sdk.Context, mappingData types.LimitOrderBid, collateralTokenID uint64, debtTokenID uint64) { +func (k Keeper) SetUserLimitBidData(ctx sdk.Context, userLimitBidData types.LimitOrderBid, debtTokenID, collateralTokenID uint64, premium string) { var ( store = k.Store(ctx) - key = types.UserLimitBidKey(mappingData.BidderAddress, collateralTokenID, debtTokenID) - value = k.cdc.MustMarshal(&mappingData) + key = types.UserLimitBidKey(debtTokenID, collateralTokenID, premium, userLimitBidData.BidderAddress) + value = k.cdc.MustMarshal(&userLimitBidData) ) store.Set(key, value) } -func (k Keeper) GetUserLimitBidData(ctx sdk.Context, address string, collateralTokenID uint64, debtTokenID uint64) (mappingData types.LimitOrderBid, found bool) { +func (k Keeper) GetUserLimitBidData(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium, address string) (mappingData types.LimitOrderBid, found bool) { var ( store = k.Store(ctx) - key = types.UserLimitBidKey(address, collateralTokenID, debtTokenID) + key = types.UserLimitBidKey(debtTokenID, collateralTokenID, premium, address) value = store.Get(key) ) @@ -74,6 +71,14 @@ func (k Keeper) GetUserLimitBidData(ctx sdk.Context, address string, collateralT k.cdc.MustUnmarshal(value, &mappingData) return mappingData, true } +func (k Keeper) DeleteUserLimitBidData(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium, address string) { + var ( + store = k.Store(ctx) + key = types.UserLimitBidKey(debtTokenID, collateralTokenID, premium, address) + ) + + store.Delete(key) +} func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount string, amount sdk.Coin) error { id := k.GetLimitAuctionBidID(ctx) @@ -81,10 +86,6 @@ func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, Collatera if err != nil { return nil } - err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, types.ModuleName, sdk.NewCoins(amount)) - if err != nil { - return err - } premiumDiscount, err := sdk.NewDecFromStr(PremiumDiscount) if err != nil { return err @@ -94,7 +95,7 @@ func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, Collatera return assettypes.ErrorAssetDoesNotExist } collateralAssetToken := sdk.NewCoin(collateralAsset.Denom, sdk.NewInt(0)) - userLimitBid, found := k.GetUserLimitBidData(ctx, bidder, CollateralTokenId, DebtTokenId) + userLimitBid, found := k.GetUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) if !found { userLimitBid = types.LimitOrderBid{ LimitOrderBiddingId: id + 1, @@ -105,17 +106,67 @@ func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, Collatera PremiumDiscount: premiumDiscount, } } else { - userLimitBid.CollateralToken = userLimitBid.CollateralToken.Add(amount) + userLimitBid.DebtToken = userLimitBid.DebtToken.Add(amount) } + // send tokens from user to the auction module + err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, types.ModuleName, sdk.NewCoins(amount)) + if err != nil { + return err + } + + // Set ID and LimitBid Data k.SetLimitAuctionBidID(ctx, userLimitBid.LimitOrderBiddingId) + k.SetUserLimitBidData(ctx, userLimitBid, DebtTokenId, CollateralTokenId, PremiumDiscount) return nil } -func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder sdk.AccAddress, CollateralTokenId, DebtTokenId uint64) error { +func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenId, CollateralTokenId uint64, PremiumDiscount string) error { + userLimitBid, found := k.GetUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) + if !found { + // return err not found + } + + bidderAddr, err := sdk.AccAddressFromBech32(bidder) + if err != nil { + return err + } + // return all the tokens back to the user + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, sdk.NewCoins(userLimitBid.DebtToken)) + if err != nil { + return err + } + + // delete userLimitBid from KV store + k.DeleteUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) + return nil } -func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64) error { +func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount string, amount sdk.Coin) error { + userLimitBid, found := k.GetUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) + if !found { + // return err not found + } + + bidderAddr, err := sdk.AccAddressFromBech32(bidder) + if err != nil { + return err + } + + if amount.Amount.Equal(userLimitBid.DebtToken.Amount) { + err := k.CancelLimitAuctionBid(ctx, bidder, DebtTokenId, CollateralTokenId, PremiumDiscount) + if err != nil { + return err + } + return nil + } + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, sdk.NewCoins(amount)) + if err != nil { + return err + } + userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(amount.Amount) + k.SetUserLimitBidData(ctx, userLimitBid, DebtTokenId, CollateralTokenId, PremiumDiscount) + return nil } diff --git a/x/auctionsV2/keeper/msg_server.go b/x/auctionsV2/keeper/msg_server.go index b869a2272..8fa4fb06d 100644 --- a/x/auctionsV2/keeper/msg_server.go +++ b/x/auctionsV2/keeper/msg_server.go @@ -62,11 +62,7 @@ func (k msgServer) MsgDepositLimitBid(goCtx context.Context, msg *types.MsgDepos func (k msgServer) MsgCancelLimitBid(goCtx context.Context, msg *types.MsgCancelLimitBidRequest) (*types.MsgCancelLimitBidResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - bidder, err := sdk.AccAddressFromBech32(msg.Bidder) - if err != nil { - return nil, err - } - err = k.CancelLimitAuctionBid(ctx, bidder, msg.CollateralTokenId, msg.DebtTokenId) + err := k.CancelLimitAuctionBid(ctx, msg.Bidder, msg.CollateralTokenId, msg.DebtTokenId, msg.PremiumDiscount) if err != nil { return nil, err } @@ -75,7 +71,7 @@ func (k msgServer) MsgCancelLimitBid(goCtx context.Context, msg *types.MsgCancel func (k msgServer) MsgWithdrawLimitBid(goCtx context.Context, msg *types.MsgWithdrawLimitBidRequest) (*types.MsgWithdrawLimitBidResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - err := k.WithdrawLimitAuctionBid(ctx, msg.Bidder, msg.CollateralTokenId, msg.DebtTokenId) + err := k.WithdrawLimitAuctionBid(ctx, msg.Bidder, msg.CollateralTokenId, msg.DebtTokenId, msg.PremiumDiscount, msg.Amount) if err != nil { return nil, err } diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go index 7b8dcdc6e..57d2159d7 100644 --- a/x/auctionsV2/keeper/utils.go +++ b/x/auctionsV2/keeper/utils.go @@ -1,10 +1,7 @@ package keeper import ( - "time" - "github.com/comdex-official/comdex/x/auctionsV2/types" - liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" protobuftypes "github.com/gogo/protobuf/types" diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index 1a55142b1..44d69c600 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -23,7 +23,7 @@ const ( var ( TypePlaceMarketBidRequest = ModuleName + ":market-bid-request" - TypePlaceLimitBidRequest = ModuleName + ":limit-bid-request" + TypePlaceLimitBidRequest = ModuleName + ":deposit-limit-bid-request" TypeCancelLimitBidRequest = ModuleName + ":cancel-limit-bid-request" TypeWithdrawLimitBidRequest = ModuleName + ":withdraw-limit-bid-request" AuctionIDKey = []byte{0x01} @@ -37,6 +37,6 @@ func AuctionKey(auctionID uint64) []byte { return append(append(AuctionKeyPrefix, sdk.Uint64ToBigEndian(auctionID)...)) } -func UserLimitBidKey(address string, collateralTokenID, debtTokenID uint64) []byte { - return append(append(append(UserLimitBidMappingKeyPrefix, address...), sdk.Uint64ToBigEndian(collateralTokenID)...), sdk.Uint64ToBigEndian(debtTokenID)...) +func UserLimitBidKey(debtTokenID, collateralTokenID uint64, premium, address string) []byte { + return append(append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), premium...), address...) } From d801bd1e483eeb3f0bf1709eaa9cdad75411acec Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 9 May 2023 17:54:23 +0530 Subject: [PATCH 067/155] updating cancel and withdraw limit bid function --- x/auctionsV2/keeper/bid.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index b6e6d32ea..9f4e22e82 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -71,6 +71,7 @@ func (k Keeper) GetUserLimitBidData(ctx sdk.Context, debtTokenID, collateralToke k.cdc.MustUnmarshal(value, &mappingData) return mappingData, true } + func (k Keeper) DeleteUserLimitBidData(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium, address string) { var ( store = k.Store(ctx) @@ -167,6 +168,5 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater } userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(amount.Amount) k.SetUserLimitBidData(ctx, userLimitBid, DebtTokenId, CollateralTokenId, PremiumDiscount) - return nil } From 73cd57b3e73bc0cd079b278591b3c19163b119c3 Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 19 May 2023 04:19:08 +0530 Subject: [PATCH 068/155] LimitOrderBid updated --- x/auctionsV2/abci.go | 9 +++++- x/auctionsV2/keeper/auctions.go | 50 +++++++++++++++++++++++++++++++++ x/auctionsV2/keeper/bid.go | 26 +++++++++++++++++ x/auctionsV2/types/keys.go | 4 +++ 4 files changed, 88 insertions(+), 1 deletion(-) diff --git a/x/auctionsV2/abci.go b/x/auctionsV2/abci.go index 6678dd6ab..a76bace41 100644 --- a/x/auctionsV2/abci.go +++ b/x/auctionsV2/abci.go @@ -11,7 +11,10 @@ func BeginBlocker(ctx sdk.Context, k keeper.Keeper, assetKeeper expected.AssetKe // defer telemetry.ModuleMeasureSince(types.ModuleName, ctx.BlockTime(), telemetry.MetricKeyBeginBlocker) - k.AuctionIterator(ctx) + err := k.AuctionIterator(ctx) + if err != nil { + return + } // // auctionMapData, auctionMappingFound := collectorKeeper.GetAllAuctionMappingForApp(ctx) // if auctionMappingFound { @@ -98,4 +101,8 @@ func BeginBlocker(ctx sdk.Context, k keeper.Keeper, assetKeeper expected.AssetKe // } // } // } + err = k.LimitOrderBid(ctx) + if err != nil { + return + } } diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index c0cd0f2e1..5faffac17 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -371,3 +371,53 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio return nil } + +func (k Keeper) LimitOrderBid(ctx sdk.Context) error { + // Get Auctions One by One and for that particular auction check the current discount + // if we find any active limit bid for that premium then we will execute it and update both + + auctions := k.GetAuctions(ctx) + for _, auction := range auctions { + _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { + if auction.CollateralTokenOraclePrice.GT(auction.CollateralTokenAuctionPrice) { + premium := (auction.CollateralTokenOraclePrice.Sub(auction.CollateralTokenAuctionPrice)).Quo(auction.CollateralTokenOraclePrice) + premiumPerc := premium.Mul(sdk.NewDecFromInt(sdk.NewInt(100))) + biddingData, found := k.GetUserLimitBidDataByPremium(ctx, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt().String()) + if !found { + return nil + } + // Here we will check if the auction amount is greater than individual bids or vice versa, + // in any of the case update both user bids and individual auctions + + for _, individualBids := range biddingData { + addr, _ := sdk.AccAddressFromBech32(individualBids.BidderAddress) + if individualBids.DebtToken.Amount.GTE(auction.DebtToken.Amount) { + // the auction is completed here, and now we will update user's limit bid data + err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr, auction.DebtToken, auction) + if err != nil { + return err + } + if individualBids.DebtToken.Amount.Equal(auction.DebtToken.Amount) { + k.DeleteUserLimitBidData(ctx, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt().String(), individualBids.BidderAddress) + return nil + } + individualBids.DebtToken.Amount = individualBids.DebtToken.Amount.Sub(auction.DebtToken.Amount) + //Todo: append bidding ID + //individualBids.BiddingId = append(individualBids.BiddingId, id) + k.SetUserLimitBidData(ctx, individualBids, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt().String()) + } else { + err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr, individualBids.DebtToken, auction) + if err != nil { + return err + } + k.DeleteUserLimitBidData(ctx, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt().String(), individualBids.BidderAddress) + } + + } + + } + return nil + }) + } + return nil +} diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 9f4e22e82..ea4fdb870 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -81,6 +81,32 @@ func (k Keeper) DeleteUserLimitBidData(ctx sdk.Context, debtTokenID, collateralT store.Delete(key) } +func (k Keeper) GetUserLimitBidDataByPremium(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium string) (biddingData []types.LimitOrderBid, found bool) { + var ( + store = k.Store(ctx) + key = types.UserLimitBidKeyForPremium(debtTokenID, collateralTokenID, premium) + iter = sdk.KVStorePrefixIterator(store, key) + ) + + defer func(iter sdk.Iterator) { + err := iter.Close() + if err != nil { + return + } + }(iter) + + for ; iter.Valid(); iter.Next() { + var mapData types.LimitOrderBid + k.cdc.MustUnmarshal(iter.Value(), &mapData) + biddingData = append(biddingData, mapData) + } + if biddingData == nil { + return nil, false + } + + return biddingData, true +} + func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount string, amount sdk.Coin) error { id := k.GetLimitAuctionBidID(ctx) bidderAddr, err := sdk.AccAddressFromBech32(bidder) diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index 44d69c600..a32c00e1d 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -40,3 +40,7 @@ func AuctionKey(auctionID uint64) []byte { func UserLimitBidKey(debtTokenID, collateralTokenID uint64, premium, address string) []byte { return append(append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), premium...), address...) } + +func UserLimitBidKeyForPremium(debtTokenID, collateralTokenID uint64, premium string) []byte { + return append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), premium...) +} From 9d77bd82a268142885cfb450db6078cf481b9be6 Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 23 May 2023 07:16:01 +0530 Subject: [PATCH 069/155] english activator --- x/liquidationsV2/expected/keeper.go | 13 ++++++ x/liquidationsV2/keeper/keeper.go | 3 ++ x/liquidationsV2/keeper/liquidate.go | 70 ++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) diff --git a/x/liquidationsV2/expected/keeper.go b/x/liquidationsV2/expected/keeper.go index ef3fafb7f..3f543d320 100644 --- a/x/liquidationsV2/expected/keeper.go +++ b/x/liquidationsV2/expected/keeper.go @@ -2,6 +2,7 @@ package expected import ( assettypes "github.com/comdex-official/comdex/x/asset/types" + collectortypes "github.com/comdex-official/comdex/x/collector/types" esmtypes "github.com/comdex-official/comdex/x/esm/types" lendtypes "github.com/comdex-official/comdex/x/lend/types" liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" @@ -96,3 +97,15 @@ type RewardsKeeper interface { type AuctionsV2Keeper interface { AuctionActivator(ctx sdk.Context, lockedVault liquidationtypes.LockedVault) error } + +type CollectorKeeper interface { + GetAppidToAssetCollectorMapping(ctx sdk.Context, appID, assetID uint64) (appAssetCollectorData collectortypes.AppToAssetIdCollectorMapping, found bool) + UpdateCollector(ctx sdk.Context, appID, assetID uint64, CollectedStabilityFee, CollectedClosingFee, CollectedOpeningFee, LiquidationRewardsCollected sdk.Int) error + GetCollectorLookupTable(ctx sdk.Context, appID, assetID uint64) (collectorLookup collectortypes.CollectorLookupTableData, found bool) + GetAuctionMappingForApp(ctx sdk.Context, appID, assetID uint64) (collectorAuctionLookupTable collectortypes.AppAssetIdToAuctionLookupTable, found bool) + GetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64) (netFeeData collectortypes.AppAssetIdToFeeCollectedData, found bool) + GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, amount sdk.Int) (sdk.Int, error) + SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdk.Int) error + SetAuctionMappingForApp(ctx sdk.Context, records collectortypes.AppAssetIdToAuctionLookupTable) error + GetAllAuctionMappingForApp(ctx sdk.Context) (collectorAuctionLookupTable []collectortypes.AppAssetIdToAuctionLookupTable, found bool) +} diff --git a/x/liquidationsV2/keeper/keeper.go b/x/liquidationsV2/keeper/keeper.go index d081bac34..0441400cc 100644 --- a/x/liquidationsV2/keeper/keeper.go +++ b/x/liquidationsV2/keeper/keeper.go @@ -27,6 +27,7 @@ type Keeper struct { rewards expected.RewardsKeeper lend expected.LendKeeper auctionsV2 expected.AuctionsV2Keeper + collector expected.CollectorKeeper } func NewKeeper( @@ -43,6 +44,7 @@ func NewKeeper( rewards expected.RewardsKeeper, lend expected.LendKeeper, auctionsV2Keeper expected.AuctionsV2Keeper, + collector expected.CollectorKeeper, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -63,6 +65,7 @@ func NewKeeper( rewards: rewards, lend: lend, auctionsV2: auctionsV2Keeper, + collector: collector, } } diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 92e915b72..8a1ffe4ef 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -21,6 +21,11 @@ func (k Keeper) Liquidate(ctx sdk.Context) error { if err != nil { return err } + + err = k.LiquidateForSurplusAndDebt(ctx) + if err != nil { + return err + } return nil } @@ -394,3 +399,68 @@ func (k Keeper) WhitelistLiquidation(ctx sdk.Context, msg types.LiquidationWhite k.SetLiquidationWhiteListing(ctx, msg) return nil } + +func (k Keeper) LiquidateForSurplusAndDebt(ctx sdk.Context) error { + auctionMapData, _ := k.collector.GetAllAuctionMappingForApp(ctx) + for _, data := range auctionMapData { + err := k.CheckNetFeesCollectedStatsForSurplusAndDebt(ctx, data.AppId, data.AssetId) + if err != nil { + return err + } + } + + return nil +} + +func (k Keeper) CheckNetFeesCollectedStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint64) error { + collector, found := k.collector.GetCollectorLookupTable(ctx, appID, assetID) + if !found { + return nil + } + // coin denomination will be of 2 type: Auctioned Asset the asset which is being sold; i.e. Collateral Token + // Asset required to bid on Collateral Asset; i.e. Debt Token + // traverse this to access appId , collector asset id , debt threshold + + netFeeCollectedData, found := k.collector.GetNetFeeCollectedData(ctx, appID, assetID) + if !found { + return nil + } + // for debt Auction + if netFeeCollectedData.NetFeesCollected.LTE(collector.DebtThreshold.Sub(collector.LotSize)) { + collateralAssetID := collector.CollectorAssetId + debtAssetID := collector.SecondaryAssetId + // net = 200 debtThreshold = 500 , lotSize = 100 + collateralToken, debtToken := k.getDebtSellTokenAmount(ctx, collateralAssetID, debtAssetID, collector.LotSize, collector.DebtLotSize) + err := k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, true, false, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "", false, true, 0) + if err != nil { + return err + } + return nil + } + + //// for surplus auction + //if netFeeCollectedData.NetFeesCollected.GTE(collector.SurplusThreshold.Add(collector.LotSize)) { + // collateralAssetID := collector.SecondaryAssetId + // debtAssetID := collector.CollectorAssetId + // + // // net = 900 surplusThreshold = 500 , lotSize = 100 + // amount := collector.LotSize + // debtToken, collateralToken := k.getSurplusBuyTokenAmount(ctx, collateralAssetID, debtAssetID, amount) + // + // _, err := k.collector.GetAmountFromCollector(ctx, appID, assetID, sellToken.Amount) + // if err != nil { + // return err + // } + //} + + return nil +} + +func (k Keeper) getDebtSellTokenAmount(ctx sdk.Context, AssetInID, AssetOutID uint64, lotSize, debtLotSize sdk.Int) (collateralToken, debtToken sdk.Coin) { + collateralAsset, found1 := k.asset.GetAsset(ctx, AssetOutID) + debtAsset, found2 := k.asset.GetAsset(ctx, AssetInID) + if !found1 || !found2 { + return sdk.Coin{}, sdk.Coin{} + } + return sdk.NewCoin(collateralAsset.Denom, debtLotSize), sdk.NewCoin(debtAsset.Denom, lotSize) +} From 147bac800616f34f6fc06193ede627d52fc22c8b Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sat, 27 May 2023 14:26:54 +0530 Subject: [PATCH 070/155] updating PlaceDutcBid --- .../comdex/x/asset/types/app.pb.go | 1031 ++ .../comdex/x/asset/types/asset.pb.go | 546 ++ .../comdex/x/asset/types/events.pb.go | 299 + .../x/asset/types/extendedPairVault.pb.go | 1006 ++ .../comdex/x/asset/types/genesis.pb.go | 547 ++ .../comdex/x/asset/types/gov.pb.go | 2724 ++++++ .../comdex/x/asset/types/pair.pb.go | 1075 +++ .../comdex/x/asset/types/params.pb.go | 265 + .../comdex/x/asset/types/query.pb.go | 5660 +++++++++++ .../comdex/x/asset/types/query.pb.gw.go | 1401 +++ .../comdex/x/auction/types/auction.pb.go | 3531 +++++++ .../comdex/x/auction/types/biddings.pb.go | 1683 ++++ .../comdex/x/auction/types/genesis.pb.go | 745 ++ .../comdex/x/auction/types/params.pb.go | 265 + .../comdex/x/auction/types/query.pb.go | 8289 +++++++++++++++++ .../comdex/x/auction/types/query.pb.gw.go | 2355 +++++ .../comdex/x/auction/types/tx.pb.go | 2056 ++++ proto/comdex/auctionsV2/v1beta1/auction.proto | 16 +- .../liquidationsV2/v1beta1/liquidate.proto | 26 +- x/auctionsV2/expected/keeper.go | 20 + x/auctionsV2/keeper/auctions.go | 6 +- x/auctionsV2/keeper/bid.go | 201 +- x/auctionsV2/keeper/keeper.go | 6 + x/auctionsV2/keeper/utils.go | 138 +- x/auctionsV2/types/auction.pb.go | 416 +- x/auctionsV2/types/keys.go | 10 + x/liquidationsV2/keeper/liquidate.go | 2 +- x/liquidationsV2/types/liquidate.pb.go | 263 +- x/vault/keeper/vault.go | 2 +- 29 files changed, 34335 insertions(+), 249 deletions(-) create mode 100644 github.com/comdex-official/comdex/x/asset/types/app.pb.go create mode 100644 github.com/comdex-official/comdex/x/asset/types/asset.pb.go create mode 100644 github.com/comdex-official/comdex/x/asset/types/events.pb.go create mode 100644 github.com/comdex-official/comdex/x/asset/types/extendedPairVault.pb.go create mode 100644 github.com/comdex-official/comdex/x/asset/types/genesis.pb.go create mode 100644 github.com/comdex-official/comdex/x/asset/types/gov.pb.go create mode 100644 github.com/comdex-official/comdex/x/asset/types/pair.pb.go create mode 100644 github.com/comdex-official/comdex/x/asset/types/params.pb.go create mode 100644 github.com/comdex-official/comdex/x/asset/types/query.pb.go create mode 100644 github.com/comdex-official/comdex/x/asset/types/query.pb.gw.go create mode 100644 github.com/comdex-official/comdex/x/auction/types/auction.pb.go create mode 100644 github.com/comdex-official/comdex/x/auction/types/biddings.pb.go create mode 100644 github.com/comdex-official/comdex/x/auction/types/genesis.pb.go create mode 100644 github.com/comdex-official/comdex/x/auction/types/params.pb.go create mode 100644 github.com/comdex-official/comdex/x/auction/types/query.pb.go create mode 100644 github.com/comdex-official/comdex/x/auction/types/query.pb.gw.go create mode 100644 github.com/comdex-official/comdex/x/auction/types/tx.pb.go diff --git a/github.com/comdex-official/comdex/x/asset/types/app.pb.go b/github.com/comdex-official/comdex/x/asset/types/app.pb.go new file mode 100644 index 000000000..401221d82 --- /dev/null +++ b/github.com/comdex-official/comdex/x/asset/types/app.pb.go @@ -0,0 +1,1031 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/asset/v1beta1/app.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type AppData struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` + ShortName string `protobuf:"bytes,3,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty" yaml:"short_name"` + MinGovDeposit github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=min_gov_deposit,json=minGovDeposit,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_gov_deposit" yaml:"min_gov_deposit"` + GovTimeInSeconds uint64 `protobuf:"varint,5,opt,name=gov_time_in_seconds,json=govTimeInSeconds,proto3" json:"gov_time_in_seconds,omitempty" yaml:"gov_time_in_seconds"` + GenesisToken []MintGenesisToken `protobuf:"bytes,6,rep,name=genesis_token,json=genesisToken,proto3" json:"genesis_token" yaml:"genesis_token"` +} + +func (m *AppData) Reset() { *m = AppData{} } +func (m *AppData) String() string { return proto.CompactTextString(m) } +func (*AppData) ProtoMessage() {} +func (*AppData) Descriptor() ([]byte, []int) { + return fileDescriptor_1372b4734b6486fd, []int{0} +} +func (m *AppData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AppData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AppData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AppData) XXX_Merge(src proto.Message) { + xxx_messageInfo_AppData.Merge(m, src) +} +func (m *AppData) XXX_Size() int { + return m.Size() +} +func (m *AppData) XXX_DiscardUnknown() { + xxx_messageInfo_AppData.DiscardUnknown(m) +} + +var xxx_messageInfo_AppData proto.InternalMessageInfo + +type MintGenesisToken struct { + AssetId uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + GenesisSupply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=genesis_supply,json=genesisSupply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"genesis_supply"` + IsGovToken bool `protobuf:"varint,3,opt,name=is_gov_token,json=isGovToken,proto3" json:"is_gov_token,omitempty" yaml:"is_gov_token"` + Recipient string `protobuf:"bytes,4,opt,name=recipient,proto3" json:"recipient,omitempty" yaml:"recipient"` +} + +func (m *MintGenesisToken) Reset() { *m = MintGenesisToken{} } +func (m *MintGenesisToken) String() string { return proto.CompactTextString(m) } +func (*MintGenesisToken) ProtoMessage() {} +func (*MintGenesisToken) Descriptor() ([]byte, []int) { + return fileDescriptor_1372b4734b6486fd, []int{1} +} +func (m *MintGenesisToken) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MintGenesisToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MintGenesisToken.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MintGenesisToken) XXX_Merge(src proto.Message) { + xxx_messageInfo_MintGenesisToken.Merge(m, src) +} +func (m *MintGenesisToken) XXX_Size() int { + return m.Size() +} +func (m *MintGenesisToken) XXX_DiscardUnknown() { + xxx_messageInfo_MintGenesisToken.DiscardUnknown(m) +} + +var xxx_messageInfo_MintGenesisToken proto.InternalMessageInfo + +type AppAndGovTime struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + GovTimeInSeconds uint64 `protobuf:"varint,2,opt,name=gov_time_in_seconds,json=govTimeInSeconds,proto3" json:"gov_time_in_seconds,omitempty" yaml:"gov_time_in_seconds"` + MinGovDeposit github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=min_gov_deposit,json=minGovDeposit,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_gov_deposit" yaml:"min_gov_deposit"` +} + +func (m *AppAndGovTime) Reset() { *m = AppAndGovTime{} } +func (m *AppAndGovTime) String() string { return proto.CompactTextString(m) } +func (*AppAndGovTime) ProtoMessage() {} +func (*AppAndGovTime) Descriptor() ([]byte, []int) { + return fileDescriptor_1372b4734b6486fd, []int{2} +} +func (m *AppAndGovTime) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AppAndGovTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AppAndGovTime.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AppAndGovTime) XXX_Merge(src proto.Message) { + xxx_messageInfo_AppAndGovTime.Merge(m, src) +} +func (m *AppAndGovTime) XXX_Size() int { + return m.Size() +} +func (m *AppAndGovTime) XXX_DiscardUnknown() { + xxx_messageInfo_AppAndGovTime.DiscardUnknown(m) +} + +var xxx_messageInfo_AppAndGovTime proto.InternalMessageInfo + +func init() { + proto.RegisterType((*AppData)(nil), "comdex.asset.v1beta1.AppData") + proto.RegisterType((*MintGenesisToken)(nil), "comdex.asset.v1beta1.MintGenesisToken") + proto.RegisterType((*AppAndGovTime)(nil), "comdex.asset.v1beta1.AppAndGovTime") +} + +func init() { proto.RegisterFile("comdex/asset/v1beta1/app.proto", fileDescriptor_1372b4734b6486fd) } + +var fileDescriptor_1372b4734b6486fd = []byte{ + // 569 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xbd, 0x6e, 0xdb, 0x3c, + 0x14, 0x95, 0xec, 0xfc, 0x32, 0x71, 0xec, 0xc8, 0xfe, 0xbe, 0x1a, 0x41, 0x21, 0x19, 0x2c, 0x10, + 0x78, 0x89, 0x84, 0xa4, 0x5d, 0xda, 0xcd, 0x42, 0x00, 0xd7, 0x43, 0x0a, 0x54, 0x49, 0x97, 0x2e, + 0x82, 0x2c, 0x31, 0x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71, 0x1f, 0x65, 0xa9, 0xd5, 0x54, 0xbf, 0xb2, 0x8a, 0x42, 0x0f, 0x60, 0xde, 0xa7, 0x13, + 0x55, 0xc1, 0x19, 0xd8, 0x1d, 0xa3, 0x10, 0x33, 0x8c, 0x48, 0xd9, 0xfc, 0x56, 0x96, 0x5a, 0x0d, + 0x75, 0xef, 0x27, 0x04, 0xbd, 0x25, 0x0d, 0x7e, 0xd7, 0x41, 0xad, 0xc7, 0x58, 0x8f, 0x44, 0x7d, + 0xd5, 0x10, 0xa3, 0x0b, 0xb6, 0x02, 0xc6, 0x96, 0x29, 0x1c, 0x66, 0xa9, 0x55, 0x2b, 0x52, 0x90, + 0xe7, 0xd0, 0xdb, 0x0c, 0x18, 0x1b, 0x44, 0xbf, 0x1b, 0x80, 0xca, 0x5f, 0x0e, 0xc0, 0x9a, 0x09, + 0xae, 0xfe, 0xd3, 0x09, 0x76, 0x5f, 0xcf, 0xbe, 0x99, 0xda, 0xa7, 0xb9, 0xa9, 0xcd, 0xe6, 0xa6, + 0x7e, 0x3f, 0x37, 0xf5, 0xaf, 0x73, 0x53, 0xff, 0xb0, 0x30, 0xb5, 0xfb, 0x85, 0xa9, 0x7d, 0x5e, + 0x98, 0xda, 0x5b, 0xe7, 0x17, 0xcb, 0x7c, 0x0e, 0x4f, 0xe8, 0xf5, 0x35, 0x0e, 0x71, 0x30, 0x2a, + 0xf6, 0x4e, 0xf9, 0x6a, 0x48, 0xff, 0xe1, 0x96, 0x7c, 0x04, 0x9e, 0xfe, 0x08, 0x00, 0x00, 0xff, + 0xff, 0xf0, 0xde, 0x5d, 0x41, 0x52, 0x04, 0x00, 0x00, +} + +func (m *AppData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AppData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AppData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GenesisToken) > 0 { + for iNdEx := len(m.GenesisToken) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GenesisToken[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApp(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.GovTimeInSeconds != 0 { + i = encodeVarintApp(dAtA, i, uint64(m.GovTimeInSeconds)) + i-- + dAtA[i] = 0x28 + } + { + size := m.MinGovDeposit.Size() + i -= size + if _, err := m.MinGovDeposit.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintApp(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.ShortName) > 0 { + i -= len(m.ShortName) + copy(dAtA[i:], m.ShortName) + i = encodeVarintApp(dAtA, i, uint64(len(m.ShortName))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintApp(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintApp(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MintGenesisToken) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MintGenesisToken) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MintGenesisToken) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintApp(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x22 + } + if m.IsGovToken { + i-- + if m.IsGovToken { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + { + size := m.GenesisSupply.Size() + i -= size + if _, err := m.GenesisSupply.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintApp(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.AssetId != 0 { + i = encodeVarintApp(dAtA, i, uint64(m.AssetId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AppAndGovTime) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AppAndGovTime) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AppAndGovTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MinGovDeposit.Size() + i -= size + if _, err := m.MinGovDeposit.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintApp(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.GovTimeInSeconds != 0 { + i = encodeVarintApp(dAtA, i, uint64(m.GovTimeInSeconds)) + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintApp(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintApp(dAtA []byte, offset int, v uint64) int { + offset -= sovApp(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AppData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovApp(uint64(m.Id)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovApp(uint64(l)) + } + l = len(m.ShortName) + if l > 0 { + n += 1 + l + sovApp(uint64(l)) + } + l = m.MinGovDeposit.Size() + n += 1 + l + sovApp(uint64(l)) + if m.GovTimeInSeconds != 0 { + n += 1 + sovApp(uint64(m.GovTimeInSeconds)) + } + if len(m.GenesisToken) > 0 { + for _, e := range m.GenesisToken { + l = e.Size() + n += 1 + l + sovApp(uint64(l)) + } + } + return n +} + +func (m *MintGenesisToken) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AssetId != 0 { + n += 1 + sovApp(uint64(m.AssetId)) + } + l = m.GenesisSupply.Size() + n += 1 + l + sovApp(uint64(l)) + if m.IsGovToken { + n += 2 + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovApp(uint64(l)) + } + return n +} + +func (m *AppAndGovTime) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovApp(uint64(m.AppId)) + } + if m.GovTimeInSeconds != 0 { + n += 1 + sovApp(uint64(m.GovTimeInSeconds)) + } + l = m.MinGovDeposit.Size() + n += 1 + l + sovApp(uint64(l)) + return n +} + +func sovApp(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozApp(x uint64) (n int) { + return sovApp(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AppData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AppData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AppData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + 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 ErrInvalidLengthApp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShortName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + 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 ErrInvalidLengthApp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ShortName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinGovDeposit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + 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 ErrInvalidLengthApp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinGovDeposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GovTimeInSeconds", wireType) + } + m.GovTimeInSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GovTimeInSeconds |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApp + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GenesisToken = append(m.GenesisToken, MintGenesisToken{}) + if err := m.GenesisToken[len(m.GenesisToken)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApp(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApp + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MintGenesisToken) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MintGenesisToken: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MintGenesisToken: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + m.AssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisSupply", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + 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 ErrInvalidLengthApp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.GenesisSupply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsGovToken", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsGovToken = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + 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 ErrInvalidLengthApp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApp(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApp + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AppAndGovTime) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AppAndGovTime: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AppAndGovTime: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GovTimeInSeconds", wireType) + } + m.GovTimeInSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GovTimeInSeconds |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinGovDeposit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApp + } + 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 ErrInvalidLengthApp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinGovDeposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApp(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApp + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipApp(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowApp + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowApp + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowApp + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthApp + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupApp + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthApp + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthApp = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowApp = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupApp = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/asset/types/asset.pb.go b/github.com/comdex-official/comdex/x/asset/types/asset.pb.go new file mode 100644 index 000000000..417f4bb3c --- /dev/null +++ b/github.com/comdex-official/comdex/x/asset/types/asset.pb.go @@ -0,0 +1,546 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/asset/v1beta1/asset.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Asset struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` + Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + Decimals github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=decimals,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"decimals" yaml:"decimals"` + IsOnChain bool `protobuf:"varint,5,opt,name=is_on_chain,json=isOnChain,proto3" json:"is_on_chain,omitempty" yaml:"is_on_chain"` + IsOraclePriceRequired bool `protobuf:"varint,6,opt,name=is_oracle_price_required,json=isOraclePriceRequired,proto3" json:"is_oracle_price_required,omitempty" yaml:"is_oracle_price_required"` + IsCdpMintable bool `protobuf:"varint,7,opt,name=is_cdp_mintable,json=isCdpMintable,proto3" json:"is_cdp_mintable,omitempty" yaml:"is_cdp_mintable"` +} + +func (m *Asset) Reset() { *m = Asset{} } +func (m *Asset) String() string { return proto.CompactTextString(m) } +func (*Asset) ProtoMessage() {} +func (*Asset) Descriptor() ([]byte, []int) { + return fileDescriptor_67277aee9bd3eed4, []int{0} +} +func (m *Asset) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Asset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Asset.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Asset) XXX_Merge(src proto.Message) { + xxx_messageInfo_Asset.Merge(m, src) +} +func (m *Asset) XXX_Size() int { + return m.Size() +} +func (m *Asset) XXX_DiscardUnknown() { + xxx_messageInfo_Asset.DiscardUnknown(m) +} + +var xxx_messageInfo_Asset proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Asset)(nil), "comdex.asset.v1beta1.Asset") +} + +func init() { proto.RegisterFile("comdex/asset/v1beta1/asset.proto", fileDescriptor_67277aee9bd3eed4) } + +var fileDescriptor_67277aee9bd3eed4 = []byte{ + // 414 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xb1, 0x6e, 0xd4, 0x30, + 0x18, 0xc7, 0x93, 0xeb, 0x5d, 0x69, 0x5d, 0xe0, 0x90, 0x55, 0xaa, 0xa8, 0x83, 0x7d, 0x72, 0xa5, + 0xea, 0x96, 0x5e, 0x54, 0x21, 0x31, 0xb0, 0xf5, 0x3a, 0x31, 0xa0, 0x82, 0x47, 0x04, 0x8a, 0x7c, + 0xb6, 0x7b, 0xb5, 0x88, 0xe3, 0x10, 0xa7, 0x88, 0xbe, 0x05, 0x2f, 0xc0, 0xce, 0xa3, 0xdc, 0xd8, + 0x11, 0x31, 0x58, 0x90, 0x7b, 0x83, 0x3c, 0x01, 0x8a, 0x9d, 0x96, 0x43, 0xea, 0x14, 0x7f, 0xff, + 0xff, 0x2f, 0xbf, 0xc1, 0x9f, 0xc1, 0x84, 0x1b, 0x2d, 0xe4, 0xd7, 0x94, 0x59, 0x2b, 0xeb, 0xf4, + 0xcb, 0xe9, 0x42, 0xd6, 0xec, 0x34, 0x4c, 0xb3, 0xb2, 0x32, 0xb5, 0x81, 0xfb, 0x81, 0x98, 0x85, + 0xac, 0x27, 0x0e, 0xf7, 0x97, 0x66, 0x69, 0x3c, 0x90, 0x76, 0xa7, 0xc0, 0x92, 0xef, 0x5b, 0x60, + 0x74, 0xd6, 0x71, 0xf0, 0x29, 0x18, 0x28, 0x91, 0xc4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b8, 0x28, + 0x33, 0xad, 0x8a, 0x9a, 0x2d, 0x72, 0x99, 0x3c, 0xf2, 0xd2, 0xc3, 0xd6, 0xe1, 0x83, 0x7b, 0xe9, + 0x26, 0x40, 0xe8, 0x13, 0x65, 0xcf, 0x45, 0xf9, 0xa6, 0x9f, 0xe7, 0xef, 0x56, 0x7f, 0x50, 0xf4, + 0xa3, 0x41, 0xd1, 0xaa, 0x41, 0xf1, 0x6d, 0x83, 0xe2, 0xdf, 0x0d, 0x8a, 0xbf, 0xad, 0x51, 0x74, + 0xbb, 0x46, 0xd1, 0xcf, 0x35, 0x8a, 0xde, 0xa7, 0xff, 0x5d, 0x60, 0xb7, 0xf8, 0x13, 0x73, 0x79, + 0xa9, 0xb8, 0x62, 0x79, 0x3f, 0xa7, 0x77, 0x8f, 0xc5, 0xdf, 0xe6, 0x62, 0xdb, 0x6f, 0xfe, 0xc5, + 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x38, 0x2d, 0x65, 0x49, 0x02, 0x00, 0x00, +} + +func (m *Asset) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Asset) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Asset) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsCdpMintable { + i-- + if m.IsCdpMintable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.IsOraclePriceRequired { + i-- + if m.IsOraclePriceRequired { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.IsOnChain { + i-- + if m.IsOnChain { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + { + size := m.Decimals.Size() + i -= size + if _, err := m.Decimals.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAsset(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintAsset(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintAsset(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintAsset(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintAsset(dAtA []byte, offset int, v uint64) int { + offset -= sovAsset(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Asset) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovAsset(uint64(m.Id)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovAsset(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovAsset(uint64(l)) + } + l = m.Decimals.Size() + n += 1 + l + sovAsset(uint64(l)) + if m.IsOnChain { + n += 2 + } + if m.IsOraclePriceRequired { + n += 2 + } + if m.IsCdpMintable { + n += 2 + } + return n +} + +func sovAsset(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAsset(x uint64) (n int) { + return sovAsset(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Asset) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAsset + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Asset: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Asset: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAsset + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAsset + } + 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 ErrInvalidLengthAsset + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAsset + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAsset + } + 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 ErrInvalidLengthAsset + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAsset + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAsset + } + 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 ErrInvalidLengthAsset + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAsset + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Decimals.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsOnChain", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAsset + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsOnChain = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsOraclePriceRequired", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAsset + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsOraclePriceRequired = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsCdpMintable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAsset + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsCdpMintable = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipAsset(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAsset + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAsset(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAsset + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAsset + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAsset + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthAsset + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAsset + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAsset + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAsset = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAsset = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAsset = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/asset/types/events.pb.go b/github.com/comdex-official/comdex/x/asset/types/events.pb.go new file mode 100644 index 000000000..f11a9bd0f --- /dev/null +++ b/github.com/comdex-official/comdex/x/asset/types/events.pb.go @@ -0,0 +1,299 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/asset/v1beta1/events.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type EventAddPair struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *EventAddPair) Reset() { *m = EventAddPair{} } +func (m *EventAddPair) String() string { return proto.CompactTextString(m) } +func (*EventAddPair) ProtoMessage() {} +func (*EventAddPair) Descriptor() ([]byte, []int) { + return fileDescriptor_8698e7aadaab4005, []int{0} +} +func (m *EventAddPair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventAddPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventAddPair.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventAddPair) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventAddPair.Merge(m, src) +} +func (m *EventAddPair) XXX_Size() int { + return m.Size() +} +func (m *EventAddPair) XXX_DiscardUnknown() { + xxx_messageInfo_EventAddPair.DiscardUnknown(m) +} + +var xxx_messageInfo_EventAddPair proto.InternalMessageInfo + +func (m *EventAddPair) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func init() { + proto.RegisterType((*EventAddPair)(nil), "comdex.asset.v1beta1.EventAddPair") +} + +func init() { proto.RegisterFile("comdex/asset/v1beta1/events.proto", fileDescriptor_8698e7aadaab4005) } + +var fileDescriptor_8698e7aadaab4005 = []byte{ + // 166 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x2e, 0x4e, 0x2d, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, + 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, + 0x28, 0xd1, 0x03, 0x2b, 0xd1, 0x83, 0x2a, 0x51, 0x92, 0xe3, 0xe2, 0x71, 0x05, 0xa9, 0x72, 0x4c, + 0x49, 0x09, 0x48, 0xcc, 0x2c, 0x12, 0xe2, 0xe3, 0x62, 0xca, 0x4c, 0x91, 0x60, 0x54, 0x60, 0xd4, + 0x60, 0x09, 0x62, 0xca, 0x4c, 0x71, 0xf2, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, + 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, + 0x86, 0x28, 0xfd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, 0xd1, + 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0xcc, 0x3d, 0x25, 0x95, + 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x77, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x6b, 0xa5, + 0x03, 0xfe, 0xac, 0x00, 0x00, 0x00, +} + +func (m *EventAddPair) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventAddPair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventAddPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventAddPair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovEvents(uint64(m.Id)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventAddPair) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventAddPair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventAddPair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/asset/types/extendedPairVault.pb.go b/github.com/comdex-official/comdex/x/asset/types/extendedPairVault.pb.go new file mode 100644 index 000000000..1ff9cd077 --- /dev/null +++ b/github.com/comdex-official/comdex/x/asset/types/extendedPairVault.pb.go @@ -0,0 +1,1006 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/asset/v1beta1/extendedPairVault.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type ExtendedPairVault struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + PairId uint64 `protobuf:"varint,3,opt,name=pair_id,json=pairId,proto3" json:"pair_id,omitempty" yaml:"pair_id"` + StabilityFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stability_fee,json=stabilityFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stability_fee" yaml:"stability_fee"` + ClosingFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=closing_fee,json=closingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"closing_fee" yaml:"closing_fee"` + LiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_penalty" yaml:"liquidation_penalty"` + DrawDownFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=draw_down_fee,json=drawDownFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"draw_down_fee" yaml:"draw_down_fee"` + IsVaultActive bool `protobuf:"varint,8,opt,name=is_vault_active,json=isVaultActive,proto3" json:"is_vault_active,omitempty" yaml:"active_flag"` + DebtCeiling github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,9,opt,name=debt_ceiling,json=debtCeiling,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt_ceiling" yaml:"debt_ceiling"` + DebtFloor github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=debt_floor,json=debtFloor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt_floor" yaml:"debt_floor"` + IsStableMintVault bool `protobuf:"varint,11,opt,name=is_stable_mint_vault,json=isStableMintVault,proto3" json:"is_stable_mint_vault,omitempty" yaml:"is_stable_mint_vault"` + MinCr github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=min_cr,json=minCr,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_cr" yaml:"min_cr"` + PairName string `protobuf:"bytes,13,opt,name=pair_name,json=pairName,proto3" json:"pair_name,omitempty" yaml:"pair_name"` + AssetOutOraclePrice bool `protobuf:"varint,14,opt,name=asset_out_oracle_price,json=assetOutOraclePrice,proto3" json:"asset_out_oracle_price,omitempty" yaml:"asset_out_oracle_price"` + AssetOutPrice uint64 `protobuf:"varint,15,opt,name=asset_out_price,json=assetOutPrice,proto3" json:"asset_out_price,omitempty" yaml:"asset_out_price"` + MinUsdValueLeft uint64 `protobuf:"varint,16,opt,name=min_usd_value_left,json=minUsdValueLeft,proto3" json:"min_usd_value_left,omitempty" yaml:"min_usd_value_left"` + BlockHeight int64 `protobuf:"varint,17,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty" yaml:"block_height"` + BlockTime time.Time `protobuf:"bytes,18,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time" yaml:"block_time"` +} + +func (m *ExtendedPairVault) Reset() { *m = ExtendedPairVault{} } +func (m *ExtendedPairVault) String() string { return proto.CompactTextString(m) } +func (*ExtendedPairVault) ProtoMessage() {} +func (*ExtendedPairVault) Descriptor() ([]byte, []int) { + return fileDescriptor_23dd38fcddb231cd, []int{0} +} +func (m *ExtendedPairVault) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExtendedPairVault) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExtendedPairVault.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExtendedPairVault) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExtendedPairVault.Merge(m, src) +} +func (m *ExtendedPairVault) XXX_Size() int { + return m.Size() +} +func (m *ExtendedPairVault) XXX_DiscardUnknown() { + xxx_messageInfo_ExtendedPairVault.DiscardUnknown(m) +} + +var xxx_messageInfo_ExtendedPairVault proto.InternalMessageInfo + +func init() { + proto.RegisterType((*ExtendedPairVault)(nil), "comdex.asset.v1beta1.ExtendedPairVault") +} + +func init() { + proto.RegisterFile("comdex/asset/v1beta1/extendedPairVault.proto", fileDescriptor_23dd38fcddb231cd) +} + +var fileDescriptor_23dd38fcddb231cd = []byte{ + // 820 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xc1, 0x72, 0xe3, 0x34, + 0x18, 0x8e, 0xbb, 0xdb, 0x6c, 0xa3, 0x34, 0xed, 0x46, 0xcd, 0x14, 0x13, 0xa6, 0x71, 0xd0, 0x81, + 0xc9, 0x0c, 0x6c, 0x3c, 0x85, 0xdb, 0x1e, 0x60, 0x48, 0xbb, 0x1d, 0xca, 0x2c, 0x6c, 0x11, 0xd0, + 0x61, 0xb8, 0x68, 0x64, 0x5b, 0x71, 0x45, 0x65, 0xcb, 0xd8, 0x4a, 0xbb, 0x3d, 0xf0, 0x0e, 0xfb, + 0x0c, 0x9c, 0x78, 0x94, 0x1e, 0xf7, 0xc8, 0x70, 0x30, 0xd0, 0xbe, 0x81, 0x9f, 0x80, 0x91, 0xe4, + 0x92, 0xa4, 0xd3, 0x4b, 0x66, 0x4f, 0xd1, 0xff, 0xfd, 0x5f, 0xbe, 0xef, 0x97, 0xf4, 0xeb, 0x37, + 0xf8, 0x24, 0x94, 0x49, 0xc4, 0x5e, 0xfb, 0xb4, 0x28, 0x98, 0xf2, 0x2f, 0xf6, 0x03, 0xa6, 0xe8, + 0xbe, 0xcf, 0x5e, 0x2b, 0x96, 0x46, 0x2c, 0x3a, 0xa1, 0x3c, 0x3f, 0xa5, 0x33, 0xa1, 0xc6, 0x59, + 0x2e, 0x95, 0x84, 0x3d, 0xcb, 0x1e, 0x1b, 0xf6, 0xb8, 0x66, 0xf7, 0x7b, 0xb1, 0x8c, 0xa5, 0x21, + 0xf8, 0x7a, 0x65, 0xb9, 0x7d, 0x2f, 0x96, 0x32, 0x16, 0xcc, 0x37, 0x51, 0x30, 0x9b, 0xfa, 0x8a, + 0x27, 0xac, 0x50, 0x34, 0xc9, 0x2c, 0x01, 0xfd, 0xde, 0x06, 0xdd, 0x17,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, 0x56, 0x05, 0xe1, 0xf5, 0x84, 0xa7, 0x07, + 0x39, 0xdc, 0x07, 0x2d, 0xf3, 0x14, 0x53, 0x9a, 0x30, 0xb7, 0x63, 0xa4, 0x7b, 0x55, 0xe9, 0x3d, + 0x5d, 0x78, 0xa5, 0x3a, 0x85, 0xf0, 0x86, 0x5e, 0x7f, 0x4b, 0x13, 0x06, 0x4f, 0xc1, 0xae, 0x19, + 0x37, 0x44, 0xce, 0x14, 0x91, 0x39, 0x0d, 0x05, 0x23, 0x59, 0xce, 0x43, 0xe6, 0x6e, 0x99, 0xed, + 0x7d, 0x58, 0x95, 0xde, 0x5e, 0x7d, 0xe3, 0x0f, 0xf2, 0x10, 0xde, 0x31, 0x89, 0x57, 0x33, 0xf5, + 0xca, 0xc0, 0x27, 0x1a, 0x85, 0x13, 0xb0, 0x3d, 0xe7, 0x5b, 0xc1, 0x6d, 0x33, 0x36, 0xfa, 0x55, + 0xe9, 0xed, 0xde, 0x17, 0xac, 0x95, 0x3a, 0x77, 0x4a, 0x56, 0xe3, 0x6b, 0x00, 0xf5, 0x06, 0x67, + 0x45, 0x44, 0x2e, 0xa8, 0x98, 0x31, 0x22, 0xd8, 0x54, 0xb9, 0x4f, 0x8d, 0xcc, 0x5e, 0x55, 0x7a, + 0xef, 0xcf, 0x0f, 0x61, 0x99, 0x83, 0xf0, 0x76, 0xc2, 0xd3, 0x1f, 0x8b, 0xe8, 0x54, 0x43, 0x2f, + 0xd9, 0x54, 0xc1, 0xe7, 0x60, 0x33, 0x10, 0x32, 0x3c, 0x27, 0x67, 0x8c, 0xc7, 0x67, 0xca, 0xed, + 0x0e, 0x9d, 0xd1, 0xa3, 0xc9, 0x7b, 0xf3, 0x26, 0x5b, 0xcc, 0x22, 0xdc, 0x36, 0xe1, 0x57, 0x26, + 0x82, 0x3f, 0x01, 0x60, 0xb3, 0x7a, 0xc6, 0xba, 0x70, 0xe8, 0x8c, 0xda, 0x9f, 0xf6, 0xc7, 0x76, + 0x00, 0x8f, 0xef, 0x06, 0xf0, 0xf8, 0x87, 0xbb, 0x01, 0x3c, 0xd9, 0xd3, 0xd7, 0x39, 0x6f, 0xab, + 0xf9, 0x7f, 0xd1, 0x9b, 0xbf, 0x3d, 0x07, 0xb7, 0x0c, 0xa0, 0xe9, 0x93, 0xef, 0xae, 0xff, 0x1d, + 0x34, 0xfe, 0xb8, 0x19, 0x34, 0xae, 0x6f, 0x06, 0xce, 0xdb, 0x9b, 0x81, 0xf3, 0xcf, 0xcd, 0xc0, + 0x79, 0x73, 0x3b, 0x68, 0xbc, 0xbd, 0x1d, 0x34, 0xfe, 0xbc, 0x1d, 0x34, 0x7e, 0xf6, 0x97, 0x5a, + 0x42, 0x7f, 0x1e, 0x9e, 0xc9, 0xe9, 0x94, 0x87, 0x9c, 0x8a, 0x3a, 0xf6, 0xef, 0x3e, 0x2f, 0xa6, + 0x3f, 0x82, 0xa6, 0x29, 0xe8, 0xb3, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf2, 0x98, 0x15, 0x0f, + 0x7b, 0x06, 0x00, 0x00, +} + +func (m *ExtendedPairVault) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExtendedPairVault) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExtendedPairVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BlockTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintExtendedPairVault(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + if m.BlockHeight != 0 { + i = encodeVarintExtendedPairVault(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + if m.MinUsdValueLeft != 0 { + i = encodeVarintExtendedPairVault(dAtA, i, uint64(m.MinUsdValueLeft)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.AssetOutPrice != 0 { + i = encodeVarintExtendedPairVault(dAtA, i, uint64(m.AssetOutPrice)) + i-- + dAtA[i] = 0x78 + } + if m.AssetOutOraclePrice { + i-- + if m.AssetOutOraclePrice { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x70 + } + if len(m.PairName) > 0 { + i -= len(m.PairName) + copy(dAtA[i:], m.PairName) + i = encodeVarintExtendedPairVault(dAtA, i, uint64(len(m.PairName))) + i-- + dAtA[i] = 0x6a + } + { + size := m.MinCr.Size() + i -= size + if _, err := m.MinCr.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + if m.IsStableMintVault { + i-- + if m.IsStableMintVault { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + { + size := m.DebtFloor.Size() + i -= size + if _, err := m.DebtFloor.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + { + size := m.DebtCeiling.Size() + i -= size + if _, err := m.DebtCeiling.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + if m.IsVaultActive { + i-- + if m.IsVaultActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + { + size := m.DrawDownFee.Size() + i -= size + if _, err := m.DrawDownFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size := m.LiquidationPenalty.Size() + i -= size + if _, err := m.LiquidationPenalty.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.ClosingFee.Size() + i -= size + if _, err := m.ClosingFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.StabilityFee.Size() + i -= size + if _, err := m.StabilityFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.PairId != 0 { + i = encodeVarintExtendedPairVault(dAtA, i, uint64(m.PairId)) + i-- + dAtA[i] = 0x18 + } + if m.AppId != 0 { + i = encodeVarintExtendedPairVault(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintExtendedPairVault(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintExtendedPairVault(dAtA []byte, offset int, v uint64) int { + offset -= sovExtendedPairVault(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ExtendedPairVault) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovExtendedPairVault(uint64(m.Id)) + } + if m.AppId != 0 { + n += 1 + sovExtendedPairVault(uint64(m.AppId)) + } + if m.PairId != 0 { + n += 1 + sovExtendedPairVault(uint64(m.PairId)) + } + l = m.StabilityFee.Size() + n += 1 + l + sovExtendedPairVault(uint64(l)) + l = m.ClosingFee.Size() + n += 1 + l + sovExtendedPairVault(uint64(l)) + l = m.LiquidationPenalty.Size() + n += 1 + l + sovExtendedPairVault(uint64(l)) + l = m.DrawDownFee.Size() + n += 1 + l + sovExtendedPairVault(uint64(l)) + if m.IsVaultActive { + n += 2 + } + l = m.DebtCeiling.Size() + n += 1 + l + sovExtendedPairVault(uint64(l)) + l = m.DebtFloor.Size() + n += 1 + l + sovExtendedPairVault(uint64(l)) + if m.IsStableMintVault { + n += 2 + } + l = m.MinCr.Size() + n += 1 + l + sovExtendedPairVault(uint64(l)) + l = len(m.PairName) + if l > 0 { + n += 1 + l + sovExtendedPairVault(uint64(l)) + } + if m.AssetOutOraclePrice { + n += 2 + } + if m.AssetOutPrice != 0 { + n += 1 + sovExtendedPairVault(uint64(m.AssetOutPrice)) + } + if m.MinUsdValueLeft != 0 { + n += 2 + sovExtendedPairVault(uint64(m.MinUsdValueLeft)) + } + if m.BlockHeight != 0 { + n += 2 + sovExtendedPairVault(uint64(m.BlockHeight)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BlockTime) + n += 2 + l + sovExtendedPairVault(uint64(l)) + return n +} + +func sovExtendedPairVault(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozExtendedPairVault(x uint64) (n int) { + return sovExtendedPairVault(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ExtendedPairVault) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExtendedPairVault: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExtendedPairVault: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PairId", wireType) + } + m.PairId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PairId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StabilityFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + 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 ErrInvalidLengthExtendedPairVault + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExtendedPairVault + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StabilityFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClosingFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + 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 ErrInvalidLengthExtendedPairVault + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExtendedPairVault + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ClosingFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidationPenalty", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + 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 ErrInvalidLengthExtendedPairVault + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExtendedPairVault + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LiquidationPenalty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DrawDownFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + 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 ErrInvalidLengthExtendedPairVault + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExtendedPairVault + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DrawDownFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsVaultActive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsVaultActive = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtCeiling", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + 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 ErrInvalidLengthExtendedPairVault + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExtendedPairVault + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DebtCeiling.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtFloor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + 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 ErrInvalidLengthExtendedPairVault + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExtendedPairVault + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DebtFloor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsStableMintVault", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsStableMintVault = bool(v != 0) + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinCr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + 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 ErrInvalidLengthExtendedPairVault + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExtendedPairVault + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinCr.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PairName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + 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 ErrInvalidLengthExtendedPairVault + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthExtendedPairVault + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PairName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetOutOraclePrice", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AssetOutOraclePrice = bool(v != 0) + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetOutPrice", wireType) + } + m.AssetOutPrice = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetOutPrice |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinUsdValueLeft", wireType) + } + m.MinUsdValueLeft = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinUsdValueLeft |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthExtendedPairVault + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthExtendedPairVault + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BlockTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipExtendedPairVault(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExtendedPairVault + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipExtendedPairVault(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowExtendedPairVault + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthExtendedPairVault + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupExtendedPairVault + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthExtendedPairVault + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthExtendedPairVault = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowExtendedPairVault = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupExtendedPairVault = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/asset/types/genesis.pb.go b/github.com/comdex-official/comdex/x/asset/types/genesis.pb.go new file mode 100644 index 000000000..3490746b6 --- /dev/null +++ b/github.com/comdex-official/comdex/x/asset/types/genesis.pb.go @@ -0,0 +1,547 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/asset/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type GenesisState struct { + Assets []Asset `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets" yaml:"assets"` + Pairs []Pair `protobuf:"bytes,2,rep,name=pairs,proto3" json:"pairs" yaml:"pairs"` + AppData []AppData `protobuf:"bytes,3,rep,name=appData,proto3" json:"appData" yaml:"appData"` + ExtendedPairVault []ExtendedPairVault `protobuf:"bytes,4,rep,name=extendedPairVault,proto3" json:"extendedPairVault" yaml:"extendedPairVault"` + Params Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params" yaml:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_13a69a7476a1f579, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func init() { + proto.RegisterType((*GenesisState)(nil), "comdex.asset.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("comdex/asset/v1beta1/genesis.proto", fileDescriptor_13a69a7476a1f579) +} + +var fileDescriptor_13a69a7476a1f579 = []byte{ + // 388 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcf, 0x4e, 0xea, 0x40, + 0x14, 0x87, 0xdb, 0xcb, 0x85, 0x9b, 0x14, 0xee, 0x4d, 0x6e, 0x83, 0xa6, 0x41, 0x1d, 0xea, 0x6c, + 0x64, 0xa1, 0x6d, 0xc0, 0x9d, 0x3b, 0x1b, 0xff, 0x24, 0xba, 0x50, 0x6b, 0xe2, 0xc2, 0xdd, 0x00, + 0x43, 0x6d, 0x02, 0x74, 0xd2, 0x19, 0x14, 0xde, 0xc2, 0xc7, 0xf0, 0x15, 0x7c, 0x03, 0x96, 0x2c, + 0x5d, 0x11, 0x2d, 0x6f, 0xe0, 0x13, 0x98, 0xce, 0x19, 0x36, 0x30, 0xec, 0x3a, 0x9d, 0xef, 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16, 0xfc, 0xc6, 0xe1, 0xd2, 0x62, 0xbf, 0x58, 0xff, 0xd7, + 0x76, 0xe6, 0xfc, 0x96, 0xea, 0x03, 0xbd, 0xfa, 0x7c, 0x15, 0x0f, 0x5c, 0x15, 0xe2, 0x40, 0xc8, + 0x9a, 0x0f, 0x87, 0xeb, 0x19, 0xf6, 0xb5, 0x55, 0x82, 0xf5, 0x3b, 0x45, 0xd7, 0x6c, 0x94, 0x5b, + 0xbb, 0x9b, 0x56, 0x92, 0x33, 0xab, 0xeb, 0x85, 0x4a, 0x1c, 0x2a, 0x45, 0x70, 0x37, 0xfd, 0x42, + 0xc6, 0x5b, 0x86, 0x8c, 0x69, 0x86, 0xcc, 0x59, 0x86, 0xcc, 0xcf, 0x0c, 0x99, 0xaf, 0x0b, 0x64, + 0xcc, 0x16, 0xc8, 0xf8, 0x58, 0x20, 0xe3, 0xd1, 0x8f, 0x62, 0xf1, 0x34, 0x6a, 0xe7, 0x21, 0x3e, + 0x04, 0x1d, 0x25, 0xbd, 0x5e, 0xdc, 0x89, 0x49, 0x5f, 0x9d, 0xfd, 0xe5, 0xeb, 0x10, 0x13, 0x46, + 0x79, 0xbb, 0x24, 0x5f, 0xc5, 0xf1, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x6f, 0x99, 0x1f, + 0x1b, 0x03, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.ExtendedPairVault) > 0 { + for iNdEx := len(m.ExtendedPairVault) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExtendedPairVault[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.AppData) > 0 { + for iNdEx := len(m.AppData) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AppData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Pairs) > 0 { + for iNdEx := len(m.Pairs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Pairs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Assets) > 0 { + for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Assets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Assets) > 0 { + for _, e := range m.Assets { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Pairs) > 0 { + for _, e := range m.Pairs { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.AppData) > 0 { + for _, e := range m.AppData { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.ExtendedPairVault) > 0 { + for _, e := range m.ExtendedPairVault { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Assets = append(m.Assets, Asset{}) + if err := m.Assets[len(m.Assets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pairs = append(m.Pairs, Pair{}) + if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppData = append(m.AppData, AppData{}) + if err := m.AppData[len(m.AppData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtendedPairVault", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExtendedPairVault = append(m.ExtendedPairVault, ExtendedPairVault{}) + if err := m.ExtendedPairVault[len(m.ExtendedPairVault)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/asset/types/gov.pb.go b/github.com/comdex-official/comdex/x/asset/types/gov.pb.go new file mode 100644 index 000000000..bb7b38fa5 --- /dev/null +++ b/github.com/comdex-official/comdex/x/asset/types/gov.pb.go @@ -0,0 +1,2724 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/asset/v1beta1/gov.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type AddAssetsProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + Assets Asset `protobuf:"bytes,3,opt,name=assets,proto3" json:"assets"` +} + +func (m *AddAssetsProposal) Reset() { *m = AddAssetsProposal{} } +func (m *AddAssetsProposal) String() string { return proto.CompactTextString(m) } +func (*AddAssetsProposal) ProtoMessage() {} +func (*AddAssetsProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_31c5aab0360b917f, []int{0} +} +func (m *AddAssetsProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddAssetsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddAssetsProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddAssetsProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddAssetsProposal.Merge(m, src) +} +func (m *AddAssetsProposal) XXX_Size() int { + return m.Size() +} +func (m *AddAssetsProposal) XXX_DiscardUnknown() { + xxx_messageInfo_AddAssetsProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_AddAssetsProposal proto.InternalMessageInfo + +type AddMultipleAssetsProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + Assets []Asset `protobuf:"bytes,3,rep,name=assets,proto3" json:"assets"` +} + +func (m *AddMultipleAssetsProposal) Reset() { *m = AddMultipleAssetsProposal{} } +func (m *AddMultipleAssetsProposal) String() string { return proto.CompactTextString(m) } +func (*AddMultipleAssetsProposal) ProtoMessage() {} +func (*AddMultipleAssetsProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_31c5aab0360b917f, []int{1} +} +func (m *AddMultipleAssetsProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddMultipleAssetsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddMultipleAssetsProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddMultipleAssetsProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddMultipleAssetsProposal.Merge(m, src) +} +func (m *AddMultipleAssetsProposal) XXX_Size() int { + return m.Size() +} +func (m *AddMultipleAssetsProposal) XXX_DiscardUnknown() { + xxx_messageInfo_AddMultipleAssetsProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_AddMultipleAssetsProposal proto.InternalMessageInfo + +type AddMultiplePairsProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + Pairs []Pair `protobuf:"bytes,3,rep,name=pairs,proto3" json:"pairs"` +} + +func (m *AddMultiplePairsProposal) Reset() { *m = AddMultiplePairsProposal{} } +func (m *AddMultiplePairsProposal) String() string { return proto.CompactTextString(m) } +func (*AddMultiplePairsProposal) ProtoMessage() {} +func (*AddMultiplePairsProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_31c5aab0360b917f, []int{2} +} +func (m *AddMultiplePairsProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddMultiplePairsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddMultiplePairsProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddMultiplePairsProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddMultiplePairsProposal.Merge(m, src) +} +func (m *AddMultiplePairsProposal) XXX_Size() int { + return m.Size() +} +func (m *AddMultiplePairsProposal) XXX_DiscardUnknown() { + xxx_messageInfo_AddMultiplePairsProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_AddMultiplePairsProposal proto.InternalMessageInfo + +type UpdateAssetProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + Asset Asset `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset"` +} + +func (m *UpdateAssetProposal) Reset() { *m = UpdateAssetProposal{} } +func (m *UpdateAssetProposal) String() string { return proto.CompactTextString(m) } +func (*UpdateAssetProposal) ProtoMessage() {} +func (*UpdateAssetProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_31c5aab0360b917f, []int{3} +} +func (m *UpdateAssetProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdateAssetProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateAssetProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UpdateAssetProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateAssetProposal.Merge(m, src) +} +func (m *UpdateAssetProposal) XXX_Size() int { + return m.Size() +} +func (m *UpdateAssetProposal) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateAssetProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateAssetProposal proto.InternalMessageInfo + +type AddPairsProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + Pairs Pair `protobuf:"bytes,3,opt,name=pairs,proto3" json:"pairs"` +} + +func (m *AddPairsProposal) Reset() { *m = AddPairsProposal{} } +func (m *AddPairsProposal) String() string { return proto.CompactTextString(m) } +func (*AddPairsProposal) ProtoMessage() {} +func (*AddPairsProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_31c5aab0360b917f, []int{4} +} +func (m *AddPairsProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddPairsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddPairsProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddPairsProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddPairsProposal.Merge(m, src) +} +func (m *AddPairsProposal) XXX_Size() int { + return m.Size() +} +func (m *AddPairsProposal) XXX_DiscardUnknown() { + xxx_messageInfo_AddPairsProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_AddPairsProposal proto.InternalMessageInfo + +type UpdatePairProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + Pairs Pair `protobuf:"bytes,3,opt,name=pairs,proto3" json:"pairs"` +} + +func (m *UpdatePairProposal) Reset() { *m = UpdatePairProposal{} } +func (m *UpdatePairProposal) String() string { return proto.CompactTextString(m) } +func (*UpdatePairProposal) ProtoMessage() {} +func (*UpdatePairProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_31c5aab0360b917f, []int{5} +} +func (m *UpdatePairProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdatePairProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdatePairProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UpdatePairProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdatePairProposal.Merge(m, src) +} +func (m *UpdatePairProposal) XXX_Size() int { + return m.Size() +} +func (m *UpdatePairProposal) XXX_DiscardUnknown() { + xxx_messageInfo_UpdatePairProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdatePairProposal proto.InternalMessageInfo + +type AddAppProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + App AppData `protobuf:"bytes,3,opt,name=app,proto3" json:"app"` +} + +func (m *AddAppProposal) Reset() { *m = AddAppProposal{} } +func (m *AddAppProposal) String() string { return proto.CompactTextString(m) } +func (*AddAppProposal) ProtoMessage() {} +func (*AddAppProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_31c5aab0360b917f, []int{6} +} +func (m *AddAppProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddAppProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddAppProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddAppProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddAppProposal.Merge(m, src) +} +func (m *AddAppProposal) XXX_Size() int { + return m.Size() +} +func (m *AddAppProposal) XXX_DiscardUnknown() { + xxx_messageInfo_AddAppProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_AddAppProposal proto.InternalMessageInfo + +type UpdateGovTimeInAppProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + GovTime AppAndGovTime `protobuf:"bytes,3,opt,name=govTime,proto3" json:"govTime"` +} + +func (m *UpdateGovTimeInAppProposal) Reset() { *m = UpdateGovTimeInAppProposal{} } +func (m *UpdateGovTimeInAppProposal) String() string { return proto.CompactTextString(m) } +func (*UpdateGovTimeInAppProposal) ProtoMessage() {} +func (*UpdateGovTimeInAppProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_31c5aab0360b917f, []int{7} +} +func (m *UpdateGovTimeInAppProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdateGovTimeInAppProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateGovTimeInAppProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UpdateGovTimeInAppProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateGovTimeInAppProposal.Merge(m, src) +} +func (m *UpdateGovTimeInAppProposal) XXX_Size() int { + return m.Size() +} +func (m *UpdateGovTimeInAppProposal) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateGovTimeInAppProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateGovTimeInAppProposal proto.InternalMessageInfo + +type AddAssetInAppProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + App AppData `protobuf:"bytes,3,opt,name=app,proto3" json:"app"` +} + +func (m *AddAssetInAppProposal) Reset() { *m = AddAssetInAppProposal{} } +func (m *AddAssetInAppProposal) String() string { return proto.CompactTextString(m) } +func (*AddAssetInAppProposal) ProtoMessage() {} +func (*AddAssetInAppProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_31c5aab0360b917f, []int{8} +} +func (m *AddAssetInAppProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddAssetInAppProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddAssetInAppProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddAssetInAppProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddAssetInAppProposal.Merge(m, src) +} +func (m *AddAssetInAppProposal) XXX_Size() int { + return m.Size() +} +func (m *AddAssetInAppProposal) XXX_DiscardUnknown() { + xxx_messageInfo_AddAssetInAppProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_AddAssetInAppProposal proto.InternalMessageInfo + +type AddMultipleAssetsPairsProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + AssetsPair []AssetPair `protobuf:"bytes,3,rep,name=assetsPair,proto3" json:"assetsPair"` +} + +func (m *AddMultipleAssetsPairsProposal) Reset() { *m = AddMultipleAssetsPairsProposal{} } +func (m *AddMultipleAssetsPairsProposal) String() string { return proto.CompactTextString(m) } +func (*AddMultipleAssetsPairsProposal) ProtoMessage() {} +func (*AddMultipleAssetsPairsProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_31c5aab0360b917f, []int{9} +} +func (m *AddMultipleAssetsPairsProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddMultipleAssetsPairsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddMultipleAssetsPairsProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddMultipleAssetsPairsProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddMultipleAssetsPairsProposal.Merge(m, src) +} +func (m *AddMultipleAssetsPairsProposal) XXX_Size() int { + return m.Size() +} +func (m *AddMultipleAssetsPairsProposal) XXX_DiscardUnknown() { + xxx_messageInfo_AddMultipleAssetsPairsProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_AddMultipleAssetsPairsProposal proto.InternalMessageInfo + +func init() { + proto.RegisterType((*AddAssetsProposal)(nil), "comdex.asset.v1beta1.AddAssetsProposal") + proto.RegisterType((*AddMultipleAssetsProposal)(nil), "comdex.asset.v1beta1.AddMultipleAssetsProposal") + proto.RegisterType((*AddMultiplePairsProposal)(nil), "comdex.asset.v1beta1.AddMultiplePairsProposal") + proto.RegisterType((*UpdateAssetProposal)(nil), "comdex.asset.v1beta1.UpdateAssetProposal") + proto.RegisterType((*AddPairsProposal)(nil), "comdex.asset.v1beta1.AddPairsProposal") + proto.RegisterType((*UpdatePairProposal)(nil), "comdex.asset.v1beta1.UpdatePairProposal") + proto.RegisterType((*AddAppProposal)(nil), "comdex.asset.v1beta1.AddAppProposal") + proto.RegisterType((*UpdateGovTimeInAppProposal)(nil), "comdex.asset.v1beta1.UpdateGovTimeInAppProposal") + proto.RegisterType((*AddAssetInAppProposal)(nil), "comdex.asset.v1beta1.AddAssetInAppProposal") + proto.RegisterType((*AddMultipleAssetsPairsProposal)(nil), "comdex.asset.v1beta1.AddMultipleAssetsPairsProposal") +} + +func init() { proto.RegisterFile("comdex/asset/v1beta1/gov.proto", fileDescriptor_31c5aab0360b917f) } + +var fileDescriptor_31c5aab0360b917f = []byte{ + // 500 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x95, 0x4f, 0x8b, 0xd3, 0x40, + 0x18, 0xc6, 0x33, 0xd6, 0xae, 0xf8, 0xae, 0xc8, 0x1a, 0x57, 0xa9, 0x15, 0x27, 0x25, 0x82, 0xec, + 0xc5, 0x84, 0x55, 0xfc, 0x7b, 0x4b, 0x55, 0xc4, 0x83, 0xb0, 0x16, 0xbd, 0x78, 0x9b, 0x76, 0x66, + 0xe3, 0x40, 0xda, 0x19, 0x92, 0xd9, 0xe2, 0x7e, 0x0b, 0x3f, 0x86, 0x82, 0x88, 0x07, 0x0f, 0xde, + 0xbd, 0xd4, 0xdb, 0x1e, 0x3d, 0x15, 0x6d, 0xbf, 0xc1, 0x7e, 0x02, 0x99, 0x3f, 0x91, 0x80, 0x59, + 0x71, 0x3d, 0xa4, 0x78, 0x6b, 0xf3, 0x3c, 0xef, 0xcc, 0x6f, 0x1e, 0xde, 0x79, 0x07, 0xf0, 0x48, + 0x8c, 0x29, 0x7b, 0x1d, 0x93, 0xa2, 0x60, 0x2a, 0x9e, 0x6e, 0x0f, 0x99, 0x22, 0xdb, 0x71, 0x2a, + 0xa6, 0x91, 0xcc, 0x85, 0x12, 0xfe, 0xa6, 0xd5, 0x23, 0xa3, 0x47, 0x4e, 0xef, 0x6e, 0xa6, 0x22, + 0x15, 0xc6, 0x10, 0xeb, 0x5f, 0xd6, 0xdb, 0xed, 0xd5, 0xae, 0x65, 0x2b, 0xad, 0x23, 0xa8, 0x75, + 0x48, 0xc2, 0x73, 0x67, 0xa8, 0xc7, 0x21, 0x52, 0x5a, 0x3d, 0xfc, 0x88, 0xe0, 0x5c, 0x42, 0x69, + 0xa2, 0xe5, 0x62, 0x27, 0x17, 0x52, 0x14, 0x24, 0xf3, 0xaf, 0x41, 0x5b, 0x71, 0x95, 0xb1, 0x0e, + 0xea, 0xa1, 0xad, 0xd3, 0xfd, 0x8d, 0xc3, 0x79, 0x70, 0x66, 0x9f, 0x8c, 0xb3, 0xfb, 0xa1, 0xf9, + 0x1c, 0x0e, 0xac, 0xec, 0xdf, 0x85, 0x75, 0xca, 0x8a, 0x51, 0xce, 0xa5, 0xe2, 0x62, 0xd2, 0x39, + 0x61, 0xdc, 0x17, 0x0f, 0xe7, 0x81, 0x6f, 0xdd, 0x15, 0x31, 0x1c, 0x54, 0xad, 0xfe, 0x3d, 0x58, + 0x33, 0x48, 0x45, 0xa7, 0xd5, 0x43, 0x5b, 0xeb, 0x37, 0x2e, 0x47, 0x75, 0xb9, 0x44, 0x86, 0xab, + 0x7f, 0x72, 0x36, 0x0f, 0xbc, 0x81, 0x2b, 0x08, 0x3f, 0x23, 0xb8, 0x94, 0x50, 0xfa, 0x74, 0x2f, + 0x53,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, 0x18, 0x7d, 0x5f, 0x60, 0xf4, 0x66, 0x89, 0xbd, 0x83, + 0x25, 0xf6, 0xbe, 0x2d, 0xb1, 0xf7, 0x32, 0x4e, 0xb9, 0x7a, 0xb5, 0x37, 0xd4, 0x4b, 0xc7, 0x76, + 0xf9, 0xeb, 0x62, 0x77, 0x97, 0x8f, 0x38, 0xc9, 0xdc, 0xff, 0xb8, 0x7c, 0x87, 0xd5, 0xbe, 0x64, + 0xc5, 0x70, 0xcd, 0x3c, 0xc1, 0x37, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, 0x44, 0x27, 0xbf, 0x14, + 0x33, 0x08, 0x00, 0x00, +} + +func (m *AddAssetsProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddAssetsProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddAssetsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Assets.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddMultipleAssetsProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddMultipleAssetsProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddMultipleAssetsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Assets) > 0 { + for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Assets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddMultiplePairsProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddMultiplePairsProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddMultiplePairsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Pairs) > 0 { + for iNdEx := len(m.Pairs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Pairs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdateAssetProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateAssetProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateAssetProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Asset.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddPairsProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddPairsProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddPairsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Pairs.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdatePairProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdatePairProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdatePairProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Pairs.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddAppProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddAppProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddAppProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.App.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdateGovTimeInAppProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateGovTimeInAppProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateGovTimeInAppProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.GovTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddAssetInAppProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddAssetInAppProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddAssetInAppProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.App.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddMultipleAssetsPairsProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddMultipleAssetsPairsProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddMultipleAssetsPairsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AssetsPair) > 0 { + for iNdEx := len(m.AssetsPair) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AssetsPair[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGov(dAtA []byte, offset int, v uint64) int { + offset -= sovGov(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AddAssetsProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = m.Assets.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *AddMultipleAssetsProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + if len(m.Assets) > 0 { + for _, e := range m.Assets { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + return n +} + +func (m *AddMultiplePairsProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + if len(m.Pairs) > 0 { + for _, e := range m.Pairs { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + return n +} + +func (m *UpdateAssetProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = m.Asset.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *AddPairsProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = m.Pairs.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *UpdatePairProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = m.Pairs.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *AddAppProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = m.App.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *UpdateGovTimeInAppProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = m.GovTime.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *AddAssetInAppProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = m.App.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *AddMultipleAssetsPairsProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + if len(m.AssetsPair) > 0 { + for _, e := range m.AssetsPair { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + return n +} + +func sovGov(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGov(x uint64) (n int) { + return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AddAssetsProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddAssetsProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddAssetsProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Assets.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddMultipleAssetsProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddMultipleAssetsProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddMultipleAssetsProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Assets = append(m.Assets, Asset{}) + if err := m.Assets[len(m.Assets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddMultiplePairsProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddMultiplePairsProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddMultiplePairsProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pairs = append(m.Pairs, Pair{}) + if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateAssetProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateAssetProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateAssetProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Asset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddPairsProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddPairsProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddPairsProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Pairs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdatePairProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdatePairProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdatePairProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Pairs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddAppProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddAppProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddAppProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field App", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.App.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateGovTimeInAppProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateGovTimeInAppProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateGovTimeInAppProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GovTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.GovTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddAssetInAppProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddAssetInAppProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddAssetInAppProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field App", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.App.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddMultipleAssetsPairsProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddMultipleAssetsPairsProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddMultipleAssetsPairsProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetsPair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssetsPair = append(m.AssetsPair, AssetPair{}) + if err := m.AssetsPair[len(m.AssetsPair)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGov(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGov + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGov + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGov + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGov + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGov + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGov + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/asset/types/pair.pb.go b/github.com/comdex-official/comdex/x/asset/types/pair.pb.go new file mode 100644 index 000000000..45c132d80 --- /dev/null +++ b/github.com/comdex-official/comdex/x/asset/types/pair.pb.go @@ -0,0 +1,1075 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/asset/v1beta1/pair.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Pair struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + AssetIn uint64 `protobuf:"varint,2,opt,name=asset_in,json=assetIn,proto3" json:"asset_in,omitempty" yaml:"asset_in"` + AssetOut uint64 `protobuf:"varint,3,opt,name=asset_out,json=assetOut,proto3" json:"asset_out,omitempty" yaml:"asset_out"` +} + +func (m *Pair) Reset() { *m = Pair{} } +func (m *Pair) String() string { return proto.CompactTextString(m) } +func (*Pair) ProtoMessage() {} +func (*Pair) Descriptor() ([]byte, []int) { + return fileDescriptor_65bd24918e5ac160, []int{0} +} +func (m *Pair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Pair.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Pair) XXX_Merge(src proto.Message) { + xxx_messageInfo_Pair.Merge(m, src) +} +func (m *Pair) XXX_Size() int { + return m.Size() +} +func (m *Pair) XXX_DiscardUnknown() { + xxx_messageInfo_Pair.DiscardUnknown(m) +} + +var xxx_messageInfo_Pair proto.InternalMessageInfo + +type PairInfo struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + AssetIn uint64 `protobuf:"varint,2,opt,name=asset_in,json=assetIn,proto3" json:"asset_in,omitempty" yaml:"asset_in"` + DenomIn string `protobuf:"bytes,3,opt,name=denom_in,json=denomIn,proto3" json:"denom_in,omitempty" yaml:"denom"` + AssetOut uint64 `protobuf:"varint,4,opt,name=asset_out,json=assetOut,proto3" json:"asset_out,omitempty" yaml:"asset_out"` + DenomOut string `protobuf:"bytes,5,opt,name=denom_out,json=denomOut,proto3" json:"denom_out,omitempty" yaml:"denom"` +} + +func (m *PairInfo) Reset() { *m = PairInfo{} } +func (m *PairInfo) String() string { return proto.CompactTextString(m) } +func (*PairInfo) ProtoMessage() {} +func (*PairInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_65bd24918e5ac160, []int{1} +} +func (m *PairInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PairInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PairInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PairInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_PairInfo.Merge(m, src) +} +func (m *PairInfo) XXX_Size() int { + return m.Size() +} +func (m *PairInfo) XXX_DiscardUnknown() { + xxx_messageInfo_PairInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_PairInfo proto.InternalMessageInfo + +type AssetPair struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` + Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + Decimals github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=decimals,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"decimals" yaml:"decimals"` + IsOnChain bool `protobuf:"varint,5,opt,name=is_on_chain,json=isOnChain,proto3" json:"is_on_chain,omitempty" yaml:"is_on_chain"` + IsOraclePriceRequired bool `protobuf:"varint,6,opt,name=is_oracle_price_required,json=isOraclePriceRequired,proto3" json:"is_oracle_price_required,omitempty" yaml:"is_oracle_price_required"` + IsCdpMintable bool `protobuf:"varint,7,opt,name=is_cdp_mintable,json=isCdpMintable,proto3" json:"is_cdp_mintable,omitempty" yaml:"is_cdp_mintable"` + AssetOut uint64 `protobuf:"varint,8,opt,name=asset_out,json=assetOut,proto3" json:"asset_out,omitempty" yaml:"asset_out"` +} + +func (m *AssetPair) Reset() { *m = AssetPair{} } +func (m *AssetPair) String() string { return proto.CompactTextString(m) } +func (*AssetPair) ProtoMessage() {} +func (*AssetPair) Descriptor() ([]byte, []int) { + return fileDescriptor_65bd24918e5ac160, []int{2} +} +func (m *AssetPair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AssetPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AssetPair.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AssetPair) XXX_Merge(src proto.Message) { + xxx_messageInfo_AssetPair.Merge(m, src) +} +func (m *AssetPair) XXX_Size() int { + return m.Size() +} +func (m *AssetPair) XXX_DiscardUnknown() { + xxx_messageInfo_AssetPair.DiscardUnknown(m) +} + +var xxx_messageInfo_AssetPair proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Pair)(nil), "comdex.asset.v1beta1.Pair") + proto.RegisterType((*PairInfo)(nil), "comdex.asset.v1beta1.PairInfo") + proto.RegisterType((*AssetPair)(nil), "comdex.asset.v1beta1.AssetPair") +} + +func init() { proto.RegisterFile("comdex/asset/v1beta1/pair.proto", fileDescriptor_65bd24918e5ac160) } + +var fileDescriptor_65bd24918e5ac160 = []byte{ + // 517 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xcf, 0x6e, 0xd3, 0x30, + 0x18, 0x4f, 0xb6, 0x6e, 0x6d, 0x3c, 0xa0, 0x93, 0x29, 0x53, 0xb4, 0x43, 0x8c, 0x32, 0x69, 0x42, + 0x42, 0x4d, 0x54, 0x21, 0x71, 0xe0, 0xb6, 0xec, 0xd4, 0x03, 0xea, 0xc8, 0x11, 0x81, 0x22, 0x37, + 0x71, 0x3b, 0x8b, 0xc6, 0x0e, 0xb1, 0x8b, 0xe8, 0x5b, 0xf0, 0x18, 0x3c, 0x4a, 0x8f, 0x3b, 0x70, + 0x00, 0x0e, 0x11, 0xb4, 0x6f, 0x90, 0x27, 0x40, 0xb6, 0x53, 0xd6, 0xa1, 0x4d, 0x9a, 0xc4, 0x29, + 0x9f, 0xbf, 0xdf, 0x9f, 0xcf, 0x3f, 0xc7, 0x06, 0x28, 0xe5, 0x79, 0x46, 0x3e, 0x87, 0x58, 0x08, + 0x22, 0xc3, 0x4f, 0x83, 0x31, 0x91, 0x78, 0x10, 0x16, 0x98, 0x96, 0x41, 0x51, 0x72, 0xc9, 0x61, + 0xcf, 0x10, 0x02, 0x4d, 0x08, 0x1a, 0xc2, 0x71, 0x6f, 0xca, 0xa7, 0x5c, 0x13, 0x42, 0x55, 0x19, + 0xae, 0xbf, 0x00, 0xad, 0x0b,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, 0xe5, 0xea, + 0x1f, 0x30, 0xde, 0xd7, 0xef, 0xf0, 0xc5, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc9, 0xbe, 0x85, + 0x72, 0xd6, 0x03, 0x00, 0x00, +} + +func (m *Pair) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Pair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Pair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AssetOut != 0 { + i = encodeVarintPair(dAtA, i, uint64(m.AssetOut)) + i-- + dAtA[i] = 0x18 + } + if m.AssetIn != 0 { + i = encodeVarintPair(dAtA, i, uint64(m.AssetIn)) + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintPair(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PairInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PairInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PairInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DenomOut) > 0 { + i -= len(m.DenomOut) + copy(dAtA[i:], m.DenomOut) + i = encodeVarintPair(dAtA, i, uint64(len(m.DenomOut))) + i-- + dAtA[i] = 0x2a + } + if m.AssetOut != 0 { + i = encodeVarintPair(dAtA, i, uint64(m.AssetOut)) + i-- + dAtA[i] = 0x20 + } + if len(m.DenomIn) > 0 { + i -= len(m.DenomIn) + copy(dAtA[i:], m.DenomIn) + i = encodeVarintPair(dAtA, i, uint64(len(m.DenomIn))) + i-- + dAtA[i] = 0x1a + } + if m.AssetIn != 0 { + i = encodeVarintPair(dAtA, i, uint64(m.AssetIn)) + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintPair(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AssetPair) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AssetPair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssetPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AssetOut != 0 { + i = encodeVarintPair(dAtA, i, uint64(m.AssetOut)) + i-- + dAtA[i] = 0x40 + } + if m.IsCdpMintable { + i-- + if m.IsCdpMintable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.IsOraclePriceRequired { + i-- + if m.IsOraclePriceRequired { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.IsOnChain { + i-- + if m.IsOnChain { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + { + size := m.Decimals.Size() + i -= size + if _, err := m.Decimals.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintPair(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintPair(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintPair(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintPair(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintPair(dAtA []byte, offset int, v uint64) int { + offset -= sovPair(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Pair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovPair(uint64(m.Id)) + } + if m.AssetIn != 0 { + n += 1 + sovPair(uint64(m.AssetIn)) + } + if m.AssetOut != 0 { + n += 1 + sovPair(uint64(m.AssetOut)) + } + return n +} + +func (m *PairInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovPair(uint64(m.Id)) + } + if m.AssetIn != 0 { + n += 1 + sovPair(uint64(m.AssetIn)) + } + l = len(m.DenomIn) + if l > 0 { + n += 1 + l + sovPair(uint64(l)) + } + if m.AssetOut != 0 { + n += 1 + sovPair(uint64(m.AssetOut)) + } + l = len(m.DenomOut) + if l > 0 { + n += 1 + l + sovPair(uint64(l)) + } + return n +} + +func (m *AssetPair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovPair(uint64(m.Id)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovPair(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovPair(uint64(l)) + } + l = m.Decimals.Size() + n += 1 + l + sovPair(uint64(l)) + if m.IsOnChain { + n += 2 + } + if m.IsOraclePriceRequired { + n += 2 + } + if m.IsCdpMintable { + n += 2 + } + if m.AssetOut != 0 { + n += 1 + sovPair(uint64(m.AssetOut)) + } + return n +} + +func sovPair(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPair(x uint64) (n int) { + return sovPair(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Pair) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Pair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Pair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetIn", wireType) + } + m.AssetIn = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetIn |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetOut", wireType) + } + m.AssetOut = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetOut |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipPair(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPair + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PairInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PairInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PairInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetIn", wireType) + } + m.AssetIn = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetIn |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomIn", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + 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 ErrInvalidLengthPair + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPair + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomIn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetOut", wireType) + } + m.AssetOut = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetOut |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomOut", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + 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 ErrInvalidLengthPair + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPair + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomOut = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPair(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPair + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AssetPair) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AssetPair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AssetPair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + 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 ErrInvalidLengthPair + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPair + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + 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 ErrInvalidLengthPair + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPair + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + 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 ErrInvalidLengthPair + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPair + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Decimals.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsOnChain", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsOnChain = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsOraclePriceRequired", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsOraclePriceRequired = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsCdpMintable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsCdpMintable = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetOut", wireType) + } + m.AssetOut = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetOut |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipPair(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPair + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPair(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPair + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPair + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPair + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthPair + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPair + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPair + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPair = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPair = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPair = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/asset/types/params.pb.go b/github.com/comdex-official/comdex/x/asset/types/params.pb.go new file mode 100644 index 000000000..29c4379a3 --- /dev/null +++ b/github.com/comdex-official/comdex/x/asset/types/params.pb.go @@ -0,0 +1,265 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/asset/v1beta1/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_6cd5d1c7ef4e1c40, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "comdex.asset.v1beta1.Params") +} + +func init() { proto.RegisterFile("comdex/asset/v1beta1/params.proto", fileDescriptor_6cd5d1c7ef4e1c40) } + +var fileDescriptor_6cd5d1c7ef4e1c40 = []byte{ + // 164 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x2e, 0x4e, 0x2d, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, + 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, + 0x28, 0xd1, 0x03, 0x2b, 0xd1, 0x83, 0x2a, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, 0xd0, + 0x07, 0xb1, 0x20, 0x6a, 0x95, 0x38, 0xb8, 0xd8, 0x02, 0xc0, 0x7a, 0x9d, 0x02, 0x4f, 0x3c, 0x94, + 0x63, 0x58, 0xf1, 0x48, 0x8e, 0xe1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, + 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, + 0xf4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x21, 0x56, 0xe8, 0xe6, + 0xa7, 0xa5, 0x65, 0x26, 0x67, 0x26, 0xe6, 0x40, 0xf9, 0xfa, 0x30, 0x77, 0x95, 0x54, 0x16, 0xa4, + 0x16, 0x27, 0xb1, 0x81, 0xed, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xba, 0x38, 0xd8, 0xd2, + 0xb4, 0x00, 0x00, 0x00, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/asset/types/query.pb.go b/github.com/comdex-official/comdex/x/asset/types/query.pb.go new file mode 100644 index 000000000..d51796b79 --- /dev/null +++ b/github.com/comdex-official/comdex/x/asset/types/query.pb.go @@ -0,0 +1,5660 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/asset/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type QueryAssetsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAssetsRequest) Reset() { *m = QueryAssetsRequest{} } +func (m *QueryAssetsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAssetsRequest) ProtoMessage() {} +func (*QueryAssetsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{0} +} +func (m *QueryAssetsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAssetsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAssetsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAssetsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAssetsRequest.Merge(m, src) +} +func (m *QueryAssetsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAssetsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAssetsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAssetsRequest proto.InternalMessageInfo + +type QueryAssetsResponse struct { + Assets []Asset `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets" yaml:"assets"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAssetsResponse) Reset() { *m = QueryAssetsResponse{} } +func (m *QueryAssetsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAssetsResponse) ProtoMessage() {} +func (*QueryAssetsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{1} +} +func (m *QueryAssetsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAssetsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAssetsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAssetsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAssetsResponse.Merge(m, src) +} +func (m *QueryAssetsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAssetsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAssetsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAssetsResponse proto.InternalMessageInfo + +type QueryAssetRequest struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryAssetRequest) Reset() { *m = QueryAssetRequest{} } +func (m *QueryAssetRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAssetRequest) ProtoMessage() {} +func (*QueryAssetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{2} +} +func (m *QueryAssetRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAssetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAssetRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAssetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAssetRequest.Merge(m, src) +} +func (m *QueryAssetRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAssetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAssetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAssetRequest proto.InternalMessageInfo + +type QueryAssetResponse struct { + Asset Asset `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset" yaml:"asset"` +} + +func (m *QueryAssetResponse) Reset() { *m = QueryAssetResponse{} } +func (m *QueryAssetResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAssetResponse) ProtoMessage() {} +func (*QueryAssetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{3} +} +func (m *QueryAssetResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAssetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAssetResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAssetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAssetResponse.Merge(m, src) +} +func (m *QueryAssetResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAssetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAssetResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAssetResponse proto.InternalMessageInfo + +type QueryAssetPairsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAssetPairsRequest) Reset() { *m = QueryAssetPairsRequest{} } +func (m *QueryAssetPairsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAssetPairsRequest) ProtoMessage() {} +func (*QueryAssetPairsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{4} +} +func (m *QueryAssetPairsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAssetPairsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAssetPairsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAssetPairsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAssetPairsRequest.Merge(m, src) +} +func (m *QueryAssetPairsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAssetPairsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAssetPairsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAssetPairsRequest proto.InternalMessageInfo + +type QueryAssetPairsResponse struct { + PairsInfo []PairInfo `protobuf:"bytes,1,rep,name=pairsInfo,proto3" json:"pairsInfo" yaml:"pairs_info"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAssetPairsResponse) Reset() { *m = QueryAssetPairsResponse{} } +func (m *QueryAssetPairsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAssetPairsResponse) ProtoMessage() {} +func (*QueryAssetPairsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{5} +} +func (m *QueryAssetPairsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAssetPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAssetPairsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAssetPairsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAssetPairsResponse.Merge(m, src) +} +func (m *QueryAssetPairsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAssetPairsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAssetPairsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAssetPairsResponse proto.InternalMessageInfo + +type QueryAssetPairRequest struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryAssetPairRequest) Reset() { *m = QueryAssetPairRequest{} } +func (m *QueryAssetPairRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAssetPairRequest) ProtoMessage() {} +func (*QueryAssetPairRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{6} +} +func (m *QueryAssetPairRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAssetPairRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAssetPairRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAssetPairRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAssetPairRequest.Merge(m, src) +} +func (m *QueryAssetPairRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAssetPairRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAssetPairRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAssetPairRequest proto.InternalMessageInfo + +type QueryAssetPairResponse struct { + PairInfo PairInfo `protobuf:"bytes,1,opt,name=pairInfo,proto3" json:"pairInfo" yaml:"pair_info"` +} + +func (m *QueryAssetPairResponse) Reset() { *m = QueryAssetPairResponse{} } +func (m *QueryAssetPairResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAssetPairResponse) ProtoMessage() {} +func (*QueryAssetPairResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{7} +} +func (m *QueryAssetPairResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAssetPairResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAssetPairResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAssetPairResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAssetPairResponse.Merge(m, src) +} +func (m *QueryAssetPairResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAssetPairResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAssetPairResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAssetPairResponse proto.InternalMessageInfo + +type QueryAppRequest struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryAppRequest) Reset() { *m = QueryAppRequest{} } +func (m *QueryAppRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAppRequest) ProtoMessage() {} +func (*QueryAppRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{8} +} +func (m *QueryAppRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAppRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAppRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAppRequest.Merge(m, src) +} +func (m *QueryAppRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAppRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAppRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAppRequest proto.InternalMessageInfo + +type QueryAppResponse struct { + App AppData `protobuf:"bytes,1,opt,name=app,proto3" json:"app" yaml:"app"` +} + +func (m *QueryAppResponse) Reset() { *m = QueryAppResponse{} } +func (m *QueryAppResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAppResponse) ProtoMessage() {} +func (*QueryAppResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{9} +} +func (m *QueryAppResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAppResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAppResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAppResponse.Merge(m, src) +} +func (m *QueryAppResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAppResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAppResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAppResponse proto.InternalMessageInfo + +type QueryGovTokenByAppRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` +} + +func (m *QueryGovTokenByAppRequest) Reset() { *m = QueryGovTokenByAppRequest{} } +func (m *QueryGovTokenByAppRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGovTokenByAppRequest) ProtoMessage() {} +func (*QueryGovTokenByAppRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{10} +} +func (m *QueryGovTokenByAppRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGovTokenByAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGovTokenByAppRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGovTokenByAppRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGovTokenByAppRequest.Merge(m, src) +} +func (m *QueryGovTokenByAppRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGovTokenByAppRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGovTokenByAppRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGovTokenByAppRequest proto.InternalMessageInfo + +type QueryGovTokenByAppResponse struct { + GovAssetId uint64 `protobuf:"varint,1,opt,name=gov_asset_id,json=govAssetId,proto3" json:"gov_asset_id,omitempty" yaml:"gov_asset_id"` +} + +func (m *QueryGovTokenByAppResponse) Reset() { *m = QueryGovTokenByAppResponse{} } +func (m *QueryGovTokenByAppResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGovTokenByAppResponse) ProtoMessage() {} +func (*QueryGovTokenByAppResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{11} +} +func (m *QueryGovTokenByAppResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGovTokenByAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGovTokenByAppResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGovTokenByAppResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGovTokenByAppResponse.Merge(m, src) +} +func (m *QueryGovTokenByAppResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGovTokenByAppResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGovTokenByAppResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGovTokenByAppResponse proto.InternalMessageInfo + +type QueryAppsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAppsRequest) Reset() { *m = QueryAppsRequest{} } +func (m *QueryAppsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAppsRequest) ProtoMessage() {} +func (*QueryAppsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{12} +} +func (m *QueryAppsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAppsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAppsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAppsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAppsRequest.Merge(m, src) +} +func (m *QueryAppsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAppsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAppsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAppsRequest proto.InternalMessageInfo + +type QueryAppsResponse struct { + Apps []AppData `protobuf:"bytes,1,rep,name=apps,proto3" json:"apps" yaml:"apps"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAppsResponse) Reset() { *m = QueryAppsResponse{} } +func (m *QueryAppsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAppsResponse) ProtoMessage() {} +func (*QueryAppsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{13} +} +func (m *QueryAppsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAppsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAppsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAppsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAppsResponse.Merge(m, src) +} +func (m *QueryAppsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAppsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAppsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAppsResponse proto.InternalMessageInfo + +type QueryExtendedPairVaultRequest struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryExtendedPairVaultRequest) Reset() { *m = QueryExtendedPairVaultRequest{} } +func (m *QueryExtendedPairVaultRequest) String() string { return proto.CompactTextString(m) } +func (*QueryExtendedPairVaultRequest) ProtoMessage() {} +func (*QueryExtendedPairVaultRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{14} +} +func (m *QueryExtendedPairVaultRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryExtendedPairVaultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryExtendedPairVaultRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryExtendedPairVaultRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryExtendedPairVaultRequest.Merge(m, src) +} +func (m *QueryExtendedPairVaultRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryExtendedPairVaultRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryExtendedPairVaultRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryExtendedPairVaultRequest proto.InternalMessageInfo + +type QueryExtendedPairVaultResponse struct { + PairVault ExtendedPairVault `protobuf:"bytes,1,opt,name=pairVault,proto3" json:"pairVault" yaml:"pair_vault"` +} + +func (m *QueryExtendedPairVaultResponse) Reset() { *m = QueryExtendedPairVaultResponse{} } +func (m *QueryExtendedPairVaultResponse) String() string { return proto.CompactTextString(m) } +func (*QueryExtendedPairVaultResponse) ProtoMessage() {} +func (*QueryExtendedPairVaultResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{15} +} +func (m *QueryExtendedPairVaultResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryExtendedPairVaultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryExtendedPairVaultResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryExtendedPairVaultResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryExtendedPairVaultResponse.Merge(m, src) +} +func (m *QueryExtendedPairVaultResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryExtendedPairVaultResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryExtendedPairVaultResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryExtendedPairVaultResponse proto.InternalMessageInfo + +type QueryAllExtendedPairVaultsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAllExtendedPairVaultsRequest) Reset() { *m = QueryAllExtendedPairVaultsRequest{} } +func (m *QueryAllExtendedPairVaultsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllExtendedPairVaultsRequest) ProtoMessage() {} +func (*QueryAllExtendedPairVaultsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{16} +} +func (m *QueryAllExtendedPairVaultsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllExtendedPairVaultsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllExtendedPairVaultsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllExtendedPairVaultsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllExtendedPairVaultsRequest.Merge(m, src) +} +func (m *QueryAllExtendedPairVaultsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllExtendedPairVaultsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllExtendedPairVaultsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllExtendedPairVaultsRequest proto.InternalMessageInfo + +type QueryAllExtendedPairVaultsResponse struct { + PairVault []ExtendedPairVault `protobuf:"bytes,1,rep,name=pairVault,proto3" json:"pairVault" yaml:"pair_vault"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAllExtendedPairVaultsResponse) Reset() { *m = QueryAllExtendedPairVaultsResponse{} } +func (m *QueryAllExtendedPairVaultsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllExtendedPairVaultsResponse) ProtoMessage() {} +func (*QueryAllExtendedPairVaultsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{17} +} +func (m *QueryAllExtendedPairVaultsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllExtendedPairVaultsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllExtendedPairVaultsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllExtendedPairVaultsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllExtendedPairVaultsResponse.Merge(m, src) +} +func (m *QueryAllExtendedPairVaultsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllExtendedPairVaultsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllExtendedPairVaultsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllExtendedPairVaultsResponse proto.InternalMessageInfo + +type QueryAllExtendedPairVaultsByAppRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAllExtendedPairVaultsByAppRequest) Reset() { + *m = QueryAllExtendedPairVaultsByAppRequest{} +} +func (m *QueryAllExtendedPairVaultsByAppRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllExtendedPairVaultsByAppRequest) ProtoMessage() {} +func (*QueryAllExtendedPairVaultsByAppRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{18} +} +func (m *QueryAllExtendedPairVaultsByAppRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllExtendedPairVaultsByAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllExtendedPairVaultsByAppRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllExtendedPairVaultsByAppRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllExtendedPairVaultsByAppRequest.Merge(m, src) +} +func (m *QueryAllExtendedPairVaultsByAppRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllExtendedPairVaultsByAppRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllExtendedPairVaultsByAppRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllExtendedPairVaultsByAppRequest proto.InternalMessageInfo + +type QueryAllExtendedPairVaultsByAppResponse struct { + ExtendedPair []ExtendedPairVault `protobuf:"bytes,1,rep,name=extended_pair,json=extendedPair,proto3" json:"extended_pair" yaml:"extended_pair"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAllExtendedPairVaultsByAppResponse) Reset() { + *m = QueryAllExtendedPairVaultsByAppResponse{} +} +func (m *QueryAllExtendedPairVaultsByAppResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllExtendedPairVaultsByAppResponse) ProtoMessage() {} +func (*QueryAllExtendedPairVaultsByAppResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{19} +} +func (m *QueryAllExtendedPairVaultsByAppResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllExtendedPairVaultsByAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllExtendedPairVaultsByAppResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllExtendedPairVaultsByAppResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllExtendedPairVaultsByAppResponse.Merge(m, src) +} +func (m *QueryAllExtendedPairVaultsByAppResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllExtendedPairVaultsByAppResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllExtendedPairVaultsByAppResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllExtendedPairVaultsByAppResponse proto.InternalMessageInfo + +type QueryAllExtendedPairStableVaultsIDByAppRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) Reset() { + *m = QueryAllExtendedPairStableVaultsIDByAppRequest{} +} +func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) String() string { + return proto.CompactTextString(m) +} +func (*QueryAllExtendedPairStableVaultsIDByAppRequest) ProtoMessage() {} +func (*QueryAllExtendedPairStableVaultsIDByAppRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{20} +} +func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppRequest.Merge(m, src) +} +func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppRequest proto.InternalMessageInfo + +type QueryAllExtendedPairStableVaultsIDByAppResponse struct { + ExtendedPairsId []uint64 `protobuf:"varint,1,rep,packed,name=extended_pairs_id,json=extendedPairsId,proto3" json:"extended_pairs_id,omitempty" yaml:"extended_pairs_id"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) Reset() { + *m = QueryAllExtendedPairStableVaultsIDByAppResponse{} +} +func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryAllExtendedPairStableVaultsIDByAppResponse) ProtoMessage() {} +func (*QueryAllExtendedPairStableVaultsIDByAppResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{21} +} +func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppResponse.Merge(m, src) +} +func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppResponse proto.InternalMessageInfo + +type QueryAllExtendedPairStableVaultsByAppRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAllExtendedPairStableVaultsByAppRequest) Reset() { + *m = QueryAllExtendedPairStableVaultsByAppRequest{} +} +func (m *QueryAllExtendedPairStableVaultsByAppRequest) String() string { + return proto.CompactTextString(m) +} +func (*QueryAllExtendedPairStableVaultsByAppRequest) ProtoMessage() {} +func (*QueryAllExtendedPairStableVaultsByAppRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{22} +} +func (m *QueryAllExtendedPairStableVaultsByAppRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllExtendedPairStableVaultsByAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllExtendedPairStableVaultsByAppRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppRequest.Merge(m, src) +} +func (m *QueryAllExtendedPairStableVaultsByAppRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllExtendedPairStableVaultsByAppRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppRequest proto.InternalMessageInfo + +type QueryAllExtendedPairStableVaultsByAppResponse struct { + ExtendedPair []ExtendedPairVault `protobuf:"bytes,1,rep,name=extended_pair,json=extendedPair,proto3" json:"extended_pair" yaml:"extended_pair"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAllExtendedPairStableVaultsByAppResponse) Reset() { + *m = QueryAllExtendedPairStableVaultsByAppResponse{} +} +func (m *QueryAllExtendedPairStableVaultsByAppResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryAllExtendedPairStableVaultsByAppResponse) ProtoMessage() {} +func (*QueryAllExtendedPairStableVaultsByAppResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{23} +} +func (m *QueryAllExtendedPairStableVaultsByAppResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllExtendedPairStableVaultsByAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllExtendedPairStableVaultsByAppResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppResponse.Merge(m, src) +} +func (m *QueryAllExtendedPairStableVaultsByAppResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllExtendedPairStableVaultsByAppResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppResponse proto.InternalMessageInfo + +type QueryExtendedPairVaultsByAppWithoutStableRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) Reset() { + *m = QueryExtendedPairVaultsByAppWithoutStableRequest{} +} +func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) String() string { + return proto.CompactTextString(m) +} +func (*QueryExtendedPairVaultsByAppWithoutStableRequest) ProtoMessage() {} +func (*QueryExtendedPairVaultsByAppWithoutStableRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{24} +} +func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableRequest.Merge(m, src) +} +func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableRequest proto.InternalMessageInfo + +type QueryExtendedPairVaultsByAppWithoutStableResponse struct { + ExtendedPair []ExtendedPairVault `protobuf:"bytes,1,rep,name=extended_pair,json=extendedPair,proto3" json:"extended_pair" yaml:"extended_pair"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) Reset() { + *m = QueryExtendedPairVaultsByAppWithoutStableResponse{} +} +func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryExtendedPairVaultsByAppWithoutStableResponse) ProtoMessage() {} +func (*QueryExtendedPairVaultsByAppWithoutStableResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e7e9ce3abb4febf, []int{25} +} +func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableResponse.Merge(m, src) +} +func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*QueryAssetsRequest)(nil), "comdex.asset.v1beta1.QueryAssetsRequest") + proto.RegisterType((*QueryAssetsResponse)(nil), "comdex.asset.v1beta1.QueryAssetsResponse") + proto.RegisterType((*QueryAssetRequest)(nil), "comdex.asset.v1beta1.QueryAssetRequest") + proto.RegisterType((*QueryAssetResponse)(nil), "comdex.asset.v1beta1.QueryAssetResponse") + proto.RegisterType((*QueryAssetPairsRequest)(nil), "comdex.asset.v1beta1.QueryAssetPairsRequest") + proto.RegisterType((*QueryAssetPairsResponse)(nil), "comdex.asset.v1beta1.QueryAssetPairsResponse") + proto.RegisterType((*QueryAssetPairRequest)(nil), "comdex.asset.v1beta1.QueryAssetPairRequest") + proto.RegisterType((*QueryAssetPairResponse)(nil), "comdex.asset.v1beta1.QueryAssetPairResponse") + proto.RegisterType((*QueryAppRequest)(nil), "comdex.asset.v1beta1.QueryAppRequest") + proto.RegisterType((*QueryAppResponse)(nil), "comdex.asset.v1beta1.QueryAppResponse") + proto.RegisterType((*QueryGovTokenByAppRequest)(nil), "comdex.asset.v1beta1.QueryGovTokenByAppRequest") + proto.RegisterType((*QueryGovTokenByAppResponse)(nil), "comdex.asset.v1beta1.QueryGovTokenByAppResponse") + proto.RegisterType((*QueryAppsRequest)(nil), "comdex.asset.v1beta1.QueryAppsRequest") + proto.RegisterType((*QueryAppsResponse)(nil), "comdex.asset.v1beta1.QueryAppsResponse") + proto.RegisterType((*QueryExtendedPairVaultRequest)(nil), "comdex.asset.v1beta1.QueryExtendedPairVaultRequest") + proto.RegisterType((*QueryExtendedPairVaultResponse)(nil), "comdex.asset.v1beta1.QueryExtendedPairVaultResponse") + proto.RegisterType((*QueryAllExtendedPairVaultsRequest)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairVaultsRequest") + proto.RegisterType((*QueryAllExtendedPairVaultsResponse)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairVaultsResponse") + proto.RegisterType((*QueryAllExtendedPairVaultsByAppRequest)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairVaultsByAppRequest") + proto.RegisterType((*QueryAllExtendedPairVaultsByAppResponse)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairVaultsByAppResponse") + proto.RegisterType((*QueryAllExtendedPairStableVaultsIDByAppRequest)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairStableVaultsIDByAppRequest") + proto.RegisterType((*QueryAllExtendedPairStableVaultsIDByAppResponse)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairStableVaultsIDByAppResponse") + proto.RegisterType((*QueryAllExtendedPairStableVaultsByAppRequest)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairStableVaultsByAppRequest") + proto.RegisterType((*QueryAllExtendedPairStableVaultsByAppResponse)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairStableVaultsByAppResponse") + proto.RegisterType((*QueryExtendedPairVaultsByAppWithoutStableRequest)(nil), "comdex.asset.v1beta1.QueryExtendedPairVaultsByAppWithoutStableRequest") + proto.RegisterType((*QueryExtendedPairVaultsByAppWithoutStableResponse)(nil), "comdex.asset.v1beta1.QueryExtendedPairVaultsByAppWithoutStableResponse") +} + +func init() { proto.RegisterFile("comdex/asset/v1beta1/query.proto", fileDescriptor_9e7e9ce3abb4febf) } + +var fileDescriptor_9e7e9ce3abb4febf = []byte{ + // 1345 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xdb, 0x4f, 0x1c, 0xd5, + 0x1f, 0xdf, 0xb3, 0xb4, 0x4d, 0x7b, 0xa0, 0x17, 0x0e, 0xf0, 0x2b, 0x9d, 0xc2, 0x2c, 0x0c, 0xbf, + 0xb2, 0x4b, 0x85, 0x1d, 0xa0, 0x8d, 0xb5, 0x8d, 0xd7, 0x2d, 0x17, 0x31, 0x31, 0xb6, 0x6b, 0x95, + 0xc4, 0xa4, 0x8e, 0x03, 0x3b, 0x6c, 0x47, 0x97, 0x99, 0xc3, 0x9e, 0xd9, 0xa5, 0xa4, 0x69, 0xa2, + 0x3c, 0x19, 0x9f, 0x4c, 0x88, 0xff, 0x83, 0xaf, 0xc6, 0x07, 0x63, 0x78, 0x32, 0xbe, 0xf0, 0xd8, + 0xe8, 0x8b, 0x89, 0x09, 0x2a, 0x18, 0xff, 0x00, 0x12, 0x13, 0x13, 0x13, 0x35, 0x73, 0xce, 0x77, + 0x76, 0x76, 0x61, 0x66, 0x77, 0x16, 0x0a, 0x21, 0x7d, 0x23, 0x3b, 0xdf, 0xcb, 0xe7, 0x72, 0xce, + 0xcc, 0xf7, 0x1c, 0x70, 0xdf, 0xbc, 0xbd, 0x98, 0x33, 0x1e, 0xaa, 0x3a, 0x63, 0x86, 0xa3, 0x96, + 0xc7, 0xe6, 0x0c, 0x47, 0x1f, 0x53, 0x97, 0x4a, 0x46, 0x71, 0x25, 0x4d, 0x8b, 0xb6, 0x63,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, 0x32, 0x4a, 0x27, 0x74, + 0x47, 0xcf, 0x10, 0x80, 0x81, 0x61, 0x99, 0x51, 0xaa, 0x64, 0xdd, 0x6c, 0x65, 0x12, 0x5f, 0xe2, + 0x85, 0xa7, 0xed, 0xf2, 0x3d, 0xfb, 0x23, 0xc3, 0xca, 0x54, 0xa3, 0x48, 0xe1, 0x53, 0x3a, 0xa5, + 0x9a, 0x87, 0x24, 0xd3, 0x5e, 0xb5, 0x1d, 0xf9, 0xef, 0xee, 0x4a, 0xa5, 0x74, 0xc6, 0xc5, 0x27, + 0x05, 0x95, 0x01, 0xa4, 0x37, 0x71, 0x5b, 0xde, 0x2e, 0x6b, 0x1c, 0x9a, 0x5f, 0xed, 0xe2, 0xce, + 0x66, 0xa2, 0x43, 0x54, 0xab, 0x7e, 0xaa, 0x64, 0x71, 0xde, 0x2e, 0x73, 0xed, 0x67, 0x72, 0xca, + 0x92, 0x4f, 0xfc, 0xa8, 0x16, 0xff, 0x3a, 0xf2, 0xb6, 0x3e, 0xef, 0x09, 0x1c, 0xa6, 0xf0, 0x09, + 0x9d, 0x52, 0xef, 0xcd, 0xd5, 0x40, 0xee, 0x0e, 0x90, 0xbb, 0xb5, 0x22, 0x16, 0x53, 0xb2, 0x3c, + 0xff, 0xd0, 0x57, 0xb9, 0x8a, 0x7b, 0x39, 0xf8, 0xc9, 0xdd, 0x1f, 0x84, 0xb0, 0xa5, 0xb5, 0x8a, + 0xb0, 0x1c, 0x96, 0x01, 0xdc, 0x3f, 0x10, 0x5b, 0x9e, 0xff, 0x08, 0x7a, 0x27, 0x83, 0x05, 0xd8, + 0x53, 0x23, 0x68, 0xef, 0x6b, 0x65, 0xf7, 0x09, 0xec, 0x7d, 0x1e, 0xe5, 0x82, 0xe8, 0x17, 0x9a, + 0x17, 0x0a, 0x7b, 0x6a, 0x1c, 0x95, 0xf1, 0x7f, 0x20, 0xac, 0xd4, 0x03, 0x11, 0xac, 0x46, 0xcb, + 0x53, 0x57, 0xe3, 0xd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a, 0xe6, 0xad, 0x17, 0x3e, 0x6f, 0x4a, 0xd3, 0x07, 0xae, + 0x03, 0x32, 0xbc, 0xc3, 0x65, 0x78, 0x8b, 0xbc, 0xb9, 0x2f, 0x19, 0xb4, 0x65, 0x51, 0x14, 0x9e, + 0x54, 0x54, 0xc9, 0xdc, 0xdd, 0xf8, 0x4d, 0x8e, 0x7d, 0xb9, 0x25, 0xc7, 0x36, 0xb6, 0x64, 0xf4, + 0x64, 0x4b, 0x46, 0xbf, 0x6e, 0xc9, 0xe8, 0xf3, 0x6d, 0x39, 0xf6, 0x64, 0x5b, 0x8e, 0xfd, 0xb4, + 0x2d, 0xc7, 0xde, 0x53, 0xf3, 0xa6, 0xf3, 0xa0, 0x34, 0xe7, 0xf2, 0x80, 0xd6, 0x23, 0xf6, 0xc2, + 0x82, 0x39, 0x6f, 0xea, 0x05, 0x0f, 0x8a, 0x07, 0xc6, 0x59, 0xa1, 0x06, 0x9b, 0x3b, 0xc5, 0xff, + 0x63, 0x71, 0xed, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x37, 0x25, 0x4f, 0xdc, 0x19, 0x00, + 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + QueryAssets(ctx context.Context, in *QueryAssetsRequest, opts ...grpc.CallOption) (*QueryAssetsResponse, error) + QueryAsset(ctx context.Context, in *QueryAssetRequest, opts ...grpc.CallOption) (*QueryAssetResponse, error) + QueryAssetPairs(ctx context.Context, in *QueryAssetPairsRequest, opts ...grpc.CallOption) (*QueryAssetPairsResponse, error) + QueryAssetPair(ctx context.Context, in *QueryAssetPairRequest, opts ...grpc.CallOption) (*QueryAssetPairResponse, error) + QueryApps(ctx context.Context, in *QueryAppsRequest, opts ...grpc.CallOption) (*QueryAppsResponse, error) + QueryApp(ctx context.Context, in *QueryAppRequest, opts ...grpc.CallOption) (*QueryAppResponse, error) + QueryExtendedPairVault(ctx context.Context, in *QueryExtendedPairVaultRequest, opts ...grpc.CallOption) (*QueryExtendedPairVaultResponse, error) + QueryAllExtendedPairVaults(ctx context.Context, in *QueryAllExtendedPairVaultsRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairVaultsResponse, error) + QueryAllExtendedPairVaultsByApp(ctx context.Context, in *QueryAllExtendedPairVaultsByAppRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairVaultsByAppResponse, error) + QueryAllExtendedPairStableVaultsIDByApp(ctx context.Context, in *QueryAllExtendedPairStableVaultsIDByAppRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairStableVaultsIDByAppResponse, error) + QueryGovTokenByApp(ctx context.Context, in *QueryGovTokenByAppRequest, opts ...grpc.CallOption) (*QueryGovTokenByAppResponse, error) + QueryAllExtendedPairStableVaultsByApp(ctx context.Context, in *QueryAllExtendedPairStableVaultsByAppRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairStableVaultsByAppResponse, error) + QueryExtendedPairVaultsByAppWithoutStable(ctx context.Context, in *QueryExtendedPairVaultsByAppWithoutStableRequest, opts ...grpc.CallOption) (*QueryExtendedPairVaultsByAppWithoutStableResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) QueryAssets(ctx context.Context, in *QueryAssetsRequest, opts ...grpc.CallOption) (*QueryAssetsResponse, error) { + out := new(QueryAssetsResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAssets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAsset(ctx context.Context, in *QueryAssetRequest, opts ...grpc.CallOption) (*QueryAssetResponse, error) { + out := new(QueryAssetResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAsset", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAssetPairs(ctx context.Context, in *QueryAssetPairsRequest, opts ...grpc.CallOption) (*QueryAssetPairsResponse, error) { + out := new(QueryAssetPairsResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAssetPairs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAssetPair(ctx context.Context, in *QueryAssetPairRequest, opts ...grpc.CallOption) (*QueryAssetPairResponse, error) { + out := new(QueryAssetPairResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAssetPair", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryApps(ctx context.Context, in *QueryAppsRequest, opts ...grpc.CallOption) (*QueryAppsResponse, error) { + out := new(QueryAppsResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryApps", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryApp(ctx context.Context, in *QueryAppRequest, opts ...grpc.CallOption) (*QueryAppResponse, error) { + out := new(QueryAppResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryApp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryExtendedPairVault(ctx context.Context, in *QueryExtendedPairVaultRequest, opts ...grpc.CallOption) (*QueryExtendedPairVaultResponse, error) { + out := new(QueryExtendedPairVaultResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryExtendedPairVault", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAllExtendedPairVaults(ctx context.Context, in *QueryAllExtendedPairVaultsRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairVaultsResponse, error) { + out := new(QueryAllExtendedPairVaultsResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAllExtendedPairVaults", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAllExtendedPairVaultsByApp(ctx context.Context, in *QueryAllExtendedPairVaultsByAppRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairVaultsByAppResponse, error) { + out := new(QueryAllExtendedPairVaultsByAppResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAllExtendedPairVaultsByApp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAllExtendedPairStableVaultsIDByApp(ctx context.Context, in *QueryAllExtendedPairStableVaultsIDByAppRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairStableVaultsIDByAppResponse, error) { + out := new(QueryAllExtendedPairStableVaultsIDByAppResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAllExtendedPairStableVaultsIDByApp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryGovTokenByApp(ctx context.Context, in *QueryGovTokenByAppRequest, opts ...grpc.CallOption) (*QueryGovTokenByAppResponse, error) { + out := new(QueryGovTokenByAppResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryGovTokenByApp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAllExtendedPairStableVaultsByApp(ctx context.Context, in *QueryAllExtendedPairStableVaultsByAppRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairStableVaultsByAppResponse, error) { + out := new(QueryAllExtendedPairStableVaultsByAppResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAllExtendedPairStableVaultsByApp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryExtendedPairVaultsByAppWithoutStable(ctx context.Context, in *QueryExtendedPairVaultsByAppWithoutStableRequest, opts ...grpc.CallOption) (*QueryExtendedPairVaultsByAppWithoutStableResponse, error) { + out := new(QueryExtendedPairVaultsByAppWithoutStableResponse) + err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryExtendedPairVaultsByAppWithoutStable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + QueryAssets(context.Context, *QueryAssetsRequest) (*QueryAssetsResponse, error) + QueryAsset(context.Context, *QueryAssetRequest) (*QueryAssetResponse, error) + QueryAssetPairs(context.Context, *QueryAssetPairsRequest) (*QueryAssetPairsResponse, error) + QueryAssetPair(context.Context, *QueryAssetPairRequest) (*QueryAssetPairResponse, error) + QueryApps(context.Context, *QueryAppsRequest) (*QueryAppsResponse, error) + QueryApp(context.Context, *QueryAppRequest) (*QueryAppResponse, error) + QueryExtendedPairVault(context.Context, *QueryExtendedPairVaultRequest) (*QueryExtendedPairVaultResponse, error) + QueryAllExtendedPairVaults(context.Context, *QueryAllExtendedPairVaultsRequest) (*QueryAllExtendedPairVaultsResponse, error) + QueryAllExtendedPairVaultsByApp(context.Context, *QueryAllExtendedPairVaultsByAppRequest) (*QueryAllExtendedPairVaultsByAppResponse, error) + QueryAllExtendedPairStableVaultsIDByApp(context.Context, *QueryAllExtendedPairStableVaultsIDByAppRequest) (*QueryAllExtendedPairStableVaultsIDByAppResponse, error) + QueryGovTokenByApp(context.Context, *QueryGovTokenByAppRequest) (*QueryGovTokenByAppResponse, error) + QueryAllExtendedPairStableVaultsByApp(context.Context, *QueryAllExtendedPairStableVaultsByAppRequest) (*QueryAllExtendedPairStableVaultsByAppResponse, error) + QueryExtendedPairVaultsByAppWithoutStable(context.Context, *QueryExtendedPairVaultsByAppWithoutStableRequest) (*QueryExtendedPairVaultsByAppWithoutStableResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) QueryAssets(ctx context.Context, req *QueryAssetsRequest) (*QueryAssetsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAssets not implemented") +} +func (*UnimplementedQueryServer) QueryAsset(ctx context.Context, req *QueryAssetRequest) (*QueryAssetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAsset not implemented") +} +func (*UnimplementedQueryServer) QueryAssetPairs(ctx context.Context, req *QueryAssetPairsRequest) (*QueryAssetPairsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAssetPairs not implemented") +} +func (*UnimplementedQueryServer) QueryAssetPair(ctx context.Context, req *QueryAssetPairRequest) (*QueryAssetPairResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAssetPair not implemented") +} +func (*UnimplementedQueryServer) QueryApps(ctx context.Context, req *QueryAppsRequest) (*QueryAppsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryApps not implemented") +} +func (*UnimplementedQueryServer) QueryApp(ctx context.Context, req *QueryAppRequest) (*QueryAppResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryApp not implemented") +} +func (*UnimplementedQueryServer) QueryExtendedPairVault(ctx context.Context, req *QueryExtendedPairVaultRequest) (*QueryExtendedPairVaultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryExtendedPairVault not implemented") +} +func (*UnimplementedQueryServer) QueryAllExtendedPairVaults(ctx context.Context, req *QueryAllExtendedPairVaultsRequest) (*QueryAllExtendedPairVaultsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAllExtendedPairVaults not implemented") +} +func (*UnimplementedQueryServer) QueryAllExtendedPairVaultsByApp(ctx context.Context, req *QueryAllExtendedPairVaultsByAppRequest) (*QueryAllExtendedPairVaultsByAppResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAllExtendedPairVaultsByApp not implemented") +} +func (*UnimplementedQueryServer) QueryAllExtendedPairStableVaultsIDByApp(ctx context.Context, req *QueryAllExtendedPairStableVaultsIDByAppRequest) (*QueryAllExtendedPairStableVaultsIDByAppResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAllExtendedPairStableVaultsIDByApp not implemented") +} +func (*UnimplementedQueryServer) QueryGovTokenByApp(ctx context.Context, req *QueryGovTokenByAppRequest) (*QueryGovTokenByAppResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryGovTokenByApp not implemented") +} +func (*UnimplementedQueryServer) QueryAllExtendedPairStableVaultsByApp(ctx context.Context, req *QueryAllExtendedPairStableVaultsByAppRequest) (*QueryAllExtendedPairStableVaultsByAppResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAllExtendedPairStableVaultsByApp not implemented") +} +func (*UnimplementedQueryServer) QueryExtendedPairVaultsByAppWithoutStable(ctx context.Context, req *QueryExtendedPairVaultsByAppWithoutStableRequest) (*QueryExtendedPairVaultsByAppWithoutStableResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryExtendedPairVaultsByAppWithoutStable not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_QueryAssets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAssetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAssets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Query/QueryAssets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAssets(ctx, req.(*QueryAssetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAsset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAssetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAsset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Query/QueryAsset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAsset(ctx, req.(*QueryAssetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAssetPairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAssetPairsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAssetPairs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Query/QueryAssetPairs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAssetPairs(ctx, req.(*QueryAssetPairsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAssetPair_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAssetPairRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAssetPair(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Query/QueryAssetPair", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAssetPair(ctx, req.(*QueryAssetPairRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryApps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAppsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryApps(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Query/QueryApps", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryApps(ctx, req.(*QueryAppsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAppRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryApp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Query/QueryApp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryApp(ctx, req.(*QueryAppRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryExtendedPairVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryExtendedPairVaultRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryExtendedPairVault(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Query/QueryExtendedPairVault", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryExtendedPairVault(ctx, req.(*QueryExtendedPairVaultRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAllExtendedPairVaults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllExtendedPairVaultsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAllExtendedPairVaults(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Query/QueryAllExtendedPairVaults", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAllExtendedPairVaults(ctx, req.(*QueryAllExtendedPairVaultsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAllExtendedPairVaultsByApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllExtendedPairVaultsByAppRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAllExtendedPairVaultsByApp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Query/QueryAllExtendedPairVaultsByApp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAllExtendedPairVaultsByApp(ctx, req.(*QueryAllExtendedPairVaultsByAppRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAllExtendedPairStableVaultsIDByApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllExtendedPairStableVaultsIDByAppRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAllExtendedPairStableVaultsIDByApp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Query/QueryAllExtendedPairStableVaultsIDByApp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAllExtendedPairStableVaultsIDByApp(ctx, req.(*QueryAllExtendedPairStableVaultsIDByAppRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryGovTokenByApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGovTokenByAppRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryGovTokenByApp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Query/QueryGovTokenByApp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryGovTokenByApp(ctx, req.(*QueryGovTokenByAppRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAllExtendedPairStableVaultsByApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllExtendedPairStableVaultsByAppRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAllExtendedPairStableVaultsByApp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Query/QueryAllExtendedPairStableVaultsByApp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAllExtendedPairStableVaultsByApp(ctx, req.(*QueryAllExtendedPairStableVaultsByAppRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryExtendedPairVaultsByAppWithoutStable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryExtendedPairVaultsByAppWithoutStableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryExtendedPairVaultsByAppWithoutStable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.asset.v1beta1.Query/QueryExtendedPairVaultsByAppWithoutStable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryExtendedPairVaultsByAppWithoutStable(ctx, req.(*QueryExtendedPairVaultsByAppWithoutStableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "comdex.asset.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QueryAssets", + Handler: _Query_QueryAssets_Handler, + }, + { + MethodName: "QueryAsset", + Handler: _Query_QueryAsset_Handler, + }, + { + MethodName: "QueryAssetPairs", + Handler: _Query_QueryAssetPairs_Handler, + }, + { + MethodName: "QueryAssetPair", + Handler: _Query_QueryAssetPair_Handler, + }, + { + MethodName: "QueryApps", + Handler: _Query_QueryApps_Handler, + }, + { + MethodName: "QueryApp", + Handler: _Query_QueryApp_Handler, + }, + { + MethodName: "QueryExtendedPairVault", + Handler: _Query_QueryExtendedPairVault_Handler, + }, + { + MethodName: "QueryAllExtendedPairVaults", + Handler: _Query_QueryAllExtendedPairVaults_Handler, + }, + { + MethodName: "QueryAllExtendedPairVaultsByApp", + Handler: _Query_QueryAllExtendedPairVaultsByApp_Handler, + }, + { + MethodName: "QueryAllExtendedPairStableVaultsIDByApp", + Handler: _Query_QueryAllExtendedPairStableVaultsIDByApp_Handler, + }, + { + MethodName: "QueryGovTokenByApp", + Handler: _Query_QueryGovTokenByApp_Handler, + }, + { + MethodName: "QueryAllExtendedPairStableVaultsByApp", + Handler: _Query_QueryAllExtendedPairStableVaultsByApp_Handler, + }, + { + MethodName: "QueryExtendedPairVaultsByAppWithoutStable", + Handler: _Query_QueryExtendedPairVaultsByAppWithoutStable_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "comdex/asset/v1beta1/query.proto", +} + +func (m *QueryAssetsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAssetsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAssetsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAssetsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAssetsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAssetsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Assets) > 0 { + for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Assets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryAssetRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAssetRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAssetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAssetResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAssetResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAssetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Asset.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAssetPairsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAssetPairsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAssetPairsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAssetPairsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAssetPairsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAssetPairsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.PairsInfo) > 0 { + for iNdEx := len(m.PairsInfo) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PairsInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryAssetPairRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAssetPairRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAssetPairRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAssetPairResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAssetPairResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAssetPairResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PairInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAppRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAppRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAppRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAppResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAppResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAppResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.App.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGovTokenByAppRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGovTokenByAppRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGovTokenByAppRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryGovTokenByAppResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGovTokenByAppResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGovTokenByAppResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.GovAssetId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.GovAssetId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAppsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAppsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAppsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAppsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAppsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAppsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Apps) > 0 { + for iNdEx := len(m.Apps) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Apps[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryExtendedPairVaultRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryExtendedPairVaultRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryExtendedPairVaultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryExtendedPairVaultResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryExtendedPairVaultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryExtendedPairVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PairVault.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAllExtendedPairVaultsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllExtendedPairVaultsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllExtendedPairVaultsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllExtendedPairVaultsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllExtendedPairVaultsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllExtendedPairVaultsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.PairVault) > 0 { + for iNdEx := len(m.PairVault) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PairVault[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryAllExtendedPairVaultsByAppRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllExtendedPairVaultsByAppRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllExtendedPairVaultsByAppRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAllExtendedPairVaultsByAppResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllExtendedPairVaultsByAppResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllExtendedPairVaultsByAppResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ExtendedPair) > 0 { + for iNdEx := len(m.ExtendedPair) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExtendedPair[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ExtendedPairsId) > 0 { + dAtA18 := make([]byte, len(m.ExtendedPairsId)*10) + var j17 int + for _, num := range m.ExtendedPairsId { + for num >= 1<<7 { + dAtA18[j17] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j17++ + } + dAtA18[j17] = uint8(num) + j17++ + } + i -= j17 + copy(dAtA[i:], dAtA18[:j17]) + i = encodeVarintQuery(dAtA, i, uint64(j17)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllExtendedPairStableVaultsByAppRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllExtendedPairStableVaultsByAppRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllExtendedPairStableVaultsByAppRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAllExtendedPairStableVaultsByAppResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllExtendedPairStableVaultsByAppResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllExtendedPairStableVaultsByAppResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ExtendedPair) > 0 { + for iNdEx := len(m.ExtendedPair) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExtendedPair[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ExtendedPair) > 0 { + for iNdEx := len(m.ExtendedPair) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExtendedPair[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryAssetsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAssetsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Assets) > 0 { + for _, e := range m.Assets { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAssetRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n +} + +func (m *QueryAssetResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Asset.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAssetPairsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAssetPairsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PairsInfo) > 0 { + for _, e := range m.PairsInfo { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAssetPairRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n +} + +func (m *QueryAssetPairResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PairInfo.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAppRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n +} + +func (m *QueryAppResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.App.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGovTokenByAppRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + return n +} + +func (m *QueryGovTokenByAppResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GovAssetId != 0 { + n += 1 + sovQuery(uint64(m.GovAssetId)) + } + return n +} + +func (m *QueryAppsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAppsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Apps) > 0 { + for _, e := range m.Apps { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryExtendedPairVaultRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n +} + +func (m *QueryExtendedPairVaultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PairVault.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllExtendedPairVaultsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllExtendedPairVaultsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PairVault) > 0 { + for _, e := range m.PairVault { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllExtendedPairVaultsByAppRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllExtendedPairVaultsByAppResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ExtendedPair) > 0 { + for _, e := range m.ExtendedPair { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ExtendedPairsId) > 0 { + l = 0 + for _, e := range m.ExtendedPairsId { + l += sovQuery(uint64(e)) + } + n += 1 + sovQuery(uint64(l)) + l + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllExtendedPairStableVaultsByAppRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllExtendedPairStableVaultsByAppResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ExtendedPair) > 0 { + for _, e := range m.ExtendedPair { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ExtendedPair) > 0 { + for _, e := range m.ExtendedPair { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryAssetsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAssetsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAssetsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAssetsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAssetsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAssetsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Assets = append(m.Assets, Asset{}) + if err := m.Assets[len(m.Assets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAssetRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAssetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAssetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAssetResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAssetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAssetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Asset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAssetPairsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAssetPairsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAssetPairsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAssetPairsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAssetPairsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAssetPairsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PairsInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PairsInfo = append(m.PairsInfo, PairInfo{}) + if err := m.PairsInfo[len(m.PairsInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAssetPairRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAssetPairRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAssetPairRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAssetPairResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAssetPairResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAssetPairResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PairInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PairInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAppRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAppRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAppRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAppResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAppResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAppResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field App", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.App.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGovTokenByAppRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGovTokenByAppRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGovTokenByAppRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGovTokenByAppResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGovTokenByAppResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGovTokenByAppResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GovAssetId", wireType) + } + m.GovAssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GovAssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAppsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAppsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAppsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAppsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAppsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAppsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Apps", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Apps = append(m.Apps, AppData{}) + if err := m.Apps[len(m.Apps)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryExtendedPairVaultRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryExtendedPairVaultRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryExtendedPairVaultRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryExtendedPairVaultResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryExtendedPairVaultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryExtendedPairVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PairVault", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PairVault.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllExtendedPairVaultsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllExtendedPairVaultsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllExtendedPairVaultsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllExtendedPairVaultsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllExtendedPairVaultsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllExtendedPairVaultsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PairVault", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PairVault = append(m.PairVault, ExtendedPairVault{}) + if err := m.PairVault[len(m.PairVault)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllExtendedPairVaultsByAppRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllExtendedPairVaultsByAppRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllExtendedPairVaultsByAppRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllExtendedPairVaultsByAppResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllExtendedPairVaultsByAppResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllExtendedPairVaultsByAppResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtendedPair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExtendedPair = append(m.ExtendedPair, ExtendedPairVault{}) + if err := m.ExtendedPair[len(m.ExtendedPair)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsIDByAppRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsIDByAppRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsIDByAppResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsIDByAppResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ExtendedPairsId = append(m.ExtendedPairsId, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.ExtendedPairsId) == 0 { + m.ExtendedPairsId = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ExtendedPairsId = append(m.ExtendedPairsId, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field ExtendedPairsId", wireType) + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllExtendedPairStableVaultsByAppRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsByAppRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsByAppRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllExtendedPairStableVaultsByAppResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsByAppResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsByAppResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtendedPair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExtendedPair = append(m.ExtendedPair, ExtendedPairVault{}) + if err := m.ExtendedPair[len(m.ExtendedPair)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryExtendedPairVaultsByAppWithoutStableRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryExtendedPairVaultsByAppWithoutStableRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryExtendedPairVaultsByAppWithoutStableResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryExtendedPairVaultsByAppWithoutStableResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtendedPair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExtendedPair = append(m.ExtendedPair, ExtendedPairVault{}) + if err := m.ExtendedPair[len(m.ExtendedPair)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/asset/types/query.pb.gw.go b/github.com/comdex-official/comdex/x/asset/types/query.pb.gw.go new file mode 100644 index 000000000..4d18ec8d5 --- /dev/null +++ b/github.com/comdex-official/comdex/x/asset/types/query.pb.gw.go @@ -0,0 +1,1401 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: comdex/asset/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +var ( + filter_Query_QueryAssets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryAssets_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAssetsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryAssets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAssets_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAssetsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryAssets(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryAsset_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAssetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.QueryAsset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAsset_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAssetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.QueryAsset(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryAssetPairs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryAssetPairs_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAssetPairsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAssetPairs_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryAssetPairs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAssetPairs_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAssetPairsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAssetPairs_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryAssetPairs(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryAssetPair_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAssetPairRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.QueryAssetPair(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAssetPair_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAssetPairRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.QueryAssetPair(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryApps_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryApps_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAppsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryApps_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryApps(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryApps_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAppsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryApps_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryApps(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryApp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAppRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.QueryApp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryApp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAppRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.QueryApp(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryExtendedPairVault_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryExtendedPairVaultRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.QueryExtendedPairVault(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryExtendedPairVault_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryExtendedPairVaultRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.QueryExtendedPairVault(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryAllExtendedPairVaults_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryAllExtendedPairVaults_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllExtendedPairVaultsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairVaults_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryAllExtendedPairVaults(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAllExtendedPairVaults_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllExtendedPairVaultsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairVaults_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryAllExtendedPairVaults(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryAllExtendedPairVaultsByApp_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryAllExtendedPairVaultsByApp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllExtendedPairVaultsByAppRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairVaultsByApp_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryAllExtendedPairVaultsByApp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAllExtendedPairVaultsByApp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllExtendedPairVaultsByAppRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairVaultsByApp_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryAllExtendedPairVaultsByApp(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryAllExtendedPairStableVaultsIDByApp_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryAllExtendedPairStableVaultsIDByApp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllExtendedPairStableVaultsIDByAppRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairStableVaultsIDByApp_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryAllExtendedPairStableVaultsIDByApp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAllExtendedPairStableVaultsIDByApp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllExtendedPairStableVaultsIDByAppRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairStableVaultsIDByApp_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryAllExtendedPairStableVaultsIDByApp(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryGovTokenByApp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGovTokenByAppRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + msg, err := client.QueryGovTokenByApp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryGovTokenByApp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGovTokenByAppRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + msg, err := server.QueryGovTokenByApp(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryAllExtendedPairStableVaultsByApp_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryAllExtendedPairStableVaultsByApp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllExtendedPairStableVaultsByAppRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairStableVaultsByApp_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryAllExtendedPairStableVaultsByApp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAllExtendedPairStableVaultsByApp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllExtendedPairStableVaultsByAppRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairStableVaultsByApp_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryAllExtendedPairStableVaultsByApp(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryExtendedPairVaultsByAppWithoutStable_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryExtendedPairVaultsByAppWithoutStable_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryExtendedPairVaultsByAppWithoutStableRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryExtendedPairVaultsByAppWithoutStable_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryExtendedPairVaultsByAppWithoutStable(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryExtendedPairVaultsByAppWithoutStable_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryExtendedPairVaultsByAppWithoutStableRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryExtendedPairVaultsByAppWithoutStable_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryExtendedPairVaultsByAppWithoutStable(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_QueryAssets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryAssets_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryAsset_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAssetPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryAssetPairs_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAssetPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAssetPair_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryAssetPair_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAssetPair_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryApps_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryApps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryApp_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryExtendedPairVault_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryExtendedPairVault_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryExtendedPairVault_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllExtendedPairVaults_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryAllExtendedPairVaults_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAllExtendedPairVaults_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllExtendedPairVaultsByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryAllExtendedPairVaultsByApp_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAllExtendedPairVaultsByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllExtendedPairStableVaultsIDByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryAllExtendedPairStableVaultsIDByApp_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAllExtendedPairStableVaultsIDByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryGovTokenByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryGovTokenByApp_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryGovTokenByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllExtendedPairStableVaultsByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryAllExtendedPairStableVaultsByApp_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAllExtendedPairStableVaultsByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryExtendedPairVaultsByAppWithoutStable_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryExtendedPairVaultsByAppWithoutStable_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryExtendedPairVaultsByAppWithoutStable_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_QueryAssets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryAssets_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryAsset_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAssetPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryAssetPairs_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAssetPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAssetPair_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryAssetPair_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAssetPair_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryApps_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryApps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryApp_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryExtendedPairVault_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryExtendedPairVault_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryExtendedPairVault_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllExtendedPairVaults_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryAllExtendedPairVaults_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAllExtendedPairVaults_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllExtendedPairVaultsByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryAllExtendedPairVaultsByApp_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAllExtendedPairVaultsByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllExtendedPairStableVaultsIDByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryAllExtendedPairStableVaultsIDByApp_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAllExtendedPairStableVaultsIDByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryGovTokenByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryGovTokenByApp_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryGovTokenByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllExtendedPairStableVaultsByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryAllExtendedPairStableVaultsByApp_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAllExtendedPairStableVaultsByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryExtendedPairVaultsByAppWithoutStable_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryExtendedPairVaultsByAppWithoutStable_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryExtendedPairVaultsByAppWithoutStable_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_QueryAssets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "asset", "v1beta1", "assets"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAsset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "assets", "id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAssetPairs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "asset", "v1beta1", "pairs"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAssetPair_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "pairs", "id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryApps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "asset", "v1beta1", "apps"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryApp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "app", "id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryExtendedPairVault_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "extended_pair_vault", "id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAllExtendedPairVaults_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "asset", "v1beta1", "extended_pair_vaults"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAllExtendedPairVaultsByApp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "product_to_extended_pair", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAllExtendedPairStableVaultsIDByApp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "extended_pair_stable_vault_wise", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryGovTokenByApp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "gov_token_in_an_app", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAllExtendedPairStableVaultsByApp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "extended_pair_stable_vault_data", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryExtendedPairVaultsByAppWithoutStable_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "extended_pair_stable_vault_data_without_stable", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_QueryAssets_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAsset_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAssetPairs_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAssetPair_0 = runtime.ForwardResponseMessage + + forward_Query_QueryApps_0 = runtime.ForwardResponseMessage + + forward_Query_QueryApp_0 = runtime.ForwardResponseMessage + + forward_Query_QueryExtendedPairVault_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAllExtendedPairVaults_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAllExtendedPairVaultsByApp_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAllExtendedPairStableVaultsIDByApp_0 = runtime.ForwardResponseMessage + + forward_Query_QueryGovTokenByApp_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAllExtendedPairStableVaultsByApp_0 = runtime.ForwardResponseMessage + + forward_Query_QueryExtendedPairVaultsByAppWithoutStable_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/comdex-official/comdex/x/auction/types/auction.pb.go b/github.com/comdex-official/comdex/x/auction/types/auction.pb.go new file mode 100644 index 000000000..b3a51395e --- /dev/null +++ b/github.com/comdex-official/comdex/x/auction/types/auction.pb.go @@ -0,0 +1,3531 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/auction/v1beta1/auction.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type SurplusAuction struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + SellToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=sell_token,json=sellToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"sell_token" yaml:"sell_token"` + BuyToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=buy_token,json=buyToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"buy_token" yaml:"buy_token"` + ActiveBiddingId uint64 `protobuf:"varint,4,opt,name=active_bidding_id,json=activeBiddingId,proto3" json:"active_bidding_id,omitempty" yaml:"active_bidding_id"` + Bidder github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,5,opt,name=bidder,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"bidder,omitempty" yaml:"bidder"` + Bid github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=bid,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"bid" yaml:"bid"` + EndTime time.Time `protobuf:"bytes,7,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` + BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` + BiddingIds []*BidOwnerMapping `protobuf:"bytes,9,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` + AuctionStatus uint64 `protobuf:"varint,10,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` + AppId uint64 `protobuf:"varint,11,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AssetId uint64 `protobuf:"varint,12,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + AuctionMappingId uint64 `protobuf:"varint,13,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` + AssetInId uint64 `protobuf:"varint,14,opt,name=asset_in_id,json=assetInId,proto3" json:"asset_in_id,omitempty" yaml:"asset_in_id"` + AssetOutId uint64 `protobuf:"varint,15,opt,name=asset_out_id,json=assetOutId,proto3" json:"asset_out_id,omitempty" yaml:"asset_out_id"` + BidEndTime time.Time `protobuf:"bytes,16,opt,name=bid_end_time,json=bidEndTime,proto3,stdtime" json:"bid_end_time" yaml:"bid_end_time"` +} + +func (m *SurplusAuction) Reset() { *m = SurplusAuction{} } +func (m *SurplusAuction) String() string { return proto.CompactTextString(m) } +func (*SurplusAuction) ProtoMessage() {} +func (*SurplusAuction) Descriptor() ([]byte, []int) { + return fileDescriptor_4bb9aead25d5fe6c, []int{0} +} +func (m *SurplusAuction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SurplusAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SurplusAuction.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SurplusAuction) XXX_Merge(src proto.Message) { + xxx_messageInfo_SurplusAuction.Merge(m, src) +} +func (m *SurplusAuction) XXX_Size() int { + return m.Size() +} +func (m *SurplusAuction) XXX_DiscardUnknown() { + xxx_messageInfo_SurplusAuction.DiscardUnknown(m) +} + +var xxx_messageInfo_SurplusAuction proto.InternalMessageInfo + +type DebtAuction struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + AuctionedToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=auctioned_token,json=auctionedToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"auctioned_token" yaml:"auctioned_token"` + ExpectedUserToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=expected_user_token,json=expectedUserToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"expected_user_token" yaml:"expected_user_token"` + ExpectedMintedToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=expected_minted_token,json=expectedMintedToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"expected_minted_token" yaml:"expected_minted_token"` + EndTime time.Time `protobuf:"bytes,5,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` + ActiveBiddingId uint64 `protobuf:"varint,6,opt,name=active_bidding_id,json=activeBiddingId,proto3" json:"active_bidding_id,omitempty" yaml:"active_bidding_id"` + Bidder github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,7,opt,name=bidder,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"bidder,omitempty" yaml:"bidder"` + CurrentBidAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,8,opt,name=current_bid_amount,json=currentBidAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"current_bid_amount" yaml:"current_bid_amount"` + AuctionStatus uint64 `protobuf:"varint,9,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` + AppId uint64 `protobuf:"varint,10,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AssetId uint64 `protobuf:"varint,11,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + BiddingIds []*BidOwnerMapping `protobuf:"bytes,12,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` + AuctionMappingId uint64 `protobuf:"varint,13,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` + BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,14,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` + AssetInId uint64 `protobuf:"varint,15,opt,name=asset_in_id,json=assetInId,proto3" json:"asset_in_id,omitempty" yaml:"asset_in_id"` + AssetOutId uint64 `protobuf:"varint,16,opt,name=asset_out_id,json=assetOutId,proto3" json:"asset_out_id,omitempty" yaml:"asset_out_id"` + BidEndTime time.Time `protobuf:"bytes,17,opt,name=bid_end_time,json=bidEndTime,proto3,stdtime" json:"bid_end_time" yaml:"bid_end_time"` +} + +func (m *DebtAuction) Reset() { *m = DebtAuction{} } +func (m *DebtAuction) String() string { return proto.CompactTextString(m) } +func (*DebtAuction) ProtoMessage() {} +func (*DebtAuction) Descriptor() ([]byte, []int) { + return fileDescriptor_4bb9aead25d5fe6c, []int{1} +} +func (m *DebtAuction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DebtAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DebtAuction.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DebtAuction) XXX_Merge(src proto.Message) { + xxx_messageInfo_DebtAuction.Merge(m, src) +} +func (m *DebtAuction) XXX_Size() int { + return m.Size() +} +func (m *DebtAuction) XXX_DiscardUnknown() { + xxx_messageInfo_DebtAuction.DiscardUnknown(m) +} + +var xxx_messageInfo_DebtAuction proto.InternalMessageInfo + +type DutchAuction struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + OutflowTokenInitAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=outflow_token_init_amount,json=outflowTokenInitAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_token_init_amount" yaml:"outflow_token_init_amount"` + OutflowTokenCurrentAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=outflow_token_current_amount,json=outflowTokenCurrentAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_token_current_amount" yaml:"outflow_token_current_amount"` + InflowTokenTargetAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=inflow_token_target_amount,json=inflowTokenTargetAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_target_amount" yaml:"inflow_token_target_amount"` + InflowTokenCurrentAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=inflow_token_current_amount,json=inflowTokenCurrentAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_current_amount" yaml:"inflow_token_current_amount"` + OutflowTokenInitialPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=outflow_token_initial_price,json=outflowTokenInitialPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_initial_price" yaml:"outflow_token_initial_price"` + OutflowTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=outflow_token_current_price,json=outflowTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_current_price" yaml:"outflow_token_current_price"` + OutflowTokenEndPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=outflow_token_end_price,json=outflowTokenEndPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_end_price" yaml:"outflow_token_end_price"` + InflowTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=inflow_token_current_price,json=inflowTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflow_token_current_price" yaml:"inflow_token_current_price"` + EndTime time.Time `protobuf:"bytes,10,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` + AuctionStatus uint64 `protobuf:"varint,11,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` + StartTime time.Time `protobuf:"bytes,12,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` + BiddingIds []*BidOwnerMapping `protobuf:"bytes,13,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` + AuctionMappingId uint64 `protobuf:"varint,14,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` + AppId uint64 `protobuf:"varint,15,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AssetInId uint64 `protobuf:"varint,16,opt,name=asset_in_id,json=assetInId,proto3" json:"asset_in_id,omitempty" yaml:"asset_in_id"` + AssetOutId uint64 `protobuf:"varint,17,opt,name=asset_out_id,json=assetOutId,proto3" json:"asset_out_id,omitempty" yaml:"asset_out_id"` + LockedVaultId uint64 `protobuf:"varint,18,opt,name=locked_vault_id,json=lockedVaultId,proto3" json:"locked_vault_id,omitempty" yaml:"locked_vault_id"` + VaultOwner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,19,opt,name=vault_owner,json=vaultOwner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"vault_owner,omitempty" yaml:"vault_owner"` + LiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,20,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_penalty" yaml:"liquidatin_penalty"` +} + +func (m *DutchAuction) Reset() { *m = DutchAuction{} } +func (m *DutchAuction) String() string { return proto.CompactTextString(m) } +func (*DutchAuction) ProtoMessage() {} +func (*DutchAuction) Descriptor() ([]byte, []int) { + return fileDescriptor_4bb9aead25d5fe6c, []int{2} +} +func (m *DutchAuction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DutchAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DutchAuction.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DutchAuction) XXX_Merge(src proto.Message) { + xxx_messageInfo_DutchAuction.Merge(m, src) +} +func (m *DutchAuction) XXX_Size() int { + return m.Size() +} +func (m *DutchAuction) XXX_DiscardUnknown() { + xxx_messageInfo_DutchAuction.DiscardUnknown(m) +} + +var xxx_messageInfo_DutchAuction proto.InternalMessageInfo + +type BidOwnerMapping struct { + BidId uint64 `protobuf:"varint,1,opt,name=bid_id,json=bidId,proto3" json:"bid_id,omitempty"` + BidOwner string `protobuf:"bytes,2,opt,name=bid_owner,json=bidOwner,proto3" json:"bid_owner,omitempty"` +} + +func (m *BidOwnerMapping) Reset() { *m = BidOwnerMapping{} } +func (m *BidOwnerMapping) String() string { return proto.CompactTextString(m) } +func (*BidOwnerMapping) ProtoMessage() {} +func (*BidOwnerMapping) Descriptor() ([]byte, []int) { + return fileDescriptor_4bb9aead25d5fe6c, []int{3} +} +func (m *BidOwnerMapping) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BidOwnerMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BidOwnerMapping.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BidOwnerMapping) XXX_Merge(src proto.Message) { + xxx_messageInfo_BidOwnerMapping.Merge(m, src) +} +func (m *BidOwnerMapping) XXX_Size() int { + return m.Size() +} +func (m *BidOwnerMapping) XXX_DiscardUnknown() { + xxx_messageInfo_BidOwnerMapping.DiscardUnknown(m) +} + +var xxx_messageInfo_BidOwnerMapping proto.InternalMessageInfo + +type ProtocolStatistics struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AssetId uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + Loss github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=loss,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"loss" yaml:"loss"` +} + +func (m *ProtocolStatistics) Reset() { *m = ProtocolStatistics{} } +func (m *ProtocolStatistics) String() string { return proto.CompactTextString(m) } +func (*ProtocolStatistics) ProtoMessage() {} +func (*ProtocolStatistics) Descriptor() ([]byte, []int) { + return fileDescriptor_4bb9aead25d5fe6c, []int{4} +} +func (m *ProtocolStatistics) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProtocolStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProtocolStatistics.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProtocolStatistics) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProtocolStatistics.Merge(m, src) +} +func (m *ProtocolStatistics) XXX_Size() int { + return m.Size() +} +func (m *ProtocolStatistics) XXX_DiscardUnknown() { + xxx_messageInfo_ProtocolStatistics.DiscardUnknown(m) +} + +var xxx_messageInfo_ProtocolStatistics proto.InternalMessageInfo + +type AuctionParams struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AuctionDurationSeconds uint64 `protobuf:"varint,2,opt,name=auction_duration_seconds,json=auctionDurationSeconds,proto3" json:"auction_duration_seconds,omitempty" yaml:"auction_duration_seconds"` + Buffer github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=buffer,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"buffer" yaml:"buffer"` + Cusp github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=cusp,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"cusp" yaml:"cusp"` + Step github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"step" yaml:"step"` + PriceFunctionType uint64 `protobuf:"varint,6,opt,name=price_function_type,json=priceFunctionType,proto3" json:"price_function_type,omitempty" yaml:"price_function_type"` + SurplusId uint64 `protobuf:"varint,7,opt,name=surplus_id,json=surplusId,proto3" json:"surplus_id,omitempty" yaml:"surplus_id"` + DebtId uint64 `protobuf:"varint,8,opt,name=debt_id,json=debtId,proto3" json:"debt_id,omitempty" yaml:"debt_id"` + DutchId uint64 `protobuf:"varint,9,opt,name=dutch_id,json=dutchId,proto3" json:"dutch_id,omitempty" yaml:"dutch_id"` + BidDurationSeconds uint64 `protobuf:"varint,10,opt,name=bid_duration_seconds,json=bidDurationSeconds,proto3" json:"bid_duration_seconds,omitempty" yaml:"bid_duration_seconds"` +} + +func (m *AuctionParams) Reset() { *m = AuctionParams{} } +func (m *AuctionParams) String() string { return proto.CompactTextString(m) } +func (*AuctionParams) ProtoMessage() {} +func (*AuctionParams) Descriptor() ([]byte, []int) { + return fileDescriptor_4bb9aead25d5fe6c, []int{5} +} +func (m *AuctionParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuctionParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuctionParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuctionParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuctionParams.Merge(m, src) +} +func (m *AuctionParams) XXX_Size() int { + return m.Size() +} +func (m *AuctionParams) XXX_DiscardUnknown() { + xxx_messageInfo_AuctionParams.DiscardUnknown(m) +} + +var xxx_messageInfo_AuctionParams proto.InternalMessageInfo + +func init() { + proto.RegisterType((*SurplusAuction)(nil), "comdex.auction.v1beta1.SurplusAuction") + proto.RegisterType((*DebtAuction)(nil), "comdex.auction.v1beta1.DebtAuction") + proto.RegisterType((*DutchAuction)(nil), "comdex.auction.v1beta1.DutchAuction") + proto.RegisterType((*BidOwnerMapping)(nil), "comdex.auction.v1beta1.bidOwnerMapping") + proto.RegisterType((*ProtocolStatistics)(nil), "comdex.auction.v1beta1.ProtocolStatistics") + proto.RegisterType((*AuctionParams)(nil), "comdex.auction.v1beta1.AuctionParams") +} + +func init() { + proto.RegisterFile("comdex/auction/v1beta1/auction.proto", fileDescriptor_4bb9aead25d5fe6c) +} + +var fileDescriptor_4bb9aead25d5fe6c = []byte{ + // 1687 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcd, 0x6f, 0x1b, 0x45, + 0x1b, 0xcf, 0xb6, 0x49, 0x1c, 0x8f, 0x93, 0x38, 0xde, 0x7c, 0x39, 0x49, 0xeb, 0x4d, 0xa7, 0xaf, + 0xde, 0x46, 0x7a, 0x55, 0x5b, 0xed, 0xfb, 0xea, 0x95, 0x40, 0x42, 0x10, 0x37, 0x2d, 0x58, 0xa5, + 0x34, 0x6c, 0xd2, 0x82, 0x2a, 0x55, 0x66, 0x77, 0x67, 0xec, 0x0e, 0x5d, 0xef, 0x2e, 0xbb, 0xb3, + 0x6d, 0x23, 0x10, 0x57, 0x4e, 0x48, 0x95, 0x10, 0x12, 0x27, 0x0e, 0x9c, 0x00, 0x21, 0x21, 0x71, + 0xe1, 0xcc, 0xad, 0x17, 0xa4, 0x1e, 0x11, 0x07, 0x03, 0xe9, 0x7f, 0xe0, 0x23, 0x27, 0x34, 0x1f, + 0xbb, 0x6b, 0x6f, 0xdc, 0x3a, 0x9b, 0x04, 0x4e, 0xf1, 0xce, 0x33, 0xcf, 0xef, 0xf9, 0xed, 0x33, + 0xcf, 0xd7, 0x6c, 0xc0, 0xbf, 0x2c, 0xb7, 0x83, 0xf0, 0xa3, 0x9a, 0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f7, 0x21, 0xd8, 0x6d, 0x61, 0x2b, 0x89, 0xb8, 0x04, + 0x09, 0xea, 0x79, 0x93, 0xa0, 0x6b, 0xfc, 0xb7, 0xfa, 0x1e, 0x28, 0x24, 0xe7, 0x13, 0x94, 0xf3, + 0xeb, 0xa7, 0x37, 0x0a, 0x97, 0x2f, 0x54, 0x87, 0x27, 0x65, 0xd5, 0x24, 0xe8, 0xe6, 0x43, 0x07, + 0xfb, 0x37, 0x0c, 0xcf, 0x23, 0x4e, 0xbb, 0xbe, 0xd4, 0xeb, 0x6a, 0x6a, 0x72, 0x5a, 0x12, 0x05, + 0xea, 0xc0, 0x8c, 0x0e, 0x38, 0x50, 0x5f, 0x03, 0xb3, 0x51, 0x0a, 0x05, 0xd4, 0xa0, 0x61, 0x50, + 0x06, 0x3c, 0x50, 0x56, 0x7a, 0x5d, 0x6d, 0x71, 0x30, 0xc5, 0x84, 0x1c, 0xea, 0x33, 0x72, 0x61, + 0x87, 0x3f, 0xab, 0x1b, 0x60, 0xd2, 0xf0, 0x3c, 0x16, 0x62, 0x05, 0xae, 0x59, 0x4a, 0x62, 0x44, + 0xac, 0x43, 0x7d, 0xc2, 0xf0, 0xbc, 0x06, 0x52, 0xab, 0x60, 0xca, 0x08, 0x02, 0x4c, 0xd9, 0xde, + 0x69, 0xbe, 0x77, 0x3e, 0xf1, 0x72, 0x24, 0x81, 0x7a, 0x8e, 0xff, 0x6c, 0x20, 0xf5, 0x3a, 0x50, + 0x23, 0xdb, 0x1d, 0xf1, 0x4a, 0x4c, 0x73, 0x86, 0x6b, 0x9e, 0xed, 0x75, 0xb5, 0x95, 0x41, 0x7e, + 0xc9, 0x1e, 0xa8, 0xcf, 0xc9, 0x45, 0xe9, 0x8a, 0x06, 0x52, 0xff, 0x0f, 0x0a, 0xd2, 0x04, 0x2f, + 0x24, 0xb3, 0x1c, 0xa5, 0xcf, 0x43, 0x7d, 0x42, 0x56, 0x49, 0x38, 0x05, 0x56, 0x49, 0x5e, 0x02,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, 0x27, 0x8f, 0xe7, 0x05, 0x96, 0x5d, 0x07, 0x82, 0x47, 0x5c, 0x47, 0xb5, 0x5e, 0x57, + 0x5b, 0x4b, 0x2e, 0x22, 0x07, 0x03, 0x47, 0x35, 0x09, 0x4a, 0x05, 0x4d, 0x7d, 0xe7, 0xc9, 0x1f, + 0x95, 0xb1, 0xaf, 0xf7, 0x2b, 0x63, 0x4f, 0xf6, 0x2b, 0xca, 0xd3, 0xfd, 0x8a, 0xf2, 0xfb, 0x7e, + 0x45, 0x79, 0xfc, 0xac, 0x32, 0xf6, 0xf4, 0x59, 0x65, 0xec, 0x97, 0x67, 0x95, 0xb1, 0x3b, 0x97, + 0x06, 0x0e, 0x85, 0x75, 0x9a, 0x8b, 0x6e, 0xab, 0x45, 0x2c, 0x62, 0xd8, 0xf2, 0xb9, 0x96, 0xfc, + 0xeb, 0x82, 0x9f, 0x91, 0x39, 0xc9, 0xbb, 0xdc, 0x7f, 0xff, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x07, + 0xc7, 0xb4, 0x31, 0xd9, 0x18, 0x00, 0x00, +} + +func (m *SurplusAuction) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SurplusAuction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SurplusAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BidEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BidEndTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintAuction(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + if m.AssetOutId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AssetOutId)) + i-- + dAtA[i] = 0x78 + } + if m.AssetInId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AssetInId)) + i-- + dAtA[i] = 0x70 + } + if m.AuctionMappingId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x68 + } + if m.AssetId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AssetId)) + i-- + dAtA[i] = 0x60 + } + if m.AppId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x58 + } + if m.AuctionStatus != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionStatus)) + i-- + dAtA[i] = 0x50 + } + if len(m.BiddingIds) > 0 { + for iNdEx := len(m.BiddingIds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BiddingIds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + { + size := m.BidFactor.Size() + i -= size + if _, err := m.BidFactor.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintAuction(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x3a + { + size, err := m.Bid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintAuction(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x2a + } + if m.ActiveBiddingId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.ActiveBiddingId)) + i-- + dAtA[i] = 0x20 + } + { + size, err := m.BuyToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.SellToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.AuctionId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DebtAuction) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DebtAuction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DebtAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BidEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BidEndTime):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintAuction(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + if m.AssetOutId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AssetOutId)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.AssetInId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AssetInId)) + i-- + dAtA[i] = 0x78 + } + { + size := m.BidFactor.Size() + i -= size + if _, err := m.BidFactor.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + if m.AuctionMappingId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x68 + } + if len(m.BiddingIds) > 0 { + for iNdEx := len(m.BiddingIds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BiddingIds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + } + if m.AssetId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AssetId)) + i-- + dAtA[i] = 0x58 + } + if m.AppId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x50 + } + if m.AuctionStatus != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionStatus)) + i-- + dAtA[i] = 0x48 + } + { + size, err := m.CurrentBidAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintAuction(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x3a + } + if m.ActiveBiddingId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.ActiveBiddingId)) + i-- + dAtA[i] = 0x30 + } + n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintAuction(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0x2a + { + size, err := m.ExpectedMintedToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.ExpectedUserToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.AuctionedToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.AuctionId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DutchAuction) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DutchAuction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DutchAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.LiquidationPenalty.Size() + i -= size + if _, err := m.LiquidationPenalty.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + if len(m.VaultOwner) > 0 { + i -= len(m.VaultOwner) + copy(dAtA[i:], m.VaultOwner) + i = encodeVarintAuction(dAtA, i, uint64(len(m.VaultOwner))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if m.LockedVaultId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.LockedVaultId)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if m.AssetOutId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AssetOutId)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + if m.AssetInId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AssetInId)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.AppId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x78 + } + if m.AuctionMappingId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x70 + } + if len(m.BiddingIds) > 0 { + for iNdEx := len(m.BiddingIds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BiddingIds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + } + n12, err12 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + if err12 != nil { + return 0, err12 + } + i -= n12 + i = encodeVarintAuction(dAtA, i, uint64(n12)) + i-- + dAtA[i] = 0x62 + if m.AuctionStatus != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionStatus)) + i-- + dAtA[i] = 0x58 + } + n13, err13 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) + if err13 != nil { + return 0, err13 + } + i -= n13 + i = encodeVarintAuction(dAtA, i, uint64(n13)) + i-- + dAtA[i] = 0x52 + { + size := m.InflowTokenCurrentPrice.Size() + i -= size + if _, err := m.InflowTokenCurrentPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + { + size := m.OutflowTokenEndPrice.Size() + i -= size + if _, err := m.OutflowTokenEndPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size := m.OutflowTokenCurrentPrice.Size() + i -= size + if _, err := m.OutflowTokenCurrentPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size := m.OutflowTokenInitialPrice.Size() + i -= size + if _, err := m.OutflowTokenInitialPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size, err := m.InflowTokenCurrentAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size, err := m.InflowTokenTargetAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.OutflowTokenCurrentAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.OutflowTokenInitAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.AuctionId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BidOwnerMapping) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BidOwnerMapping) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BidOwnerMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BidOwner) > 0 { + i -= len(m.BidOwner) + copy(dAtA[i:], m.BidOwner) + i = encodeVarintAuction(dAtA, i, uint64(len(m.BidOwner))) + i-- + dAtA[i] = 0x12 + } + if m.BidId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.BidId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProtocolStatistics) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProtocolStatistics) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProtocolStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Loss.Size() + i -= size + if _, err := m.Loss.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.AssetId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AssetId)) + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AuctionParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AuctionParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuctionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BidDurationSeconds != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.BidDurationSeconds)) + i-- + dAtA[i] = 0x50 + } + if m.DutchId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.DutchId)) + i-- + dAtA[i] = 0x48 + } + if m.DebtId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.DebtId)) + i-- + dAtA[i] = 0x40 + } + if m.SurplusId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.SurplusId)) + i-- + dAtA[i] = 0x38 + } + if m.PriceFunctionType != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.PriceFunctionType)) + i-- + dAtA[i] = 0x30 + } + { + size := m.Step.Size() + i -= size + if _, err := m.Step.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.Cusp.Size() + i -= size + if _, err := m.Cusp.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.Buffer.Size() + i -= size + if _, err := m.Buffer.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.AuctionDurationSeconds != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionDurationSeconds)) + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintAuction(dAtA []byte, offset int, v uint64) int { + offset -= sovAuction(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SurplusAuction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovAuction(uint64(m.AuctionId)) + } + l = m.SellToken.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.BuyToken.Size() + n += 1 + l + sovAuction(uint64(l)) + if m.ActiveBiddingId != 0 { + n += 1 + sovAuction(uint64(m.ActiveBiddingId)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + l = m.Bid.Size() + n += 1 + l + sovAuction(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) + n += 1 + l + sovAuction(uint64(l)) + l = m.BidFactor.Size() + n += 1 + l + sovAuction(uint64(l)) + if len(m.BiddingIds) > 0 { + for _, e := range m.BiddingIds { + l = e.Size() + n += 1 + l + sovAuction(uint64(l)) + } + } + if m.AuctionStatus != 0 { + n += 1 + sovAuction(uint64(m.AuctionStatus)) + } + if m.AppId != 0 { + n += 1 + sovAuction(uint64(m.AppId)) + } + if m.AssetId != 0 { + n += 1 + sovAuction(uint64(m.AssetId)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovAuction(uint64(m.AuctionMappingId)) + } + if m.AssetInId != 0 { + n += 1 + sovAuction(uint64(m.AssetInId)) + } + if m.AssetOutId != 0 { + n += 1 + sovAuction(uint64(m.AssetOutId)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BidEndTime) + n += 2 + l + sovAuction(uint64(l)) + return n +} + +func (m *DebtAuction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovAuction(uint64(m.AuctionId)) + } + l = m.AuctionedToken.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.ExpectedUserToken.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.ExpectedMintedToken.Size() + n += 1 + l + sovAuction(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) + n += 1 + l + sovAuction(uint64(l)) + if m.ActiveBiddingId != 0 { + n += 1 + sovAuction(uint64(m.ActiveBiddingId)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + l = m.CurrentBidAmount.Size() + n += 1 + l + sovAuction(uint64(l)) + if m.AuctionStatus != 0 { + n += 1 + sovAuction(uint64(m.AuctionStatus)) + } + if m.AppId != 0 { + n += 1 + sovAuction(uint64(m.AppId)) + } + if m.AssetId != 0 { + n += 1 + sovAuction(uint64(m.AssetId)) + } + if len(m.BiddingIds) > 0 { + for _, e := range m.BiddingIds { + l = e.Size() + n += 1 + l + sovAuction(uint64(l)) + } + } + if m.AuctionMappingId != 0 { + n += 1 + sovAuction(uint64(m.AuctionMappingId)) + } + l = m.BidFactor.Size() + n += 1 + l + sovAuction(uint64(l)) + if m.AssetInId != 0 { + n += 1 + sovAuction(uint64(m.AssetInId)) + } + if m.AssetOutId != 0 { + n += 2 + sovAuction(uint64(m.AssetOutId)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BidEndTime) + n += 2 + l + sovAuction(uint64(l)) + return n +} + +func (m *DutchAuction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovAuction(uint64(m.AuctionId)) + } + l = m.OutflowTokenInitAmount.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.OutflowTokenCurrentAmount.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.InflowTokenTargetAmount.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.InflowTokenCurrentAmount.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.OutflowTokenInitialPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.OutflowTokenCurrentPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.OutflowTokenEndPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.InflowTokenCurrentPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) + n += 1 + l + sovAuction(uint64(l)) + if m.AuctionStatus != 0 { + n += 1 + sovAuction(uint64(m.AuctionStatus)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) + n += 1 + l + sovAuction(uint64(l)) + if len(m.BiddingIds) > 0 { + for _, e := range m.BiddingIds { + l = e.Size() + n += 1 + l + sovAuction(uint64(l)) + } + } + if m.AuctionMappingId != 0 { + n += 1 + sovAuction(uint64(m.AuctionMappingId)) + } + if m.AppId != 0 { + n += 1 + sovAuction(uint64(m.AppId)) + } + if m.AssetInId != 0 { + n += 2 + sovAuction(uint64(m.AssetInId)) + } + if m.AssetOutId != 0 { + n += 2 + sovAuction(uint64(m.AssetOutId)) + } + if m.LockedVaultId != 0 { + n += 2 + sovAuction(uint64(m.LockedVaultId)) + } + l = len(m.VaultOwner) + if l > 0 { + n += 2 + l + sovAuction(uint64(l)) + } + l = m.LiquidationPenalty.Size() + n += 2 + l + sovAuction(uint64(l)) + return n +} + +func (m *BidOwnerMapping) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BidId != 0 { + n += 1 + sovAuction(uint64(m.BidId)) + } + l = len(m.BidOwner) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + return n +} + +func (m *ProtocolStatistics) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovAuction(uint64(m.AppId)) + } + if m.AssetId != 0 { + n += 1 + sovAuction(uint64(m.AssetId)) + } + l = m.Loss.Size() + n += 1 + l + sovAuction(uint64(l)) + return n +} + +func (m *AuctionParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovAuction(uint64(m.AppId)) + } + if m.AuctionDurationSeconds != 0 { + n += 1 + sovAuction(uint64(m.AuctionDurationSeconds)) + } + l = m.Buffer.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.Cusp.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.Step.Size() + n += 1 + l + sovAuction(uint64(l)) + if m.PriceFunctionType != 0 { + n += 1 + sovAuction(uint64(m.PriceFunctionType)) + } + if m.SurplusId != 0 { + n += 1 + sovAuction(uint64(m.SurplusId)) + } + if m.DebtId != 0 { + n += 1 + sovAuction(uint64(m.DebtId)) + } + if m.DutchId != 0 { + n += 1 + sovAuction(uint64(m.DutchId)) + } + if m.BidDurationSeconds != 0 { + n += 1 + sovAuction(uint64(m.BidDurationSeconds)) + } + return n +} + +func sovAuction(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAuction(x uint64) (n int) { + return sovAuction(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SurplusAuction) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SurplusAuction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SurplusAuction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SellToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SellToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuyToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BuyToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveBiddingId", wireType) + } + m.ActiveBiddingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ActiveBiddingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = github_com_cosmos_cosmos_sdk_types.AccAddress(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidFactor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BidFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingIds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BiddingIds = append(m.BiddingIds, &BidOwnerMapping{}) + if err := m.BiddingIds[len(m.BiddingIds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) + } + m.AuctionStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionStatus |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + m.AssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetInId", wireType) + } + m.AssetInId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetInId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetOutId", wireType) + } + m.AssetOutId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetOutId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidEndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BidEndTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DebtAuction) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DebtAuction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DebtAuction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionedToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AuctionedToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpectedUserToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExpectedUserToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpectedMintedToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExpectedMintedToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveBiddingId", wireType) + } + m.ActiveBiddingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ActiveBiddingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = github_com_cosmos_cosmos_sdk_types.AccAddress(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentBidAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CurrentBidAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) + } + m.AuctionStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionStatus |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + m.AssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingIds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BiddingIds = append(m.BiddingIds, &BidOwnerMapping{}) + if err := m.BiddingIds[len(m.BiddingIds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidFactor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BidFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetInId", wireType) + } + m.AssetInId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetInId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetOutId", wireType) + } + m.AssetOutId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetOutId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidEndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BidEndTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DutchAuction) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DutchAuction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DutchAuction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenInitAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OutflowTokenInitAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenCurrentAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OutflowTokenCurrentAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenTargetAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InflowTokenTargetAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenCurrentAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InflowTokenCurrentAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenInitialPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OutflowTokenInitialPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenCurrentPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OutflowTokenCurrentPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenEndPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OutflowTokenEndPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenCurrentPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InflowTokenCurrentPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) + } + m.AuctionStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionStatus |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingIds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BiddingIds = append(m.BiddingIds, &BidOwnerMapping{}) + if err := m.BiddingIds[len(m.BiddingIds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetInId", wireType) + } + m.AssetInId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetInId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetOutId", wireType) + } + m.AssetOutId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetOutId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LockedVaultId", wireType) + } + m.LockedVaultId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LockedVaultId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VaultOwner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VaultOwner = github_com_cosmos_cosmos_sdk_types.AccAddress(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidationPenalty", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LiquidationPenalty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BidOwnerMapping) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: bidOwnerMapping: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: bidOwnerMapping: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BidId", wireType) + } + m.BidId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BidId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidOwner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BidOwner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProtocolStatistics) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ProtocolStatistics: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProtocolStatistics: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + m.AssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Loss", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Loss.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AuctionParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AuctionParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuctionParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionDurationSeconds", wireType) + } + m.AuctionDurationSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionDurationSeconds |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Buffer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Buffer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cusp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Cusp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Step.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PriceFunctionType", wireType) + } + m.PriceFunctionType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PriceFunctionType |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SurplusId", wireType) + } + m.SurplusId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SurplusId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtId", wireType) + } + m.DebtId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DebtId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DutchId", wireType) + } + m.DutchId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DutchId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BidDurationSeconds", wireType) + } + m.BidDurationSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BidDurationSeconds |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAuction(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAuction + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAuction + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAuction + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthAuction + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAuction + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAuction + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAuction = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAuction = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAuction = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/auction/types/biddings.pb.go b/github.com/comdex-official/comdex/x/auction/types/biddings.pb.go new file mode 100644 index 000000000..2767b7031 --- /dev/null +++ b/github.com/comdex-official/comdex/x/auction/types/biddings.pb.go @@ -0,0 +1,1683 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/auction/v1beta1/biddings.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type SurplusBiddings struct { + BiddingId uint64 `protobuf:"varint,1,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` + AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + AuctionStatus string `protobuf:"bytes,3,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` + AuctionedCollateral github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=auctioned_collateral,json=auctionedCollateral,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"auctioned_collateral" yaml:"auctioned_collateral"` + Bidder string `protobuf:"bytes,5,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` + Bid github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=bid,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"bid" yaml:"bid"` + BiddingTimestamp time.Time `protobuf:"bytes,7,opt,name=bidding_timestamp,json=biddingTimestamp,proto3,stdtime" json:"bidding_timestamp" yaml:"bidding_timestamp"` + BiddingStatus string `protobuf:"bytes,8,opt,name=bidding_status,json=biddingStatus,proto3" json:"bidding_status,omitempty" yaml:"bidding_status"` + AuctionMappingId uint64 `protobuf:"varint,9,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` + AppId uint64 `protobuf:"varint,10,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` +} + +func (m *SurplusBiddings) Reset() { *m = SurplusBiddings{} } +func (m *SurplusBiddings) String() string { return proto.CompactTextString(m) } +func (*SurplusBiddings) ProtoMessage() {} +func (*SurplusBiddings) Descriptor() ([]byte, []int) { + return fileDescriptor_a5a3f4b8597bafd2, []int{0} +} +func (m *SurplusBiddings) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SurplusBiddings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SurplusBiddings.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SurplusBiddings) XXX_Merge(src proto.Message) { + xxx_messageInfo_SurplusBiddings.Merge(m, src) +} +func (m *SurplusBiddings) XXX_Size() int { + return m.Size() +} +func (m *SurplusBiddings) XXX_DiscardUnknown() { + xxx_messageInfo_SurplusBiddings.DiscardUnknown(m) +} + +var xxx_messageInfo_SurplusBiddings proto.InternalMessageInfo + +type DebtBiddings struct { + BiddingId uint64 `protobuf:"varint,1,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` + AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + AuctionStatus string `protobuf:"bytes,3,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` + OutflowTokens github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=outflow_tokens,json=outflowTokens,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_tokens" yaml:"outflow_tokens"` + Bidder string `protobuf:"bytes,5,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` + Bid github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=bid,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"bid" yaml:"bid"` + BiddingTimestamp time.Time `protobuf:"bytes,7,opt,name=bidding_timestamp,json=biddingTimestamp,proto3,stdtime" json:"bidding_timestamp" yaml:"bidding_timestamp"` + BiddingStatus string `protobuf:"bytes,8,opt,name=bidding_status,json=biddingStatus,proto3" json:"bidding_status,omitempty" yaml:"bidding_status"` + AuctionMappingId uint64 `protobuf:"varint,9,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` + AppId uint64 `protobuf:"varint,10,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` +} + +func (m *DebtBiddings) Reset() { *m = DebtBiddings{} } +func (m *DebtBiddings) String() string { return proto.CompactTextString(m) } +func (*DebtBiddings) ProtoMessage() {} +func (*DebtBiddings) Descriptor() ([]byte, []int) { + return fileDescriptor_a5a3f4b8597bafd2, []int{1} +} +func (m *DebtBiddings) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DebtBiddings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DebtBiddings.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DebtBiddings) XXX_Merge(src proto.Message) { + xxx_messageInfo_DebtBiddings.Merge(m, src) +} +func (m *DebtBiddings) XXX_Size() int { + return m.Size() +} +func (m *DebtBiddings) XXX_DiscardUnknown() { + xxx_messageInfo_DebtBiddings.DiscardUnknown(m) +} + +var xxx_messageInfo_DebtBiddings proto.InternalMessageInfo + +type DutchBiddings struct { + BiddingId uint64 `protobuf:"varint,1,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` + AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + AuctionStatus string `protobuf:"bytes,3,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` + OutflowTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=outflow_token_amount,json=outflowTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_token_amount" yaml:"outflow_token_amount"` + InflowTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=inflow_token_amount,json=inflowTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_amount" yaml:"inflow_token_amount"` + Bidder string `protobuf:"bytes,6,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` + BiddingTimestamp time.Time `protobuf:"bytes,7,opt,name=bidding_timestamp,json=biddingTimestamp,proto3,stdtime" json:"bidding_timestamp" yaml:"bidding_timestamp"` + BiddingStatus string `protobuf:"bytes,8,opt,name=bidding_status,json=biddingStatus,proto3" json:"bidding_status,omitempty" yaml:"bidding_status"` + AuctionMappingId uint64 `protobuf:"varint,9,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` + AppId uint64 `protobuf:"varint,10,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` +} + +func (m *DutchBiddings) Reset() { *m = DutchBiddings{} } +func (m *DutchBiddings) String() string { return proto.CompactTextString(m) } +func (*DutchBiddings) ProtoMessage() {} +func (*DutchBiddings) Descriptor() ([]byte, []int) { + return fileDescriptor_a5a3f4b8597bafd2, []int{2} +} +func (m *DutchBiddings) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DutchBiddings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DutchBiddings.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DutchBiddings) XXX_Merge(src proto.Message) { + xxx_messageInfo_DutchBiddings.Merge(m, src) +} +func (m *DutchBiddings) XXX_Size() int { + return m.Size() +} +func (m *DutchBiddings) XXX_DiscardUnknown() { + xxx_messageInfo_DutchBiddings.DiscardUnknown(m) +} + +var xxx_messageInfo_DutchBiddings proto.InternalMessageInfo + +func init() { + proto.RegisterType((*SurplusBiddings)(nil), "comdex.auction.v1beta1.SurplusBiddings") + proto.RegisterType((*DebtBiddings)(nil), "comdex.auction.v1beta1.DebtBiddings") + proto.RegisterType((*DutchBiddings)(nil), "comdex.auction.v1beta1.DutchBiddings") +} + +func init() { + proto.RegisterFile("comdex/auction/v1beta1/biddings.proto", fileDescriptor_a5a3f4b8597bafd2) +} + +var fileDescriptor_a5a3f4b8597bafd2 = []byte{ + // 675 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0xbd, 0x6e, 0xd3, 0x50, + 0x14, 0x8e, 0x69, 0x6b, 0xc8, 0x85, 0x94, 0xc6, 0x6d, 0x91, 0x1b, 0x84, 0x5d, 0x59, 0x20, 0xc2, + 0x50, 0x5b, 0x05, 0x26, 0x24, 0x24, 0x48, 0x3b, 0x10, 0xa1, 0x32, 0xb8, 0x9d, 0x58, 0xa2, 0xeb, + 0x9f, 0xa4, 0x97, 0xda, 0xbe, 0x56, 0x7c, 0x0d, 0xf4, 0x0d, 0x10, 0x53, 0x47, 0x24, 0x60, 0xe7, + 0x51, 0xca, 0xd6, 0x91, 0xc9, 0x40, 0xfa, 0x06, 0x19, 0x99, 0x90, 0xaf, 0x8f, 0xed, 0xba, 0x54, + 0x0a, 0x19, 0x23, 0x75, 0x4a, 0xce, 0xdf, 0x77, 0xbe, 0x9c, 0xf3, 0x1d, 0xe5, 0xa2, 0x7b, 0x36, + 0xf5, 0x1d, 0xf7, 0xbd, 0x81, 0x63, 0x9b, 0x11, 0x1a, 0x18, 0x6f, 0x37, 0x2d, 0x97, 0xe1, 0x4d, + 0xc3, 0x22, 0x8e, 0x43, 0x82, 0x41, 0xa4, 0x87, 0x43, 0xca, 0xa8, 0x74, 0x2b, 0x4b, 0xd3, 0x21, + 0x4d, 0x87, 0xb4, 0xd6, 0xca, 0x80, 0x0e, 0x28, 0x4f, 0x31, 0xd2, 0x6f, 0x59, 0x76, 0x4b, 0x1d, + 0x50, 0x3a, 0xf0, 0x5c, 0x83, 0x5b, 0x56, 0xdc, 0x37, 0x18, 0xf1, 0xdd, 0x88, 0x61, 0x3f, 0x84, + 0x04, 0xc5, 0xa6, 0x91, 0x4f, 0x23, 0xc3, 0xc2, 0x91, 0x5b, 0xb4, 0xb4, 0x29, 0x09, 0xb2, 0xb8, + 0xf6, 0x55, 0x44, 0x37, 0x77, 0xe3, 0x61, 0xe8, 0xc5, 0x51, 0x07, 0x88, 0x48, 0x8f, 0x11, 0x02, + 0x52, 0x3d, 0xe2, 0xc8, 0xc2, 0xba, 0xd0, 0x9e, 0xef, 0xac, 0x8e, 0x13, 0xb5, 0x79, 0x88, 0x7d, + 0xef, 0x89, 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5b, 0x98, 0x44, 0x6e, 0x07, 0xc8, 0xb5, 0x32, 0x72, 0x17, 0x60, 0x4c, 0xc5, 0xad, 0x99, 0x01, + 0x9c, 0xa5, 0x56, 0xde, 0xad, 0x38, 0xe9, 0x6e, 0x2f, 0x6f, 0xe9, 0xbf, 0x6e, 0xa9, 0xb3, 0x7b, + 0xfc, 0x5b, 0xa9, 0x7d, 0x1b, 0x29, 0xb5, 0xe3, 0x91, 0x22, 0x9c, 0x8c, 0x14, 0xe1, 0xd7, 0x48, + 0x11, 0x8e, 0x4e, 0x95, 0xda, 0xc9, 0xa9, 0x52, 0xfb, 0x71, 0xaa, 0xd4, 0x5e, 0x6f, 0x56, 0x16, + 0x96, 0x3e, 0x09, 0x37, 0x68, 0xbf, 0x4f, 0x6c, 0x82, 0x3d, 0xb0, 0x8d, 0xf2, 0x2d, 0xc9, 0xf7, + 0x67, 0x89, 0x7c, 0xb2, 0x8f, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x0e, 0x99, 0xf1, 0x6a, + 0x0a, 0x00, 0x00, +} + +func (m *SurplusBiddings) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SurplusBiddings) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SurplusBiddings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppId != 0 { + i = encodeVarintBiddings(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x50 + } + if m.AuctionMappingId != 0 { + i = encodeVarintBiddings(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x48 + } + if len(m.BiddingStatus) > 0 { + i -= len(m.BiddingStatus) + copy(dAtA[i:], m.BiddingStatus) + i = encodeVarintBiddings(dAtA, i, uint64(len(m.BiddingStatus))) + i-- + dAtA[i] = 0x42 + } + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BiddingTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintBiddings(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x3a + { + size, err := m.Bid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBiddings(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintBiddings(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x2a + } + { + size, err := m.AuctionedCollateral.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBiddings(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.AuctionStatus) > 0 { + i -= len(m.AuctionStatus) + copy(dAtA[i:], m.AuctionStatus) + i = encodeVarintBiddings(dAtA, i, uint64(len(m.AuctionStatus))) + i-- + dAtA[i] = 0x1a + } + if m.AuctionId != 0 { + i = encodeVarintBiddings(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x10 + } + if m.BiddingId != 0 { + i = encodeVarintBiddings(dAtA, i, uint64(m.BiddingId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DebtBiddings) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DebtBiddings) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DebtBiddings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppId != 0 { + i = encodeVarintBiddings(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x50 + } + if m.AuctionMappingId != 0 { + i = encodeVarintBiddings(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x48 + } + if len(m.BiddingStatus) > 0 { + i -= len(m.BiddingStatus) + copy(dAtA[i:], m.BiddingStatus) + i = encodeVarintBiddings(dAtA, i, uint64(len(m.BiddingStatus))) + i-- + dAtA[i] = 0x42 + } + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BiddingTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintBiddings(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x3a + { + size, err := m.Bid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBiddings(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintBiddings(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x2a + } + { + size, err := m.OutflowTokens.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBiddings(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.AuctionStatus) > 0 { + i -= len(m.AuctionStatus) + copy(dAtA[i:], m.AuctionStatus) + i = encodeVarintBiddings(dAtA, i, uint64(len(m.AuctionStatus))) + i-- + dAtA[i] = 0x1a + } + if m.AuctionId != 0 { + i = encodeVarintBiddings(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x10 + } + if m.BiddingId != 0 { + i = encodeVarintBiddings(dAtA, i, uint64(m.BiddingId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DutchBiddings) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DutchBiddings) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DutchBiddings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppId != 0 { + i = encodeVarintBiddings(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x50 + } + if m.AuctionMappingId != 0 { + i = encodeVarintBiddings(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x48 + } + if len(m.BiddingStatus) > 0 { + i -= len(m.BiddingStatus) + copy(dAtA[i:], m.BiddingStatus) + i = encodeVarintBiddings(dAtA, i, uint64(len(m.BiddingStatus))) + i-- + dAtA[i] = 0x42 + } + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BiddingTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintBiddings(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x3a + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintBiddings(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x32 + } + { + size, err := m.InflowTokenAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBiddings(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size, err := m.OutflowTokenAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBiddings(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.AuctionStatus) > 0 { + i -= len(m.AuctionStatus) + copy(dAtA[i:], m.AuctionStatus) + i = encodeVarintBiddings(dAtA, i, uint64(len(m.AuctionStatus))) + i-- + dAtA[i] = 0x1a + } + if m.AuctionId != 0 { + i = encodeVarintBiddings(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x10 + } + if m.BiddingId != 0 { + i = encodeVarintBiddings(dAtA, i, uint64(m.BiddingId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintBiddings(dAtA []byte, offset int, v uint64) int { + offset -= sovBiddings(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SurplusBiddings) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BiddingId != 0 { + n += 1 + sovBiddings(uint64(m.BiddingId)) + } + if m.AuctionId != 0 { + n += 1 + sovBiddings(uint64(m.AuctionId)) + } + l = len(m.AuctionStatus) + if l > 0 { + n += 1 + l + sovBiddings(uint64(l)) + } + l = m.AuctionedCollateral.Size() + n += 1 + l + sovBiddings(uint64(l)) + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovBiddings(uint64(l)) + } + l = m.Bid.Size() + n += 1 + l + sovBiddings(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp) + n += 1 + l + sovBiddings(uint64(l)) + l = len(m.BiddingStatus) + if l > 0 { + n += 1 + l + sovBiddings(uint64(l)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovBiddings(uint64(m.AuctionMappingId)) + } + if m.AppId != 0 { + n += 1 + sovBiddings(uint64(m.AppId)) + } + return n +} + +func (m *DebtBiddings) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BiddingId != 0 { + n += 1 + sovBiddings(uint64(m.BiddingId)) + } + if m.AuctionId != 0 { + n += 1 + sovBiddings(uint64(m.AuctionId)) + } + l = len(m.AuctionStatus) + if l > 0 { + n += 1 + l + sovBiddings(uint64(l)) + } + l = m.OutflowTokens.Size() + n += 1 + l + sovBiddings(uint64(l)) + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovBiddings(uint64(l)) + } + l = m.Bid.Size() + n += 1 + l + sovBiddings(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp) + n += 1 + l + sovBiddings(uint64(l)) + l = len(m.BiddingStatus) + if l > 0 { + n += 1 + l + sovBiddings(uint64(l)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovBiddings(uint64(m.AuctionMappingId)) + } + if m.AppId != 0 { + n += 1 + sovBiddings(uint64(m.AppId)) + } + return n +} + +func (m *DutchBiddings) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BiddingId != 0 { + n += 1 + sovBiddings(uint64(m.BiddingId)) + } + if m.AuctionId != 0 { + n += 1 + sovBiddings(uint64(m.AuctionId)) + } + l = len(m.AuctionStatus) + if l > 0 { + n += 1 + l + sovBiddings(uint64(l)) + } + l = m.OutflowTokenAmount.Size() + n += 1 + l + sovBiddings(uint64(l)) + l = m.InflowTokenAmount.Size() + n += 1 + l + sovBiddings(uint64(l)) + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovBiddings(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp) + n += 1 + l + sovBiddings(uint64(l)) + l = len(m.BiddingStatus) + if l > 0 { + n += 1 + l + sovBiddings(uint64(l)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovBiddings(uint64(m.AuctionMappingId)) + } + if m.AppId != 0 { + n += 1 + sovBiddings(uint64(m.AppId)) + } + return n +} + +func sovBiddings(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBiddings(x uint64) (n int) { + return sovBiddings(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SurplusBiddings) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SurplusBiddings: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SurplusBiddings: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingId", wireType) + } + m.BiddingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BiddingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + 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 ErrInvalidLengthBiddings + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuctionStatus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionedCollateral", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBiddings + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AuctionedCollateral.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + 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 ErrInvalidLengthBiddings + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBiddings + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingTimestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBiddings + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BiddingTimestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingStatus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + 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 ErrInvalidLengthBiddings + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BiddingStatus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipBiddings(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBiddings + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DebtBiddings) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DebtBiddings: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DebtBiddings: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingId", wireType) + } + m.BiddingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BiddingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + 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 ErrInvalidLengthBiddings + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuctionStatus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokens", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBiddings + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OutflowTokens.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + 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 ErrInvalidLengthBiddings + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBiddings + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingTimestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBiddings + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BiddingTimestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingStatus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + 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 ErrInvalidLengthBiddings + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BiddingStatus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipBiddings(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBiddings + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DutchBiddings) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DutchBiddings: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DutchBiddings: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingId", wireType) + } + m.BiddingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BiddingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + 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 ErrInvalidLengthBiddings + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuctionStatus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBiddings + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OutflowTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBiddings + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InflowTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + 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 ErrInvalidLengthBiddings + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingTimestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBiddings + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BiddingTimestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BiddingStatus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + 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 ErrInvalidLengthBiddings + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBiddings + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BiddingStatus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBiddings + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipBiddings(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBiddings + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBiddings(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBiddings + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBiddings + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBiddings + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthBiddings + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBiddings + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBiddings + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBiddings = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBiddings = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBiddings = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/auction/types/genesis.pb.go b/github.com/comdex-official/comdex/x/auction/types/genesis.pb.go new file mode 100644 index 000000000..99082bc32 --- /dev/null +++ b/github.com/comdex-official/comdex/x/auction/types/genesis.pb.go @@ -0,0 +1,745 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/auction/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type GenesisState struct { + SurplusAuction []SurplusAuction `protobuf:"bytes,1,rep,name=surplusAuction,proto3" json:"surplusAuction" yaml:"surplusAuction"` + DebtAuction []DebtAuction `protobuf:"bytes,2,rep,name=debtAuction,proto3" json:"debtAuction" yaml:"debtAuction"` + DutchAuction []DutchAuction `protobuf:"bytes,3,rep,name=dutchAuction,proto3" json:"dutchAuction" yaml:"dutchAuction"` + ProtocolStatistics []ProtocolStatistics `protobuf:"bytes,4,rep,name=protocolStatistics,proto3" json:"protocolStatistics" yaml:"protocolStatistics"` + AuctionParams []AuctionParams `protobuf:"bytes,5,rep,name=auctionParams,proto3" json:"auctionParams" yaml:"auctionParams"` + DutchLendAuction []DutchAuction `protobuf:"bytes,6,rep,name=dutchLendAuction,proto3" json:"dutchLendAuction" yaml:"dutchLendAuction"` + Params Params `protobuf:"bytes,7,opt,name=params,proto3" json:"params"` + UserBiddingID uint64 `protobuf:"varint,8,opt,name=UserBiddingID,proto3" json:"UserBiddingID,omitempty"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_49088f171dd3086d, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetSurplusAuction() []SurplusAuction { + if m != nil { + return m.SurplusAuction + } + return nil +} + +func (m *GenesisState) GetDebtAuction() []DebtAuction { + if m != nil { + return m.DebtAuction + } + return nil +} + +func (m *GenesisState) GetDutchAuction() []DutchAuction { + if m != nil { + return m.DutchAuction + } + return nil +} + +func (m *GenesisState) GetProtocolStatistics() []ProtocolStatistics { + if m != nil { + return m.ProtocolStatistics + } + return nil +} + +func (m *GenesisState) GetAuctionParams() []AuctionParams { + if m != nil { + return m.AuctionParams + } + return nil +} + +func (m *GenesisState) GetDutchLendAuction() []DutchAuction { + if m != nil { + return m.DutchLendAuction + } + return nil +} + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetUserBiddingID() uint64 { + if m != nil { + return m.UserBiddingID + } + return 0 +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "comdex.auction.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("comdex/auction/v1beta1/genesis.proto", fileDescriptor_49088f171dd3086d) +} + +var fileDescriptor_49088f171dd3086d = []byte{ + // 455 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 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x87, 0x23, 0xf7, 0xee, 0xc4, 0x99, 0xf5, + 0x71, 0xf7, 0x61, 0xf8, 0xf1, 0x62, 0xe9, 0x39, 0x97, 0x4b, 0xcf, 0xf9, 0xb3, 0xf4, 0x9c, 0x5f, + 0x2b, 0xaf, 0x77, 0xb9, 0xf2, 0x7a, 0xbf, 0x57, 0x5e, 0xef, 0xcb, 0x3c, 0x65, 0xf2, 0xac, 0x8a, + 0x6a, 0x67, 0xa0, 0xbd, 0xaf, 0xf9, 0xe9, 0x29, 0x8b, 0x19, 0x59, 0x98, 0xfb, 0xe0, 0xfa, 0xa0, + 0xc9, 0xf3, 0x82, 0x8a, 0x68, 0xa0, 0x7e, 0xd1, 0x9b, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf3, + 0xf6, 0xde, 0xc2, 0x26, 0x04, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UserBiddingID != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.UserBiddingID)) + i-- + dAtA[i] = 0x40 + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.DutchLendAuction) > 0 { + for iNdEx := len(m.DutchLendAuction) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DutchLendAuction[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.AuctionParams) > 0 { + for iNdEx := len(m.AuctionParams) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AuctionParams[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.ProtocolStatistics) > 0 { + for iNdEx := len(m.ProtocolStatistics) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ProtocolStatistics[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.DutchAuction) > 0 { + for iNdEx := len(m.DutchAuction) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DutchAuction[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.DebtAuction) > 0 { + for iNdEx := len(m.DebtAuction) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DebtAuction[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.SurplusAuction) > 0 { + for iNdEx := len(m.SurplusAuction) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SurplusAuction[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SurplusAuction) > 0 { + for _, e := range m.SurplusAuction { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.DebtAuction) > 0 { + for _, e := range m.DebtAuction { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.DutchAuction) > 0 { + for _, e := range m.DutchAuction { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.ProtocolStatistics) > 0 { + for _, e := range m.ProtocolStatistics { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.AuctionParams) > 0 { + for _, e := range m.AuctionParams { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.DutchLendAuction) > 0 { + for _, e := range m.DutchLendAuction { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if m.UserBiddingID != 0 { + n += 1 + sovGenesis(uint64(m.UserBiddingID)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SurplusAuction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SurplusAuction = append(m.SurplusAuction, SurplusAuction{}) + if err := m.SurplusAuction[len(m.SurplusAuction)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtAuction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DebtAuction = append(m.DebtAuction, DebtAuction{}) + if err := m.DebtAuction[len(m.DebtAuction)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DutchAuction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DutchAuction = append(m.DutchAuction, DutchAuction{}) + if err := m.DutchAuction[len(m.DutchAuction)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProtocolStatistics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProtocolStatistics = append(m.ProtocolStatistics, ProtocolStatistics{}) + if err := m.ProtocolStatistics[len(m.ProtocolStatistics)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuctionParams = append(m.AuctionParams, AuctionParams{}) + if err := m.AuctionParams[len(m.AuctionParams)-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 DutchLendAuction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DutchLendAuction = append(m.DutchLendAuction, DutchAuction{}) + if err := m.DutchLendAuction[len(m.DutchLendAuction)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserBiddingID", wireType) + } + m.UserBiddingID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserBiddingID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/auction/types/params.pb.go b/github.com/comdex-official/comdex/x/auction/types/params.pb.go new file mode 100644 index 000000000..e1c743254 --- /dev/null +++ b/github.com/comdex-official/comdex/x/auction/types/params.pb.go @@ -0,0 +1,265 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/auction/v1beta1/params.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_4370eec7f59a9a46, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "comdex.auction.v1beta1.Params") +} + +func init() { + proto.RegisterFile("comdex/auction/v1beta1/params.proto", fileDescriptor_4370eec7f59a9a46) +} + +var fileDescriptor_4370eec7f59a9a46 = []byte{ + // 145 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, + 0x49, 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x83, 0x28, 0xd2, 0x83, 0x2a, 0xd2, 0x83, 0x2a, 0x52, 0xe2, 0xe0, 0x62, 0x0b, 0x00, 0xab, + 0x73, 0xf2, 0x3e, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, + 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xc3, 0xf4, 0xcc, + 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, 0x31, 0xba, 0xf9, 0x69, 0x69, 0x99, + 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0xc2, 0xf6, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, + 0xb0, 0xad, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x3e, 0xe4, 0x24, 0x9c, 0x00, 0x00, + 0x00, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/auction/types/query.pb.go b/github.com/comdex-official/comdex/x/auction/types/query.pb.go new file mode 100644 index 000000000..4017bc744 --- /dev/null +++ b/github.com/comdex-official/comdex/x/auction/types/query.pb.go @@ -0,0 +1,8289 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/auction/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type QuerySurplusAuctionRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + AuctionMappingId uint64 `protobuf:"varint,2,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` + AuctionId uint64 `protobuf:"varint,3,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + History bool `protobuf:"varint,4,opt,name=history,proto3" json:"history,omitempty"` +} + +func (m *QuerySurplusAuctionRequest) Reset() { *m = QuerySurplusAuctionRequest{} } +func (m *QuerySurplusAuctionRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySurplusAuctionRequest) ProtoMessage() {} +func (*QuerySurplusAuctionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{0} +} +func (m *QuerySurplusAuctionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySurplusAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySurplusAuctionRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySurplusAuctionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySurplusAuctionRequest.Merge(m, src) +} +func (m *QuerySurplusAuctionRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySurplusAuctionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySurplusAuctionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySurplusAuctionRequest proto.InternalMessageInfo + +type QuerySurplusAuctionResponse struct { + Auction SurplusAuction `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction" yaml:"auction"` +} + +func (m *QuerySurplusAuctionResponse) Reset() { *m = QuerySurplusAuctionResponse{} } +func (m *QuerySurplusAuctionResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySurplusAuctionResponse) ProtoMessage() {} +func (*QuerySurplusAuctionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{1} +} +func (m *QuerySurplusAuctionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySurplusAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySurplusAuctionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySurplusAuctionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySurplusAuctionResponse.Merge(m, src) +} +func (m *QuerySurplusAuctionResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySurplusAuctionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySurplusAuctionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySurplusAuctionResponse proto.InternalMessageInfo + +type QuerySurplusAuctionsRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + History bool `protobuf:"varint,2,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QuerySurplusAuctionsRequest) Reset() { *m = QuerySurplusAuctionsRequest{} } +func (m *QuerySurplusAuctionsRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySurplusAuctionsRequest) ProtoMessage() {} +func (*QuerySurplusAuctionsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{2} +} +func (m *QuerySurplusAuctionsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySurplusAuctionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySurplusAuctionsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySurplusAuctionsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySurplusAuctionsRequest.Merge(m, src) +} +func (m *QuerySurplusAuctionsRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySurplusAuctionsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySurplusAuctionsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySurplusAuctionsRequest proto.InternalMessageInfo + +type QuerySurplusAuctionsResponse struct { + Auctions []SurplusAuction `protobuf:"bytes,1,rep,name=auctions,proto3" json:"auctions" yaml:"auctions"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QuerySurplusAuctionsResponse) Reset() { *m = QuerySurplusAuctionsResponse{} } +func (m *QuerySurplusAuctionsResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySurplusAuctionsResponse) ProtoMessage() {} +func (*QuerySurplusAuctionsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{3} +} +func (m *QuerySurplusAuctionsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySurplusAuctionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySurplusAuctionsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySurplusAuctionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySurplusAuctionsResponse.Merge(m, src) +} +func (m *QuerySurplusAuctionsResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySurplusAuctionsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySurplusAuctionsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySurplusAuctionsResponse proto.InternalMessageInfo + +type QuerySurplusBiddingsRequest struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + History bool `protobuf:"varint,3,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QuerySurplusBiddingsRequest) Reset() { *m = QuerySurplusBiddingsRequest{} } +func (m *QuerySurplusBiddingsRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySurplusBiddingsRequest) ProtoMessage() {} +func (*QuerySurplusBiddingsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{4} +} +func (m *QuerySurplusBiddingsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySurplusBiddingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySurplusBiddingsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySurplusBiddingsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySurplusBiddingsRequest.Merge(m, src) +} +func (m *QuerySurplusBiddingsRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySurplusBiddingsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySurplusBiddingsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySurplusBiddingsRequest proto.InternalMessageInfo + +type QuerySurplusBiddingsResponse struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` + Biddings []SurplusBiddings `protobuf:"bytes,2,rep,name=biddings,proto3" json:"biddings" yaml:"biddings"` + Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QuerySurplusBiddingsResponse) Reset() { *m = QuerySurplusBiddingsResponse{} } +func (m *QuerySurplusBiddingsResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySurplusBiddingsResponse) ProtoMessage() {} +func (*QuerySurplusBiddingsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{5} +} +func (m *QuerySurplusBiddingsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySurplusBiddingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySurplusBiddingsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySurplusBiddingsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySurplusBiddingsResponse.Merge(m, src) +} +func (m *QuerySurplusBiddingsResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySurplusBiddingsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySurplusBiddingsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySurplusBiddingsResponse proto.InternalMessageInfo + +type QueryDebtAuctionRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + AuctionMappingId uint64 `protobuf:"varint,2,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` + AuctionId uint64 `protobuf:"varint,3,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + History bool `protobuf:"varint,4,opt,name=history,proto3" json:"history,omitempty"` +} + +func (m *QueryDebtAuctionRequest) Reset() { *m = QueryDebtAuctionRequest{} } +func (m *QueryDebtAuctionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDebtAuctionRequest) ProtoMessage() {} +func (*QueryDebtAuctionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{6} +} +func (m *QueryDebtAuctionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDebtAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDebtAuctionRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDebtAuctionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDebtAuctionRequest.Merge(m, src) +} +func (m *QueryDebtAuctionRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDebtAuctionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDebtAuctionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDebtAuctionRequest proto.InternalMessageInfo + +type QueryDebtAuctionResponse struct { + Auction DebtAuction `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction" yaml:"auction"` + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryDebtAuctionResponse) Reset() { *m = QueryDebtAuctionResponse{} } +func (m *QueryDebtAuctionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDebtAuctionResponse) ProtoMessage() {} +func (*QueryDebtAuctionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{7} +} +func (m *QueryDebtAuctionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDebtAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDebtAuctionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDebtAuctionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDebtAuctionResponse.Merge(m, src) +} +func (m *QueryDebtAuctionResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDebtAuctionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDebtAuctionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDebtAuctionResponse proto.InternalMessageInfo + +type QueryDebtAuctionsRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + History bool `protobuf:"varint,2,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryDebtAuctionsRequest) Reset() { *m = QueryDebtAuctionsRequest{} } +func (m *QueryDebtAuctionsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDebtAuctionsRequest) ProtoMessage() {} +func (*QueryDebtAuctionsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{8} +} +func (m *QueryDebtAuctionsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDebtAuctionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDebtAuctionsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDebtAuctionsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDebtAuctionsRequest.Merge(m, src) +} +func (m *QueryDebtAuctionsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDebtAuctionsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDebtAuctionsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDebtAuctionsRequest proto.InternalMessageInfo + +type QueryDebtAuctionsResponse struct { + Auctions []DebtAuction `protobuf:"bytes,1,rep,name=auctions,proto3" json:"auctions" yaml:"auctions"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryDebtAuctionsResponse) Reset() { *m = QueryDebtAuctionsResponse{} } +func (m *QueryDebtAuctionsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDebtAuctionsResponse) ProtoMessage() {} +func (*QueryDebtAuctionsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{9} +} +func (m *QueryDebtAuctionsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDebtAuctionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDebtAuctionsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDebtAuctionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDebtAuctionsResponse.Merge(m, src) +} +func (m *QueryDebtAuctionsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDebtAuctionsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDebtAuctionsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDebtAuctionsResponse proto.InternalMessageInfo + +type QueryDebtBiddingsRequest struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + History bool `protobuf:"varint,3,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryDebtBiddingsRequest) Reset() { *m = QueryDebtBiddingsRequest{} } +func (m *QueryDebtBiddingsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDebtBiddingsRequest) ProtoMessage() {} +func (*QueryDebtBiddingsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{10} +} +func (m *QueryDebtBiddingsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDebtBiddingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDebtBiddingsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDebtBiddingsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDebtBiddingsRequest.Merge(m, src) +} +func (m *QueryDebtBiddingsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDebtBiddingsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDebtBiddingsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDebtBiddingsRequest proto.InternalMessageInfo + +type QueryDebtBiddingsResponse struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` + Biddings []DebtBiddings `protobuf:"bytes,2,rep,name=biddings,proto3" json:"biddings" yaml:"biddings"` + Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryDebtBiddingsResponse) Reset() { *m = QueryDebtBiddingsResponse{} } +func (m *QueryDebtBiddingsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDebtBiddingsResponse) ProtoMessage() {} +func (*QueryDebtBiddingsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{11} +} +func (m *QueryDebtBiddingsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDebtBiddingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDebtBiddingsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDebtBiddingsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDebtBiddingsResponse.Merge(m, src) +} +func (m *QueryDebtBiddingsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDebtBiddingsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDebtBiddingsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDebtBiddingsResponse proto.InternalMessageInfo + +type QueryDutchAuctionRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + AuctionMappingId uint64 `protobuf:"varint,2,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` + AuctionId uint64 `protobuf:"varint,3,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + History bool `protobuf:"varint,4,opt,name=history,proto3" json:"history,omitempty"` +} + +func (m *QueryDutchAuctionRequest) Reset() { *m = QueryDutchAuctionRequest{} } +func (m *QueryDutchAuctionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDutchAuctionRequest) ProtoMessage() {} +func (*QueryDutchAuctionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{12} +} +func (m *QueryDutchAuctionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDutchAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDutchAuctionRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDutchAuctionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDutchAuctionRequest.Merge(m, src) +} +func (m *QueryDutchAuctionRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDutchAuctionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDutchAuctionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDutchAuctionRequest proto.InternalMessageInfo + +type QueryDutchAuctionResponse struct { + Auction DutchAuction `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction" yaml:"auction"` +} + +func (m *QueryDutchAuctionResponse) Reset() { *m = QueryDutchAuctionResponse{} } +func (m *QueryDutchAuctionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDutchAuctionResponse) ProtoMessage() {} +func (*QueryDutchAuctionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{13} +} +func (m *QueryDutchAuctionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDutchAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDutchAuctionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDutchAuctionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDutchAuctionResponse.Merge(m, src) +} +func (m *QueryDutchAuctionResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDutchAuctionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDutchAuctionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDutchAuctionResponse proto.InternalMessageInfo + +type QueryDutchAuctionsRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + History bool `protobuf:"varint,2,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryDutchAuctionsRequest) Reset() { *m = QueryDutchAuctionsRequest{} } +func (m *QueryDutchAuctionsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDutchAuctionsRequest) ProtoMessage() {} +func (*QueryDutchAuctionsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{14} +} +func (m *QueryDutchAuctionsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDutchAuctionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDutchAuctionsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDutchAuctionsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDutchAuctionsRequest.Merge(m, src) +} +func (m *QueryDutchAuctionsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDutchAuctionsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDutchAuctionsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDutchAuctionsRequest proto.InternalMessageInfo + +type QueryDutchAuctionsResponse struct { + Auctions []DutchAuction `protobuf:"bytes,1,rep,name=auctions,proto3" json:"auctions" yaml:"auctions"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryDutchAuctionsResponse) Reset() { *m = QueryDutchAuctionsResponse{} } +func (m *QueryDutchAuctionsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDutchAuctionsResponse) ProtoMessage() {} +func (*QueryDutchAuctionsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{15} +} +func (m *QueryDutchAuctionsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDutchAuctionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDutchAuctionsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDutchAuctionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDutchAuctionsResponse.Merge(m, src) +} +func (m *QueryDutchAuctionsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDutchAuctionsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDutchAuctionsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDutchAuctionsResponse proto.InternalMessageInfo + +type QueryDutchBiddingsRequest struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + History bool `protobuf:"varint,3,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryDutchBiddingsRequest) Reset() { *m = QueryDutchBiddingsRequest{} } +func (m *QueryDutchBiddingsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDutchBiddingsRequest) ProtoMessage() {} +func (*QueryDutchBiddingsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{16} +} +func (m *QueryDutchBiddingsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDutchBiddingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDutchBiddingsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDutchBiddingsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDutchBiddingsRequest.Merge(m, src) +} +func (m *QueryDutchBiddingsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDutchBiddingsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDutchBiddingsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDutchBiddingsRequest proto.InternalMessageInfo + +type QueryDutchBiddingsResponse struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` + Biddings []DutchBiddings `protobuf:"bytes,2,rep,name=biddings,proto3" json:"biddings" yaml:"biddings"` + Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryDutchBiddingsResponse) Reset() { *m = QueryDutchBiddingsResponse{} } +func (m *QueryDutchBiddingsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDutchBiddingsResponse) ProtoMessage() {} +func (*QueryDutchBiddingsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{17} +} +func (m *QueryDutchBiddingsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDutchBiddingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDutchBiddingsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDutchBiddingsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDutchBiddingsResponse.Merge(m, src) +} +func (m *QueryDutchBiddingsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDutchBiddingsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDutchBiddingsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDutchBiddingsResponse proto.InternalMessageInfo + +type QueryBiddingsForSurplusAuctionRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + AuctionMappingId uint64 `protobuf:"varint,2,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` + AuctionId uint64 `protobuf:"varint,3,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + History bool `protobuf:"varint,4,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,5,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryBiddingsForSurplusAuctionRequest) Reset() { *m = QueryBiddingsForSurplusAuctionRequest{} } +func (m *QueryBiddingsForSurplusAuctionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBiddingsForSurplusAuctionRequest) ProtoMessage() {} +func (*QueryBiddingsForSurplusAuctionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{18} +} +func (m *QueryBiddingsForSurplusAuctionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBiddingsForSurplusAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBiddingsForSurplusAuctionRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBiddingsForSurplusAuctionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBiddingsForSurplusAuctionRequest.Merge(m, src) +} +func (m *QueryBiddingsForSurplusAuctionRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBiddingsForSurplusAuctionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBiddingsForSurplusAuctionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBiddingsForSurplusAuctionRequest proto.InternalMessageInfo + +type QueryBiddingsForSurplusAuctionResponse struct { + Biddings []SurplusBiddings `protobuf:"bytes,1,rep,name=biddings,proto3" json:"biddings" yaml:"biddings"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryBiddingsForSurplusAuctionResponse) Reset() { + *m = QueryBiddingsForSurplusAuctionResponse{} +} +func (m *QueryBiddingsForSurplusAuctionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBiddingsForSurplusAuctionResponse) ProtoMessage() {} +func (*QueryBiddingsForSurplusAuctionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{19} +} +func (m *QueryBiddingsForSurplusAuctionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBiddingsForSurplusAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBiddingsForSurplusAuctionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBiddingsForSurplusAuctionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBiddingsForSurplusAuctionResponse.Merge(m, src) +} +func (m *QueryBiddingsForSurplusAuctionResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBiddingsForSurplusAuctionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBiddingsForSurplusAuctionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBiddingsForSurplusAuctionResponse proto.InternalMessageInfo + +type QueryProtocolStatisticsRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryProtocolStatisticsRequest) Reset() { *m = QueryProtocolStatisticsRequest{} } +func (m *QueryProtocolStatisticsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProtocolStatisticsRequest) ProtoMessage() {} +func (*QueryProtocolStatisticsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{20} +} +func (m *QueryProtocolStatisticsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProtocolStatisticsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProtocolStatisticsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProtocolStatisticsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProtocolStatisticsRequest.Merge(m, src) +} +func (m *QueryProtocolStatisticsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProtocolStatisticsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProtocolStatisticsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProtocolStatisticsRequest proto.InternalMessageInfo + +type QueryProtocolStatisticsResponse struct { + Stats []ProtocolStatistics `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats" yaml:"ProtocolStatistics"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryProtocolStatisticsResponse) Reset() { *m = QueryProtocolStatisticsResponse{} } +func (m *QueryProtocolStatisticsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProtocolStatisticsResponse) ProtoMessage() {} +func (*QueryProtocolStatisticsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{21} +} +func (m *QueryProtocolStatisticsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProtocolStatisticsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProtocolStatisticsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProtocolStatisticsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProtocolStatisticsResponse.Merge(m, src) +} +func (m *QueryProtocolStatisticsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProtocolStatisticsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProtocolStatisticsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProtocolStatisticsResponse proto.InternalMessageInfo + +type QueryGenericAuctionParamRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` +} + +func (m *QueryGenericAuctionParamRequest) Reset() { *m = QueryGenericAuctionParamRequest{} } +func (m *QueryGenericAuctionParamRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGenericAuctionParamRequest) ProtoMessage() {} +func (*QueryGenericAuctionParamRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{22} +} +func (m *QueryGenericAuctionParamRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGenericAuctionParamRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGenericAuctionParamRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGenericAuctionParamRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGenericAuctionParamRequest.Merge(m, src) +} +func (m *QueryGenericAuctionParamRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGenericAuctionParamRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGenericAuctionParamRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGenericAuctionParamRequest proto.InternalMessageInfo + +type QueryGenericAuctionParamResponse struct { + AuctionParams AuctionParams `protobuf:"bytes,1,opt,name=auctionParams,proto3" json:"auctionParams" yaml:"auction_params"` +} + +func (m *QueryGenericAuctionParamResponse) Reset() { *m = QueryGenericAuctionParamResponse{} } +func (m *QueryGenericAuctionParamResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGenericAuctionParamResponse) ProtoMessage() {} +func (*QueryGenericAuctionParamResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{23} +} +func (m *QueryGenericAuctionParamResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGenericAuctionParamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGenericAuctionParamResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGenericAuctionParamResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGenericAuctionParamResponse.Merge(m, src) +} +func (m *QueryGenericAuctionParamResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGenericAuctionParamResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGenericAuctionParamResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGenericAuctionParamResponse proto.InternalMessageInfo + +type QueryDutchLendAuctionRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + AuctionMappingId uint64 `protobuf:"varint,2,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` + AuctionId uint64 `protobuf:"varint,3,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + History bool `protobuf:"varint,4,opt,name=history,proto3" json:"history,omitempty"` +} + +func (m *QueryDutchLendAuctionRequest) Reset() { *m = QueryDutchLendAuctionRequest{} } +func (m *QueryDutchLendAuctionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDutchLendAuctionRequest) ProtoMessage() {} +func (*QueryDutchLendAuctionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{24} +} +func (m *QueryDutchLendAuctionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDutchLendAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDutchLendAuctionRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDutchLendAuctionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDutchLendAuctionRequest.Merge(m, src) +} +func (m *QueryDutchLendAuctionRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDutchLendAuctionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDutchLendAuctionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDutchLendAuctionRequest proto.InternalMessageInfo + +type QueryDutchLendAuctionResponse struct { + Auction DutchAuction `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction" yaml:"auction"` +} + +func (m *QueryDutchLendAuctionResponse) Reset() { *m = QueryDutchLendAuctionResponse{} } +func (m *QueryDutchLendAuctionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDutchLendAuctionResponse) ProtoMessage() {} +func (*QueryDutchLendAuctionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{25} +} +func (m *QueryDutchLendAuctionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDutchLendAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDutchLendAuctionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDutchLendAuctionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDutchLendAuctionResponse.Merge(m, src) +} +func (m *QueryDutchLendAuctionResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDutchLendAuctionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDutchLendAuctionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDutchLendAuctionResponse proto.InternalMessageInfo + +type QueryDutchLendAuctionsRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + History bool `protobuf:"varint,2,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryDutchLendAuctionsRequest) Reset() { *m = QueryDutchLendAuctionsRequest{} } +func (m *QueryDutchLendAuctionsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDutchLendAuctionsRequest) ProtoMessage() {} +func (*QueryDutchLendAuctionsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{26} +} +func (m *QueryDutchLendAuctionsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDutchLendAuctionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDutchLendAuctionsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDutchLendAuctionsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDutchLendAuctionsRequest.Merge(m, src) +} +func (m *QueryDutchLendAuctionsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDutchLendAuctionsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDutchLendAuctionsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDutchLendAuctionsRequest proto.InternalMessageInfo + +type QueryDutchLendAuctionsResponse struct { + Auctions []DutchAuction `protobuf:"bytes,1,rep,name=auctions,proto3" json:"auctions" yaml:"auctions"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryDutchLendAuctionsResponse) Reset() { *m = QueryDutchLendAuctionsResponse{} } +func (m *QueryDutchLendAuctionsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDutchLendAuctionsResponse) ProtoMessage() {} +func (*QueryDutchLendAuctionsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{27} +} +func (m *QueryDutchLendAuctionsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDutchLendAuctionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDutchLendAuctionsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDutchLendAuctionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDutchLendAuctionsResponse.Merge(m, src) +} +func (m *QueryDutchLendAuctionsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDutchLendAuctionsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDutchLendAuctionsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDutchLendAuctionsResponse proto.InternalMessageInfo + +type QueryDutchLendBiddingsRequest struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + History bool `protobuf:"varint,3,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryDutchLendBiddingsRequest) Reset() { *m = QueryDutchLendBiddingsRequest{} } +func (m *QueryDutchLendBiddingsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDutchLendBiddingsRequest) ProtoMessage() {} +func (*QueryDutchLendBiddingsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{28} +} +func (m *QueryDutchLendBiddingsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDutchLendBiddingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDutchLendBiddingsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDutchLendBiddingsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDutchLendBiddingsRequest.Merge(m, src) +} +func (m *QueryDutchLendBiddingsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDutchLendBiddingsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDutchLendBiddingsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDutchLendBiddingsRequest proto.InternalMessageInfo + +type QueryDutchLendBiddingsResponse struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` + Biddings []DutchBiddings `protobuf:"bytes,2,rep,name=biddings,proto3" json:"biddings" yaml:"biddings"` + Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryDutchLendBiddingsResponse) Reset() { *m = QueryDutchLendBiddingsResponse{} } +func (m *QueryDutchLendBiddingsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDutchLendBiddingsResponse) ProtoMessage() {} +func (*QueryDutchLendBiddingsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{29} +} +func (m *QueryDutchLendBiddingsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDutchLendBiddingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDutchLendBiddingsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDutchLendBiddingsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDutchLendBiddingsResponse.Merge(m, src) +} +func (m *QueryDutchLendBiddingsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDutchLendBiddingsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDutchLendBiddingsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDutchLendBiddingsResponse proto.InternalMessageInfo + +type QueryFilterDutchAuctionsRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + Denom []string `protobuf:"bytes,2,rep,name=denom,proto3" json:"denom,omitempty"` + History bool `protobuf:"varint,3,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryFilterDutchAuctionsRequest) Reset() { *m = QueryFilterDutchAuctionsRequest{} } +func (m *QueryFilterDutchAuctionsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryFilterDutchAuctionsRequest) ProtoMessage() {} +func (*QueryFilterDutchAuctionsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{30} +} +func (m *QueryFilterDutchAuctionsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFilterDutchAuctionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFilterDutchAuctionsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFilterDutchAuctionsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFilterDutchAuctionsRequest.Merge(m, src) +} +func (m *QueryFilterDutchAuctionsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryFilterDutchAuctionsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFilterDutchAuctionsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFilterDutchAuctionsRequest proto.InternalMessageInfo + +type QueryFilterDutchAuctionsResponse struct { + Auctions []DutchAuction `protobuf:"bytes,1,rep,name=auctions,proto3" json:"auctions" yaml:"auctions"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryFilterDutchAuctionsResponse) Reset() { *m = QueryFilterDutchAuctionsResponse{} } +func (m *QueryFilterDutchAuctionsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryFilterDutchAuctionsResponse) ProtoMessage() {} +func (*QueryFilterDutchAuctionsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ff4a64a3f291f95, []int{31} +} +func (m *QueryFilterDutchAuctionsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFilterDutchAuctionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFilterDutchAuctionsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFilterDutchAuctionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFilterDutchAuctionsResponse.Merge(m, src) +} +func (m *QueryFilterDutchAuctionsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryFilterDutchAuctionsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFilterDutchAuctionsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFilterDutchAuctionsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*QuerySurplusAuctionRequest)(nil), "comdex.auction.v1beta1.QuerySurplusAuctionRequest") + proto.RegisterType((*QuerySurplusAuctionResponse)(nil), "comdex.auction.v1beta1.QuerySurplusAuctionResponse") + proto.RegisterType((*QuerySurplusAuctionsRequest)(nil), "comdex.auction.v1beta1.QuerySurplusAuctionsRequest") + proto.RegisterType((*QuerySurplusAuctionsResponse)(nil), "comdex.auction.v1beta1.QuerySurplusAuctionsResponse") + proto.RegisterType((*QuerySurplusBiddingsRequest)(nil), "comdex.auction.v1beta1.QuerySurplusBiddingsRequest") + proto.RegisterType((*QuerySurplusBiddingsResponse)(nil), "comdex.auction.v1beta1.QuerySurplusBiddingsResponse") + proto.RegisterType((*QueryDebtAuctionRequest)(nil), "comdex.auction.v1beta1.QueryDebtAuctionRequest") + proto.RegisterType((*QueryDebtAuctionResponse)(nil), "comdex.auction.v1beta1.QueryDebtAuctionResponse") + proto.RegisterType((*QueryDebtAuctionsRequest)(nil), "comdex.auction.v1beta1.QueryDebtAuctionsRequest") + proto.RegisterType((*QueryDebtAuctionsResponse)(nil), "comdex.auction.v1beta1.QueryDebtAuctionsResponse") + proto.RegisterType((*QueryDebtBiddingsRequest)(nil), "comdex.auction.v1beta1.QueryDebtBiddingsRequest") + proto.RegisterType((*QueryDebtBiddingsResponse)(nil), "comdex.auction.v1beta1.QueryDebtBiddingsResponse") + proto.RegisterType((*QueryDutchAuctionRequest)(nil), "comdex.auction.v1beta1.QueryDutchAuctionRequest") + proto.RegisterType((*QueryDutchAuctionResponse)(nil), "comdex.auction.v1beta1.QueryDutchAuctionResponse") + proto.RegisterType((*QueryDutchAuctionsRequest)(nil), "comdex.auction.v1beta1.QueryDutchAuctionsRequest") + proto.RegisterType((*QueryDutchAuctionsResponse)(nil), "comdex.auction.v1beta1.QueryDutchAuctionsResponse") + proto.RegisterType((*QueryDutchBiddingsRequest)(nil), "comdex.auction.v1beta1.QueryDutchBiddingsRequest") + proto.RegisterType((*QueryDutchBiddingsResponse)(nil), "comdex.auction.v1beta1.QueryDutchBiddingsResponse") + proto.RegisterType((*QueryBiddingsForSurplusAuctionRequest)(nil), "comdex.auction.v1beta1.QueryBiddingsForSurplusAuctionRequest") + proto.RegisterType((*QueryBiddingsForSurplusAuctionResponse)(nil), "comdex.auction.v1beta1.QueryBiddingsForSurplusAuctionResponse") + proto.RegisterType((*QueryProtocolStatisticsRequest)(nil), "comdex.auction.v1beta1.QueryProtocolStatisticsRequest") + proto.RegisterType((*QueryProtocolStatisticsResponse)(nil), "comdex.auction.v1beta1.QueryProtocolStatisticsResponse") + proto.RegisterType((*QueryGenericAuctionParamRequest)(nil), "comdex.auction.v1beta1.QueryGenericAuctionParamRequest") + proto.RegisterType((*QueryGenericAuctionParamResponse)(nil), "comdex.auction.v1beta1.QueryGenericAuctionParamResponse") + proto.RegisterType((*QueryDutchLendAuctionRequest)(nil), "comdex.auction.v1beta1.QueryDutchLendAuctionRequest") + proto.RegisterType((*QueryDutchLendAuctionResponse)(nil), "comdex.auction.v1beta1.QueryDutchLendAuctionResponse") + proto.RegisterType((*QueryDutchLendAuctionsRequest)(nil), "comdex.auction.v1beta1.QueryDutchLendAuctionsRequest") + proto.RegisterType((*QueryDutchLendAuctionsResponse)(nil), "comdex.auction.v1beta1.QueryDutchLendAuctionsResponse") + proto.RegisterType((*QueryDutchLendBiddingsRequest)(nil), "comdex.auction.v1beta1.QueryDutchLendBiddingsRequest") + proto.RegisterType((*QueryDutchLendBiddingsResponse)(nil), "comdex.auction.v1beta1.QueryDutchLendBiddingsResponse") + proto.RegisterType((*QueryFilterDutchAuctionsRequest)(nil), "comdex.auction.v1beta1.QueryFilterDutchAuctionsRequest") + proto.RegisterType((*QueryFilterDutchAuctionsResponse)(nil), "comdex.auction.v1beta1.QueryFilterDutchAuctionsResponse") +} + +func init() { + proto.RegisterFile("comdex/auction/v1beta1/query.proto", fileDescriptor_5ff4a64a3f291f95) +} + +var fileDescriptor_5ff4a64a3f291f95 = []byte{ + // 1478 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x5d, 0x4f, 0x1c, 0x55, + 0x18, 0xde, 0xb3, 0x7c, 0x14, 0x8e, 0xa9, 0x96, 0x23, 0xd0, 0x65, 0x2d, 0x0b, 0x8e, 0xa5, 0xad, + 0x8d, 0xee, 0x16, 0x5a, 0x29, 0x92, 0x46, 0xdb, 0x6d, 0x4b, 0x4b, 0xb4, 0x06, 0x97, 0x68, 0x0a, + 0x88, 0x38, 0xbb, 0x33, 0x2c, 0x63, 0x76, 0x77, 0xa6, 0x3b, 0xb3, 0x2a, 0x21, 0x5c, 0xf8, 0x91, + 0x78, 0x67, 0x4c, 0x4c, 0xd4, 0x18, 0x7f, 0x80, 0xd1, 0x18, 0xaf, 0xbd, 0xf0, 0x06, 0x53, 0xcb, + 0x4d, 0x0d, 0x89, 0xd1, 0x9a, 0x34, 0x25, 0x0a, 0xc6, 0x1b, 0xef, 0xf8, 0x05, 0x66, 0xce, 0x9c, + 0x33, 0x3b, 0x5f, 0x67, 0x3e, 0x02, 0xc4, 0x21, 0xde, 0xed, 0xcc, 0x9e, 0xf7, 0x9d, 0xe7, 0x79, + 0x9f, 0x77, 0x9e, 0x99, 0xf7, 0x0c, 0xe4, 0x4a, 0x72, 0x55, 0x10, 0xdf, 0xc9, 0xf1, 0x8d, 0x92, + 0x26, 0xc9, 0xb5, 0xdc, 0x5b, 0xc3, 0x45, 0x51, 0xe3, 0x87, 0x73, 0xb7, 0x1a, 0x62, 0x7d, 0x39, + 0xab, 0xd4, 0x65, 0x4d, 0x46, 0xbd, 0xc6, 0x9a, 0x2c, 0x59, 0x93, 0x25, 0x6b, 0xd2, 0xdd, 0x65, + 0xb9, 0x2c, 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0x23, 0x26, 0xd7, 0x7c, 0x5a, 0x5e, 0x5c, 0x94, 0x4a, 0x12, 0x5f, 0xa1, 0x18, 0x9a, 0x28, 0xb4, + 0x65, 0x45, 0x54, 0x8b, 0xed, 0xd8, 0xac, 0xce, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xb1, 0xd3, + 0x79, 0x93, 0x8e, 0x25, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + QuerySurplusAuction(ctx context.Context, in *QuerySurplusAuctionRequest, opts ...grpc.CallOption) (*QuerySurplusAuctionResponse, error) + QuerySurplusAuctions(ctx context.Context, in *QuerySurplusAuctionsRequest, opts ...grpc.CallOption) (*QuerySurplusAuctionsResponse, error) + QuerySurplusBiddings(ctx context.Context, in *QuerySurplusBiddingsRequest, opts ...grpc.CallOption) (*QuerySurplusBiddingsResponse, error) + QueryDebtAuction(ctx context.Context, in *QueryDebtAuctionRequest, opts ...grpc.CallOption) (*QueryDebtAuctionResponse, error) + QueryDebtAuctions(ctx context.Context, in *QueryDebtAuctionsRequest, opts ...grpc.CallOption) (*QueryDebtAuctionsResponse, error) + QueryDebtBiddings(ctx context.Context, in *QueryDebtBiddingsRequest, opts ...grpc.CallOption) (*QueryDebtBiddingsResponse, error) + QueryDutchAuction(ctx context.Context, in *QueryDutchAuctionRequest, opts ...grpc.CallOption) (*QueryDutchAuctionResponse, error) + QueryDutchAuctions(ctx context.Context, in *QueryDutchAuctionsRequest, opts ...grpc.CallOption) (*QueryDutchAuctionsResponse, error) + QueryDutchBiddings(ctx context.Context, in *QueryDutchBiddingsRequest, opts ...grpc.CallOption) (*QueryDutchBiddingsResponse, error) + QueryProtocolStatistics(ctx context.Context, in *QueryProtocolStatisticsRequest, opts ...grpc.CallOption) (*QueryProtocolStatisticsResponse, error) + QueryGenericAuctionParams(ctx context.Context, in *QueryGenericAuctionParamRequest, opts ...grpc.CallOption) (*QueryGenericAuctionParamResponse, error) + QueryDutchLendAuction(ctx context.Context, in *QueryDutchLendAuctionRequest, opts ...grpc.CallOption) (*QueryDutchLendAuctionResponse, error) + QueryDutchLendAuctions(ctx context.Context, in *QueryDutchLendAuctionsRequest, opts ...grpc.CallOption) (*QueryDutchLendAuctionsResponse, error) + QueryDutchLendBiddings(ctx context.Context, in *QueryDutchLendBiddingsRequest, opts ...grpc.CallOption) (*QueryDutchLendBiddingsResponse, error) + QueryFilterDutchAuctions(ctx context.Context, in *QueryFilterDutchAuctionsRequest, opts ...grpc.CallOption) (*QueryFilterDutchAuctionsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) QuerySurplusAuction(ctx context.Context, in *QuerySurplusAuctionRequest, opts ...grpc.CallOption) (*QuerySurplusAuctionResponse, error) { + out := new(QuerySurplusAuctionResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QuerySurplusAuction", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QuerySurplusAuctions(ctx context.Context, in *QuerySurplusAuctionsRequest, opts ...grpc.CallOption) (*QuerySurplusAuctionsResponse, error) { + out := new(QuerySurplusAuctionsResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QuerySurplusAuctions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QuerySurplusBiddings(ctx context.Context, in *QuerySurplusBiddingsRequest, opts ...grpc.CallOption) (*QuerySurplusBiddingsResponse, error) { + out := new(QuerySurplusBiddingsResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QuerySurplusBiddings", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryDebtAuction(ctx context.Context, in *QueryDebtAuctionRequest, opts ...grpc.CallOption) (*QueryDebtAuctionResponse, error) { + out := new(QueryDebtAuctionResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDebtAuction", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryDebtAuctions(ctx context.Context, in *QueryDebtAuctionsRequest, opts ...grpc.CallOption) (*QueryDebtAuctionsResponse, error) { + out := new(QueryDebtAuctionsResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDebtAuctions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryDebtBiddings(ctx context.Context, in *QueryDebtBiddingsRequest, opts ...grpc.CallOption) (*QueryDebtBiddingsResponse, error) { + out := new(QueryDebtBiddingsResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDebtBiddings", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryDutchAuction(ctx context.Context, in *QueryDutchAuctionRequest, opts ...grpc.CallOption) (*QueryDutchAuctionResponse, error) { + out := new(QueryDutchAuctionResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDutchAuction", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryDutchAuctions(ctx context.Context, in *QueryDutchAuctionsRequest, opts ...grpc.CallOption) (*QueryDutchAuctionsResponse, error) { + out := new(QueryDutchAuctionsResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDutchAuctions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryDutchBiddings(ctx context.Context, in *QueryDutchBiddingsRequest, opts ...grpc.CallOption) (*QueryDutchBiddingsResponse, error) { + out := new(QueryDutchBiddingsResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDutchBiddings", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryProtocolStatistics(ctx context.Context, in *QueryProtocolStatisticsRequest, opts ...grpc.CallOption) (*QueryProtocolStatisticsResponse, error) { + out := new(QueryProtocolStatisticsResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryProtocolStatistics", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryGenericAuctionParams(ctx context.Context, in *QueryGenericAuctionParamRequest, opts ...grpc.CallOption) (*QueryGenericAuctionParamResponse, error) { + out := new(QueryGenericAuctionParamResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryGenericAuctionParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryDutchLendAuction(ctx context.Context, in *QueryDutchLendAuctionRequest, opts ...grpc.CallOption) (*QueryDutchLendAuctionResponse, error) { + out := new(QueryDutchLendAuctionResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDutchLendAuction", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryDutchLendAuctions(ctx context.Context, in *QueryDutchLendAuctionsRequest, opts ...grpc.CallOption) (*QueryDutchLendAuctionsResponse, error) { + out := new(QueryDutchLendAuctionsResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDutchLendAuctions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryDutchLendBiddings(ctx context.Context, in *QueryDutchLendBiddingsRequest, opts ...grpc.CallOption) (*QueryDutchLendBiddingsResponse, error) { + out := new(QueryDutchLendBiddingsResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDutchLendBiddings", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryFilterDutchAuctions(ctx context.Context, in *QueryFilterDutchAuctionsRequest, opts ...grpc.CallOption) (*QueryFilterDutchAuctionsResponse, error) { + out := new(QueryFilterDutchAuctionsResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryFilterDutchAuctions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + QuerySurplusAuction(context.Context, *QuerySurplusAuctionRequest) (*QuerySurplusAuctionResponse, error) + QuerySurplusAuctions(context.Context, *QuerySurplusAuctionsRequest) (*QuerySurplusAuctionsResponse, error) + QuerySurplusBiddings(context.Context, *QuerySurplusBiddingsRequest) (*QuerySurplusBiddingsResponse, error) + QueryDebtAuction(context.Context, *QueryDebtAuctionRequest) (*QueryDebtAuctionResponse, error) + QueryDebtAuctions(context.Context, *QueryDebtAuctionsRequest) (*QueryDebtAuctionsResponse, error) + QueryDebtBiddings(context.Context, *QueryDebtBiddingsRequest) (*QueryDebtBiddingsResponse, error) + QueryDutchAuction(context.Context, *QueryDutchAuctionRequest) (*QueryDutchAuctionResponse, error) + QueryDutchAuctions(context.Context, *QueryDutchAuctionsRequest) (*QueryDutchAuctionsResponse, error) + QueryDutchBiddings(context.Context, *QueryDutchBiddingsRequest) (*QueryDutchBiddingsResponse, error) + QueryProtocolStatistics(context.Context, *QueryProtocolStatisticsRequest) (*QueryProtocolStatisticsResponse, error) + QueryGenericAuctionParams(context.Context, *QueryGenericAuctionParamRequest) (*QueryGenericAuctionParamResponse, error) + QueryDutchLendAuction(context.Context, *QueryDutchLendAuctionRequest) (*QueryDutchLendAuctionResponse, error) + QueryDutchLendAuctions(context.Context, *QueryDutchLendAuctionsRequest) (*QueryDutchLendAuctionsResponse, error) + QueryDutchLendBiddings(context.Context, *QueryDutchLendBiddingsRequest) (*QueryDutchLendBiddingsResponse, error) + QueryFilterDutchAuctions(context.Context, *QueryFilterDutchAuctionsRequest) (*QueryFilterDutchAuctionsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) QuerySurplusAuction(ctx context.Context, req *QuerySurplusAuctionRequest) (*QuerySurplusAuctionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QuerySurplusAuction not implemented") +} +func (*UnimplementedQueryServer) QuerySurplusAuctions(ctx context.Context, req *QuerySurplusAuctionsRequest) (*QuerySurplusAuctionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QuerySurplusAuctions not implemented") +} +func (*UnimplementedQueryServer) QuerySurplusBiddings(ctx context.Context, req *QuerySurplusBiddingsRequest) (*QuerySurplusBiddingsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QuerySurplusBiddings not implemented") +} +func (*UnimplementedQueryServer) QueryDebtAuction(ctx context.Context, req *QueryDebtAuctionRequest) (*QueryDebtAuctionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryDebtAuction not implemented") +} +func (*UnimplementedQueryServer) QueryDebtAuctions(ctx context.Context, req *QueryDebtAuctionsRequest) (*QueryDebtAuctionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryDebtAuctions not implemented") +} +func (*UnimplementedQueryServer) QueryDebtBiddings(ctx context.Context, req *QueryDebtBiddingsRequest) (*QueryDebtBiddingsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryDebtBiddings not implemented") +} +func (*UnimplementedQueryServer) QueryDutchAuction(ctx context.Context, req *QueryDutchAuctionRequest) (*QueryDutchAuctionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryDutchAuction not implemented") +} +func (*UnimplementedQueryServer) QueryDutchAuctions(ctx context.Context, req *QueryDutchAuctionsRequest) (*QueryDutchAuctionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryDutchAuctions not implemented") +} +func (*UnimplementedQueryServer) QueryDutchBiddings(ctx context.Context, req *QueryDutchBiddingsRequest) (*QueryDutchBiddingsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryDutchBiddings not implemented") +} +func (*UnimplementedQueryServer) QueryProtocolStatistics(ctx context.Context, req *QueryProtocolStatisticsRequest) (*QueryProtocolStatisticsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryProtocolStatistics not implemented") +} +func (*UnimplementedQueryServer) QueryGenericAuctionParams(ctx context.Context, req *QueryGenericAuctionParamRequest) (*QueryGenericAuctionParamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryGenericAuctionParams not implemented") +} +func (*UnimplementedQueryServer) QueryDutchLendAuction(ctx context.Context, req *QueryDutchLendAuctionRequest) (*QueryDutchLendAuctionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryDutchLendAuction not implemented") +} +func (*UnimplementedQueryServer) QueryDutchLendAuctions(ctx context.Context, req *QueryDutchLendAuctionsRequest) (*QueryDutchLendAuctionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryDutchLendAuctions not implemented") +} +func (*UnimplementedQueryServer) QueryDutchLendBiddings(ctx context.Context, req *QueryDutchLendBiddingsRequest) (*QueryDutchLendBiddingsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryDutchLendBiddings not implemented") +} +func (*UnimplementedQueryServer) QueryFilterDutchAuctions(ctx context.Context, req *QueryFilterDutchAuctionsRequest) (*QueryFilterDutchAuctionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryFilterDutchAuctions not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_QuerySurplusAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySurplusAuctionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QuerySurplusAuction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QuerySurplusAuction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QuerySurplusAuction(ctx, req.(*QuerySurplusAuctionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QuerySurplusAuctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySurplusAuctionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QuerySurplusAuctions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QuerySurplusAuctions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QuerySurplusAuctions(ctx, req.(*QuerySurplusAuctionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QuerySurplusBiddings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySurplusBiddingsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QuerySurplusBiddings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QuerySurplusBiddings", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QuerySurplusBiddings(ctx, req.(*QuerySurplusBiddingsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryDebtAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDebtAuctionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryDebtAuction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QueryDebtAuction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryDebtAuction(ctx, req.(*QueryDebtAuctionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryDebtAuctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDebtAuctionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryDebtAuctions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QueryDebtAuctions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryDebtAuctions(ctx, req.(*QueryDebtAuctionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryDebtBiddings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDebtBiddingsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryDebtBiddings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QueryDebtBiddings", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryDebtBiddings(ctx, req.(*QueryDebtBiddingsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryDutchAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDutchAuctionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryDutchAuction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QueryDutchAuction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryDutchAuction(ctx, req.(*QueryDutchAuctionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryDutchAuctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDutchAuctionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryDutchAuctions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QueryDutchAuctions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryDutchAuctions(ctx, req.(*QueryDutchAuctionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryDutchBiddings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDutchBiddingsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryDutchBiddings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QueryDutchBiddings", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryDutchBiddings(ctx, req.(*QueryDutchBiddingsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryProtocolStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProtocolStatisticsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryProtocolStatistics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QueryProtocolStatistics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryProtocolStatistics(ctx, req.(*QueryProtocolStatisticsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryGenericAuctionParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGenericAuctionParamRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryGenericAuctionParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QueryGenericAuctionParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryGenericAuctionParams(ctx, req.(*QueryGenericAuctionParamRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryDutchLendAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDutchLendAuctionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryDutchLendAuction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QueryDutchLendAuction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryDutchLendAuction(ctx, req.(*QueryDutchLendAuctionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryDutchLendAuctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDutchLendAuctionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryDutchLendAuctions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QueryDutchLendAuctions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryDutchLendAuctions(ctx, req.(*QueryDutchLendAuctionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryDutchLendBiddings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDutchLendBiddingsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryDutchLendBiddings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QueryDutchLendBiddings", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryDutchLendBiddings(ctx, req.(*QueryDutchLendBiddingsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryFilterDutchAuctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryFilterDutchAuctionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryFilterDutchAuctions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Query/QueryFilterDutchAuctions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryFilterDutchAuctions(ctx, req.(*QueryFilterDutchAuctionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "comdex.auction.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QuerySurplusAuction", + Handler: _Query_QuerySurplusAuction_Handler, + }, + { + MethodName: "QuerySurplusAuctions", + Handler: _Query_QuerySurplusAuctions_Handler, + }, + { + MethodName: "QuerySurplusBiddings", + Handler: _Query_QuerySurplusBiddings_Handler, + }, + { + MethodName: "QueryDebtAuction", + Handler: _Query_QueryDebtAuction_Handler, + }, + { + MethodName: "QueryDebtAuctions", + Handler: _Query_QueryDebtAuctions_Handler, + }, + { + MethodName: "QueryDebtBiddings", + Handler: _Query_QueryDebtBiddings_Handler, + }, + { + MethodName: "QueryDutchAuction", + Handler: _Query_QueryDutchAuction_Handler, + }, + { + MethodName: "QueryDutchAuctions", + Handler: _Query_QueryDutchAuctions_Handler, + }, + { + MethodName: "QueryDutchBiddings", + Handler: _Query_QueryDutchBiddings_Handler, + }, + { + MethodName: "QueryProtocolStatistics", + Handler: _Query_QueryProtocolStatistics_Handler, + }, + { + MethodName: "QueryGenericAuctionParams", + Handler: _Query_QueryGenericAuctionParams_Handler, + }, + { + MethodName: "QueryDutchLendAuction", + Handler: _Query_QueryDutchLendAuction_Handler, + }, + { + MethodName: "QueryDutchLendAuctions", + Handler: _Query_QueryDutchLendAuctions_Handler, + }, + { + MethodName: "QueryDutchLendBiddings", + Handler: _Query_QueryDutchLendBiddings_Handler, + }, + { + MethodName: "QueryFilterDutchAuctions", + Handler: _Query_QueryFilterDutchAuctions_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "comdex/auction/v1beta1/query.proto", +} + +func (m *QuerySurplusAuctionRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuerySurplusAuctionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySurplusAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.AuctionId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x18 + } + if m.AuctionMappingId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QuerySurplusAuctionResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuerySurplusAuctionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySurplusAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Auction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QuerySurplusAuctionsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuerySurplusAuctionsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySurplusAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QuerySurplusAuctionsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuerySurplusAuctionsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySurplusAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Auctions) > 0 { + for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QuerySurplusBiddingsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuerySurplusBiddingsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySurplusBiddingsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySurplusBiddingsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuerySurplusBiddingsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySurplusBiddingsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Biddings) > 0 { + for iNdEx := len(m.Biddings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Biddings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDebtAuctionRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDebtAuctionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDebtAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.AuctionId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x18 + } + if m.AuctionMappingId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDebtAuctionResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDebtAuctionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDebtAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + { + size, err := m.Auction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryDebtAuctionsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDebtAuctionsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDebtAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDebtAuctionsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDebtAuctionsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDebtAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Auctions) > 0 { + for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryDebtBiddingsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDebtBiddingsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDebtBiddingsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDebtBiddingsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDebtBiddingsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDebtBiddingsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Biddings) > 0 { + for iNdEx := len(m.Biddings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Biddings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDutchAuctionRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDutchAuctionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDutchAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.AuctionId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x18 + } + if m.AuctionMappingId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDutchAuctionResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDutchAuctionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDutchAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Auction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryDutchAuctionsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDutchAuctionsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDutchAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDutchAuctionsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDutchAuctionsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDutchAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Auctions) > 0 { + for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryDutchBiddingsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDutchBiddingsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDutchBiddingsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDutchBiddingsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDutchBiddingsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDutchBiddingsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Biddings) > 0 { + for iNdEx := len(m.Biddings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Biddings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBiddingsForSurplusAuctionRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBiddingsForSurplusAuctionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBiddingsForSurplusAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.AuctionId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x18 + } + if m.AuctionMappingId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryBiddingsForSurplusAuctionResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBiddingsForSurplusAuctionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBiddingsForSurplusAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Biddings) > 0 { + for iNdEx := len(m.Biddings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Biddings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryProtocolStatisticsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProtocolStatisticsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProtocolStatisticsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryProtocolStatisticsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProtocolStatisticsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProtocolStatisticsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Stats) > 0 { + for iNdEx := len(m.Stats) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Stats[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGenericAuctionParamRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGenericAuctionParamRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGenericAuctionParamRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryGenericAuctionParamResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGenericAuctionParamResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGenericAuctionParamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.AuctionParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryDutchLendAuctionRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDutchLendAuctionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDutchLendAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.AuctionId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x18 + } + if m.AuctionMappingId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDutchLendAuctionResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDutchLendAuctionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDutchLendAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Auction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryDutchLendAuctionsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDutchLendAuctionsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDutchLendAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDutchLendAuctionsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDutchLendAuctionsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDutchLendAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Auctions) > 0 { + for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryDutchLendBiddingsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDutchLendBiddingsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDutchLendBiddingsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDutchLendBiddingsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDutchLendBiddingsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDutchLendBiddingsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Biddings) > 0 { + for iNdEx := len(m.Biddings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Biddings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryFilterDutchAuctionsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFilterDutchAuctionsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFilterDutchAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.Denom) > 0 { + for iNdEx := len(m.Denom) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denom[iNdEx]) + copy(dAtA[i:], m.Denom[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryFilterDutchAuctionsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFilterDutchAuctionsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFilterDutchAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Auctions) > 0 { + for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QuerySurplusAuctionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovQuery(uint64(m.AuctionMappingId)) + } + if m.AuctionId != 0 { + n += 1 + sovQuery(uint64(m.AuctionId)) + } + if m.History { + n += 2 + } + return n +} + +func (m *QuerySurplusAuctionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Auction.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QuerySurplusAuctionsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySurplusAuctionsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Auctions) > 0 { + for _, e := range m.Auctions { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySurplusBiddingsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySurplusBiddingsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Biddings) > 0 { + for _, e := range m.Biddings { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDebtAuctionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovQuery(uint64(m.AuctionMappingId)) + } + if m.AuctionId != 0 { + n += 1 + sovQuery(uint64(m.AuctionId)) + } + if m.History { + n += 2 + } + return n +} + +func (m *QueryDebtAuctionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Auction.Size() + n += 1 + l + sovQuery(uint64(l)) + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDebtAuctionsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDebtAuctionsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Auctions) > 0 { + for _, e := range m.Auctions { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDebtBiddingsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDebtBiddingsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Biddings) > 0 { + for _, e := range m.Biddings { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDutchAuctionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovQuery(uint64(m.AuctionMappingId)) + } + if m.AuctionId != 0 { + n += 1 + sovQuery(uint64(m.AuctionId)) + } + if m.History { + n += 2 + } + return n +} + +func (m *QueryDutchAuctionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Auction.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryDutchAuctionsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDutchAuctionsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Auctions) > 0 { + for _, e := range m.Auctions { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDutchBiddingsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDutchBiddingsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Biddings) > 0 { + for _, e := range m.Biddings { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBiddingsForSurplusAuctionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovQuery(uint64(m.AuctionMappingId)) + } + if m.AuctionId != 0 { + n += 1 + sovQuery(uint64(m.AuctionId)) + } + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBiddingsForSurplusAuctionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Biddings) > 0 { + for _, e := range m.Biddings { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryProtocolStatisticsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryProtocolStatisticsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Stats) > 0 { + for _, e := range m.Stats { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGenericAuctionParamRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + return n +} + +func (m *QueryGenericAuctionParamResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.AuctionParams.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryDutchLendAuctionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovQuery(uint64(m.AuctionMappingId)) + } + if m.AuctionId != 0 { + n += 1 + sovQuery(uint64(m.AuctionId)) + } + if m.History { + n += 2 + } + return n +} + +func (m *QueryDutchLendAuctionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Auction.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryDutchLendAuctionsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDutchLendAuctionsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Auctions) > 0 { + for _, e := range m.Auctions { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDutchLendBiddingsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDutchLendBiddingsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Biddings) > 0 { + for _, e := range m.Biddings { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryFilterDutchAuctionsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if len(m.Denom) > 0 { + for _, s := range m.Denom { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryFilterDutchAuctionsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Auctions) > 0 { + for _, e := range m.Auctions { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QuerySurplusAuctionRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySurplusAuctionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySurplusAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySurplusAuctionResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySurplusAuctionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySurplusAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Auction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySurplusAuctionsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySurplusAuctionsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySurplusAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySurplusAuctionsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySurplusAuctionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySurplusAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Auctions = append(m.Auctions, SurplusAuction{}) + if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySurplusBiddingsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySurplusBiddingsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySurplusBiddingsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySurplusBiddingsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySurplusBiddingsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySurplusBiddingsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Biddings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Biddings = append(m.Biddings, SurplusBiddings{}) + if err := m.Biddings[len(m.Biddings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDebtAuctionRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDebtAuctionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDebtAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDebtAuctionResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDebtAuctionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDebtAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Auction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDebtAuctionsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDebtAuctionsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDebtAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDebtAuctionsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDebtAuctionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDebtAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Auctions = append(m.Auctions, DebtAuction{}) + if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDebtBiddingsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDebtBiddingsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDebtBiddingsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDebtBiddingsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDebtBiddingsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDebtBiddingsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Biddings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Biddings = append(m.Biddings, DebtBiddings{}) + if err := m.Biddings[len(m.Biddings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDutchAuctionRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDutchAuctionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDutchAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDutchAuctionResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDutchAuctionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDutchAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Auction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDutchAuctionsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDutchAuctionsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDutchAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDutchAuctionsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDutchAuctionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDutchAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Auctions = append(m.Auctions, DutchAuction{}) + if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDutchBiddingsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDutchBiddingsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDutchBiddingsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDutchBiddingsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDutchBiddingsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDutchBiddingsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Biddings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Biddings = append(m.Biddings, DutchBiddings{}) + if err := m.Biddings[len(m.Biddings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBiddingsForSurplusAuctionRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBiddingsForSurplusAuctionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBiddingsForSurplusAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBiddingsForSurplusAuctionResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBiddingsForSurplusAuctionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBiddingsForSurplusAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Biddings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Biddings = append(m.Biddings, SurplusBiddings{}) + if err := m.Biddings[len(m.Biddings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProtocolStatisticsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProtocolStatisticsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProtocolStatisticsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProtocolStatisticsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProtocolStatisticsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProtocolStatisticsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Stats = append(m.Stats, ProtocolStatistics{}) + if err := m.Stats[len(m.Stats)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGenericAuctionParamRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGenericAuctionParamRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGenericAuctionParamRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGenericAuctionParamResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGenericAuctionParamResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGenericAuctionParamResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AuctionParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDutchLendAuctionRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDutchLendAuctionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDutchLendAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDutchLendAuctionResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDutchLendAuctionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDutchLendAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Auction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDutchLendAuctionsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDutchLendAuctionsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDutchLendAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDutchLendAuctionsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDutchLendAuctionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDutchLendAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Auctions = append(m.Auctions, DutchAuction{}) + if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDutchLendBiddingsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDutchLendBiddingsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDutchLendBiddingsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDutchLendBiddingsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDutchLendBiddingsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDutchLendBiddingsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Biddings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Biddings = append(m.Biddings, DutchBiddings{}) + if err := m.Biddings[len(m.Biddings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryFilterDutchAuctionsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFilterDutchAuctionsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFilterDutchAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = append(m.Denom, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryFilterDutchAuctionsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFilterDutchAuctionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFilterDutchAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Auctions = append(m.Auctions, DutchAuction{}) + if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/comdex-official/comdex/x/auction/types/query.pb.gw.go b/github.com/comdex-official/comdex/x/auction/types/query.pb.gw.go new file mode 100644 index 000000000..4ee152426 --- /dev/null +++ b/github.com/comdex-official/comdex/x/auction/types/query.pb.gw.go @@ -0,0 +1,2355 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: comdex/auction/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_QuerySurplusAuction_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySurplusAuctionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["auction_mapping_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") + } + + protoReq.AuctionMappingId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) + } + + val, ok = pathParams["auction_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") + } + + protoReq.AuctionId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + msg, err := client.QuerySurplusAuction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QuerySurplusAuction_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySurplusAuctionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["auction_mapping_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") + } + + protoReq.AuctionMappingId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) + } + + val, ok = pathParams["auction_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") + } + + protoReq.AuctionId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + msg, err := server.QuerySurplusAuction(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QuerySurplusAuctions_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0, "history": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_Query_QuerySurplusAuctions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySurplusAuctionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySurplusAuctions_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QuerySurplusAuctions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QuerySurplusAuctions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySurplusAuctionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySurplusAuctions_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QuerySurplusAuctions(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QuerySurplusBiddings_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "app_id": 1, "history": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} +) + +func request_Query_QuerySurplusBiddings_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySurplusBiddingsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySurplusBiddings_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QuerySurplusBiddings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QuerySurplusBiddings_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySurplusBiddingsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySurplusBiddings_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QuerySurplusBiddings(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryDebtAuction_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDebtAuctionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["auction_mapping_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") + } + + protoReq.AuctionMappingId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) + } + + val, ok = pathParams["auction_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") + } + + protoReq.AuctionId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + msg, err := client.QueryDebtAuction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDebtAuction_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDebtAuctionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["auction_mapping_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") + } + + protoReq.AuctionMappingId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) + } + + val, ok = pathParams["auction_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") + } + + protoReq.AuctionId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + msg, err := server.QueryDebtAuction(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDebtAuctions_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0, "history": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_Query_QueryDebtAuctions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDebtAuctionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDebtAuctions_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDebtAuctions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDebtAuctions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDebtAuctionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDebtAuctions_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDebtAuctions(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDebtBiddings_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "app_id": 1, "history": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} +) + +func request_Query_QueryDebtBiddings_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDebtBiddingsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDebtBiddings_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDebtBiddings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDebtBiddings_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDebtBiddingsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDebtBiddings_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDebtBiddings(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryDutchAuction_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDutchAuctionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["auction_mapping_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") + } + + protoReq.AuctionMappingId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) + } + + val, ok = pathParams["auction_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") + } + + protoReq.AuctionId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + msg, err := client.QueryDutchAuction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDutchAuction_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDutchAuctionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["auction_mapping_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") + } + + protoReq.AuctionMappingId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) + } + + val, ok = pathParams["auction_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") + } + + protoReq.AuctionId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + msg, err := server.QueryDutchAuction(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDutchAuctions_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0, "history": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_Query_QueryDutchAuctions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDutchAuctionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchAuctions_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDutchAuctions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDutchAuctions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDutchAuctionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchAuctions_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDutchAuctions(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDutchBiddings_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "app_id": 1, "history": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} +) + +func request_Query_QueryDutchBiddings_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDutchBiddingsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchBiddings_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDutchBiddings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDutchBiddings_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDutchBiddingsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchBiddings_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDutchBiddings(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryProtocolStatistics_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryProtocolStatistics_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProtocolStatisticsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryProtocolStatistics_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryProtocolStatistics(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryProtocolStatistics_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProtocolStatisticsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryProtocolStatistics_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryProtocolStatistics(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryGenericAuctionParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGenericAuctionParamRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + msg, err := client.QueryGenericAuctionParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryGenericAuctionParams_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGenericAuctionParamRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + msg, err := server.QueryGenericAuctionParams(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryDutchLendAuction_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDutchLendAuctionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["auction_mapping_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") + } + + protoReq.AuctionMappingId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) + } + + val, ok = pathParams["auction_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") + } + + protoReq.AuctionId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + msg, err := client.QueryDutchLendAuction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDutchLendAuction_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDutchLendAuctionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["auction_mapping_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") + } + + protoReq.AuctionMappingId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) + } + + val, ok = pathParams["auction_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") + } + + protoReq.AuctionId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + msg, err := server.QueryDutchLendAuction(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDutchLendAuctions_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0, "history": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_Query_QueryDutchLendAuctions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDutchLendAuctionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchLendAuctions_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDutchLendAuctions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDutchLendAuctions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDutchLendAuctionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchLendAuctions_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDutchLendAuctions(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDutchLendBiddings_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "app_id": 1, "history": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} +) + +func request_Query_QueryDutchLendBiddings_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDutchLendBiddingsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchLendBiddings_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDutchLendBiddings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDutchLendBiddings_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDutchLendBiddingsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchLendBiddings_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDutchLendBiddings(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryFilterDutchAuctions_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0, "denom": 1, "history": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} +) + +func request_Query_QueryFilterDutchAuctions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFilterDutchAuctionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.StringSlice(val, ",") + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryFilterDutchAuctions_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryFilterDutchAuctions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryFilterDutchAuctions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFilterDutchAuctionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.StringSlice(val, ",") + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryFilterDutchAuctions_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryFilterDutchAuctions(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_QuerySurplusAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QuerySurplusAuction_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySurplusAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySurplusAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QuerySurplusAuctions_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySurplusAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySurplusBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QuerySurplusBiddings_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySurplusBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDebtAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDebtAuction_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDebtAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDebtAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDebtAuctions_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDebtAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDebtBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDebtBiddings_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDebtBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDutchAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDutchAuction_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDutchAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDutchAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDutchAuctions_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDutchAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDutchBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDutchBiddings_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDutchBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryProtocolStatistics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryProtocolStatistics_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryProtocolStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryGenericAuctionParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryGenericAuctionParams_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryGenericAuctionParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDutchLendAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDutchLendAuction_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDutchLendAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDutchLendAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDutchLendAuctions_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDutchLendAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDutchLendBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryDutchLendBiddings_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDutchLendBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryFilterDutchAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryFilterDutchAuctions_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryFilterDutchAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_QuerySurplusAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QuerySurplusAuction_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySurplusAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySurplusAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QuerySurplusAuctions_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySurplusAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QuerySurplusBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QuerySurplusBiddings_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QuerySurplusBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDebtAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDebtAuction_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDebtAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDebtAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDebtAuctions_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDebtAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDebtBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDebtBiddings_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDebtBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDutchAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDutchAuction_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDutchAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDutchAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDutchAuctions_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDutchAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDutchBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDutchBiddings_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDutchBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryProtocolStatistics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryProtocolStatistics_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryProtocolStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryGenericAuctionParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryGenericAuctionParams_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryGenericAuctionParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDutchLendAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDutchLendAuction_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDutchLendAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDutchLendAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDutchLendAuctions_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDutchLendAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDutchLendBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryDutchLendBiddings_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryDutchLendBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryFilterDutchAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryFilterDutchAuctions_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryFilterDutchAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_QuerySurplusAuction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"comdex", "auction", "v1beta1", "surplusauction", "app_id", "auction_mapping_id", "auction_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QuerySurplusAuctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auction", "v1beta1", "surplusauctions", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QuerySurplusBiddings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auction", "v1beta1", "surplusbiddings", "bidder", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryDebtAuction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"comdex", "auction", "v1beta1", "debtauction", "app_id", "auction_mapping_id", "auction_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryDebtAuctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auction", "v1beta1", "debtauctions", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryDebtBiddings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auction", "v1beta1", "debtbiddings", "bidder", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryDutchAuction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"comdex", "auction", "v1beta1", "dutchauction", "app_id", "auction_mapping_id", "auction_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryDutchAuctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auction", "v1beta1", "dutchauctions", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryDutchBiddings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auction", "v1beta1", "dutchbiddings", "bidder", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryProtocolStatistics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "auction", "v1beta1", "protocolstats", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryGenericAuctionParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "auction", "v1beta1", "auctionparams", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryDutchLendAuction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"comdex", "auction", "v1beta1", "dutchlendauction", "app_id", "auction_mapping_id", "auction_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryDutchLendAuctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auction", "v1beta1", "dutchlendauctions", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryDutchLendBiddings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auction", "v1beta1", "dutchlendbiddings", "bidder", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryFilterDutchAuctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auction", "v1beta1", "filterdutchauctions", "app_id", "denom", "history"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_QuerySurplusAuction_0 = runtime.ForwardResponseMessage + + forward_Query_QuerySurplusAuctions_0 = runtime.ForwardResponseMessage + + forward_Query_QuerySurplusBiddings_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDebtAuction_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDebtAuctions_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDebtBiddings_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDutchAuction_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDutchAuctions_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDutchBiddings_0 = runtime.ForwardResponseMessage + + forward_Query_QueryProtocolStatistics_0 = runtime.ForwardResponseMessage + + forward_Query_QueryGenericAuctionParams_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDutchLendAuction_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDutchLendAuctions_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDutchLendBiddings_0 = runtime.ForwardResponseMessage + + forward_Query_QueryFilterDutchAuctions_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/comdex-official/comdex/x/auction/types/tx.pb.go b/github.com/comdex-official/comdex/x/auction/types/tx.pb.go new file mode 100644 index 000000000..7a3389403 --- /dev/null +++ b/github.com/comdex-official/comdex/x/auction/types/tx.pb.go @@ -0,0 +1,2056 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: comdex/auction/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MsgPlaceSurplusBidRequest struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` + AppId uint64 `protobuf:"varint,4,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + AuctionMappingId uint64 `protobuf:"varint,5,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` +} + +func (m *MsgPlaceSurplusBidRequest) Reset() { *m = MsgPlaceSurplusBidRequest{} } +func (m *MsgPlaceSurplusBidRequest) String() string { return proto.CompactTextString(m) } +func (*MsgPlaceSurplusBidRequest) ProtoMessage() {} +func (*MsgPlaceSurplusBidRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a8457d7b1ca5de6a, []int{0} +} +func (m *MsgPlaceSurplusBidRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPlaceSurplusBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPlaceSurplusBidRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPlaceSurplusBidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPlaceSurplusBidRequest.Merge(m, src) +} +func (m *MsgPlaceSurplusBidRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgPlaceSurplusBidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPlaceSurplusBidRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPlaceSurplusBidRequest proto.InternalMessageInfo + +type MsgPlaceSurplusBidResponse struct { +} + +func (m *MsgPlaceSurplusBidResponse) Reset() { *m = MsgPlaceSurplusBidResponse{} } +func (m *MsgPlaceSurplusBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPlaceSurplusBidResponse) ProtoMessage() {} +func (*MsgPlaceSurplusBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a8457d7b1ca5de6a, []int{1} +} +func (m *MsgPlaceSurplusBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPlaceSurplusBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPlaceSurplusBidResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPlaceSurplusBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPlaceSurplusBidResponse.Merge(m, src) +} +func (m *MsgPlaceSurplusBidResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPlaceSurplusBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPlaceSurplusBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPlaceSurplusBidResponse proto.InternalMessageInfo + +type MsgPlaceDebtBidRequest struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + Bid types.Coin `protobuf:"bytes,3,opt,name=bid,proto3" json:"bid"` + ExpectedUserToken types.Coin `protobuf:"bytes,4,opt,name=expectedUserToken,proto3" json:"expectedUserToken"` + AppId uint64 `protobuf:"varint,5,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + AuctionMappingId uint64 `protobuf:"varint,6,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` +} + +func (m *MsgPlaceDebtBidRequest) Reset() { *m = MsgPlaceDebtBidRequest{} } +func (m *MsgPlaceDebtBidRequest) String() string { return proto.CompactTextString(m) } +func (*MsgPlaceDebtBidRequest) ProtoMessage() {} +func (*MsgPlaceDebtBidRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a8457d7b1ca5de6a, []int{2} +} +func (m *MsgPlaceDebtBidRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPlaceDebtBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPlaceDebtBidRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPlaceDebtBidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPlaceDebtBidRequest.Merge(m, src) +} +func (m *MsgPlaceDebtBidRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgPlaceDebtBidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPlaceDebtBidRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPlaceDebtBidRequest proto.InternalMessageInfo + +type MsgPlaceDebtBidResponse struct { +} + +func (m *MsgPlaceDebtBidResponse) Reset() { *m = MsgPlaceDebtBidResponse{} } +func (m *MsgPlaceDebtBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPlaceDebtBidResponse) ProtoMessage() {} +func (*MsgPlaceDebtBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a8457d7b1ca5de6a, []int{3} +} +func (m *MsgPlaceDebtBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPlaceDebtBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPlaceDebtBidResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPlaceDebtBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPlaceDebtBidResponse.Merge(m, src) +} +func (m *MsgPlaceDebtBidResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPlaceDebtBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPlaceDebtBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPlaceDebtBidResponse proto.InternalMessageInfo + +type MsgPlaceDutchBidRequest struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` + AppId uint64 `protobuf:"varint,4,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + AuctionMappingId uint64 `protobuf:"varint,5,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` +} + +func (m *MsgPlaceDutchBidRequest) Reset() { *m = MsgPlaceDutchBidRequest{} } +func (m *MsgPlaceDutchBidRequest) String() string { return proto.CompactTextString(m) } +func (*MsgPlaceDutchBidRequest) ProtoMessage() {} +func (*MsgPlaceDutchBidRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a8457d7b1ca5de6a, []int{4} +} +func (m *MsgPlaceDutchBidRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPlaceDutchBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPlaceDutchBidRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPlaceDutchBidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPlaceDutchBidRequest.Merge(m, src) +} +func (m *MsgPlaceDutchBidRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgPlaceDutchBidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPlaceDutchBidRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPlaceDutchBidRequest proto.InternalMessageInfo + +type MsgPlaceDutchBidResponse struct { +} + +func (m *MsgPlaceDutchBidResponse) Reset() { *m = MsgPlaceDutchBidResponse{} } +func (m *MsgPlaceDutchBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPlaceDutchBidResponse) ProtoMessage() {} +func (*MsgPlaceDutchBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a8457d7b1ca5de6a, []int{5} +} +func (m *MsgPlaceDutchBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPlaceDutchBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPlaceDutchBidResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPlaceDutchBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPlaceDutchBidResponse.Merge(m, src) +} +func (m *MsgPlaceDutchBidResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPlaceDutchBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPlaceDutchBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPlaceDutchBidResponse proto.InternalMessageInfo + +type MsgPlaceDutchLendBidRequest struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` + AppId uint64 `protobuf:"varint,4,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + AuctionMappingId uint64 `protobuf:"varint,5,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` +} + +func (m *MsgPlaceDutchLendBidRequest) Reset() { *m = MsgPlaceDutchLendBidRequest{} } +func (m *MsgPlaceDutchLendBidRequest) String() string { return proto.CompactTextString(m) } +func (*MsgPlaceDutchLendBidRequest) ProtoMessage() {} +func (*MsgPlaceDutchLendBidRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a8457d7b1ca5de6a, []int{6} +} +func (m *MsgPlaceDutchLendBidRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPlaceDutchLendBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPlaceDutchLendBidRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPlaceDutchLendBidRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPlaceDutchLendBidRequest.Merge(m, src) +} +func (m *MsgPlaceDutchLendBidRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgPlaceDutchLendBidRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPlaceDutchLendBidRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPlaceDutchLendBidRequest proto.InternalMessageInfo + +type MsgPlaceDutchLendBidResponse struct { +} + +func (m *MsgPlaceDutchLendBidResponse) Reset() { *m = MsgPlaceDutchLendBidResponse{} } +func (m *MsgPlaceDutchLendBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPlaceDutchLendBidResponse) ProtoMessage() {} +func (*MsgPlaceDutchLendBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a8457d7b1ca5de6a, []int{7} +} +func (m *MsgPlaceDutchLendBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPlaceDutchLendBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPlaceDutchLendBidResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPlaceDutchLendBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPlaceDutchLendBidResponse.Merge(m, src) +} +func (m *MsgPlaceDutchLendBidResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPlaceDutchLendBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPlaceDutchLendBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPlaceDutchLendBidResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgPlaceSurplusBidRequest)(nil), "comdex.auction.v1beta1.MsgPlaceSurplusBidRequest") + proto.RegisterType((*MsgPlaceSurplusBidResponse)(nil), "comdex.auction.v1beta1.MsgPlaceSurplusBidResponse") + proto.RegisterType((*MsgPlaceDebtBidRequest)(nil), "comdex.auction.v1beta1.MsgPlaceDebtBidRequest") + proto.RegisterType((*MsgPlaceDebtBidResponse)(nil), "comdex.auction.v1beta1.MsgPlaceDebtBidResponse") + proto.RegisterType((*MsgPlaceDutchBidRequest)(nil), "comdex.auction.v1beta1.MsgPlaceDutchBidRequest") + proto.RegisterType((*MsgPlaceDutchBidResponse)(nil), "comdex.auction.v1beta1.MsgPlaceDutchBidResponse") + proto.RegisterType((*MsgPlaceDutchLendBidRequest)(nil), "comdex.auction.v1beta1.MsgPlaceDutchLendBidRequest") + proto.RegisterType((*MsgPlaceDutchLendBidResponse)(nil), "comdex.auction.v1beta1.MsgPlaceDutchLendBidResponse") +} + +func init() { proto.RegisterFile("comdex/auction/v1beta1/tx.proto", fileDescriptor_a8457d7b1ca5de6a) } + +var fileDescriptor_a8457d7b1ca5de6a = []byte{ + // 523 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0xf5, 0x36, 0x4d, 0xa4, 0x0e, 0x07, 0xca, 0xaa, 0x84, 0xc4, 0x94, 0x6d, 0x94, 0x53, 0x0e, + 0x60, 0xe3, 0x14, 0x89, 0x7b, 0xe0, 0x12, 0x89, 0x48, 0x28, 0x85, 0x0b, 0x17, 0x64, 0x7b, 0xb7, + 0xee, 0x8a, 0xc4, 0xbb, 0x78, 0xd7, 0x28, 0x88, 0x13, 0x7f, 0xc0, 0x89, 0x6f, 0xe0, 0x53, 0x72, + 0x42, 0x11, 0x27, 0x4e, 0x08, 0x92, 0x2f, 0xe0, 0x0f, 0x90, 0xed, 0x0d, 0x34, 0x4d, 0xaa, 0xb8, + 0xe2, 0xd4, 0x5b, 0x36, 0xf3, 0x66, 0xde, 0x7b, 0xe3, 0x99, 0x5d, 0x38, 0x0a, 0xc5, 0x98, 0xb2, + 0x89, 0xeb, 0xa7, 0xa1, 0xe6, 0x22, 0x76, 0xdf, 0x79, 0x01, 0xd3, 0xbe, 0xe7, 0xea, 0x89, 0x23, + 0x13, 0xa1, 0x05, 0xae, 0x17, 0x00, 0xc7, 0x00, 0x1c, 0x03, 0xb0, 0x0f, 0x22, 0x11, 0x89, 0x1c, + 0xe2, 0x66, 0xbf, 0x0a, 0xb4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 0x50, 0xe9, 0xf7, 0x92, 0xa9, 0xa0, 0x96, 0x3f, 0x2b, 0xc7, 0x7f, 0x02, 0x00, + 0x00, 0xff, 0xff, 0x7f, 0x4f, 0x7a, 0x59, 0xc7, 0x06, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + MsgPlaceSurplusBid(ctx context.Context, in *MsgPlaceSurplusBidRequest, opts ...grpc.CallOption) (*MsgPlaceSurplusBidResponse, error) + MsgPlaceDebtBid(ctx context.Context, in *MsgPlaceDebtBidRequest, opts ...grpc.CallOption) (*MsgPlaceDebtBidResponse, error) + MsgPlaceDutchBid(ctx context.Context, in *MsgPlaceDutchBidRequest, opts ...grpc.CallOption) (*MsgPlaceDutchBidResponse, error) + MsgPlaceDutchLendBid(ctx context.Context, in *MsgPlaceDutchLendBidRequest, opts ...grpc.CallOption) (*MsgPlaceDutchLendBidResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) MsgPlaceSurplusBid(ctx context.Context, in *MsgPlaceSurplusBidRequest, opts ...grpc.CallOption) (*MsgPlaceSurplusBidResponse, error) { + out := new(MsgPlaceSurplusBidResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Msg/MsgPlaceSurplusBid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) MsgPlaceDebtBid(ctx context.Context, in *MsgPlaceDebtBidRequest, opts ...grpc.CallOption) (*MsgPlaceDebtBidResponse, error) { + out := new(MsgPlaceDebtBidResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Msg/MsgPlaceDebtBid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) MsgPlaceDutchBid(ctx context.Context, in *MsgPlaceDutchBidRequest, opts ...grpc.CallOption) (*MsgPlaceDutchBidResponse, error) { + out := new(MsgPlaceDutchBidResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Msg/MsgPlaceDutchBid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) MsgPlaceDutchLendBid(ctx context.Context, in *MsgPlaceDutchLendBidRequest, opts ...grpc.CallOption) (*MsgPlaceDutchLendBidResponse, error) { + out := new(MsgPlaceDutchLendBidResponse) + err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Msg/MsgPlaceDutchLendBid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + MsgPlaceSurplusBid(context.Context, *MsgPlaceSurplusBidRequest) (*MsgPlaceSurplusBidResponse, error) + MsgPlaceDebtBid(context.Context, *MsgPlaceDebtBidRequest) (*MsgPlaceDebtBidResponse, error) + MsgPlaceDutchBid(context.Context, *MsgPlaceDutchBidRequest) (*MsgPlaceDutchBidResponse, error) + MsgPlaceDutchLendBid(context.Context, *MsgPlaceDutchLendBidRequest) (*MsgPlaceDutchLendBidResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) MsgPlaceSurplusBid(ctx context.Context, req *MsgPlaceSurplusBidRequest) (*MsgPlaceSurplusBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgPlaceSurplusBid not implemented") +} +func (*UnimplementedMsgServer) MsgPlaceDebtBid(ctx context.Context, req *MsgPlaceDebtBidRequest) (*MsgPlaceDebtBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgPlaceDebtBid not implemented") +} +func (*UnimplementedMsgServer) MsgPlaceDutchBid(ctx context.Context, req *MsgPlaceDutchBidRequest) (*MsgPlaceDutchBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgPlaceDutchBid not implemented") +} +func (*UnimplementedMsgServer) MsgPlaceDutchLendBid(ctx context.Context, req *MsgPlaceDutchLendBidRequest) (*MsgPlaceDutchLendBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgPlaceDutchLendBid not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_MsgPlaceSurplusBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPlaceSurplusBidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgPlaceSurplusBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Msg/MsgPlaceSurplusBid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgPlaceSurplusBid(ctx, req.(*MsgPlaceSurplusBidRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_MsgPlaceDebtBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPlaceDebtBidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgPlaceDebtBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Msg/MsgPlaceDebtBid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgPlaceDebtBid(ctx, req.(*MsgPlaceDebtBidRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_MsgPlaceDutchBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPlaceDutchBidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgPlaceDutchBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Msg/MsgPlaceDutchBid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgPlaceDutchBid(ctx, req.(*MsgPlaceDutchBidRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_MsgPlaceDutchLendBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPlaceDutchLendBidRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgPlaceDutchLendBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auction.v1beta1.Msg/MsgPlaceDutchLendBid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgPlaceDutchLendBid(ctx, req.(*MsgPlaceDutchLendBidRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "comdex.auction.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "MsgPlaceSurplusBid", + Handler: _Msg_MsgPlaceSurplusBid_Handler, + }, + { + MethodName: "MsgPlaceDebtBid", + Handler: _Msg_MsgPlaceDebtBid_Handler, + }, + { + MethodName: "MsgPlaceDutchBid", + Handler: _Msg_MsgPlaceDutchBid_Handler, + }, + { + MethodName: "MsgPlaceDutchLendBid", + Handler: _Msg_MsgPlaceDutchLendBid_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "comdex/auction/v1beta1/tx.proto", +} + +func (m *MsgPlaceSurplusBidRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPlaceSurplusBidRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPlaceSurplusBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuctionMappingId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x28 + } + if m.AppId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x20 + } + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x12 + } + if m.AuctionId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgPlaceSurplusBidResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPlaceSurplusBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPlaceSurplusBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgPlaceDebtBidRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPlaceDebtBidRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPlaceDebtBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuctionMappingId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x30 + } + if m.AppId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x28 + } + { + size, err := m.ExpectedUserToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Bid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x12 + } + if m.AuctionId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgPlaceDebtBidResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPlaceDebtBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPlaceDebtBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgPlaceDutchBidRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPlaceDutchBidRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPlaceDutchBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuctionMappingId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x28 + } + if m.AppId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x20 + } + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x12 + } + if m.AuctionId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgPlaceDutchBidResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPlaceDutchBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPlaceDutchBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgPlaceDutchLendBidRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPlaceDutchLendBidRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPlaceDutchLendBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuctionMappingId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AuctionMappingId)) + i-- + dAtA[i] = 0x28 + } + if m.AppId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x20 + } + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0x12 + } + if m.AuctionId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgPlaceDutchLendBidResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPlaceDutchLendBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPlaceDutchLendBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgPlaceSurplusBidRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovTx(uint64(m.AuctionId)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + if m.AppId != 0 { + n += 1 + sovTx(uint64(m.AppId)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovTx(uint64(m.AuctionMappingId)) + } + return n +} + +func (m *MsgPlaceSurplusBidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgPlaceDebtBidRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovTx(uint64(m.AuctionId)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Bid.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.ExpectedUserToken.Size() + n += 1 + l + sovTx(uint64(l)) + if m.AppId != 0 { + n += 1 + sovTx(uint64(m.AppId)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovTx(uint64(m.AuctionMappingId)) + } + return n +} + +func (m *MsgPlaceDebtBidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgPlaceDutchBidRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovTx(uint64(m.AuctionId)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + if m.AppId != 0 { + n += 1 + sovTx(uint64(m.AppId)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovTx(uint64(m.AuctionMappingId)) + } + return n +} + +func (m *MsgPlaceDutchBidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgPlaceDutchLendBidRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovTx(uint64(m.AuctionId)) + } + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + if m.AppId != 0 { + n += 1 + sovTx(uint64(m.AppId)) + } + if m.AuctionMappingId != 0 { + n += 1 + sovTx(uint64(m.AuctionMappingId)) + } + return n +} + +func (m *MsgPlaceDutchLendBidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgPlaceSurplusBidRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPlaceSurplusBidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPlaceSurplusBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPlaceSurplusBidResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPlaceSurplusBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPlaceSurplusBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPlaceDebtBidRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPlaceDebtBidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPlaceDebtBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpectedUserToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExpectedUserToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPlaceDebtBidResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPlaceDebtBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPlaceDebtBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPlaceDutchBidRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPlaceDutchBidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPlaceDutchBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPlaceDutchBidResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPlaceDutchBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPlaceDutchBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPlaceDutchLendBidRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPlaceDutchLendBidRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPlaceDutchLendBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) + } + m.AuctionMappingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionMappingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPlaceDutchLendBidResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPlaceDutchLendBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPlaceDutchLendBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index 9b8d544fd..34d800da9 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -4,10 +4,23 @@ package comdex.auctionsV2.v1beta1; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "comdex/liquidationsV2/v1beta1/liquidate.proto"; option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; -message Auctions{ +message AuctionHistorical{ + uint64 auction_id = 1 [ + (gogoproto.moretags) = "yaml:\"auction_id\"" + ]; + Auction auction_historical=2[ + (gogoproto.moretags) = "yaml:\"auction_historical\"" + ]; + LockedVault locked_vault= 3[ + (gogoproto.moretags) = "yaml:\"locked_vault\"" + ]; + +} +message Auction{ uint64 auction_id = 1 [ (gogoproto.moretags) = "yaml:\"auction_id\"" ]; @@ -91,6 +104,7 @@ message Auctions{ ]; + } message bidOwnerMapping{ diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index 1e3ed0162..e457c55f4 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -43,7 +43,11 @@ message LiquidationWhiteListing { (gogoproto.moretags) = "yaml:\"english_auction_param\""]; //One thing to keep in mind that somehow it should not happen that a void is created where something at level 2 gets triggerred and it has no data saved a level 1 for lookup and it fails . - + string keeeper_incentive = 11 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"keeper_incentive\"" + ]; } message DutchAuctionParam{ @@ -154,9 +158,9 @@ message LockedVault { (gogoproto.customname) = "InternalKeeperAddress", (gogoproto.moretags) = "yaml:\"internal_keeper_address\""]; - bool is_external_keeper = 14 [ - (gogoproto.customname) = "IsExternalKeeper", - (gogoproto.moretags) = "yaml:\"is_external_keeper\""]; + // bool is_external_keeper = 14 [ + // (gogoproto.customname) = "IsExternalKeeper", + // (gogoproto.moretags) = "yaml:\"is_external_keeper\""]; //To return funds to the external app back string external_keeper_address = 15 [ @@ -183,9 +187,17 @@ message LockedVault { (gogoproto.customname) = "IsDebtCmst", (gogoproto.moretags) = "yaml:\"is_debt_cmst\""]; - uint64 pair_id = 21 [ - (gogoproto.customname) = "PairId", - (gogoproto.moretags) = "yaml:\"pair_id\""]; + // uint64 pair_id = 21 [ + // (gogoproto.customname) = "PairId", + // (gogoproto.moretags) = "yaml:\"pair_id\""]; + uint64 collateral_asset_id = 21 [ + (gogoproto.moretags) = "yaml:\"collateral_asset_id\"" + ]; + uint64 debt_asset_id = 22 [ + (gogoproto.moretags) = "yaml:\"debt_asset_id\"" + + + ]; } diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go index 6af720699..58f83b966 100644 --- a/x/auctionsV2/expected/keeper.go +++ b/x/auctionsV2/expected/keeper.go @@ -5,12 +5,15 @@ import ( esmtypes "github.com/comdex-official/comdex/x/esm/types" liquidationsV2types "github.com/comdex-official/comdex/x/liquidationsV2/types" markettypes "github.com/comdex-official/comdex/x/market/types" + + // vaulttypes "github.com/comdex-official/comdex/x/vault/types" sdk "github.com/cosmos/cosmos-sdk/types" ) type LiquidationsV2Keeper interface { GetLiquidationWhiteListing(ctx sdk.Context, appId uint64) (liquidationWhiteListing liquidationsV2types.LiquidationWhiteListing, found bool) GetLockedVault(ctx sdk.Context, appID, id uint64) (lockedVault liquidationsV2types.LockedVault, found bool) + DeleteLockedVault(ctx sdk.Context,id uint64) } type MarketKeeper interface { @@ -45,3 +48,20 @@ type BankKeeper interface { SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin } +type VaultKeeper interface { + GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdk.Dec, amt1 sdk.Int, id2 uint64, rate2 sdk.Dec) (sdk.Dec, sdk.Int, error) + UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) + UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) +} +type CollectorKeeper interface { + // GetAppidToAssetCollectorMapping(ctx sdk.Context, appID, assetID uint64) (appAssetCollectorData types.AppToAssetIdCollectorMapping, found bool) + // UpdateCollector(ctx sdk.Context, appID, assetID uint64, CollectedStabilityFee, CollectedClosingFee, CollectedOpeningFee, LiquidationRewardsCollected sdk.Int) error + // // SetCollectorLookupTable(ctx sdk.Context, records ...types.CollectorLookupTable) error + // GetCollectorLookupTable(ctx sdk.Context, appID, assetID uint64) (collectorLookup types.CollectorLookupTableData, found bool) + // GetAuctionMappingForApp(ctx sdk.Context, appID, assetID uint64) (collectorAuctionLookupTable types.AppAssetIdToAuctionLookupTable, found bool) + // GetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64) (netFeeData types.AppAssetIdToFeeCollectedData, found bool) + // GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, amount sdk.Int) (sdk.Int, error) + SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdk.Int) error +// SetAuctionMappingForApp(ctx sdk.Context, records types.AppAssetIdToAuctionLookupTable) error +// GetAllAuctionMappingForApp(ctx sdk.Context) (collectorAuctionLookupTable []types.AppAssetIdToAuctionLookupTable, found bool) +} \ No newline at end of file diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index c0cd0f2e1..2a9fc219b 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -5,7 +5,7 @@ import ( utils "github.com/comdex-official/comdex/types" - auctiontypes "github.com/comdex-official/comdex/x/auction/types" + auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" "github.com/comdex-official/comdex/x/auctionsV2/types" liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -50,11 +50,11 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati twaDataCollateral, found := k.market.GetTwa(ctx, pair.AssetIn) if !found || !twaDataCollateral.IsPriceActive { - return auctiontypes.ErrorPrices + return auctionsV2types.ErrorPrices } twaDataDebt, found := k.market.GetTwa(ctx, pair.AssetOut) if !found || !twaDataDebt.IsPriceActive { - return auctiontypes.ErrorPrices + return auctionsV2types.ErrorPrices } //Checking if DEBT token is CMST then setting its price to $1 , else all tokens price will come from oracle. if liquidationData.IsDebtCmst { diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 25a36a942..b9d33b993 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -2,19 +2,214 @@ package keeper import ( "github.com/comdex-official/comdex/x/auctionsV2/types" + auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" + collectortypes "github.com/comdex-official/comdex/x/collector/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" protobuftypes "github.com/gogo/protobuf/types" ) -func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auctions) error { - +func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction) error { + //The bid is in debt token - This is different from the earliar auction model at comdex + if bid.Amount.Equal(sdk.ZeroInt()) { + return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid amount can't be Zero") + } + liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, auctionData.AppId) + + if bid.Denom != auctionData.DebtToken.Denom { + return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the debt token ", bid.Denom) + } + liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, auctionData.AppId, auctionData.LockedVaultId) + //Price data of the token from market module + debtToken, _ := k.market.GetTwa(ctx, auctionData.DebtAssetId) + debtPrice := sdk.NewDecFromInt(sdk.NewInt(int64(debtToken.Twa))) + //Price data of the token from market module + collateralToken, _ := k.market.GetTwa(ctx, auctionData.CollateralAssetId) + collateralPrice := sdk.NewDecFromInt(sdk.NewInt(int64(collateralToken.Twa))) + + //only if debt token is CMST , we consider it as $1 + if liquidationData.IsDebtCmst { + debtPrice = sdk.NewDecFromInt(sdk.NewInt(int64(1000000))) + + } + isBidFinalBid := false + //If user has sent a bigger bid than the target amount , + if bid.Amount.GTE(auctionData.DebtToken.Amount) { + bid.Amount = auctionData.DebtToken.Amount + isBidFinalBid = true + // bidPercent := 0 + debtuDollar, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + //From auction bonus quantity , use the available quantity to calculate the collateral value + _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, liquidationData.BonusToBeGiven, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + + //Checking if the auction bonus and the collateral to be given to user isnt more than available colalteral + totalCollateralTokenQuanitity := collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus) + if totalCollateralTokenQuanitity.LTE(auctionData.CollateralToken.Amount) { + //If everything is correct + + //Take Debt Token from user , + if bid.Amount.GT(sdk.ZeroInt()) { + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) + if err != nil { + return err + } + } + + //Send Collateral To bidder + if bid.Amount.GT(sdk.ZeroInt()) { + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) + if err != nil { + return err + } + } + + //Burn Debt Token, + liquidationPenalty := sdk.NewCoin(auctionData.DebtToken.Denom, liquidationData.FeeToBeCollected) + tokensToBurn := auctionData.DebtToken.Sub(liquidationPenalty) + + if tokensToBurn.Amount.GT(sdk.ZeroInt()) { + err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(tokensToBurn)) + if err != nil { + return err + } + } + + //Send rest tokens to the user + OwnerLeftOverCapital := auctionData.CollateralToken.Amount.Sub(totalCollateralTokenQuanitity) + if bid.Amount.GT(sdk.ZeroInt()) { + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, OwnerLeftOverCapital))) + if err != nil { + return err + } + } + //Add bid data to struct + //Creating user bid struct + bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") + if err != nil { + return err + } + //Based on app type call perform specific function - external , internal and /or keeper incentive + //See if this was keeper initiated transaction- then incentivisation will be in place based on the percentage + //For apps that are external to comdex chain + if liquidationData.InitiatorType == "external" { + + //but if an app is external - will have to check the auction bonus , liquidation penalty , module account mechanism + + } else if liquidationData.InitiatorType == "vault" { + //Check if they are initiated through a keeper, if so they will be incentivised + if liquidationData.IsInternalKeeper { + + keeperIncentive := (liquidationWhitelistingAppData.KeeeperIncentive.Mul(sdk.NewDecFromInt(liquidationPenalty.Amount))).TruncateInt() + if keeperIncentive.GT(sdk.ZeroInt()) { + liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.InternalKeeperAddress), sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) + if err != nil { + return err + } + + } + } + //Send Liquidation Penalty to the Collector Module + if liquidationPenalty.Amount.GT(sdk.ZeroInt()) { + err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(liquidationPenalty)) + if err != nil { + return err + } + } + //Update Collector Data for CMST + // Updating fees data in collector + err = k.collector.SetNetFeeCollectedData(ctx, auctionData.AppId, auctionData.CollateralAssetId, liquidationPenalty.Amount) + if err != nil { + return err + } + //Updating mapping data of vault + k.vault.UpdateTokenMintedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, tokensToBurn.Amount, false) + k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, auctionData.CollateralToken.Amount, false) + + } else if liquidationData.InitiatorType == "borrow" { + //Check if they are initiated through a keeper, if so they will be incentivised + + } + + //Add bidder data in auction + bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{bidding_id, string(bidder)} + auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMapppingData) + //Savinga auction data to auction historical + auctionHistoricalData := auctionsV2types.AuctionHistorical{auctionID, &auctionData, liquidationData} + k.SetAuctionHistorical(ctx, auctionHistoricalData) + //Close Auction + k.DeleteAuction(ctx, auctionData) + //Delete liquidation Data + k.LiquidationsV2.DeleteLockedVault(ctx, liquidationData.LockedVaultId) + } else { + //This means that there is less collateral available . + //So we first try to compensate the difference through the liquidation penalty + //check the difference in collateral - + //check if nullifing liquidation penalty helps + //if yes - go for it + + //else call the module account to give funds to compensate the user. + + } + + } else { + //if bid amount is less than the target bid + + //Checking if bid isnt leaving dust amount less than allowed -for collateral & debt + + //Calculating collateral token value from bid(debt) token value + debtuDollar, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, collateralPrice) + //From auction bonus quantity , use the available quantity to calculate the collateral value + + //Checking bid.Amount -> to targetbid ratio + //using that ratio data to calculate auction bonus to be given for the bid + //first taking the debt percentage data + //then calculating the collateral token data + _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, liquidationData.BonusToBeGiven, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + + if collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus).LTE(auctionData.CollateralToken.Amount) { + //If there is sufficient collalteral + + } else { + + //Not sure if this condition will arise in which partial bids also arent able to be fulfilled due to shortage of collateral token + } + + //Deducting auction bonus value from liquidation data also for next bid. + } + //Deducting the auction bonus + + //Now checking if the bid is not the final bid, we will check the dust amount left by the bidder + //if the dust check passes, it is good to go. + //Dust check for debt token return nil } -func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auctions) error { +func (k Keeper) CreateUserBid(ctx sdk.Context, appID uint64, BidderAddress string, auctionID uint64, collateralToken sdk.Coin, debtToken sdk.Coin, bidType string) (bidding_id uint64, err error) { + + userBidId := k.GetUserBidID(ctx) + bidding := auctionsV2types.Bid{ + BiddingId: userBidId + 1, + AuctionId: auctionID, + CollateralTokenAmount: collateralToken, + DebtTokenAmount: debtToken, + BidderAddress: BidderAddress, + BiddingTimestamp: ctx.BlockHeader().Time, + AppId: appID, + BidType: bidType, + } + k.SetUserBidID(ctx, bidding.BiddingId) + err = k.SetUserBid(ctx, bidding) + if err != nil { + return bidding_id, err + } + return bidding.BiddingId, nil +} + +func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction) error { return nil } diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index 666a5f391..213039ae3 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -23,6 +23,8 @@ type ( market expected.MarketKeeper asset expected.AssetKeeper esm expected.EsmKeeper + vault expected.VaultKeeper + collector expected.CollectorKeeper } ) @@ -41,6 +43,8 @@ func NewKeeper( marketKeeper expected.MarketKeeper, assetKeeper expected.AssetKeeper, esm expected.EsmKeeper, + vaultKeeper expected.VaultKeeper, + collector expected.CollectorKeeper, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -57,6 +61,8 @@ func NewKeeper( market: marketKeeper, asset: assetKeeper, esm: esm, + vault: vaultKeeper, + collector: collector, } } diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go index 7b8dcdc6e..39e2e1d52 100644 --- a/x/auctionsV2/keeper/utils.go +++ b/x/auctionsV2/keeper/utils.go @@ -1,10 +1,7 @@ package keeper import ( - "time" - "github.com/comdex-official/comdex/x/auctionsV2/types" - liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" protobuftypes "github.com/gogo/protobuf/types" @@ -39,7 +36,36 @@ func (k Keeper) GetAuctionID(ctx sdk.Context) uint64 { return id.GetValue() } -func (k Keeper) SetAuction(ctx sdk.Context, auction types.Auctions) error { +func (k Keeper) SetUserBidID(ctx sdk.Context, id uint64) { + var ( + store = k.Store(ctx) + key = types.UserBidIDKey + value = k.cdc.MustMarshal( + &protobuftypes.UInt64Value{ + Value: id, + }, + ) + ) + store.Set(key, value) +} +func (k Keeper) GetUserBidID(ctx sdk.Context) uint64 { + var ( + store = k.Store(ctx) + key = types.UserBidIDKey + value = store.Get(key) + ) + + if value == nil { + return 0 + } + + var id protobuftypes.UInt64Value + k.cdc.MustUnmarshal(value, &id) + + return id.GetValue() +} + +func (k Keeper) SetAuction(ctx sdk.Context, auction types.Auction) error { var ( store = k.Store(ctx) @@ -50,6 +76,29 @@ func (k Keeper) SetAuction(ctx sdk.Context, auction types.Auctions) error { store.Set(key, value) return nil } +func (k Keeper) SetAuctionHistorical(ctx sdk.Context, auction types.AuctionHistorical) error { + + var ( + store = k.Store(ctx) + key = types.AuctionHistoricalKey(auction.AuctionId) + value = k.cdc.MustMarshal(&auction) + ) + + store.Set(key, value) + return nil +} + +func (k Keeper) SetUserBid(ctx sdk.Context, userBid types.Bid) error { + + var ( + store = k.Store(ctx) + key = types.UserBidKey(userBid.BiddingId) + value = k.cdc.MustMarshal(&userBid) + ) + + store.Set(key, value) + return nil +} // func (k Keeper) AddAuctionParams(ctx sdk.Context, liquidationData liquidationtypes.LockedVault,auctionID uint64) (auction types.Auctions, err error) { @@ -76,7 +125,7 @@ func (k Keeper) SetAuction(ctx sdk.Context, auction types.Auctions) error { // } -func (k Keeper) DeleteAuction(ctx sdk.Context, auction types.Auctions) error { +func (k Keeper) DeleteAuction(ctx sdk.Context, auction types.Auction) error { var ( store = k.Store(ctx) @@ -86,7 +135,22 @@ func (k Keeper) DeleteAuction(ctx sdk.Context, auction types.Auctions) error { return nil } -func (k Keeper) GetAuction(ctx sdk.Context, auctionID uint64) (auction types.Auctions, err error) { +func (k Keeper) GetUserBid(ctx sdk.Context, userBidId uint64) (userBid types.Bid, err error) { + var ( + store = k.Store(ctx) + key = types.UserBidKey(userBidId) + value = store.Get(key) + ) + + if value == nil { + return userBid, sdkerrors.ErrNotFound + } + + k.cdc.MustUnmarshal(value, &userBid) + return userBid, nil +} + +func (k Keeper) GetAuction(ctx sdk.Context, auctionID uint64) (auction types.Auction, err error) { var ( store = k.Store(ctx) key = types.AuctionKey(auctionID) @@ -101,7 +165,22 @@ func (k Keeper) GetAuction(ctx sdk.Context, auctionID uint64) (auction types.Auc return auction, nil } -func (k Keeper) GetAuctions(ctx sdk.Context) (auctions []types.Auctions) { +func (k Keeper) GetAuctionHistorical(ctx sdk.Context, auctionID uint64) (auction types.AuctionHistorical, err error) { + var ( + store = k.Store(ctx) + key = types.AuctionHistoricalKey(auctionID) + value = store.Get(key) + ) + + if value == nil { + return auction, sdkerrors.ErrNotFound + } + + k.cdc.MustUnmarshal(value, &auction) + return auction, nil +} + +func (k Keeper) GetAuctions(ctx sdk.Context) (auctions []types.Auction) { var ( store = k.Store(ctx) iter = sdk.KVStorePrefixIterator(store, types.AuctionKeyPrefix) @@ -115,10 +194,53 @@ func (k Keeper) GetAuctions(ctx sdk.Context) (auctions []types.Auctions) { }(iter) for ; iter.Valid(); iter.Next() { - var auction types.Auctions + var auction types.Auction + k.cdc.MustUnmarshal(iter.Value(), &auction) + auctions = append(auctions, auction) + } + + return auctions +} +func (k Keeper) GetAuctionHistoricals(ctx sdk.Context) (auctions []types.AuctionHistorical) { + var ( + store = k.Store(ctx) + iter = sdk.KVStorePrefixIterator(store, types.AuctionHistoricalKeyPrefix) + ) + + defer func(iter sdk.Iterator) { + err := iter.Close() + if err != nil { + return + } + }(iter) + + for ; iter.Valid(); iter.Next() { + var auction types.AuctionHistorical k.cdc.MustUnmarshal(iter.Value(), &auction) auctions = append(auctions, auction) } return auctions } + +func (k Keeper) GetUserBids(ctx sdk.Context) (userBids []types.Bid) { + var ( + store = k.Store(ctx) + iter = sdk.KVStorePrefixIterator(store, types.UserBidKeyPrefix) + ) + + defer func(iter sdk.Iterator) { + err := iter.Close() + if err != nil { + return + } + }(iter) + + for ; iter.Valid(); iter.Next() { + var userBid types.Bid + k.cdc.MustUnmarshal(iter.Value(), &userBid) + userBids = append(userBids, userBid) + } + + return userBids +} diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index 041622d04..80c1818a7 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -29,7 +29,59 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type Auctions struct { +type AuctionHistorical struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + AuctionHistorical *Auction `protobuf:"bytes,2,opt,name=auction_historical,json=auctionHistorical,proto3" json:"auction_historical,omitempty" yaml:"auction_data"` +} + +func (m *AuctionHistorical) Reset() { *m = AuctionHistorical{} } +func (m *AuctionHistorical) String() string { return proto.CompactTextString(m) } +func (*AuctionHistorical) ProtoMessage() {} +func (*AuctionHistorical) Descriptor() ([]byte, []int) { + return fileDescriptor_8ee47f5a405fa8ba, []int{0} +} +func (m *AuctionHistorical) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuctionHistorical) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuctionHistorical.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuctionHistorical) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuctionHistorical.Merge(m, src) +} +func (m *AuctionHistorical) XXX_Size() int { + return m.Size() +} +func (m *AuctionHistorical) XXX_DiscardUnknown() { + xxx_messageInfo_AuctionHistorical.DiscardUnknown(m) +} + +var xxx_messageInfo_AuctionHistorical proto.InternalMessageInfo + +func (m *AuctionHistorical) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + +func (m *AuctionHistorical) GetAuctionHistorical() *Auction { + if m != nil { + return m.AuctionHistorical + } + return nil +} + +type Auction struct { AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` CollateralToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=collateral_token,json=collateralToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token" yaml:"collateral_token"` // cosmos.base.v1beta1.Coin outflow_token_current_amount = 3 [ @@ -59,18 +111,18 @@ type Auctions struct { DebtAssetId uint64 `protobuf:"varint,16,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` } -func (m *Auctions) Reset() { *m = Auctions{} } -func (m *Auctions) String() string { return proto.CompactTextString(m) } -func (*Auctions) ProtoMessage() {} -func (*Auctions) Descriptor() ([]byte, []int) { - return fileDescriptor_8ee47f5a405fa8ba, []int{0} +func (m *Auction) Reset() { *m = Auction{} } +func (m *Auction) String() string { return proto.CompactTextString(m) } +func (*Auction) ProtoMessage() {} +func (*Auction) Descriptor() ([]byte, []int) { + return fileDescriptor_8ee47f5a405fa8ba, []int{1} } -func (m *Auctions) XXX_Unmarshal(b []byte) error { +func (m *Auction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Auctions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Auction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Auctions.Marshal(b, m, deterministic) + return xxx_messageInfo_Auction.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -80,96 +132,96 @@ func (m *Auctions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Auctions) XXX_Merge(src proto.Message) { - xxx_messageInfo_Auctions.Merge(m, src) +func (m *Auction) XXX_Merge(src proto.Message) { + xxx_messageInfo_Auction.Merge(m, src) } -func (m *Auctions) XXX_Size() int { +func (m *Auction) XXX_Size() int { return m.Size() } -func (m *Auctions) XXX_DiscardUnknown() { - xxx_messageInfo_Auctions.DiscardUnknown(m) +func (m *Auction) XXX_DiscardUnknown() { + xxx_messageInfo_Auction.DiscardUnknown(m) } -var xxx_messageInfo_Auctions proto.InternalMessageInfo +var xxx_messageInfo_Auction proto.InternalMessageInfo -func (m *Auctions) GetAuctionId() uint64 { +func (m *Auction) GetAuctionId() uint64 { if m != nil { return m.AuctionId } return 0 } -func (m *Auctions) GetCollateralToken() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *Auction) GetCollateralToken() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { return m.CollateralToken } return github_com_cosmos_cosmos_sdk_types.Coin{} } -func (m *Auctions) GetDebtToken() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *Auction) GetDebtToken() github_com_cosmos_cosmos_sdk_types.Coin { if m != nil { return m.DebtToken } return github_com_cosmos_cosmos_sdk_types.Coin{} } -func (m *Auctions) GetActiveBiddingId() uint64 { +func (m *Auction) GetActiveBiddingId() uint64 { if m != nil { return m.ActiveBiddingId } return 0 } -func (m *Auctions) GetBiddingIds() []*BidOwnerMapping { +func (m *Auction) GetBiddingIds() []*BidOwnerMapping { if m != nil { return m.BiddingIds } return nil } -func (m *Auctions) GetLockedVaultId() uint64 { +func (m *Auction) GetLockedVaultId() uint64 { if m != nil { return m.LockedVaultId } return 0 } -func (m *Auctions) GetStartTime() time.Time { +func (m *Auction) GetStartTime() time.Time { if m != nil { return m.StartTime } return time.Time{} } -func (m *Auctions) GetEndTime() time.Time { +func (m *Auction) GetEndTime() time.Time { if m != nil { return m.EndTime } return time.Time{} } -func (m *Auctions) GetAppId() uint64 { +func (m *Auction) GetAppId() uint64 { if m != nil { return m.AppId } return 0 } -func (m *Auctions) GetAuctionType() bool { +func (m *Auction) GetAuctionType() bool { if m != nil { return m.AuctionType } return false } -func (m *Auctions) GetCollateralAssetId() uint64 { +func (m *Auction) GetCollateralAssetId() uint64 { if m != nil { return m.CollateralAssetId } return 0 } -func (m *Auctions) GetDebtAssetId() uint64 { +func (m *Auction) GetDebtAssetId() uint64 { if m != nil { return m.DebtAssetId } @@ -185,7 +237,7 @@ func (m *BidOwnerMapping) Reset() { *m = BidOwnerMapping{} } func (m *BidOwnerMapping) String() string { return proto.CompactTextString(m) } func (*BidOwnerMapping) ProtoMessage() {} func (*BidOwnerMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_8ee47f5a405fa8ba, []int{1} + return fileDescriptor_8ee47f5a405fa8ba, []int{2} } func (m *BidOwnerMapping) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -229,7 +281,8 @@ func (m *BidOwnerMapping) GetBidOwner() string { } func init() { - proto.RegisterType((*Auctions)(nil), "comdex.auctionsV2.v1beta1.Auctions") + proto.RegisterType((*AuctionHistorical)(nil), "comdex.auctionsV2.v1beta1.AuctionHistorical") + proto.RegisterType((*Auction)(nil), "comdex.auctionsV2.v1beta1.Auction") proto.RegisterType((*BidOwnerMapping)(nil), "comdex.auctionsV2.v1beta1.bidOwnerMapping") } @@ -238,64 +291,106 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 852 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4f, 0x8f, 0xdb, 0x44, - 0x14, 0x5f, 0xd3, 0xee, 0x36, 0x99, 0xec, 0x92, 0xae, 0xbb, 0x6d, 0xdd, 0x2c, 0xb5, 0xd3, 0x39, - 0xb4, 0x11, 0x52, 0x6d, 0x75, 0xe9, 0x09, 0x71, 0xa9, 0x0b, 0x88, 0x20, 0xd1, 0xa2, 0x21, 0xaa, - 0x10, 0x17, 0x6b, 0xec, 0x99, 0x84, 0xd1, 0x3a, 0x1e, 0xcb, 0x9e, 0x6c, 0xd9, 0x8f, 0xc0, 0x05, - 0xed, 0x09, 0x89, 0x0f, 0xc1, 0xf7, 0xe8, 0xb1, 0x47, 0xc4, 0xc1, 0xa0, 0xdd, 0x6f, 0xe0, 0x23, - 0x27, 0x34, 0x7f, 0xbc, 0x4e, 0xd2, 0xa2, 0x25, 0xa7, 0x64, 0xde, 0xfc, 0xde, 0xef, 0xfd, 0x66, - 0xfc, 0x7b, 0x6f, 0xc0, 0xa3, 0x84, 0xcf, 0x09, 0xfd, 0x29, 0xc0, 0x8b, 0x44, 0x30, 0x9e, 0x95, - 0xaf, 0x8e, 0x82, 0x93, 0x27, 0x31, 0x15, 0xf8, 0x49, 0x13, 0xf2, 0xf3, 0x82, 0x0b, 0x6e, 0xdf, - 0xd3, 0x40, 0xbf, 0x05, 0xfa, 0x06, 0x38, 0x38, 0x98, 0xf1, 0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x26, 0xa7, - 0x39, 0xad, 0x2b, 0xef, 0xd6, 0xea, 0x68, 0x95, 0x60, 0x88, 0x7a, 0xb8, 0xc5, 0xd8, 0x2f, 0xc0, - 0xad, 0x25, 0x2b, 0xe2, 0xb2, 0xa4, 0xea, 0xaa, 0xfb, 0x4a, 0x81, 0x5b, 0x57, 0xde, 0xe0, 0x9d, - 0x09, 0xda, 0x80, 0x20, 0xda, 0x6f, 0xa3, 0xcf, 0x64, 0x70, 0x4c, 0xec, 0xcf, 0xc0, 0x9e, 0x72, - 0xd0, 0x25, 0xd3, 0x4d, 0xc5, 0xe4, 0xd4, 0x95, 0x77, 0xa0, 0x99, 0x56, 0xb6, 0x21, 0xea, 0xc9, - 0xb5, 0xc9, 0x86, 0x5f, 0x80, 0xfe, 0xda, 0x40, 0xb1, 0x6f, 0x83, 0x1d, 0xd9, 0xe2, 0xcd, 0x8b, - 0x81, 0xb6, 0x63, 0x46, 0xc6, 0xc4, 0x3e, 0x04, 0xb2, 0xd9, 0x23, 0x2e, 0xa1, 0xea, 0x39, 0xe8, - 0xa2, 0x4e, 0x93, 0x1a, 0xbe, 0x78, 0x73, 0xee, 0x5a, 0x6f, 0xcf, 0x5d, 0xeb, 0xef, 0x73, 0xd7, - 0x3a, 0xbb, 0x70, 0xb7, 0xde, 0x5e, 0xb8, 0x5b, 0x7f, 0x5c, 0xb8, 0x5b, 0x3f, 0x3c, 0x5d, 0xf1, - 0xad, 0x1c, 0x6a, 0x8f, 0xf9, 0x74, 0xca, 0x12, 0x86, 0x53, 0xb3, 0x0e, 0x56, 0x1e, 0x52, 0xe5, - 0xe4, 0x78, 0x47, 0x7d, 0xd3, 0x4f, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x43, 0x35, 0x4d, - 0x6a, 0x07, 0x00, 0x00, + // 895 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0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x8d, 0x1b, 0x8c, 0xfd, 0x0c, 0xdc, 0x58, 0xb2, 0x22, 0x2e, 0x0a, + 0xaa, 0x5a, 0xdd, 0x51, 0x0a, 0x9c, 0xaa, 0x74, 0xfb, 0x17, 0x26, 0x68, 0x0d, 0x82, 0xa8, 0xdb, + 0x44, 0x1f, 0xcb, 0xe0, 0x88, 0xd8, 0x9f, 0x80, 0x5d, 0xe5, 0xa0, 0x05, 0xd3, 0x75, 0xc5, 0xd4, + 0xab, 0x4a, 0x77, 0x4f, 0x33, 0xad, 0x6c, 0x43, 0xd4, 0x96, 0x6b, 0x93, 0x0d, 0x3f, 0x03, 0x9d, + 0xb5, 0x81, 0x62, 0xdf, 0x04, 0x9b, 0xf2, 0x8a, 0xd7, 0x2f, 0x06, 0xba, 0x16, 0x31, 0x32, 0x22, + 0xf6, 0x01, 0x90, 0x97, 0x3d, 0xe4, 0x12, 0xaa, 0x9e, 0x83, 0x16, 0xda, 0xae, 0x53, 0x83, 0x67, + 0xaf, 0xcf, 0x1c, 0xeb, 0xcd, 0x99, 0x63, 0xfd, 0x79, 0xe6, 0x58, 0xa7, 0xe7, 0xce, 0xc6, 0x9b, + 0x73, 0x67, 0xe3, 0xb7, 0x73, 0x67, 0xe3, 0xdb, 0x47, 0x2b, 0xbe, 0x95, 0x43, 0xed, 0x01, 0x9f, + 0x4c, 0x58, 0xcc, 0x70, 0x62, 0xd6, 0xfe, 0xca, 0xfb, 0xaf, 0x9c, 0x1c, 0x6d, 0xaa, 0x6f, 0xfa, + 0xd1, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xbb, 0x0a, 0xb9, 0x21, 0x08, 0x00, 0x00, +} + +func (m *AuctionHistorical) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AuctionHistorical) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Auctions) Marshal() (dAtA []byte, err error) { +func (m *AuctionHistorical) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AuctionHistorical != nil { + { + size, err := m.AuctionHistorical.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.AuctionId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Auction) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -305,12 +400,12 @@ func (m *Auctions) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Auctions) MarshalTo(dAtA []byte) (int, error) { +func (m *Auction) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -342,21 +437,21 @@ func (m *Auctions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x68 } - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintAuction(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x62 - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) if err2 != nil { return 0, err2 } i -= n2 i = encodeVarintAuction(dAtA, i, uint64(n2)) i-- + dAtA[i] = 0x62 + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintAuction(dAtA, i, uint64(n3)) + i-- dAtA[i] = 0x5a if m.LockedVaultId != 0 { i = encodeVarintAuction(dAtA, i, uint64(m.LockedVaultId)) @@ -496,7 +591,23 @@ func encodeVarintAuction(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Auctions) Size() (n int) { +func (m *AuctionHistorical) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovAuction(uint64(m.AuctionId)) + } + if m.AuctionHistorical != nil { + l = m.AuctionHistorical.Size() + n += 1 + l + sovAuction(uint64(l)) + } + return n +} + +func (m *Auction) Size() (n int) { if m == nil { return 0 } @@ -570,7 +681,112 @@ func sovAuction(x uint64) (n int) { func sozAuction(x uint64) (n int) { return sovAuction(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Auctions) Unmarshal(dAtA []byte) error { +func (m *AuctionHistorical) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AuctionHistorical: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuctionHistorical: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionHistorical", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AuctionHistorical == nil { + m.AuctionHistorical = &Auction{} + } + if err := m.AuctionHistorical.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Auction) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -593,10 +809,10 @@ func (m *Auctions) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Auctions: wiretype end group for non-group") + return fmt.Errorf("proto: Auction: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Auctions: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Auction: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index d7bdadaea..638f1953f 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -30,8 +30,18 @@ var ( AuctionKeyPrefix = []byte{0x02} LimitAuctionBidIDKey = []byte{0x03} AuctionParamsKey = []byte{0x04} + UserBidIDKey = []byte{0x05} + UserBidKeyPrefix = []byte{0x06} + AuctionHistoricalKeyPrefix = []byte{0x07} ) func AuctionKey(auctionID uint64) []byte { return append(append(AuctionKeyPrefix, sdk.Uint64ToBigEndian(auctionID)...)) } +func AuctionHistoricalKey(auctionID uint64) []byte { + return append(append(AuctionHistoricalKeyPrefix, sdk.Uint64ToBigEndian(auctionID)...)) +} + +func UserBidKey(userBidId uint64) []byte { + return append(append(UserBidKeyPrefix, sdk.Uint64ToBigEndian(userBidId)...)) +} diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 92e915b72..18260942c 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -166,7 +166,7 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair DebtToken: AmountOut, //just a representation of the total debt the vault had incurred at the time of liquidation. // Target debt is a correct measure of what will get collected in the auction from bidders. CurrentCollaterlisationRatio: collateralizationRatio, CollateralToBeAuctioned: AmountIn, - TargetDebt: AmountOut.Add(sdk.NewCoin(AmountOut.Denom, feesToBeCollected)).Add(sdk.NewCoin(AmountOut.Denom, bonusToBeGiven)), //to add debt+liquidation+auction bonus here---- + TargetDebt: AmountOut.Add(sdk.NewCoin(AmountOut.Denom, feesToBeCollected)), //to add debt+liquidation+auction bonus here---- LiquidationTimestamp: ctx.BlockTime(), FeeToBeCollected: feesToBeCollected, //just for calculation purpose BonusToBeGiven: bonusToBeGiven, //just for calculation purpose diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index f810e426b..0fd6ede39 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -42,8 +42,9 @@ type LiquidationWhiteListing struct { IsDutchActivated bool `protobuf:"varint,7,opt,name=is_dutch_activated,json=isDutchActivated,proto3" json:"is_dutch_activated,omitempty" yaml:"is_dutch_activated"` DutchAuctionParam *DutchAuctionParam `protobuf:"bytes,8,opt,name=dutch_auction_param,json=dutchAuctionParam,proto3" json:"dutch_auction_param,omitempty" yaml:"dutch_auction_param"` //Sets of Params for English Auction - IsEnglishActivated bool `protobuf:"varint,9,opt,name=is_english_activated,json=isEnglishActivated,proto3" json:"is_english_activated,omitempty" yaml:"is_english_activated"` - EnglishAuctionParam *EnglishAuctionParam `protobuf:"bytes,10,opt,name=english_auction_param,json=englishAuctionParam,proto3" json:"english_auction_param,omitempty" yaml:"english_auction_param"` + IsEnglishActivated bool `protobuf:"varint,9,opt,name=is_english_activated,json=isEnglishActivated,proto3" json:"is_english_activated,omitempty" yaml:"is_english_activated"` + EnglishAuctionParam *EnglishAuctionParam `protobuf:"bytes,10,opt,name=english_auction_param,json=englishAuctionParam,proto3" json:"english_auction_param,omitempty" yaml:"english_auction_param"` + KeeeperIncentive github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=keeeper_incentive,json=keeeperIncentive,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"keeeper_incentive" yaml:"keeper_incentive"` } func (m *LiquidationWhiteListing) Reset() { *m = LiquidationWhiteListing{} } @@ -207,7 +208,6 @@ type LockedVault struct { // true for internal liquidator through bot , false if abci initiated liquidation IsInternalKeeper bool `protobuf:"varint,12,opt,name=is_internal_keeper,json=isInternalKeeper,proto3" json:"is_internal_keeper,omitempty" yaml:"is_intenal_keeper"` InternalKeeperAddress string `protobuf:"bytes,13,opt,name=internal_keeper_address,json=internalKeeperAddress,proto3" json:"internal_keeper_address,omitempty" yaml:"internal_keeper_address"` - IsExternalKeeper bool `protobuf:"varint,14,opt,name=is_external_keeper,json=isExternalKeeper,proto3" json:"is_external_keeper,omitempty" yaml:"is_external_keeper"` //To return funds to the external app back ExternalKeeperAddress string `protobuf:"bytes,15,opt,name=external_keeper_address,json=externalKeeperAddress,proto3" json:"external_keeper_address,omitempty" yaml:"external_keeper_address"` FeeToBeCollected github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,16,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee_to_be_collected" yaml:"fee_to_be_collected"` @@ -264,95 +264,95 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 1394 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0xa6, 0x4d, 0xd2, 0x8c, 0x13, 0xc7, 0x9e, 0xc4, 0xcd, 0x36, 0xb4, 0x9e, 0xb0, 0x52, - 0x4b, 0x85, 0x14, 0xbb, 0x49, 0x55, 0x81, 0xe0, 0x40, 0xe3, 0x24, 0x2d, 0x86, 0x48, 0x6d, 0x57, - 0x55, 0x91, 0x2a, 0x60, 0x59, 0xef, 0x8e, 0x9d, 0x51, 0xec, 0x5d, 0xb3, 0x3b, 0x0e, 0xe9, 0x05, - 0x89, 0x13, 0x07, 0x0e, 0xb4, 0x07, 0xce, 0x5c, 0xe1, 0xbf, 0xe0, 0xc0, 0xa1, 0xc7, 0x1e, 0x38, - 0x20, 0x0e, 0x03, 0x6c, 0xff, 0x03, 0x1f, 0x39, 0xa1, 0xf9, 0xb1, 0x3f, 0x6c, 0x6f, 0x53, 0x7c, - 0xe0, 0xd2, 0xd4, 0x33, 0xdf, 0xf7, 0xbd, 0xf7, 0x66, 0xde, 0xbc, 0xf7, 0x16, 0x6c, 0x39, 0x7e, - 0xcf, 0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x0e, 0x25, 0x27, 0x36, 0xc5, 0xae, 0xbe, 0x20, 0x94, 0xb6, - 0x23, 0x86, 0x4a, 0xcd, 0x70, 0x9f, 0x6f, 0xee, 0xc6, 0x7b, 0x43, 0x86, 0x2e, 0x29, 0xc1, 0x09, - 0x9e, 0x61, 0x96, 0xc8, 0x18, 0x1c, 0xfe, 0xa0, 0x81, 0x55, 0x05, 0x1b, 0x38, 0x3c, 0x64, 0xab, - 0x6f, 0x07, 0x76, 0x4f, 0xbf, 0xb0, 0xa9, 0x5d, 0x2f, 0xec, 0xdc, 0xa8, 0x9d, 0x79, 0x0b, 0x35, - 0x29, 0x26, 0x89, 0xf7, 0x39, 0xaf, 0x71, 0x33, 0x62, 0xa8, 0x3c, 0xb1, 0x3c, 0x64, 0x68, 0x43, - 0x7a, 0x95, 0x63, 0xcb, 0x30, 0xcb, 0xee, 0x38, 0x01, 0x76, 0xc0, 0x1a, 0x09, 0x2d, 0xec, 0x75, - 0xba, 0x24, 0xcc, 0x86, 0xbe, 0x28, 0x42, 0xbf, 0x15, 0x31, 0x04, 0x9b, 0xe1, 0x81, 0xdc, 0xce, - 0x06, 0xff, 0x46, 0x12, 0xfc, 0x04, 0xd7, 0x30, 0x21, 0x99, 0xa0, 0xc0, 0x1f, 0x35, 0x50, 0x49, - 0xa0, 0x23, 0x47, 0x00, 0xc4, 0x11, 0xec, 0xbc, 0xe6, 0x08, 0x62, 0xc1, 0xec, 0x21, 0xbc, 0x13, - 0x31, 0xb4, 0x9a, 0xb3, 0x31, 0x64, 0xe8, 0xb2, 0xf4, 0x2f, 0xd7, 0xa2, 0x61, 0xae, 0xe2, 0x49, - 0x92, 0xf1, 0xeb, 0x2c, 0x98, 0x3c, 0x51, 0xf8, 0x18, 0x2c, 0xf4, 0x03, 0xdc, 0x23, 0x83, 0x9e, - 0x48, 0xc7, 0xc5, 0xc6, 0xed, 0xe7, 0x0c, 0xcd, 0xfc, 0xc1, 0xd0, 0xb5, 0x0e, 0xa1, 0x47,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 0x0e, - 0x00, 0x00, + // 1403 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0xa6, 0x4d, 0x52, 0x8f, 0xf3, 0xc3, 0x9e, 0xc4, 0xcd, 0x36, 0xdf, 0xd6, 0x93, 0xef, + 0x4a, 0xed, 0x37, 0xfa, 0x4a, 0xb1, 0x9b, 0x54, 0x15, 0x08, 0x0e, 0x34, 0x4e, 0xd2, 0x62, 0x88, + 0xd4, 0x76, 0x55, 0x15, 0xa9, 0x02, 0x96, 0xf5, 0xee, 0xd8, 0x19, 0xc5, 0xde, 0x35, 0xbb, 0xe3, + 0x90, 0x5e, 0x90, 0x38, 0x21, 0xc4, 0x81, 0x72, 0xe0, 0xcc, 0x15, 0xfe, 0x0b, 0x0e, 0x1c, 0x7a, + 0xec, 0x11, 0x71, 0x18, 0x60, 0xfb, 0x1f, 0x98, 0x1b, 0x27, 0x34, 0x3f, 0xf6, 0x87, 0xed, 0x6d, + 0x8a, 0x0f, 0x5c, 0x9a, 0x7a, 0xde, 0xe7, 0xf3, 0x79, 0x6f, 0x66, 0xde, 0xbc, 0xf7, 0x16, 0x6c, + 0x3b, 0x7e, 0xcf, 0xc5, 0x67, 0xf5, 0x2e, 0xf9, 0x74, 0x40, 0x5c, 0x9b, 0x12, 0xdf, 0x0b, 0x1f, + 0xef, 0xd6, 0x4f, 0x77, 0x5a, 0x98, 0xda, 0x3b, 0xc9, 0x32, 0xae, 0xf5, 0x03, 0x9f, 0xfa, 0xf0, + 0x9a, 0x84, 0xd7, 0x46, 0xe1, 0x35, 0x05, 0xdf, 0x58, 0xeb, 0xf8, 0x1d, 0x5f, 0x20, 0xeb, 0xfc, + 0x7f, 0x92, 0xb4, 0x81, 0x3a, 0xbe, 0xdf, 0xe9, 0xe2, 0xba, 0xf8, 0xd5, 0x1a, 0xb4, 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31, 0x49, 0x7c, 0xc0, 0x79, 0x8d, 0x5b, 0x11, 0x43, 0xe5, 0x89, 0xe5, 0x21, 0x43, + 0x1b, 0x32, 0xaa, 0x1c, 0x5f, 0x86, 0x59, 0x76, 0xc7, 0x09, 0xb0, 0x03, 0xd6, 0x48, 0x68, 0x61, + 0xaf, 0xd3, 0x25, 0x61, 0x76, 0xeb, 0x05, 0xb1, 0xf5, 0xdb, 0x11, 0x43, 0xb0, 0x19, 0x1e, 0x4a, + 0x73, 0x76, 0xf3, 0xff, 0x49, 0x36, 0x3f, 0xc1, 0x35, 0x4c, 0x48, 0x26, 0x28, 0xf0, 0x7b, 0x0d, + 0x54, 0x12, 0xe8, 0xc8, 0x11, 0x00, 0x71, 0x04, 0xbb, 0xaf, 0x39, 0x82, 0x58, 0x30, 0x7b, 0x08, + 0x6f, 0x44, 0x0c, 0xad, 0xe6, 0x18, 0x86, 0x0c, 0x5d, 0x95, 0xf1, 0xe5, 0x7a, 0x34, 0xcc, 0x55, + 0x3c, 0x49, 0x82, 0xa7, 0xa0, 0x7c, 0x82, 0x31, 0xee, 0xe3, 0xc0, 0x22, 0x9e, 0x83, 0x3d, 0x4a, + 0x4e, 0xb1, 0x5e, 0xdc, 0xd4, 0xb6, 0x0a, 0x8d, 0xe6, 0x73, 0x86, 0x66, 0x7e, 0x65, 0xe8, 0x46, + 0x87, 0xd0, 0xe3, 0x41, 0x8b, 0x87, 0x5a, 0x57, 0x19, 0x2e, 0xff, 0x6c, 0x87, 0xee, 0x49, 0x9d, + 0x3e, 0xed, 0xe3, 0xb0, 0x76, 0x80, 0x9d, 0x21, 0x43, 0xeb, 0xd2, 0xff, 0xc9, 0x98, 0x9e, 0x61, + 0x96, 0x94, 0x8f, 0x66, 0xb2, 0xf4, 0xf3, 0x2c, 0x98, 0xbc, 0x49, 0xf8, 0x04, 0x2c, 0xf4, 0x03, + 0xdc, 0x23, 0x83, 0x9e, 0x78, 0x06, 0x85, 0xc6, 0x9d, 0xa9, 0x63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, 0x3d, 0xb0, 0xc8, 0x3f, 0x28, 0x78, 0x49, 0x77, 0x7a, 0x21, + 0xd5, 0xd7, 0x84, 0xd4, 0xf5, 0x88, 0x21, 0xd0, 0x0c, 0xf9, 0xcb, 0xdd, 0xef, 0x85, 0x34, 0x55, + 0xca, 0x62, 0x0d, 0x13, 0x90, 0x04, 0x02, 0x6f, 0x83, 0x05, 0xd1, 0x3e, 0x89, 0xab, 0x57, 0x44, + 0xcb, 0xbd, 0x1a, 0x31, 0x34, 0x9f, 0xb4, 0xda, 0x78, 0x36, 0x94, 0x10, 0xc3, 0x9c, 0xef, 0x0b, + 0x4b, 0xe3, 0xc9, 0xf3, 0x3f, 0xaa, 0x33, 0x3f, 0x44, 0xd5, 0x99, 0xe7, 0x51, 0x55, 0x7b, 0x11, + 0x55, 0xb5, 0xdf, 0xa3, 0xaa, 0xf6, 0xec, 0x65, 0x75, 0xe6, 0xc5, 0xcb, 0xea, 0xcc, 0x2f, 0x2f, + 0xab, 0x33, 0x4f, 0xde, 0x1c, 0xb9, 0x25, 0x3e, 0xb2, 0x6f, 0xfb, 0xed, 0x36, 0x71, 0x88, 0xdd, + 0x55, 0xbf, 0xeb, 0x13, 0x1f, 0x9f, 0xe2, 0xee, 0x5a, 0xf3, 0xa2, 0x96, 0xdc, 0xfa, 0x3b, 0x00, + 0x00, 0xff, 0xff, 0xb4, 0x6d, 0xa6, 0x85, 0xa2, 0x0e, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -375,6 +375,16 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + { + size := m.KeeeperIncentive.Size() + i -= size + if _, err := m.KeeeperIncentive.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a if m.EnglishAuctionParam != nil { { size, err := m.EnglishAuctionParam.MarshalToSizedBuffer(dAtA[:i]) @@ -642,16 +652,6 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x7a } - if m.IsExternalKeeper { - i-- - if m.IsExternalKeeper { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x70 - } if len(m.InternalKeeperAddress) > 0 { i -= len(m.InternalKeeperAddress) copy(dAtA[i:], m.InternalKeeperAddress) @@ -794,6 +794,8 @@ func (m *LiquidationWhiteListing) Size() (n int) { l = m.EnglishAuctionParam.Size() n += 1 + l + sovLiquidate(uint64(l)) } + l = m.KeeeperIncentive.Size() + n += 1 + l + sovLiquidate(uint64(l)) return n } @@ -876,9 +878,6 @@ func (m *LockedVault) Size() (n int) { if l > 0 { n += 1 + l + sovLiquidate(uint64(l)) } - if m.IsExternalKeeper { - n += 2 - } l = len(m.ExternalKeeperAddress) if l > 0 { n += 1 + l + sovLiquidate(uint64(l)) @@ -1089,6 +1088,40 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KeeeperIncentive", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.KeeeperIncentive.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipLiquidate(dAtA[iNdEx:]) @@ -1803,26 +1836,6 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } m.InternalKeeperAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsExternalKeeper", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLiquidate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsExternalKeeper = bool(v != 0) case 15: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ExternalKeeperAddress", wireType) diff --git a/x/vault/keeper/vault.go b/x/vault/keeper/vault.go index 36076a609..59853cd47 100644 --- a/x/vault/keeper/vault.go +++ b/x/vault/keeper/vault.go @@ -675,7 +675,7 @@ func (k Keeper) GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdk.Dec return sdk.ZeroDec(), sdk.ZeroInt(), assettypes.ErrorAssetDoesNotExist } - numerator := sdk.NewDecFromInt(amt1).Mul(rate1) + numerator := sdk.NewDecFromInt(amt1).Mul(rate1) //rate urate 1000000 denominator := sdk.NewDecFromInt(asset1.Decimals) t1dAmount := numerator.Quo(denominator) From d415de5d88a993f4fb80df306f8cf45deb9704fb Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sat, 27 May 2023 14:51:11 +0530 Subject: [PATCH 071/155] updating PlaceDutcBid --- .../comdex/x/asset/types/app.pb.go | 1031 -- .../comdex/x/asset/types/asset.pb.go | 546 -- .../comdex/x/asset/types/events.pb.go | 299 - .../x/asset/types/extendedPairVault.pb.go | 1006 -- .../comdex/x/asset/types/genesis.pb.go | 547 -- .../comdex/x/asset/types/gov.pb.go | 2724 ------ .../comdex/x/asset/types/pair.pb.go | 1075 --- .../comdex/x/asset/types/params.pb.go | 265 - .../comdex/x/asset/types/query.pb.go | 5660 ----------- .../comdex/x/asset/types/query.pb.gw.go | 1401 --- .../comdex/x/auction/types/auction.pb.go | 3531 ------- .../comdex/x/auction/types/biddings.pb.go | 1683 ---- .../comdex/x/auction/types/genesis.pb.go | 745 -- .../comdex/x/auction/types/params.pb.go | 265 - .../comdex/x/auction/types/query.pb.go | 8289 ----------------- .../comdex/x/auction/types/query.pb.gw.go | 2355 ----- .../comdex/x/auction/types/tx.pb.go | 2056 ---- proto/comdex/auctionsV2/v1beta1/auction.proto | 6 +- x/auctionsV2/types/auction.pb.go | 119 +- x/liquidationsV2/keeper/liquidate.go | 9 +- x/liquidationsV2/types/liquidate.pb.go | 227 +- 21 files changed, 200 insertions(+), 33639 deletions(-) delete mode 100644 github.com/comdex-official/comdex/x/asset/types/app.pb.go delete mode 100644 github.com/comdex-official/comdex/x/asset/types/asset.pb.go delete mode 100644 github.com/comdex-official/comdex/x/asset/types/events.pb.go delete mode 100644 github.com/comdex-official/comdex/x/asset/types/extendedPairVault.pb.go delete mode 100644 github.com/comdex-official/comdex/x/asset/types/genesis.pb.go delete mode 100644 github.com/comdex-official/comdex/x/asset/types/gov.pb.go delete mode 100644 github.com/comdex-official/comdex/x/asset/types/pair.pb.go delete mode 100644 github.com/comdex-official/comdex/x/asset/types/params.pb.go delete mode 100644 github.com/comdex-official/comdex/x/asset/types/query.pb.go delete mode 100644 github.com/comdex-official/comdex/x/asset/types/query.pb.gw.go delete mode 100644 github.com/comdex-official/comdex/x/auction/types/auction.pb.go delete mode 100644 github.com/comdex-official/comdex/x/auction/types/biddings.pb.go delete mode 100644 github.com/comdex-official/comdex/x/auction/types/genesis.pb.go delete mode 100644 github.com/comdex-official/comdex/x/auction/types/params.pb.go delete mode 100644 github.com/comdex-official/comdex/x/auction/types/query.pb.go delete mode 100644 github.com/comdex-official/comdex/x/auction/types/query.pb.gw.go delete mode 100644 github.com/comdex-official/comdex/x/auction/types/tx.pb.go diff --git a/github.com/comdex-official/comdex/x/asset/types/app.pb.go b/github.com/comdex-official/comdex/x/asset/types/app.pb.go deleted file mode 100644 index 401221d82..000000000 --- a/github.com/comdex-official/comdex/x/asset/types/app.pb.go +++ /dev/null @@ -1,1031 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/asset/v1beta1/app.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type AppData struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` - ShortName string `protobuf:"bytes,3,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty" yaml:"short_name"` - MinGovDeposit github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=min_gov_deposit,json=minGovDeposit,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_gov_deposit" yaml:"min_gov_deposit"` - GovTimeInSeconds uint64 `protobuf:"varint,5,opt,name=gov_time_in_seconds,json=govTimeInSeconds,proto3" json:"gov_time_in_seconds,omitempty" yaml:"gov_time_in_seconds"` - GenesisToken []MintGenesisToken `protobuf:"bytes,6,rep,name=genesis_token,json=genesisToken,proto3" json:"genesis_token" yaml:"genesis_token"` -} - -func (m *AppData) Reset() { *m = AppData{} } -func (m *AppData) String() string { return proto.CompactTextString(m) } -func (*AppData) ProtoMessage() {} -func (*AppData) Descriptor() ([]byte, []int) { - return fileDescriptor_1372b4734b6486fd, []int{0} -} -func (m *AppData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AppData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AppData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AppData) XXX_Merge(src proto.Message) { - xxx_messageInfo_AppData.Merge(m, src) -} -func (m *AppData) XXX_Size() int { - return m.Size() -} -func (m *AppData) XXX_DiscardUnknown() { - xxx_messageInfo_AppData.DiscardUnknown(m) -} - -var xxx_messageInfo_AppData proto.InternalMessageInfo - -type MintGenesisToken struct { - AssetId uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - GenesisSupply github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=genesis_supply,json=genesisSupply,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"genesis_supply"` - IsGovToken bool `protobuf:"varint,3,opt,name=is_gov_token,json=isGovToken,proto3" json:"is_gov_token,omitempty" yaml:"is_gov_token"` - Recipient string `protobuf:"bytes,4,opt,name=recipient,proto3" json:"recipient,omitempty" yaml:"recipient"` -} - -func (m *MintGenesisToken) Reset() { *m = MintGenesisToken{} } -func (m *MintGenesisToken) String() string { return proto.CompactTextString(m) } -func (*MintGenesisToken) ProtoMessage() {} -func (*MintGenesisToken) Descriptor() ([]byte, []int) { - return fileDescriptor_1372b4734b6486fd, []int{1} -} -func (m *MintGenesisToken) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MintGenesisToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MintGenesisToken.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MintGenesisToken) XXX_Merge(src proto.Message) { - xxx_messageInfo_MintGenesisToken.Merge(m, src) -} -func (m *MintGenesisToken) XXX_Size() int { - return m.Size() -} -func (m *MintGenesisToken) XXX_DiscardUnknown() { - xxx_messageInfo_MintGenesisToken.DiscardUnknown(m) -} - -var xxx_messageInfo_MintGenesisToken proto.InternalMessageInfo - -type AppAndGovTime struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - GovTimeInSeconds uint64 `protobuf:"varint,2,opt,name=gov_time_in_seconds,json=govTimeInSeconds,proto3" json:"gov_time_in_seconds,omitempty" yaml:"gov_time_in_seconds"` - MinGovDeposit github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=min_gov_deposit,json=minGovDeposit,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_gov_deposit" yaml:"min_gov_deposit"` -} - -func (m *AppAndGovTime) Reset() { *m = AppAndGovTime{} } -func (m *AppAndGovTime) String() string { return proto.CompactTextString(m) } -func (*AppAndGovTime) ProtoMessage() {} -func (*AppAndGovTime) Descriptor() ([]byte, []int) { - return fileDescriptor_1372b4734b6486fd, []int{2} -} -func (m *AppAndGovTime) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AppAndGovTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AppAndGovTime.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AppAndGovTime) XXX_Merge(src proto.Message) { - xxx_messageInfo_AppAndGovTime.Merge(m, src) -} -func (m *AppAndGovTime) XXX_Size() int { - return m.Size() -} -func (m *AppAndGovTime) XXX_DiscardUnknown() { - xxx_messageInfo_AppAndGovTime.DiscardUnknown(m) -} - -var xxx_messageInfo_AppAndGovTime proto.InternalMessageInfo - -func init() { - proto.RegisterType((*AppData)(nil), "comdex.asset.v1beta1.AppData") - proto.RegisterType((*MintGenesisToken)(nil), "comdex.asset.v1beta1.MintGenesisToken") - proto.RegisterType((*AppAndGovTime)(nil), "comdex.asset.v1beta1.AppAndGovTime") -} - -func init() { proto.RegisterFile("comdex/asset/v1beta1/app.proto", fileDescriptor_1372b4734b6486fd) } - -var fileDescriptor_1372b4734b6486fd = []byte{ - // 569 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xbd, 0x6e, 0xdb, 0x3c, - 0x14, 0x95, 0xec, 0xfc, 0x32, 0x71, 0xec, 0xc8, 0xfe, 0xbe, 0x1a, 0x41, 0x21, 0x19, 0x2c, 0x10, - 0x78, 0x89, 0x84, 0xa4, 0x5d, 0xda, 0xcd, 0x42, 0x00, 0xd7, 0x43, 0x0a, 0x54, 0x49, 0x97, 0x2e, - 0x82, 0x2c, 0x31, 0x0a, 0x11, 0x8b, 0x24, 0x4c, 0xc6, 0xa8, 0xdf, 0xa0, 0x63, 0x1f, 0xa1, 0x63, - 0x1f, 0xc5, 0x63, 0xc6, 0xa2, 0x83, 0xd0, 0xda, 0x6f, 0xa0, 0xb1, 0x53, 0x21, 0x52, 0xaa, 0xdd, - 0xc0, 0x1d, 0x5a, 0xa0, 0x93, 0x48, 0x9e, 0xc3, 0x73, 0x74, 0xcf, 0xbd, 0x20, 0x30, 0x43, 0x9a, - 0x44, 0xe8, 0x9d, 0x13, 0x70, 0x8e, 0x84, 0x33, 0x39, 0x1d, 0x22, 0x11, 0x9c, 0x3a, 0x01, 0x63, - 0x36, 0x1b, 0x53, 0x41, 0x8d, 0x96, 0xc2, 0x6d, 0x89, 0xdb, 0x05, 0x7e, 0xd4, 0x8a, 0x69, 0x4c, - 0x25, 0xc1, 0xc9, 0x57, 0x8a, 0x0b, 0x3f, 0x56, 0xc1, 0x76, 0x8f, 0xb1, 0xf3, 0x40, 0x04, 0xc6, - 0x01, 0xa8, 0xe0, 0xa8, 0xad, 0x77, 0xf4, 0xee, 0x86, 0x57, 0xc1, 0x91, 0xf1, 0x04, 0x6c, 0x90, - 0x20, 0x41, 0xed, 0x4a, 0x47, 0xef, 0xee, 0xba, 0xf5, 0x2c, 0xb5, 0xf6, 0xa6, 0x41, 0x32, 0x7a, - 0x01, 0xf3, 0x53, 0xe8, 0x49, 0xd0, 0x78, 0x06, 0x00, 0xbf, 0xa1, 0x63, 0xe1, 0x4b, 0x6a, 0x55, - 0x52, 0xff, 0xcb, 0x52, 0xeb, 0x50, 0x51, 0x97, 0x18, 0xf4, 0x76, 0xe5, 0xe6, 0x55, 0x7e, 0x8b, - 0x81, 0x7a, 0x82, 0x89, 0x1f, 0xd3, 0x89, 0x1f, 0x21, 0x46, 0x39, 0x16, 0xed, 0x0d, 0x79, 0xf5, - 0xe5, 0x2c, 0xb5, 0xb4, 0x2f, 0xa9, 0x75, 0x1c, 0x63, 0x71, 0x73, 0x37, 0xb4, 0x43, 0x9a, 0x38, - 0x21, 0xe5, 0x09, 0xe5, 0xc5, 0xe7, 0x84, 0x47, 0xb7, 0x8e, 0x98, 0x32, 0xc4, 0xed, 0x01, 0x11, - 0x59, 0x6a, 0xfd, 0xaf, 0x8c, 0x1e, 0xc8, 0x41, 0xaf, 0x96, 0x60, 0xd2, 0xa7, 0x93, 0x73, 0xb5, - 0x37, 0x2e, 0x40, 0x33, 0x87, 0x05, 0x4e, 0x90, 0x8f, 0x89, 0xcf, 0x51, 0x48, 0x49, 0xc4, 0xdb, - 0x9b, 0x79, 0xb5, 0xae, 0x99, 0xa5, 0xd6, 0x91, 0xd2, 0x59, 0x43, 0x82, 0x5e, 0x23, 0xa6, 0x93, - 0x2b, 0x9c, 0xa0, 0x01, 0xb9, 0x54, 0x47, 0x06, 0x06, 0xb5, 0x18, 0x11, 0xc4, 0x31, 0xf7, 0x05, - 0xbd, 0x45, 0xa4, 0xbd, 0xd5, 0xa9, 0x76, 0xf7, 0xce, 0x8e, 0xed, 0x75, 0xd9, 0xdb, 0x17, 0x98, - 0x88, 0xbe, 0xa2, 0x5f, 0xe5, 0x6c, 0xf7, 0x71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 0xa9, 0x7d, 0x5e, - 0x98, 0xda, 0x5b, 0xe7, 0x17, 0xcb, 0x7c, 0x0e, 0x4f, 0xe8, 0xf5, 0x35, 0x0e, 0x71, 0x30, 0x2a, - 0xf6, 0x4e, 0xf9, 0x6a, 0x48, 0xff, 0xe1, 0x96, 0x7c, 0x04, 0x9e, 0xfe, 0x08, 0x00, 0x00, 0xff, - 0xff, 0xf0, 0xde, 0x5d, 0x41, 0x52, 0x04, 0x00, 0x00, -} - -func (m *AppData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AppData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AppData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.GenesisToken) > 0 { - for iNdEx := len(m.GenesisToken) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.GenesisToken[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if m.GovTimeInSeconds != 0 { - i = encodeVarintApp(dAtA, i, uint64(m.GovTimeInSeconds)) - i-- - dAtA[i] = 0x28 - } - { - size := m.MinGovDeposit.Size() - i -= size - if _, err := m.MinGovDeposit.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintApp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.ShortName) > 0 { - i -= len(m.ShortName) - copy(dAtA[i:], m.ShortName) - i = encodeVarintApp(dAtA, i, uint64(len(m.ShortName))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintApp(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintApp(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MintGenesisToken) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MintGenesisToken) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MintGenesisToken) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Recipient) > 0 { - i -= len(m.Recipient) - copy(dAtA[i:], m.Recipient) - i = encodeVarintApp(dAtA, i, uint64(len(m.Recipient))) - i-- - dAtA[i] = 0x22 - } - if m.IsGovToken { - i-- - if m.IsGovToken { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - { - size := m.GenesisSupply.Size() - i -= size - if _, err := m.GenesisSupply.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintApp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.AssetId != 0 { - i = encodeVarintApp(dAtA, i, uint64(m.AssetId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *AppAndGovTime) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AppAndGovTime) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AppAndGovTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.MinGovDeposit.Size() - i -= size - if _, err := m.MinGovDeposit.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintApp(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.GovTimeInSeconds != 0 { - i = encodeVarintApp(dAtA, i, uint64(m.GovTimeInSeconds)) - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintApp(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintApp(dAtA []byte, offset int, v uint64) int { - offset -= sovApp(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *AppData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovApp(uint64(m.Id)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovApp(uint64(l)) - } - l = len(m.ShortName) - if l > 0 { - n += 1 + l + sovApp(uint64(l)) - } - l = m.MinGovDeposit.Size() - n += 1 + l + sovApp(uint64(l)) - if m.GovTimeInSeconds != 0 { - n += 1 + sovApp(uint64(m.GovTimeInSeconds)) - } - if len(m.GenesisToken) > 0 { - for _, e := range m.GenesisToken { - l = e.Size() - n += 1 + l + sovApp(uint64(l)) - } - } - return n -} - -func (m *MintGenesisToken) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AssetId != 0 { - n += 1 + sovApp(uint64(m.AssetId)) - } - l = m.GenesisSupply.Size() - n += 1 + l + sovApp(uint64(l)) - if m.IsGovToken { - n += 2 - } - l = len(m.Recipient) - if l > 0 { - n += 1 + l + sovApp(uint64(l)) - } - return n -} - -func (m *AppAndGovTime) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovApp(uint64(m.AppId)) - } - if m.GovTimeInSeconds != 0 { - n += 1 + sovApp(uint64(m.GovTimeInSeconds)) - } - l = m.MinGovDeposit.Size() - n += 1 + l + sovApp(uint64(l)) - return n -} - -func sovApp(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozApp(x uint64) (n int) { - return sovApp(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *AppData) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AppData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AppData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - 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 ErrInvalidLengthApp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShortName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - 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 ErrInvalidLengthApp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ShortName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinGovDeposit", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - 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 ErrInvalidLengthApp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MinGovDeposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GovTimeInSeconds", wireType) - } - m.GovTimeInSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GovTimeInSeconds |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GenesisToken", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApp - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GenesisToken = append(m.GenesisToken, MintGenesisToken{}) - if err := m.GenesisToken[len(m.GenesisToken)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MintGenesisToken) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MintGenesisToken: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MintGenesisToken: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) - } - m.AssetId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GenesisSupply", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - 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 ErrInvalidLengthApp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.GenesisSupply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsGovToken", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsGovToken = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - 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 ErrInvalidLengthApp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Recipient = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AppAndGovTime) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AppAndGovTime: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AppAndGovTime: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GovTimeInSeconds", wireType) - } - m.GovTimeInSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GovTimeInSeconds |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinGovDeposit", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApp - } - 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 ErrInvalidLengthApp - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApp - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MinGovDeposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApp(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApp - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipApp(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowApp - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowApp - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowApp - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthApp - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupApp - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthApp - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthApp = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowApp = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupApp = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/asset/types/asset.pb.go b/github.com/comdex-official/comdex/x/asset/types/asset.pb.go deleted file mode 100644 index 417f4bb3c..000000000 --- a/github.com/comdex-official/comdex/x/asset/types/asset.pb.go +++ /dev/null @@ -1,546 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/asset/v1beta1/asset.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Asset struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` - Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` - Decimals github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=decimals,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"decimals" yaml:"decimals"` - IsOnChain bool `protobuf:"varint,5,opt,name=is_on_chain,json=isOnChain,proto3" json:"is_on_chain,omitempty" yaml:"is_on_chain"` - IsOraclePriceRequired bool `protobuf:"varint,6,opt,name=is_oracle_price_required,json=isOraclePriceRequired,proto3" json:"is_oracle_price_required,omitempty" yaml:"is_oracle_price_required"` - IsCdpMintable bool `protobuf:"varint,7,opt,name=is_cdp_mintable,json=isCdpMintable,proto3" json:"is_cdp_mintable,omitempty" yaml:"is_cdp_mintable"` -} - -func (m *Asset) Reset() { *m = Asset{} } -func (m *Asset) String() string { return proto.CompactTextString(m) } -func (*Asset) ProtoMessage() {} -func (*Asset) Descriptor() ([]byte, []int) { - return fileDescriptor_67277aee9bd3eed4, []int{0} -} -func (m *Asset) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Asset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Asset.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Asset) XXX_Merge(src proto.Message) { - xxx_messageInfo_Asset.Merge(m, src) -} -func (m *Asset) XXX_Size() int { - return m.Size() -} -func (m *Asset) XXX_DiscardUnknown() { - xxx_messageInfo_Asset.DiscardUnknown(m) -} - -var xxx_messageInfo_Asset proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Asset)(nil), "comdex.asset.v1beta1.Asset") -} - -func init() { proto.RegisterFile("comdex/asset/v1beta1/asset.proto", fileDescriptor_67277aee9bd3eed4) } - -var fileDescriptor_67277aee9bd3eed4 = []byte{ - // 414 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xb1, 0x6e, 0xd4, 0x30, - 0x18, 0xc7, 0x93, 0xeb, 0x5d, 0x69, 0x5d, 0xe0, 0x90, 0x55, 0xaa, 0xa8, 0x83, 0x7d, 0x72, 0xa5, - 0xea, 0x96, 0x5e, 0x54, 0x21, 0x31, 0xb0, 0xf5, 0x3a, 0x31, 0xa0, 0x82, 0x47, 0x04, 0x8a, 0x7c, - 0xb6, 0x7b, 0xb5, 0x88, 0xe3, 0x10, 0xa7, 0x88, 0xbe, 0x05, 0x2f, 0xc0, 0x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, 0x4f, 0xd9, 0xcc, 0x14, 0x19, 0xbf, 0x62, 0xaa, 0x48, 0x46, 0x93, 0x78, 0xba, - 0x33, 0x3f, 0x68, 0x1d, 0x86, 0xe1, 0x9f, 0x8d, 0x92, 0xd0, 0x5d, 0x65, 0x2f, 0x8a, 0xf3, 0xee, - 0x0c, 0x3f, 0x80, 0xa4, 0xab, 0x2a, 0xc6, 0x73, 0x99, 0x95, 0x95, 0xe2, 0x32, 0xab, 0xe4, 0xe7, - 0x6b, 0x55, 0x49, 0x91, 0x6c, 0x7b, 0xc9, 0x51, 0xeb, 0x30, 0xfe, 0x27, 0x79, 0x88, 0x24, 0xf4, - 0xb9, 0xb2, 0x17, 0xbe, 0x79, 0xdb, 0x15, 0xb4, 0xcf, 0xe1, 0x1c, 0x8c, 0x95, 0xcd, 0xb8, 0x28, - 0x33, 0xad, 0x8a, 0x9a, 0x2d, 0x72, 0x99, 0x3c, 0xf2, 0xd2, 0xc3, 0xd6, 0xe1, 0x83, 0x7b, 0xe9, - 0x26, 0x40, 0xe8, 0x13, 0x65, 0xcf, 0x45, 0xf9, 0xa6, 0x9f, 0xe7, 0xef, 0x56, 0x7f, 0x50, 0xf4, - 0xa3, 0x41, 0xd1, 0xaa, 0x41, 0xf1, 0x6d, 0x83, 0xe2, 0xdf, 0x0d, 0x8a, 0xbf, 0xad, 0x51, 0x74, - 0xbb, 0x46, 0xd1, 0xcf, 0x35, 0x8a, 0xde, 0xa7, 0xff, 0x5d, 0x60, 0xb7, 0xf8, 0x13, 0x73, 0x79, - 0xa9, 0xb8, 0x62, 0x79, 0x3f, 0xa7, 0x77, 0x8f, 0xc5, 0xdf, 0xe6, 0x62, 0xdb, 0x6f, 0xfe, 0xc5, - 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x38, 0x2d, 0x65, 0x49, 0x02, 0x00, 0x00, -} - -func (m *Asset) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Asset) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Asset) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.IsCdpMintable { - i-- - if m.IsCdpMintable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if m.IsOraclePriceRequired { - i-- - if m.IsOraclePriceRequired { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if m.IsOnChain { - i-- - if m.IsOnChain { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - { - size := m.Decimals.Size() - i -= size - if _, err := m.Decimals.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAsset(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintAsset(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintAsset(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintAsset(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintAsset(dAtA []byte, offset int, v uint64) int { - offset -= sovAsset(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Asset) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovAsset(uint64(m.Id)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovAsset(uint64(l)) - } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovAsset(uint64(l)) - } - l = m.Decimals.Size() - n += 1 + l + sovAsset(uint64(l)) - if m.IsOnChain { - n += 2 - } - if m.IsOraclePriceRequired { - n += 2 - } - if m.IsCdpMintable { - n += 2 - } - return n -} - -func sovAsset(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAsset(x uint64) (n int) { - return sovAsset(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Asset) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAsset - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Asset: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Asset: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAsset - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAsset - } - 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 ErrInvalidLengthAsset - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAsset - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAsset - } - 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 ErrInvalidLengthAsset - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAsset - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAsset - } - 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 ErrInvalidLengthAsset - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAsset - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Decimals.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsOnChain", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAsset - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsOnChain = bool(v != 0) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsOraclePriceRequired", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAsset - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsOraclePriceRequired = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsCdpMintable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAsset - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsCdpMintable = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipAsset(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAsset - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAsset(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAsset - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAsset - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAsset - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthAsset - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAsset - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAsset - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAsset = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAsset = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAsset = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/asset/types/events.pb.go b/github.com/comdex-official/comdex/x/asset/types/events.pb.go deleted file mode 100644 index f11a9bd0f..000000000 --- a/github.com/comdex-official/comdex/x/asset/types/events.pb.go +++ /dev/null @@ -1,299 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/asset/v1beta1/events.proto - -package types - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type EventAddPair struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *EventAddPair) Reset() { *m = EventAddPair{} } -func (m *EventAddPair) String() string { return proto.CompactTextString(m) } -func (*EventAddPair) ProtoMessage() {} -func (*EventAddPair) Descriptor() ([]byte, []int) { - return fileDescriptor_8698e7aadaab4005, []int{0} -} -func (m *EventAddPair) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventAddPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventAddPair.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EventAddPair) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventAddPair.Merge(m, src) -} -func (m *EventAddPair) XXX_Size() int { - return m.Size() -} -func (m *EventAddPair) XXX_DiscardUnknown() { - xxx_messageInfo_EventAddPair.DiscardUnknown(m) -} - -var xxx_messageInfo_EventAddPair proto.InternalMessageInfo - -func (m *EventAddPair) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func init() { - proto.RegisterType((*EventAddPair)(nil), "comdex.asset.v1beta1.EventAddPair") -} - -func init() { proto.RegisterFile("comdex/asset/v1beta1/events.proto", fileDescriptor_8698e7aadaab4005) } - -var fileDescriptor_8698e7aadaab4005 = []byte{ - // 166 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x2e, 0x4e, 0x2d, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, - 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, - 0x28, 0xd1, 0x03, 0x2b, 0xd1, 0x83, 0x2a, 0x51, 0x92, 0xe3, 0xe2, 0x71, 0x05, 0xa9, 0x72, 0x4c, - 0x49, 0x09, 0x48, 0xcc, 0x2c, 0x12, 0xe2, 0xe3, 0x62, 0xca, 0x4c, 0x91, 0x60, 0x54, 0x60, 0xd4, - 0x60, 0x09, 0x62, 0xca, 0x4c, 0x71, 0xf2, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, - 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, - 0x86, 0x28, 0xfd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, 0xd1, - 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0xcc, 0x3d, 0x25, 0x95, - 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x77, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x6b, 0xa5, - 0x03, 0xfe, 0xac, 0x00, 0x00, 0x00, -} - -func (m *EventAddPair) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EventAddPair) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventAddPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Id != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { - offset -= sovEvents(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventAddPair) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovEvents(uint64(m.Id)) - } - return n -} - -func sovEvents(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvents(x uint64) (n int) { - return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventAddPair) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EventAddPair: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventAddPair: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvents(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthEvents - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvents - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvents - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/asset/types/extendedPairVault.pb.go b/github.com/comdex-official/comdex/x/asset/types/extendedPairVault.pb.go deleted file mode 100644 index 1ff9cd077..000000000 --- a/github.com/comdex-official/comdex/x/asset/types/extendedPairVault.pb.go +++ /dev/null @@ -1,1006 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/asset/v1beta1/extendedPairVault.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ExtendedPairVault struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - PairId uint64 `protobuf:"varint,3,opt,name=pair_id,json=pairId,proto3" json:"pair_id,omitempty" yaml:"pair_id"` - StabilityFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=stability_fee,json=stabilityFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stability_fee" yaml:"stability_fee"` - ClosingFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=closing_fee,json=closingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"closing_fee" yaml:"closing_fee"` - LiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_penalty" yaml:"liquidation_penalty"` - DrawDownFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=draw_down_fee,json=drawDownFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"draw_down_fee" yaml:"draw_down_fee"` - IsVaultActive bool `protobuf:"varint,8,opt,name=is_vault_active,json=isVaultActive,proto3" json:"is_vault_active,omitempty" yaml:"active_flag"` - DebtCeiling github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,9,opt,name=debt_ceiling,json=debtCeiling,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt_ceiling" yaml:"debt_ceiling"` - DebtFloor github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=debt_floor,json=debtFloor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt_floor" yaml:"debt_floor"` - IsStableMintVault bool `protobuf:"varint,11,opt,name=is_stable_mint_vault,json=isStableMintVault,proto3" json:"is_stable_mint_vault,omitempty" yaml:"is_stable_mint_vault"` - MinCr github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=min_cr,json=minCr,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_cr" yaml:"min_cr"` - PairName string `protobuf:"bytes,13,opt,name=pair_name,json=pairName,proto3" json:"pair_name,omitempty" yaml:"pair_name"` - AssetOutOraclePrice bool `protobuf:"varint,14,opt,name=asset_out_oracle_price,json=assetOutOraclePrice,proto3" json:"asset_out_oracle_price,omitempty" yaml:"asset_out_oracle_price"` - AssetOutPrice uint64 `protobuf:"varint,15,opt,name=asset_out_price,json=assetOutPrice,proto3" json:"asset_out_price,omitempty" yaml:"asset_out_price"` - MinUsdValueLeft uint64 `protobuf:"varint,16,opt,name=min_usd_value_left,json=minUsdValueLeft,proto3" json:"min_usd_value_left,omitempty" yaml:"min_usd_value_left"` - BlockHeight int64 `protobuf:"varint,17,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty" yaml:"block_height"` - BlockTime time.Time `protobuf:"bytes,18,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time" yaml:"block_time"` -} - -func (m *ExtendedPairVault) Reset() { *m = ExtendedPairVault{} } -func (m *ExtendedPairVault) String() string { return proto.CompactTextString(m) } -func (*ExtendedPairVault) ProtoMessage() {} -func (*ExtendedPairVault) Descriptor() ([]byte, []int) { - return fileDescriptor_23dd38fcddb231cd, []int{0} -} -func (m *ExtendedPairVault) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ExtendedPairVault) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ExtendedPairVault.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ExtendedPairVault) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtendedPairVault.Merge(m, src) -} -func (m *ExtendedPairVault) XXX_Size() int { - return m.Size() -} -func (m *ExtendedPairVault) XXX_DiscardUnknown() { - xxx_messageInfo_ExtendedPairVault.DiscardUnknown(m) -} - -var xxx_messageInfo_ExtendedPairVault proto.InternalMessageInfo - -func init() { - proto.RegisterType((*ExtendedPairVault)(nil), "comdex.asset.v1beta1.ExtendedPairVault") -} - -func init() { - proto.RegisterFile("comdex/asset/v1beta1/extendedPairVault.proto", fileDescriptor_23dd38fcddb231cd) -} - -var fileDescriptor_23dd38fcddb231cd = []byte{ - // 820 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xc1, 0x72, 0xe3, 0x34, - 0x18, 0x8e, 0xbb, 0xdb, 0x6c, 0xa3, 0x34, 0xed, 0x46, 0xcd, 0x14, 0x13, 0xa6, 0x71, 0xd0, 0x81, - 0xc9, 0x0c, 0x6c, 0x3c, 0x85, 0xdb, 0x1e, 0x60, 0x48, 0xbb, 0x1d, 0xca, 0x2c, 0x6c, 0x11, 0xd0, - 0x61, 0xb8, 0x68, 0x64, 0x5b, 0x71, 0x45, 0x65, 0xcb, 0xd8, 0x4a, 0xbb, 0x3d, 0xf0, 0x0e, 0xfb, - 0x0c, 0x9c, 0x78, 0x94, 0x1e, 0xf7, 0xc8, 0x70, 0x30, 0xd0, 0xbe, 0x81, 0x9f, 0x80, 0x91, 0xe4, - 0x92, 0xa4, 0xd3, 0x4b, 0x66, 0x4f, 0xd1, 0xff, 0xfd, 0x5f, 0xbe, 0xef, 0x97, 0xf4, 0xeb, 0x37, - 0xf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xc9, 0x4e, 0x85, - 0x94, 0xb9, 0x0b, 0x8c, 0xcf, 0xc1, 0xca, 0x3e, 0xdd, 0x05, 0x1f, 0xa3, 0x84, 0x70, 0x4b, 0x07, - 0x47, 0x7a, 0x0d, 0x4f, 0x40, 0x8f, 0x17, 0x44, 0xb7, 0x9c, 0x60, 0x24, 0xe1, 0xa9, 0xb2, 0x27, - 0xe3, 0xb6, 0xcd, 0x91, 0x78, 0x55, 0xe9, 0x7d, 0x60, 0xff, 0xff, 0x10, 0x0b, 0xe1, 0x2e, 0x2f, - 0xbe, 0x37, 0xe8, 0x37, 0x3c, 0x55, 0xf6, 0x15, 0x9e, 0x82, 0x66, 0xc2, 0x53, 0x12, 0xe6, 0xee, - 0xa6, 0xa9, 0xf8, 0x8b, 0x95, 0x2f, 0xb1, 0x7e, 0xa3, 0x56, 0x05, 0xe1, 0xf5, 0x84, 0xa7, 0x07, - 0x39, 0xdc, 0x07, 0x2d, 0xf3, 0x14, 0x53, 0x9a, 0x30, 0xb7, 0x63, 0xa4, 0x7b, 0x55, 0xe9, 0x3d, - 0x5d, 0x78, 0xa5, 0x3a, 0x85, 0xf0, 0x86, 0x5e, 0x7f, 0x4b, 0x13, 0x06, 0x4f, 0xc1, 0xae, 0x19, - 0x37, 0x44, 0xce, 0x14, 0x91, 0x39, 0x0d, 0x05, 0x23, 0x59, 0xce, 0x43, 0xe6, 0x6e, 0x99, 0xed, - 0x7d, 0x58, 0x95, 0xde, 0x5e, 0x7d, 0xe3, 0x0f, 0xf2, 0x10, 0xde, 0x31, 0x89, 0x57, 0x33, 0xf5, - 0xca, 0xc0, 0x27, 0x1a, 0x85, 0x13, 0xb0, 0x3d, 0xe7, 0x5b, 0xc1, 0x6d, 0x33, 0x36, 0xfa, 0x55, - 0xe9, 0xed, 0xde, 0x17, 0xac, 0x95, 0x3a, 0x77, 0x4a, 0x56, 0xe3, 0x6b, 0x00, 0xf5, 0x06, 0x67, - 0x45, 0x44, 0x2e, 0xa8, 0x98, 0x31, 0x22, 0xd8, 0x54, 0xb9, 0x4f, 0x8d, 0xcc, 0x5e, 0x55, 0x7a, - 0xef, 0xcf, 0x0f, 0x61, 0x99, 0x83, 0xf0, 0x76, 0xc2, 0xd3, 0x1f, 0x8b, 0xe8, 0x54, 0x43, 0x2f, - 0xd9, 0x54, 0xc1, 0xe7, 0x60, 0x33, 0x10, 0x32, 0x3c, 0x27, 0x67, 0x8c, 0xc7, 0x67, 0xca, 0xed, - 0x0e, 0x9d, 0xd1, 0xa3, 0xc9, 0x7b, 0xf3, 0x26, 0x5b, 0xcc, 0x22, 0xdc, 0x36, 0xe1, 0x57, 0x26, - 0x82, 0x3f, 0x01, 0x60, 0xb3, 0x7a, 0xc6, 0xba, 0x70, 0xe8, 0x8c, 0xda, 0x9f, 0xf6, 0xc7, 0x76, - 0x00, 0x8f, 0xef, 0x06, 0xf0, 0xf8, 0x87, 0xbb, 0x01, 0x3c, 0xd9, 0xd3, 0xd7, 0x39, 0x6f, 0xab, - 0xf9, 0x7f, 0xd1, 0x9b, 0xbf, 0x3d, 0x07, 0xb7, 0x0c, 0xa0, 0xe9, 0x93, 0xef, 0xae, 0xff, 0x1d, - 0x34, 0xfe, 0xb8, 0x19, 0x34, 0xae, 0x6f, 0x06, 0xce, 0xdb, 0x9b, 0x81, 0xf3, 0xcf, 0xcd, 0xc0, - 0x79, 0x73, 0x3b, 0x68, 0xbc, 0xbd, 0x1d, 0x34, 0xfe, 0xbc, 0x1d, 0x34, 0x7e, 0xf6, 0x97, 0x5a, - 0x42, 0x7f, 0x1e, 0x9e, 0xc9, 0xe9, 0x94, 0x87, 0x9c, 0x8a, 0x3a, 0xf6, 0xef, 0x3e, 0x2f, 0xa6, - 0x3f, 0x82, 0xa6, 0x29, 0xe8, 0xb3, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf2, 0x98, 0x15, 0x0f, - 0x7b, 0x06, 0x00, 0x00, -} - -func (m *ExtendedPairVault) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ExtendedPairVault) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ExtendedPairVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BlockTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintExtendedPairVault(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - if m.BlockHeight != 0 { - i = encodeVarintExtendedPairVault(dAtA, i, uint64(m.BlockHeight)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x88 - } - if m.MinUsdValueLeft != 0 { - i = encodeVarintExtendedPairVault(dAtA, i, uint64(m.MinUsdValueLeft)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x80 - } - if m.AssetOutPrice != 0 { - i = encodeVarintExtendedPairVault(dAtA, i, uint64(m.AssetOutPrice)) - i-- - dAtA[i] = 0x78 - } - if m.AssetOutOraclePrice { - i-- - if m.AssetOutOraclePrice { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x70 - } - if len(m.PairName) > 0 { - i -= len(m.PairName) - copy(dAtA[i:], m.PairName) - i = encodeVarintExtendedPairVault(dAtA, i, uint64(len(m.PairName))) - i-- - dAtA[i] = 0x6a - } - { - size := m.MinCr.Size() - i -= size - if _, err := m.MinCr.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - if m.IsStableMintVault { - i-- - if m.IsStableMintVault { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x58 - } - { - size := m.DebtFloor.Size() - i -= size - if _, err := m.DebtFloor.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - { - size := m.DebtCeiling.Size() - i -= size - if _, err := m.DebtCeiling.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - if m.IsVaultActive { - i-- - if m.IsVaultActive { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - { - size := m.DrawDownFee.Size() - i -= size - if _, err := m.DrawDownFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - { - size := m.LiquidationPenalty.Size() - i -= size - if _, err := m.LiquidationPenalty.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size := m.ClosingFee.Size() - i -= size - if _, err := m.ClosingFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size := m.StabilityFee.Size() - i -= size - if _, err := m.StabilityFee.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintExtendedPairVault(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.PairId != 0 { - i = encodeVarintExtendedPairVault(dAtA, i, uint64(m.PairId)) - i-- - dAtA[i] = 0x18 - } - if m.AppId != 0 { - i = encodeVarintExtendedPairVault(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x10 - } - if m.Id != 0 { - i = encodeVarintExtendedPairVault(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintExtendedPairVault(dAtA []byte, offset int, v uint64) int { - offset -= sovExtendedPairVault(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ExtendedPairVault) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovExtendedPairVault(uint64(m.Id)) - } - if m.AppId != 0 { - n += 1 + sovExtendedPairVault(uint64(m.AppId)) - } - if m.PairId != 0 { - n += 1 + sovExtendedPairVault(uint64(m.PairId)) - } - l = m.StabilityFee.Size() - n += 1 + l + sovExtendedPairVault(uint64(l)) - l = m.ClosingFee.Size() - n += 1 + l + sovExtendedPairVault(uint64(l)) - l = m.LiquidationPenalty.Size() - n += 1 + l + sovExtendedPairVault(uint64(l)) - l = m.DrawDownFee.Size() - n += 1 + l + sovExtendedPairVault(uint64(l)) - if m.IsVaultActive { - n += 2 - } - l = m.DebtCeiling.Size() - n += 1 + l + sovExtendedPairVault(uint64(l)) - l = m.DebtFloor.Size() - n += 1 + l + sovExtendedPairVault(uint64(l)) - if m.IsStableMintVault { - n += 2 - } - l = m.MinCr.Size() - n += 1 + l + sovExtendedPairVault(uint64(l)) - l = len(m.PairName) - if l > 0 { - n += 1 + l + sovExtendedPairVault(uint64(l)) - } - if m.AssetOutOraclePrice { - n += 2 - } - if m.AssetOutPrice != 0 { - n += 1 + sovExtendedPairVault(uint64(m.AssetOutPrice)) - } - if m.MinUsdValueLeft != 0 { - n += 2 + sovExtendedPairVault(uint64(m.MinUsdValueLeft)) - } - if m.BlockHeight != 0 { - n += 2 + sovExtendedPairVault(uint64(m.BlockHeight)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BlockTime) - n += 2 + l + sovExtendedPairVault(uint64(l)) - return n -} - -func sovExtendedPairVault(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozExtendedPairVault(x uint64) (n int) { - return sovExtendedPairVault(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ExtendedPairVault) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ExtendedPairVault: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExtendedPairVault: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PairId", wireType) - } - m.PairId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PairId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StabilityFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - 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 ErrInvalidLengthExtendedPairVault - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthExtendedPairVault - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StabilityFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClosingFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - 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 ErrInvalidLengthExtendedPairVault - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthExtendedPairVault - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ClosingFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LiquidationPenalty", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - 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 ErrInvalidLengthExtendedPairVault - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthExtendedPairVault - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LiquidationPenalty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DrawDownFee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - 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 ErrInvalidLengthExtendedPairVault - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthExtendedPairVault - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DrawDownFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsVaultActive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsVaultActive = bool(v != 0) - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DebtCeiling", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - 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 ErrInvalidLengthExtendedPairVault - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthExtendedPairVault - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DebtCeiling.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DebtFloor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - 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 ErrInvalidLengthExtendedPairVault - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthExtendedPairVault - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DebtFloor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsStableMintVault", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsStableMintVault = bool(v != 0) - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinCr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - 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 ErrInvalidLengthExtendedPairVault - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthExtendedPairVault - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MinCr.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PairName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - 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 ErrInvalidLengthExtendedPairVault - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthExtendedPairVault - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PairName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetOutOraclePrice", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AssetOutOraclePrice = bool(v != 0) - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetOutPrice", wireType) - } - m.AssetOutPrice = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetOutPrice |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinUsdValueLeft", wireType) - } - m.MinUsdValueLeft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinUsdValueLeft |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 17: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) - } - m.BlockHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthExtendedPairVault - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthExtendedPairVault - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BlockTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipExtendedPairVault(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthExtendedPairVault - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipExtendedPairVault(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowExtendedPairVault - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthExtendedPairVault - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupExtendedPairVault - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthExtendedPairVault - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthExtendedPairVault = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowExtendedPairVault = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupExtendedPairVault = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/asset/types/genesis.pb.go b/github.com/comdex-official/comdex/x/asset/types/genesis.pb.go deleted file mode 100644 index 3490746b6..000000000 --- a/github.com/comdex-official/comdex/x/asset/types/genesis.pb.go +++ /dev/null @@ -1,547 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/asset/v1beta1/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type GenesisState struct { - Assets []Asset `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets" yaml:"assets"` - Pairs []Pair `protobuf:"bytes,2,rep,name=pairs,proto3" json:"pairs" yaml:"pairs"` - AppData []AppData `protobuf:"bytes,3,rep,name=appData,proto3" json:"appData" yaml:"appData"` - ExtendedPairVault []ExtendedPairVault `protobuf:"bytes,4,rep,name=extendedPairVault,proto3" json:"extendedPairVault" yaml:"extendedPairVault"` - Params Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params" yaml:"params"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_13a69a7476a1f579, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func init() { - proto.RegisterType((*GenesisState)(nil), "comdex.asset.v1beta1.GenesisState") -} - -func init() { - proto.RegisterFile("comdex/asset/v1beta1/genesis.proto", fileDescriptor_13a69a7476a1f579) -} - -var fileDescriptor_13a69a7476a1f579 = []byte{ - // 388 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcf, 0x4e, 0xea, 0x40, - 0x14, 0x87, 0xdb, 0xcb, 0x85, 0x9b, 0x14, 0xee, 0x4d, 0x6e, 0x83, 0xa6, 0x41, 0x1d, 0xea, 0x6c, - 0x64, 0xa1, 0x6d, 0xc0, 0x9d, 0x3b, 0x1b, 0xff, 0x24, 0xba, 0x50, 0x6b, 0xe2, 0xc2, 0xdd, 0x00, - 0x43, 0x6d, 0x02, 0x74, 0xd2, 0x19, 0x14, 0xde, 0xc2, 0xc7, 0xf0, 0x15, 0x7c, 0x03, 0x96, 0x2c, - 0x5d, 0x11, 0x2d, 0x6f, 0xe0, 0x13, 0x98, 0xce, 0x19, 0x36, 0x30, 0xec, 0x3a, 0x9d, 0xef, 0x7c, - 0xbf, 0x73, 0x4e, 0xc6, 0xc2, 0x9d, 0x64, 0xd0, 0xa5, 0x63, 0x9f, 0x70, 0x4e, 0x85, 0xff, 0xdc, - 0x6c, 0x53, 0x41, 0x9a, 0x7e, 0x44, 0x87, 0x94, 0xc7, 0xdc, 0x63, 0x69, 0x22, 0x12, 0xbb, 0x0a, - 0x8c, 0x27, 0x19, 0x4f, 0x31, 0xb5, 0x6a, 0x94, 0x44, 0x89, 0x04, 0xfc, 0xfc, 0x0b, 0xd8, 0x9a, - 0xab, 0xf5, 0x41, 0x25, 0x10, 0x75, 0x2d, 0xc1, 0x48, 0x9c, 0x2a, 0x00, 0xe9, 0x15, 0x8c, 0xa9, - 0xfb, 0x43, 0xed, 0x3d, 0x1d, 0x0b, 0x3a, 0xec, 0xd2, 0xee, 0x2d, 0x89, 0xd3, 0x07, 0x32, 0xea, - 0x2f, 0xe3, 0xf6, 0x37, 0xc4, 0xa5, 0x64, 0xa0, 0xe6, 0xc3, 0xef, 0x05, 0xab, 0x72, 0x09, 0x13, - 0xdf, 0x0b, 0x22, 0xa8, 0x7d, 0x65, 0x95, 0x24, 0xce, 0x1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0x79, 0xbb, 0x24, 0x5f, 0xc5, 0xf1, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x6f, 0x99, 0x1f, - 0x1b, 0x03, 0x00, 0x00, -} - -func (m *GenesisState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.ExtendedPairVault) > 0 { - for iNdEx := len(m.ExtendedPairVault) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ExtendedPairVault[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.AppData) > 0 { - for iNdEx := len(m.AppData) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AppData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Pairs) > 0 { - for iNdEx := len(m.Pairs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Pairs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Assets) > 0 { - for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Assets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Assets) > 0 { - for _, e := range m.Assets { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Pairs) > 0 { - for _, e := range m.Pairs { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.AppData) > 0 { - for _, e := range m.AppData { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.ExtendedPairVault) > 0 { - for _, e := range m.ExtendedPairVault { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Assets = append(m.Assets, Asset{}) - if err := m.Assets[len(m.Assets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Pairs = append(m.Pairs, Pair{}) - if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppData", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppData = append(m.AppData, AppData{}) - if err := m.AppData[len(m.AppData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtendedPairVault", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExtendedPairVault = append(m.ExtendedPairVault, ExtendedPairVault{}) - if err := m.ExtendedPairVault[len(m.ExtendedPairVault)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/asset/types/gov.pb.go b/github.com/comdex-official/comdex/x/asset/types/gov.pb.go deleted file mode 100644 index bb7b38fa5..000000000 --- a/github.com/comdex-official/comdex/x/asset/types/gov.pb.go +++ /dev/null @@ -1,2724 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/asset/v1beta1/gov.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type AddAssetsProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - Assets Asset `protobuf:"bytes,3,opt,name=assets,proto3" json:"assets"` -} - -func (m *AddAssetsProposal) Reset() { *m = AddAssetsProposal{} } -func (m *AddAssetsProposal) String() string { return proto.CompactTextString(m) } -func (*AddAssetsProposal) ProtoMessage() {} -func (*AddAssetsProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_31c5aab0360b917f, []int{0} -} -func (m *AddAssetsProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddAssetsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddAssetsProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AddAssetsProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddAssetsProposal.Merge(m, src) -} -func (m *AddAssetsProposal) XXX_Size() int { - return m.Size() -} -func (m *AddAssetsProposal) XXX_DiscardUnknown() { - xxx_messageInfo_AddAssetsProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_AddAssetsProposal proto.InternalMessageInfo - -type AddMultipleAssetsProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - Assets []Asset `protobuf:"bytes,3,rep,name=assets,proto3" json:"assets"` -} - -func (m *AddMultipleAssetsProposal) Reset() { *m = AddMultipleAssetsProposal{} } -func (m *AddMultipleAssetsProposal) String() string { return proto.CompactTextString(m) } -func (*AddMultipleAssetsProposal) ProtoMessage() {} -func (*AddMultipleAssetsProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_31c5aab0360b917f, []int{1} -} -func (m *AddMultipleAssetsProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddMultipleAssetsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddMultipleAssetsProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AddMultipleAssetsProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddMultipleAssetsProposal.Merge(m, src) -} -func (m *AddMultipleAssetsProposal) XXX_Size() int { - return m.Size() -} -func (m *AddMultipleAssetsProposal) XXX_DiscardUnknown() { - xxx_messageInfo_AddMultipleAssetsProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_AddMultipleAssetsProposal proto.InternalMessageInfo - -type AddMultiplePairsProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - Pairs []Pair `protobuf:"bytes,3,rep,name=pairs,proto3" json:"pairs"` -} - -func (m *AddMultiplePairsProposal) Reset() { *m = AddMultiplePairsProposal{} } -func (m *AddMultiplePairsProposal) String() string { return proto.CompactTextString(m) } -func (*AddMultiplePairsProposal) ProtoMessage() {} -func (*AddMultiplePairsProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_31c5aab0360b917f, []int{2} -} -func (m *AddMultiplePairsProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddMultiplePairsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddMultiplePairsProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AddMultiplePairsProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddMultiplePairsProposal.Merge(m, src) -} -func (m *AddMultiplePairsProposal) XXX_Size() int { - return m.Size() -} -func (m *AddMultiplePairsProposal) XXX_DiscardUnknown() { - xxx_messageInfo_AddMultiplePairsProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_AddMultiplePairsProposal proto.InternalMessageInfo - -type UpdateAssetProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - Asset Asset `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset"` -} - -func (m *UpdateAssetProposal) Reset() { *m = UpdateAssetProposal{} } -func (m *UpdateAssetProposal) String() string { return proto.CompactTextString(m) } -func (*UpdateAssetProposal) ProtoMessage() {} -func (*UpdateAssetProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_31c5aab0360b917f, []int{3} -} -func (m *UpdateAssetProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateAssetProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateAssetProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateAssetProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateAssetProposal.Merge(m, src) -} -func (m *UpdateAssetProposal) XXX_Size() int { - return m.Size() -} -func (m *UpdateAssetProposal) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateAssetProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateAssetProposal proto.InternalMessageInfo - -type AddPairsProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - Pairs Pair `protobuf:"bytes,3,opt,name=pairs,proto3" json:"pairs"` -} - -func (m *AddPairsProposal) Reset() { *m = AddPairsProposal{} } -func (m *AddPairsProposal) String() string { return proto.CompactTextString(m) } -func (*AddPairsProposal) ProtoMessage() {} -func (*AddPairsProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_31c5aab0360b917f, []int{4} -} -func (m *AddPairsProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddPairsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddPairsProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AddPairsProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddPairsProposal.Merge(m, src) -} -func (m *AddPairsProposal) XXX_Size() int { - return m.Size() -} -func (m *AddPairsProposal) XXX_DiscardUnknown() { - xxx_messageInfo_AddPairsProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_AddPairsProposal proto.InternalMessageInfo - -type UpdatePairProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - Pairs Pair `protobuf:"bytes,3,opt,name=pairs,proto3" json:"pairs"` -} - -func (m *UpdatePairProposal) Reset() { *m = UpdatePairProposal{} } -func (m *UpdatePairProposal) String() string { return proto.CompactTextString(m) } -func (*UpdatePairProposal) ProtoMessage() {} -func (*UpdatePairProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_31c5aab0360b917f, []int{5} -} -func (m *UpdatePairProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdatePairProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdatePairProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdatePairProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdatePairProposal.Merge(m, src) -} -func (m *UpdatePairProposal) XXX_Size() int { - return m.Size() -} -func (m *UpdatePairProposal) XXX_DiscardUnknown() { - xxx_messageInfo_UpdatePairProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdatePairProposal proto.InternalMessageInfo - -type AddAppProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - App AppData `protobuf:"bytes,3,opt,name=app,proto3" json:"app"` -} - -func (m *AddAppProposal) Reset() { *m = AddAppProposal{} } -func (m *AddAppProposal) String() string { return proto.CompactTextString(m) } -func (*AddAppProposal) ProtoMessage() {} -func (*AddAppProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_31c5aab0360b917f, []int{6} -} -func (m *AddAppProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddAppProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddAppProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AddAppProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddAppProposal.Merge(m, src) -} -func (m *AddAppProposal) XXX_Size() int { - return m.Size() -} -func (m *AddAppProposal) XXX_DiscardUnknown() { - xxx_messageInfo_AddAppProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_AddAppProposal proto.InternalMessageInfo - -type UpdateGovTimeInAppProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - GovTime AppAndGovTime `protobuf:"bytes,3,opt,name=govTime,proto3" json:"govTime"` -} - -func (m *UpdateGovTimeInAppProposal) Reset() { *m = UpdateGovTimeInAppProposal{} } -func (m *UpdateGovTimeInAppProposal) String() string { return proto.CompactTextString(m) } -func (*UpdateGovTimeInAppProposal) ProtoMessage() {} -func (*UpdateGovTimeInAppProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_31c5aab0360b917f, []int{7} -} -func (m *UpdateGovTimeInAppProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateGovTimeInAppProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateGovTimeInAppProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateGovTimeInAppProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateGovTimeInAppProposal.Merge(m, src) -} -func (m *UpdateGovTimeInAppProposal) XXX_Size() int { - return m.Size() -} -func (m *UpdateGovTimeInAppProposal) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateGovTimeInAppProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateGovTimeInAppProposal proto.InternalMessageInfo - -type AddAssetInAppProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - App AppData `protobuf:"bytes,3,opt,name=app,proto3" json:"app"` -} - -func (m *AddAssetInAppProposal) Reset() { *m = AddAssetInAppProposal{} } -func (m *AddAssetInAppProposal) String() string { return proto.CompactTextString(m) } -func (*AddAssetInAppProposal) ProtoMessage() {} -func (*AddAssetInAppProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_31c5aab0360b917f, []int{8} -} -func (m *AddAssetInAppProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddAssetInAppProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddAssetInAppProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AddAssetInAppProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddAssetInAppProposal.Merge(m, src) -} -func (m *AddAssetInAppProposal) XXX_Size() int { - return m.Size() -} -func (m *AddAssetInAppProposal) XXX_DiscardUnknown() { - xxx_messageInfo_AddAssetInAppProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_AddAssetInAppProposal proto.InternalMessageInfo - -type AddMultipleAssetsPairsProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - AssetsPair []AssetPair `protobuf:"bytes,3,rep,name=assetsPair,proto3" json:"assetsPair"` -} - -func (m *AddMultipleAssetsPairsProposal) Reset() { *m = AddMultipleAssetsPairsProposal{} } -func (m *AddMultipleAssetsPairsProposal) String() string { return proto.CompactTextString(m) } -func (*AddMultipleAssetsPairsProposal) ProtoMessage() {} -func (*AddMultipleAssetsPairsProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_31c5aab0360b917f, []int{9} -} -func (m *AddMultipleAssetsPairsProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddMultipleAssetsPairsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddMultipleAssetsPairsProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AddMultipleAssetsPairsProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddMultipleAssetsPairsProposal.Merge(m, src) -} -func (m *AddMultipleAssetsPairsProposal) XXX_Size() int { - return m.Size() -} -func (m *AddMultipleAssetsPairsProposal) XXX_DiscardUnknown() { - xxx_messageInfo_AddMultipleAssetsPairsProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_AddMultipleAssetsPairsProposal proto.InternalMessageInfo - -func init() { - proto.RegisterType((*AddAssetsProposal)(nil), "comdex.asset.v1beta1.AddAssetsProposal") - proto.RegisterType((*AddMultipleAssetsProposal)(nil), "comdex.asset.v1beta1.AddMultipleAssetsProposal") - proto.RegisterType((*AddMultiplePairsProposal)(nil), "comdex.asset.v1beta1.AddMultiplePairsProposal") - proto.RegisterType((*UpdateAssetProposal)(nil), "comdex.asset.v1beta1.UpdateAssetProposal") - proto.RegisterType((*AddPairsProposal)(nil), "comdex.asset.v1beta1.AddPairsProposal") - proto.RegisterType((*UpdatePairProposal)(nil), "comdex.asset.v1beta1.UpdatePairProposal") - proto.RegisterType((*AddAppProposal)(nil), "comdex.asset.v1beta1.AddAppProposal") - proto.RegisterType((*UpdateGovTimeInAppProposal)(nil), "comdex.asset.v1beta1.UpdateGovTimeInAppProposal") - proto.RegisterType((*AddAssetInAppProposal)(nil), "comdex.asset.v1beta1.AddAssetInAppProposal") - proto.RegisterType((*AddMultipleAssetsPairsProposal)(nil), "comdex.asset.v1beta1.AddMultipleAssetsPairsProposal") -} - -func init() { proto.RegisterFile("comdex/asset/v1beta1/gov.proto", fileDescriptor_31c5aab0360b917f) } - -var fileDescriptor_31c5aab0360b917f = []byte{ - // 500 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x95, 0x4f, 0x8b, 0xd3, 0x40, - 0x18, 0xc6, 0x33, 0xd6, 0xae, 0xf8, 0xae, 0xc8, 0x1a, 0x57, 0xa9, 0x15, 0x27, 0x25, 0x82, 0xec, - 0xc5, 0x84, 0x55, 0xfc, 0x7b, 0x4b, 0x55, 0xc4, 0x83, 0xb0, 0x16, 0xbd, 0x78, 0x9b, 0x76, 0x66, - 0xe3, 0x40, 0xda, 0x19, 0x92, 0xd9, 0xe2, 0x7e, 0x0b, 0x3f, 0x86, 0x82, 0x88, 0x07, 0x0f, 0xde, - 0xbd, 0xd4, 0xdb, 0x1e, 0x3d, 0x15, 0x6d, 0xbf, 0xc1, 0x7e, 0x02, 0x99, 0x3f, 0x91, 0x80, 0x59, - 0x71, 0x3d, 0xa4, 0x78, 0x6b, 0xf3, 0x3c, 0xef, 0xcc, 0x6f, 0x1e, 0xde, 0x79, 0x07, 0xf0, 0x48, - 0x8c, 0x29, 0x7b, 0x1d, 0x93, 0xa2, 0x60, 0x2a, 0x9e, 0x6e, 0x0f, 0x99, 0x22, 0xdb, 0x71, 0x2a, - 0xa6, 0x91, 0xcc, 0x85, 0x12, 0xfe, 0xa6, 0xd5, 0x23, 0xa3, 0x47, 0x4e, 0xef, 0x6e, 0xa6, 0x22, - 0x15, 0xc6, 0x10, 0xeb, 0x5f, 0xd6, 0xdb, 0xed, 0xd5, 0xae, 0x65, 0x2b, 0xad, 0x23, 0xa8, 0x75, - 0x48, 0xc2, 0x73, 0x67, 0xa8, 0xc7, 0x21, 0x52, 0x5a, 0x3d, 0xfc, 0x88, 0xe0, 0x5c, 0x42, 0x69, - 0xa2, 0xe5, 0x62, 0x27, 0x17, 0x52, 0x14, 0x24, 0xf3, 0xaf, 0x41, 0x5b, 0x71, 0x95, 0xb1, 0x0e, - 0xea, 0xa1, 0xad, 0xd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x8b, 0xe9, 0x73, 0x3e, 0x66, - 0x4f, 0x26, 0xcd, 0x72, 0x3f, 0x80, 0x53, 0xa9, 0xdd, 0xd9, 0xb1, 0x5f, 0x3d, 0x92, 0x3d, 0x99, - 0x50, 0x07, 0xe9, 0x4e, 0x50, 0x56, 0xea, 0x4b, 0x78, 0xa1, 0x9c, 0xd4, 0x4d, 0x1f, 0xe0, 0x1f, - 0x83, 0xff, 0x8a, 0x00, 0xff, 0x3e, 0xa9, 0x1b, 0xbe, 0x92, 0x8f, 0x00, 0xc8, 0xaf, 0x8d, 0xdd, - 0xe4, 0x0b, 0xfe, 0x30, 0x47, 0x2a, 0xbd, 0x5e, 0x29, 0xec, 0x3f, 0x9b, 0xfd, 0xc0, 0xde, 0xdb, - 0x05, 0xf6, 0x66, 0x0b, 0x8c, 0x0e, 0x16, 0x18, 0x7d, 0x5f, 0x60, 0xf4, 0x66, 0x89, 0xbd, 0x83, - 0x25, 0xf6, 0xbe, 0x2d, 0xb1, 0xf7, 0x32, 0x4e, 0xb9, 0x7a, 0xb5, 0x37, 0xd4, 0x4b, 0xc7, 0x76, - 0xf9, 0xeb, 0x62, 0x77, 0x97, 0x8f, 0x38, 0xc9, 0xdc, 0xff, 0xb8, 0x7c, 0x87, 0xd5, 0xbe, 0x64, - 0xc5, 0x70, 0xcd, 0x3c, 0xc1, 0x37, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, 0x44, 0x27, 0xbf, 0x14, - 0x33, 0x08, 0x00, 0x00, -} - -func (m *AddAssetsProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AddAssetsProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddAssetsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Assets.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AddMultipleAssetsProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AddMultipleAssetsProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddMultipleAssetsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Assets) > 0 { - for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Assets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AddMultiplePairsProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AddMultiplePairsProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddMultiplePairsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Pairs) > 0 { - for iNdEx := len(m.Pairs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Pairs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateAssetProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateAssetProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateAssetProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Asset.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AddPairsProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AddPairsProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddPairsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Pairs.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdatePairProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdatePairProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdatePairProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Pairs.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AddAppProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AddAppProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddAppProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.App.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateGovTimeInAppProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateGovTimeInAppProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateGovTimeInAppProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.GovTime.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AddAssetInAppProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AddAssetInAppProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddAssetInAppProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.App.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AddMultipleAssetsPairsProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AddMultipleAssetsPairsProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddMultipleAssetsPairsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AssetsPair) > 0 { - for iNdEx := len(m.AssetsPair) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AssetsPair[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintGov(dAtA []byte, offset int, v uint64) int { - offset -= sovGov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *AddAssetsProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = m.Assets.Size() - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *AddMultipleAssetsProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - if len(m.Assets) > 0 { - for _, e := range m.Assets { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - return n -} - -func (m *AddMultiplePairsProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - if len(m.Pairs) > 0 { - for _, e := range m.Pairs { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - return n -} - -func (m *UpdateAssetProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = m.Asset.Size() - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *AddPairsProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = m.Pairs.Size() - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *UpdatePairProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = m.Pairs.Size() - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *AddAppProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = m.App.Size() - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *UpdateGovTimeInAppProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = m.GovTime.Size() - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *AddAssetInAppProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = m.App.Size() - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *AddMultipleAssetsPairsProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - if len(m.AssetsPair) > 0 { - for _, e := range m.AssetsPair { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - return n -} - -func sovGov(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGov(x uint64) (n int) { - return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *AddAssetsProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AddAssetsProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddAssetsProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Assets.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AddMultipleAssetsProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AddMultipleAssetsProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddMultipleAssetsProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Assets = append(m.Assets, Asset{}) - if err := m.Assets[len(m.Assets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AddMultiplePairsProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AddMultiplePairsProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddMultiplePairsProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Pairs = append(m.Pairs, Pair{}) - if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateAssetProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UpdateAssetProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateAssetProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Asset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AddPairsProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AddPairsProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddPairsProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Pairs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdatePairProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UpdatePairProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdatePairProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Pairs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AddAppProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AddAppProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddAppProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field App", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.App.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateGovTimeInAppProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UpdateGovTimeInAppProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateGovTimeInAppProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GovTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.GovTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AddAssetInAppProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AddAssetInAppProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddAssetInAppProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field App", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.App.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AddMultipleAssetsPairsProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AddMultipleAssetsPairsProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddMultipleAssetsPairsProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetsPair", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AssetsPair = append(m.AssetsPair, AssetPair{}) - if err := m.AssetsPair[len(m.AssetsPair)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGov(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGov - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGov - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGov - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGov - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGov - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGov - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/asset/types/pair.pb.go b/github.com/comdex-official/comdex/x/asset/types/pair.pb.go deleted file mode 100644 index 45c132d80..000000000 --- a/github.com/comdex-official/comdex/x/asset/types/pair.pb.go +++ /dev/null @@ -1,1075 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/asset/v1beta1/pair.proto - -package types - -import ( - fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Pair struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - AssetIn uint64 `protobuf:"varint,2,opt,name=asset_in,json=assetIn,proto3" json:"asset_in,omitempty" yaml:"asset_in"` - AssetOut uint64 `protobuf:"varint,3,opt,name=asset_out,json=assetOut,proto3" json:"asset_out,omitempty" yaml:"asset_out"` -} - -func (m *Pair) Reset() { *m = Pair{} } -func (m *Pair) String() string { return proto.CompactTextString(m) } -func (*Pair) ProtoMessage() {} -func (*Pair) Descriptor() ([]byte, []int) { - return fileDescriptor_65bd24918e5ac160, []int{0} -} -func (m *Pair) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Pair.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Pair) XXX_Merge(src proto.Message) { - xxx_messageInfo_Pair.Merge(m, src) -} -func (m *Pair) XXX_Size() int { - return m.Size() -} -func (m *Pair) XXX_DiscardUnknown() { - xxx_messageInfo_Pair.DiscardUnknown(m) -} - -var xxx_messageInfo_Pair proto.InternalMessageInfo - -type PairInfo struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - AssetIn uint64 `protobuf:"varint,2,opt,name=asset_in,json=assetIn,proto3" json:"asset_in,omitempty" yaml:"asset_in"` - DenomIn string `protobuf:"bytes,3,opt,name=denom_in,json=denomIn,proto3" json:"denom_in,omitempty" yaml:"denom"` - AssetOut uint64 `protobuf:"varint,4,opt,name=asset_out,json=assetOut,proto3" json:"asset_out,omitempty" yaml:"asset_out"` - DenomOut string `protobuf:"bytes,5,opt,name=denom_out,json=denomOut,proto3" json:"denom_out,omitempty" yaml:"denom"` -} - -func (m *PairInfo) Reset() { *m = PairInfo{} } -func (m *PairInfo) String() string { return proto.CompactTextString(m) } -func (*PairInfo) ProtoMessage() {} -func (*PairInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_65bd24918e5ac160, []int{1} -} -func (m *PairInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PairInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PairInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PairInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_PairInfo.Merge(m, src) -} -func (m *PairInfo) XXX_Size() int { - return m.Size() -} -func (m *PairInfo) XXX_DiscardUnknown() { - xxx_messageInfo_PairInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_PairInfo proto.InternalMessageInfo - -type AssetPair struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` - Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` - Decimals github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=decimals,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"decimals" yaml:"decimals"` - IsOnChain bool `protobuf:"varint,5,opt,name=is_on_chain,json=isOnChain,proto3" json:"is_on_chain,omitempty" yaml:"is_on_chain"` - IsOraclePriceRequired bool `protobuf:"varint,6,opt,name=is_oracle_price_required,json=isOraclePriceRequired,proto3" json:"is_oracle_price_required,omitempty" yaml:"is_oracle_price_required"` - IsCdpMintable bool `protobuf:"varint,7,opt,name=is_cdp_mintable,json=isCdpMintable,proto3" json:"is_cdp_mintable,omitempty" yaml:"is_cdp_mintable"` - AssetOut uint64 `protobuf:"varint,8,opt,name=asset_out,json=assetOut,proto3" json:"asset_out,omitempty" yaml:"asset_out"` -} - -func (m *AssetPair) Reset() { *m = AssetPair{} } -func (m *AssetPair) String() string { return proto.CompactTextString(m) } -func (*AssetPair) ProtoMessage() {} -func (*AssetPair) Descriptor() ([]byte, []int) { - return fileDescriptor_65bd24918e5ac160, []int{2} -} -func (m *AssetPair) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AssetPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AssetPair.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AssetPair) XXX_Merge(src proto.Message) { - xxx_messageInfo_AssetPair.Merge(m, src) -} -func (m *AssetPair) XXX_Size() int { - return m.Size() -} -func (m *AssetPair) XXX_DiscardUnknown() { - xxx_messageInfo_AssetPair.DiscardUnknown(m) -} - -var xxx_messageInfo_AssetPair proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Pair)(nil), "comdex.asset.v1beta1.Pair") - proto.RegisterType((*PairInfo)(nil), "comdex.asset.v1beta1.PairInfo") - proto.RegisterType((*AssetPair)(nil), "comdex.asset.v1beta1.AssetPair") -} - -func init() { proto.RegisterFile("comdex/asset/v1beta1/pair.proto", fileDescriptor_65bd24918e5ac160) } - -var fileDescriptor_65bd24918e5ac160 = []byte{ - // 517 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xcf, 0x6e, 0xd3, 0x30, - 0x18, 0x4f, 0xb6, 0x6e, 0x6d, 0x3c, 0xa0, 0x93, 0x29, 0x53, 0xb4, 0x43, 0x8c, 0x32, 0x69, 0x42, - 0x42, 0x4d, 0x54, 0x21, 0x71, 0xe0, 0xb6, 0xec, 0xd4, 0x03, 0xea, 0xc8, 0x11, 0x81, 0x22, 0x37, - 0x71, 0x3b, 0x8b, 0xc6, 0x0e, 0xb1, 0x8b,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, 0x19, 0x71, 0xdb, 0xda, 0xf4, 0xb8, 0xae, 0xd0, 0xd1, 0x5f, 0xd3, 0x6d, 0x82, - 0x1f, 0x3f, 0xa4, 0xe2, 0x3c, 0x2b, 0x5e, 0x37, 0xeb, 0x9b, 0xb7, 0xa0, 0x73, 0x9f, 0x5b, 0x10, - 0xbd, 0x59, 0xfe, 0xf6, 0xac, 0xaf, 0x2b, 0xcf, 0x5a, 0xae, 0x3c, 0xfb, 0x6a, 0xe5, 0xd9, 0xbf, - 0x56, 0x9e, 0xfd, 0x65, 0xed, 0x59, 0x57, 0x6b, 0xcf, 0xfa, 0xbe, 0xf6, 0xac, 0xb7, 0xe1, 0x8d, - 0x33, 0x57, 0xcf, 0xb0, 0xcf, 0x27, 0x13, 0x9a, 0x52, 0x3c, 0x6b, 0xd6, 0xe1, 0xe6, 0xe5, 0xea, - 0x1f, 0x30, 0xde, 0xd7, 0xef, 0xf0, 0xc5, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc9, 0xbe, 0x85, - 0x72, 0xd6, 0x03, 0x00, 0x00, -} - -func (m *Pair) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Pair) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Pair) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AssetOut != 0 { - i = encodeVarintPair(dAtA, i, uint64(m.AssetOut)) - i-- - dAtA[i] = 0x18 - } - if m.AssetIn != 0 { - i = encodeVarintPair(dAtA, i, uint64(m.AssetIn)) - i-- - dAtA[i] = 0x10 - } - if m.Id != 0 { - i = encodeVarintPair(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *PairInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PairInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PairInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DenomOut) > 0 { - i -= len(m.DenomOut) - copy(dAtA[i:], m.DenomOut) - i = encodeVarintPair(dAtA, i, uint64(len(m.DenomOut))) - i-- - dAtA[i] = 0x2a - } - if m.AssetOut != 0 { - i = encodeVarintPair(dAtA, i, uint64(m.AssetOut)) - i-- - dAtA[i] = 0x20 - } - if len(m.DenomIn) > 0 { - i -= len(m.DenomIn) - copy(dAtA[i:], m.DenomIn) - i = encodeVarintPair(dAtA, i, uint64(len(m.DenomIn))) - i-- - dAtA[i] = 0x1a - } - if m.AssetIn != 0 { - i = encodeVarintPair(dAtA, i, uint64(m.AssetIn)) - i-- - dAtA[i] = 0x10 - } - if m.Id != 0 { - i = encodeVarintPair(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *AssetPair) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AssetPair) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AssetPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AssetOut != 0 { - i = encodeVarintPair(dAtA, i, uint64(m.AssetOut)) - i-- - dAtA[i] = 0x40 - } - if m.IsCdpMintable { - i-- - if m.IsCdpMintable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if m.IsOraclePriceRequired { - i-- - if m.IsOraclePriceRequired { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if m.IsOnChain { - i-- - if m.IsOnChain { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - { - size := m.Decimals.Size() - i -= size - if _, err := m.Decimals.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintPair(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintPair(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintPair(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintPair(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintPair(dAtA []byte, offset int, v uint64) int { - offset -= sovPair(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Pair) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovPair(uint64(m.Id)) - } - if m.AssetIn != 0 { - n += 1 + sovPair(uint64(m.AssetIn)) - } - if m.AssetOut != 0 { - n += 1 + sovPair(uint64(m.AssetOut)) - } - return n -} - -func (m *PairInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovPair(uint64(m.Id)) - } - if m.AssetIn != 0 { - n += 1 + sovPair(uint64(m.AssetIn)) - } - l = len(m.DenomIn) - if l > 0 { - n += 1 + l + sovPair(uint64(l)) - } - if m.AssetOut != 0 { - n += 1 + sovPair(uint64(m.AssetOut)) - } - l = len(m.DenomOut) - if l > 0 { - n += 1 + l + sovPair(uint64(l)) - } - return n -} - -func (m *AssetPair) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovPair(uint64(m.Id)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovPair(uint64(l)) - } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovPair(uint64(l)) - } - l = m.Decimals.Size() - n += 1 + l + sovPair(uint64(l)) - if m.IsOnChain { - n += 2 - } - if m.IsOraclePriceRequired { - n += 2 - } - if m.IsCdpMintable { - n += 2 - } - if m.AssetOut != 0 { - n += 1 + sovPair(uint64(m.AssetOut)) - } - return n -} - -func sovPair(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPair(x uint64) (n int) { - return sovPair(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Pair) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Pair: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Pair: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetIn", wireType) - } - m.AssetIn = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetIn |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetOut", wireType) - } - m.AssetOut = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetOut |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipPair(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPair - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PairInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PairInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PairInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetIn", wireType) - } - m.AssetIn = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetIn |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DenomIn", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - 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 ErrInvalidLengthPair - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPair - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DenomIn = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetOut", wireType) - } - m.AssetOut = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetOut |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DenomOut", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - 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 ErrInvalidLengthPair - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPair - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DenomOut = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPair(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPair - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AssetPair) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AssetPair: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AssetPair: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - 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 ErrInvalidLengthPair - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPair - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - 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 ErrInvalidLengthPair - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPair - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - 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 ErrInvalidLengthPair - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPair - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Decimals.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsOnChain", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsOnChain = bool(v != 0) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsOraclePriceRequired", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsOraclePriceRequired = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsCdpMintable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsCdpMintable = bool(v != 0) - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetOut", wireType) - } - m.AssetOut = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPair - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetOut |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipPair(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPair - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPair(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPair - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPair - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPair - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthPair - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPair - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPair - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthPair = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPair = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPair = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/asset/types/params.pb.go b/github.com/comdex-official/comdex/x/asset/types/params.pb.go deleted file mode 100644 index 29c4379a3..000000000 --- a/github.com/comdex-official/comdex/x/asset/types/params.pb.go +++ /dev/null @@ -1,265 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/asset/v1beta1/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Params struct { -} - -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_6cd5d1c7ef4e1c40, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Params)(nil), "comdex.asset.v1beta1.Params") -} - -func init() { proto.RegisterFile("comdex/asset/v1beta1/params.proto", fileDescriptor_6cd5d1c7ef4e1c40) } - -var fileDescriptor_6cd5d1c7ef4e1c40 = []byte{ - // 164 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x2e, 0x4e, 0x2d, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, - 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, - 0x28, 0xd1, 0x03, 0x2b, 0xd1, 0x83, 0x2a, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, 0xd0, - 0x07, 0xb1, 0x20, 0x6a, 0x95, 0x38, 0xb8, 0xd8, 0x02, 0xc0, 0x7a, 0x9d, 0x02, 0x4f, 0x3c, 0x94, - 0x63, 0x58, 0xf1, 0x48, 0x8e, 0xe1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, - 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, - 0xf4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x21, 0x56, 0xe8, 0xe6, - 0xa7, 0xa5, 0x65, 0x26, 0x67, 0x26, 0xe6, 0x40, 0xf9, 0xfa, 0x30, 0x77, 0x95, 0x54, 0x16, 0xa4, - 0x16, 0x27, 0xb1, 0x81, 0xed, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xba, 0x38, 0xd8, 0xd2, - 0xb4, 0x00, 0x00, 0x00, -} - -func (m *Params) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/asset/types/query.pb.go b/github.com/comdex-official/comdex/x/asset/types/query.pb.go deleted file mode 100644 index d51796b79..000000000 --- a/github.com/comdex-official/comdex/x/asset/types/query.pb.go +++ /dev/null @@ -1,5660 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/asset/v1beta1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type QueryAssetsRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAssetsRequest) Reset() { *m = QueryAssetsRequest{} } -func (m *QueryAssetsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAssetsRequest) ProtoMessage() {} -func (*QueryAssetsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{0} -} -func (m *QueryAssetsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAssetsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAssetsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAssetsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAssetsRequest.Merge(m, src) -} -func (m *QueryAssetsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAssetsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAssetsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAssetsRequest proto.InternalMessageInfo - -type QueryAssetsResponse struct { - Assets []Asset `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets" yaml:"assets"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAssetsResponse) Reset() { *m = QueryAssetsResponse{} } -func (m *QueryAssetsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAssetsResponse) ProtoMessage() {} -func (*QueryAssetsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{1} -} -func (m *QueryAssetsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAssetsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAssetsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAssetsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAssetsResponse.Merge(m, src) -} -func (m *QueryAssetsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAssetsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAssetsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAssetsResponse proto.InternalMessageInfo - -type QueryAssetRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *QueryAssetRequest) Reset() { *m = QueryAssetRequest{} } -func (m *QueryAssetRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAssetRequest) ProtoMessage() {} -func (*QueryAssetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{2} -} -func (m *QueryAssetRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAssetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAssetRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAssetRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAssetRequest.Merge(m, src) -} -func (m *QueryAssetRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAssetRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAssetRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAssetRequest proto.InternalMessageInfo - -type QueryAssetResponse struct { - Asset Asset `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset" yaml:"asset"` -} - -func (m *QueryAssetResponse) Reset() { *m = QueryAssetResponse{} } -func (m *QueryAssetResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAssetResponse) ProtoMessage() {} -func (*QueryAssetResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{3} -} -func (m *QueryAssetResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAssetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAssetResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAssetResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAssetResponse.Merge(m, src) -} -func (m *QueryAssetResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAssetResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAssetResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAssetResponse proto.InternalMessageInfo - -type QueryAssetPairsRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAssetPairsRequest) Reset() { *m = QueryAssetPairsRequest{} } -func (m *QueryAssetPairsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAssetPairsRequest) ProtoMessage() {} -func (*QueryAssetPairsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{4} -} -func (m *QueryAssetPairsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAssetPairsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAssetPairsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAssetPairsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAssetPairsRequest.Merge(m, src) -} -func (m *QueryAssetPairsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAssetPairsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAssetPairsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAssetPairsRequest proto.InternalMessageInfo - -type QueryAssetPairsResponse struct { - PairsInfo []PairInfo `protobuf:"bytes,1,rep,name=pairsInfo,proto3" json:"pairsInfo" yaml:"pairs_info"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAssetPairsResponse) Reset() { *m = QueryAssetPairsResponse{} } -func (m *QueryAssetPairsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAssetPairsResponse) ProtoMessage() {} -func (*QueryAssetPairsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{5} -} -func (m *QueryAssetPairsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAssetPairsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAssetPairsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAssetPairsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAssetPairsResponse.Merge(m, src) -} -func (m *QueryAssetPairsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAssetPairsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAssetPairsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAssetPairsResponse proto.InternalMessageInfo - -type QueryAssetPairRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *QueryAssetPairRequest) Reset() { *m = QueryAssetPairRequest{} } -func (m *QueryAssetPairRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAssetPairRequest) ProtoMessage() {} -func (*QueryAssetPairRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{6} -} -func (m *QueryAssetPairRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAssetPairRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAssetPairRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAssetPairRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAssetPairRequest.Merge(m, src) -} -func (m *QueryAssetPairRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAssetPairRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAssetPairRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAssetPairRequest proto.InternalMessageInfo - -type QueryAssetPairResponse struct { - PairInfo PairInfo `protobuf:"bytes,1,opt,name=pairInfo,proto3" json:"pairInfo" yaml:"pair_info"` -} - -func (m *QueryAssetPairResponse) Reset() { *m = QueryAssetPairResponse{} } -func (m *QueryAssetPairResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAssetPairResponse) ProtoMessage() {} -func (*QueryAssetPairResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{7} -} -func (m *QueryAssetPairResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAssetPairResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAssetPairResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAssetPairResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAssetPairResponse.Merge(m, src) -} -func (m *QueryAssetPairResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAssetPairResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAssetPairResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAssetPairResponse proto.InternalMessageInfo - -type QueryAppRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *QueryAppRequest) Reset() { *m = QueryAppRequest{} } -func (m *QueryAppRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAppRequest) ProtoMessage() {} -func (*QueryAppRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{8} -} -func (m *QueryAppRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAppRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAppRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAppRequest.Merge(m, src) -} -func (m *QueryAppRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAppRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAppRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAppRequest proto.InternalMessageInfo - -type QueryAppResponse struct { - App AppData `protobuf:"bytes,1,opt,name=app,proto3" json:"app" yaml:"app"` -} - -func (m *QueryAppResponse) Reset() { *m = QueryAppResponse{} } -func (m *QueryAppResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAppResponse) ProtoMessage() {} -func (*QueryAppResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{9} -} -func (m *QueryAppResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAppResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAppResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAppResponse.Merge(m, src) -} -func (m *QueryAppResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAppResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAppResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAppResponse proto.InternalMessageInfo - -type QueryGovTokenByAppRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` -} - -func (m *QueryGovTokenByAppRequest) Reset() { *m = QueryGovTokenByAppRequest{} } -func (m *QueryGovTokenByAppRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGovTokenByAppRequest) ProtoMessage() {} -func (*QueryGovTokenByAppRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{10} -} -func (m *QueryGovTokenByAppRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGovTokenByAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGovTokenByAppRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryGovTokenByAppRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGovTokenByAppRequest.Merge(m, src) -} -func (m *QueryGovTokenByAppRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGovTokenByAppRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGovTokenByAppRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGovTokenByAppRequest proto.InternalMessageInfo - -type QueryGovTokenByAppResponse struct { - GovAssetId uint64 `protobuf:"varint,1,opt,name=gov_asset_id,json=govAssetId,proto3" json:"gov_asset_id,omitempty" yaml:"gov_asset_id"` -} - -func (m *QueryGovTokenByAppResponse) Reset() { *m = QueryGovTokenByAppResponse{} } -func (m *QueryGovTokenByAppResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGovTokenByAppResponse) ProtoMessage() {} -func (*QueryGovTokenByAppResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{11} -} -func (m *QueryGovTokenByAppResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGovTokenByAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGovTokenByAppResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryGovTokenByAppResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGovTokenByAppResponse.Merge(m, src) -} -func (m *QueryGovTokenByAppResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGovTokenByAppResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGovTokenByAppResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGovTokenByAppResponse proto.InternalMessageInfo - -type QueryAppsRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAppsRequest) Reset() { *m = QueryAppsRequest{} } -func (m *QueryAppsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAppsRequest) ProtoMessage() {} -func (*QueryAppsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{12} -} -func (m *QueryAppsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAppsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAppsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAppsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAppsRequest.Merge(m, src) -} -func (m *QueryAppsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAppsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAppsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAppsRequest proto.InternalMessageInfo - -type QueryAppsResponse struct { - Apps []AppData `protobuf:"bytes,1,rep,name=apps,proto3" json:"apps" yaml:"apps"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAppsResponse) Reset() { *m = QueryAppsResponse{} } -func (m *QueryAppsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAppsResponse) ProtoMessage() {} -func (*QueryAppsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{13} -} -func (m *QueryAppsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAppsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAppsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAppsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAppsResponse.Merge(m, src) -} -func (m *QueryAppsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAppsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAppsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAppsResponse proto.InternalMessageInfo - -type QueryExtendedPairVaultRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *QueryExtendedPairVaultRequest) Reset() { *m = QueryExtendedPairVaultRequest{} } -func (m *QueryExtendedPairVaultRequest) String() string { return proto.CompactTextString(m) } -func (*QueryExtendedPairVaultRequest) ProtoMessage() {} -func (*QueryExtendedPairVaultRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{14} -} -func (m *QueryExtendedPairVaultRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryExtendedPairVaultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryExtendedPairVaultRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryExtendedPairVaultRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryExtendedPairVaultRequest.Merge(m, src) -} -func (m *QueryExtendedPairVaultRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryExtendedPairVaultRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryExtendedPairVaultRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryExtendedPairVaultRequest proto.InternalMessageInfo - -type QueryExtendedPairVaultResponse struct { - PairVault ExtendedPairVault `protobuf:"bytes,1,opt,name=pairVault,proto3" json:"pairVault" yaml:"pair_vault"` -} - -func (m *QueryExtendedPairVaultResponse) Reset() { *m = QueryExtendedPairVaultResponse{} } -func (m *QueryExtendedPairVaultResponse) String() string { return proto.CompactTextString(m) } -func (*QueryExtendedPairVaultResponse) ProtoMessage() {} -func (*QueryExtendedPairVaultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{15} -} -func (m *QueryExtendedPairVaultResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryExtendedPairVaultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryExtendedPairVaultResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryExtendedPairVaultResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryExtendedPairVaultResponse.Merge(m, src) -} -func (m *QueryExtendedPairVaultResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryExtendedPairVaultResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryExtendedPairVaultResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryExtendedPairVaultResponse proto.InternalMessageInfo - -type QueryAllExtendedPairVaultsRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAllExtendedPairVaultsRequest) Reset() { *m = QueryAllExtendedPairVaultsRequest{} } -func (m *QueryAllExtendedPairVaultsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllExtendedPairVaultsRequest) ProtoMessage() {} -func (*QueryAllExtendedPairVaultsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{16} -} -func (m *QueryAllExtendedPairVaultsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllExtendedPairVaultsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllExtendedPairVaultsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllExtendedPairVaultsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllExtendedPairVaultsRequest.Merge(m, src) -} -func (m *QueryAllExtendedPairVaultsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllExtendedPairVaultsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllExtendedPairVaultsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllExtendedPairVaultsRequest proto.InternalMessageInfo - -type QueryAllExtendedPairVaultsResponse struct { - PairVault []ExtendedPairVault `protobuf:"bytes,1,rep,name=pairVault,proto3" json:"pairVault" yaml:"pair_vault"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAllExtendedPairVaultsResponse) Reset() { *m = QueryAllExtendedPairVaultsResponse{} } -func (m *QueryAllExtendedPairVaultsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllExtendedPairVaultsResponse) ProtoMessage() {} -func (*QueryAllExtendedPairVaultsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{17} -} -func (m *QueryAllExtendedPairVaultsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllExtendedPairVaultsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllExtendedPairVaultsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllExtendedPairVaultsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllExtendedPairVaultsResponse.Merge(m, src) -} -func (m *QueryAllExtendedPairVaultsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllExtendedPairVaultsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllExtendedPairVaultsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllExtendedPairVaultsResponse proto.InternalMessageInfo - -type QueryAllExtendedPairVaultsByAppRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAllExtendedPairVaultsByAppRequest) Reset() { - *m = QueryAllExtendedPairVaultsByAppRequest{} -} -func (m *QueryAllExtendedPairVaultsByAppRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllExtendedPairVaultsByAppRequest) ProtoMessage() {} -func (*QueryAllExtendedPairVaultsByAppRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{18} -} -func (m *QueryAllExtendedPairVaultsByAppRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllExtendedPairVaultsByAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllExtendedPairVaultsByAppRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllExtendedPairVaultsByAppRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllExtendedPairVaultsByAppRequest.Merge(m, src) -} -func (m *QueryAllExtendedPairVaultsByAppRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllExtendedPairVaultsByAppRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllExtendedPairVaultsByAppRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllExtendedPairVaultsByAppRequest proto.InternalMessageInfo - -type QueryAllExtendedPairVaultsByAppResponse struct { - ExtendedPair []ExtendedPairVault `protobuf:"bytes,1,rep,name=extended_pair,json=extendedPair,proto3" json:"extended_pair" yaml:"extended_pair"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAllExtendedPairVaultsByAppResponse) Reset() { - *m = QueryAllExtendedPairVaultsByAppResponse{} -} -func (m *QueryAllExtendedPairVaultsByAppResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllExtendedPairVaultsByAppResponse) ProtoMessage() {} -func (*QueryAllExtendedPairVaultsByAppResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{19} -} -func (m *QueryAllExtendedPairVaultsByAppResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllExtendedPairVaultsByAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllExtendedPairVaultsByAppResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllExtendedPairVaultsByAppResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllExtendedPairVaultsByAppResponse.Merge(m, src) -} -func (m *QueryAllExtendedPairVaultsByAppResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllExtendedPairVaultsByAppResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllExtendedPairVaultsByAppResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllExtendedPairVaultsByAppResponse proto.InternalMessageInfo - -type QueryAllExtendedPairStableVaultsIDByAppRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) Reset() { - *m = QueryAllExtendedPairStableVaultsIDByAppRequest{} -} -func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) String() string { - return proto.CompactTextString(m) -} -func (*QueryAllExtendedPairStableVaultsIDByAppRequest) ProtoMessage() {} -func (*QueryAllExtendedPairStableVaultsIDByAppRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{20} -} -func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppRequest.Merge(m, src) -} -func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppRequest proto.InternalMessageInfo - -type QueryAllExtendedPairStableVaultsIDByAppResponse struct { - ExtendedPairsId []uint64 `protobuf:"varint,1,rep,packed,name=extended_pairs_id,json=extendedPairsId,proto3" json:"extended_pairs_id,omitempty" yaml:"extended_pairs_id"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) Reset() { - *m = QueryAllExtendedPairStableVaultsIDByAppResponse{} -} -func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) String() string { - return proto.CompactTextString(m) -} -func (*QueryAllExtendedPairStableVaultsIDByAppResponse) ProtoMessage() {} -func (*QueryAllExtendedPairStableVaultsIDByAppResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{21} -} -func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppResponse.Merge(m, src) -} -func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllExtendedPairStableVaultsIDByAppResponse proto.InternalMessageInfo - -type QueryAllExtendedPairStableVaultsByAppRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAllExtendedPairStableVaultsByAppRequest) Reset() { - *m = QueryAllExtendedPairStableVaultsByAppRequest{} -} -func (m *QueryAllExtendedPairStableVaultsByAppRequest) String() string { - return proto.CompactTextString(m) -} -func (*QueryAllExtendedPairStableVaultsByAppRequest) ProtoMessage() {} -func (*QueryAllExtendedPairStableVaultsByAppRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{22} -} -func (m *QueryAllExtendedPairStableVaultsByAppRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllExtendedPairStableVaultsByAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllExtendedPairStableVaultsByAppRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppRequest.Merge(m, src) -} -func (m *QueryAllExtendedPairStableVaultsByAppRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllExtendedPairStableVaultsByAppRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppRequest proto.InternalMessageInfo - -type QueryAllExtendedPairStableVaultsByAppResponse struct { - ExtendedPair []ExtendedPairVault `protobuf:"bytes,1,rep,name=extended_pair,json=extendedPair,proto3" json:"extended_pair" yaml:"extended_pair"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAllExtendedPairStableVaultsByAppResponse) Reset() { - *m = QueryAllExtendedPairStableVaultsByAppResponse{} -} -func (m *QueryAllExtendedPairStableVaultsByAppResponse) String() string { - return proto.CompactTextString(m) -} -func (*QueryAllExtendedPairStableVaultsByAppResponse) ProtoMessage() {} -func (*QueryAllExtendedPairStableVaultsByAppResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{23} -} -func (m *QueryAllExtendedPairStableVaultsByAppResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllExtendedPairStableVaultsByAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAllExtendedPairStableVaultsByAppResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppResponse.Merge(m, src) -} -func (m *QueryAllExtendedPairStableVaultsByAppResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllExtendedPairStableVaultsByAppResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllExtendedPairStableVaultsByAppResponse proto.InternalMessageInfo - -type QueryExtendedPairVaultsByAppWithoutStableRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) Reset() { - *m = QueryExtendedPairVaultsByAppWithoutStableRequest{} -} -func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) String() string { - return proto.CompactTextString(m) -} -func (*QueryExtendedPairVaultsByAppWithoutStableRequest) ProtoMessage() {} -func (*QueryExtendedPairVaultsByAppWithoutStableRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{24} -} -func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableRequest.Merge(m, src) -} -func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableRequest proto.InternalMessageInfo - -type QueryExtendedPairVaultsByAppWithoutStableResponse struct { - ExtendedPair []ExtendedPairVault `protobuf:"bytes,1,rep,name=extended_pair,json=extendedPair,proto3" json:"extended_pair" yaml:"extended_pair"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) Reset() { - *m = QueryExtendedPairVaultsByAppWithoutStableResponse{} -} -func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) String() string { - return proto.CompactTextString(m) -} -func (*QueryExtendedPairVaultsByAppWithoutStableResponse) ProtoMessage() {} -func (*QueryExtendedPairVaultsByAppWithoutStableResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9e7e9ce3abb4febf, []int{25} -} -func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableResponse.Merge(m, src) -} -func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryExtendedPairVaultsByAppWithoutStableResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*QueryAssetsRequest)(nil), "comdex.asset.v1beta1.QueryAssetsRequest") - proto.RegisterType((*QueryAssetsResponse)(nil), "comdex.asset.v1beta1.QueryAssetsResponse") - proto.RegisterType((*QueryAssetRequest)(nil), "comdex.asset.v1beta1.QueryAssetRequest") - proto.RegisterType((*QueryAssetResponse)(nil), "comdex.asset.v1beta1.QueryAssetResponse") - proto.RegisterType((*QueryAssetPairsRequest)(nil), "comdex.asset.v1beta1.QueryAssetPairsRequest") - proto.RegisterType((*QueryAssetPairsResponse)(nil), "comdex.asset.v1beta1.QueryAssetPairsResponse") - proto.RegisterType((*QueryAssetPairRequest)(nil), "comdex.asset.v1beta1.QueryAssetPairRequest") - proto.RegisterType((*QueryAssetPairResponse)(nil), "comdex.asset.v1beta1.QueryAssetPairResponse") - proto.RegisterType((*QueryAppRequest)(nil), "comdex.asset.v1beta1.QueryAppRequest") - proto.RegisterType((*QueryAppResponse)(nil), "comdex.asset.v1beta1.QueryAppResponse") - proto.RegisterType((*QueryGovTokenByAppRequest)(nil), "comdex.asset.v1beta1.QueryGovTokenByAppRequest") - proto.RegisterType((*QueryGovTokenByAppResponse)(nil), "comdex.asset.v1beta1.QueryGovTokenByAppResponse") - proto.RegisterType((*QueryAppsRequest)(nil), "comdex.asset.v1beta1.QueryAppsRequest") - proto.RegisterType((*QueryAppsResponse)(nil), "comdex.asset.v1beta1.QueryAppsResponse") - proto.RegisterType((*QueryExtendedPairVaultRequest)(nil), "comdex.asset.v1beta1.QueryExtendedPairVaultRequest") - proto.RegisterType((*QueryExtendedPairVaultResponse)(nil), "comdex.asset.v1beta1.QueryExtendedPairVaultResponse") - proto.RegisterType((*QueryAllExtendedPairVaultsRequest)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairVaultsRequest") - proto.RegisterType((*QueryAllExtendedPairVaultsResponse)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairVaultsResponse") - proto.RegisterType((*QueryAllExtendedPairVaultsByAppRequest)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairVaultsByAppRequest") - proto.RegisterType((*QueryAllExtendedPairVaultsByAppResponse)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairVaultsByAppResponse") - proto.RegisterType((*QueryAllExtendedPairStableVaultsIDByAppRequest)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairStableVaultsIDByAppRequest") - proto.RegisterType((*QueryAllExtendedPairStableVaultsIDByAppResponse)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairStableVaultsIDByAppResponse") - proto.RegisterType((*QueryAllExtendedPairStableVaultsByAppRequest)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairStableVaultsByAppRequest") - proto.RegisterType((*QueryAllExtendedPairStableVaultsByAppResponse)(nil), "comdex.asset.v1beta1.QueryAllExtendedPairStableVaultsByAppResponse") - proto.RegisterType((*QueryExtendedPairVaultsByAppWithoutStableRequest)(nil), "comdex.asset.v1beta1.QueryExtendedPairVaultsByAppWithoutStableRequest") - proto.RegisterType((*QueryExtendedPairVaultsByAppWithoutStableResponse)(nil), "comdex.asset.v1beta1.QueryExtendedPairVaultsByAppWithoutStableResponse") -} - -func init() { proto.RegisterFile("comdex/asset/v1beta1/query.proto", fileDescriptor_9e7e9ce3abb4febf) } - -var fileDescriptor_9e7e9ce3abb4febf = []byte{ - // 1345 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xdb, 0x4f, 0x1c, 0xd5, - 0x1f, 0xdf, 0xb3, 0xb4, 0x4d, 0x7b, 0xa0, 0x17, 0x0e, 0xf0, 0x2b, 0x9d, 0xc2, 0x2c, 0x0c, 0xbf, - 0xb2, 0x4b, 0x85, 0x1d, 0xa0, 0x8d, 0xb5, 0x8d, 0xd7, 0x2d, 0x17, 0x31, 0x31, 0xb6, 0x6b, 0x95, - 0xc4, 0xa4, 0x8e, 0x03, 0x3b, 0x6c, 0x47, 0x97, 0x99, 0xc3, 0x9e, 0xd9, 0xa5, 0xa4, 0x69, 0xa2, - 0x3c, 0x19, 0x9f, 0x4c, 0x88, 0xff, 0x83, 0xaf, 0xc6, 0x07, 0x63, 0x78, 0x32, 0xbe, 0xf0, 0xd8, - 0xe8, 0x8b, 0x89, 0x09, 0x2a, 0x18, 0xff, 0x00, 0x12, 0x13, 0x13, 0x13, 0x35, 0x73, 0xce, 0x77, - 0x76, 0x76, 0x61, 0x66, 0x77, 0x16, 0x0a, 0x21, 0x7d, 0x23, 0x3b, 0xdf, 0xcb, 0xe7, 0x72, 0xce, - 0xcc, 0xf7, 0x1c, 0x70, 0xdf, 0xbc, 0xbd, 0x98, 0x33, 0x1e, 0xaa, 0x3a, 0x63, 0x86, 0xa3, 0x96, - 0xc7, 0xe6, 0x0c, 0x47, 0x1f, 0x53, 0x97, 0x4a, 0x46, 0x71, 0x25, 0x4d, 0x8b, 0xb6, 0x63, 0x93, - 0x4e, 0x11, 0x91, 0xe6, 0x11, 0x69, 0x88, 0x90, 0xae, 0xce, 0xdb, 0x6c, 0xd1, 0x66, 0xea, 0x9c, - 0xce, 0x0c, 0x11, 0x5e, 0x49, 0xa6, 0x7a, 0xde, 0xb4, 0x74, 0xc7, 0xb4, 0x2d, 0x51, 0x41, 0xea, - 0xcc, 0xdb, 0x79, 0x9b, 0xff, 0xa9, 0xba, 0x7f, 0xc1, 0xaf, 0x3d, 0x79, 0xdb, 0xce, 0x17, 0x0c, - 0x55, 0xa7, 0xa6, 0xaa, 0x5b, 0x96, 0xed, 0xf0, 0x14, 0x06, 0x4f, 0x83, 0x71, 0x09, 0x0c, 0x22, - 0x42, 0x0e, 0x8e, 0xa0, 0x14, 0x9e, 0x27, 0x02, 0x9f, 0x53, 0xdd, 0x2c, 0x42, 0xc0, 0x70, 0x60, - 0x80, 0xf1, 0xd0, 0x31, 0xac, 0x9c, 0x91, 0xbb, 0xa3, 0x9b, 0xc5, 0x77, 0xf5, 0x52, 0x01, 0xda, - 0x29, 0x0c, 0x93, 0xbb, 0x2e, 0xcd, 0xd7, 0xdc, 0x68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, 0x10, 0x29, 0xd9, 0x30, 0x0e, 0x80, 0x28, 0x1c, 0x48, 0x0f, 0x91, 0xd4, 0xb0, 0x9b, - 0x1f, 0x46, 0x3e, 0x41, 0xf8, 0xb4, 0x97, 0x49, 0xae, 0xd4, 0xaf, 0xec, 0x01, 0x18, 0x6c, 0x14, - 0x06, 0xfd, 0x07, 0x79, 0xff, 0x3e, 0x22, 0x87, 0xf6, 0x17, 0x32, 0xac, 0x23, 0x38, 0xf6, 0xee, - 0xd9, 0xfd, 0xe4, 0x5a, 0x9d, 0x56, 0x61, 0xe7, 0x0c, 0xe9, 0x7a, 0x73, 0x49, 0x80, 0xf6, 0x79, - 0x8e, 0x76, 0x94, 0xa4, 0xd5, 0xba, 0xd7, 0x5c, 0x9a, 0x3f, 0x39, 0x0b, 0xf4, 0xdf, 0x23, 0x38, - 0x81, 0x06, 0x8e, 0x87, 0xe4, 0x46, 0x3d, 0xb1, 0xea, 0x1c, 0x39, 0xa4, 0x17, 0x9a, 0x4f, 0x04, - 0x26, 0xe3, 0x9c, 0xc9, 0x30, 0xb9, 0x1a, 0x99, 0x09, 0x23, 0xbf, 0x20, 0x9c, 0x68, 0x30, 0xe4, - 0x92, 0x17, 0x9b, 0x45, 0x54, 0x3d, 0x83, 0x48, 0x2f, 0xed, 0x33, 0x1b, 0x48, 0xbd, 0xc2, 0x49, - 0xdd, 0x24, 0x37, 0x42, 0x76, 0x55, 0xd1, 0xce, 0x95, 0xe6, 0x1d, 0xcd, 0xb1, 0xb5, 0x1a, 0x7e, - 0xea, 0x23, 0xf1, 0x91, 0x7c, 0x4c, 0xfe, 0x09, 0x19, 0xe3, 0x03, 0x46, 0x42, 0x32, 0x11, 0x1d, - 0x6b, 0xf8, 0x34, 0x2c, 0x4d, 0x1e, 0xb0, 0x0a, 0x30, 0x9f, 0xe2, 0xcc, 0x5f, 0x25, 0x2f, 0x47, - 0xb1, 0x93, 0xf1, 0x42, 0xc2, 0x55, 0x6d, 0xd9, 0x64, 0x86,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x00, - 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - QueryAssets(ctx context.Context, in *QueryAssetsRequest, opts ...grpc.CallOption) (*QueryAssetsResponse, error) - QueryAsset(ctx context.Context, in *QueryAssetRequest, opts ...grpc.CallOption) (*QueryAssetResponse, error) - QueryAssetPairs(ctx context.Context, in *QueryAssetPairsRequest, opts ...grpc.CallOption) (*QueryAssetPairsResponse, error) - QueryAssetPair(ctx context.Context, in *QueryAssetPairRequest, opts ...grpc.CallOption) (*QueryAssetPairResponse, error) - QueryApps(ctx context.Context, in *QueryAppsRequest, opts ...grpc.CallOption) (*QueryAppsResponse, error) - QueryApp(ctx context.Context, in *QueryAppRequest, opts ...grpc.CallOption) (*QueryAppResponse, error) - QueryExtendedPairVault(ctx context.Context, in *QueryExtendedPairVaultRequest, opts ...grpc.CallOption) (*QueryExtendedPairVaultResponse, error) - QueryAllExtendedPairVaults(ctx context.Context, in *QueryAllExtendedPairVaultsRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairVaultsResponse, error) - QueryAllExtendedPairVaultsByApp(ctx context.Context, in *QueryAllExtendedPairVaultsByAppRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairVaultsByAppResponse, error) - QueryAllExtendedPairStableVaultsIDByApp(ctx context.Context, in *QueryAllExtendedPairStableVaultsIDByAppRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairStableVaultsIDByAppResponse, error) - QueryGovTokenByApp(ctx context.Context, in *QueryGovTokenByAppRequest, opts ...grpc.CallOption) (*QueryGovTokenByAppResponse, error) - QueryAllExtendedPairStableVaultsByApp(ctx context.Context, in *QueryAllExtendedPairStableVaultsByAppRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairStableVaultsByAppResponse, error) - QueryExtendedPairVaultsByAppWithoutStable(ctx context.Context, in *QueryExtendedPairVaultsByAppWithoutStableRequest, opts ...grpc.CallOption) (*QueryExtendedPairVaultsByAppWithoutStableResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) QueryAssets(ctx context.Context, in *QueryAssetsRequest, opts ...grpc.CallOption) (*QueryAssetsResponse, error) { - out := new(QueryAssetsResponse) - err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAssets", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryAsset(ctx context.Context, in *QueryAssetRequest, opts ...grpc.CallOption) (*QueryAssetResponse, error) { - out := new(QueryAssetResponse) - err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAsset", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryAssetPairs(ctx context.Context, in *QueryAssetPairsRequest, opts ...grpc.CallOption) (*QueryAssetPairsResponse, error) { - out := new(QueryAssetPairsResponse) - err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAssetPairs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryAssetPair(ctx context.Context, in *QueryAssetPairRequest, opts ...grpc.CallOption) (*QueryAssetPairResponse, error) { - out := new(QueryAssetPairResponse) - err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAssetPair", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryApps(ctx context.Context, in *QueryAppsRequest, opts ...grpc.CallOption) (*QueryAppsResponse, error) { - out := new(QueryAppsResponse) - err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryApps", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryApp(ctx context.Context, in *QueryAppRequest, opts ...grpc.CallOption) (*QueryAppResponse, error) { - out := new(QueryAppResponse) - err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryApp", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryExtendedPairVault(ctx context.Context, in *QueryExtendedPairVaultRequest, opts ...grpc.CallOption) (*QueryExtendedPairVaultResponse, error) { - out := new(QueryExtendedPairVaultResponse) - err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryExtendedPairVault", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryAllExtendedPairVaults(ctx context.Context, in *QueryAllExtendedPairVaultsRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairVaultsResponse, error) { - out := new(QueryAllExtendedPairVaultsResponse) - err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAllExtendedPairVaults", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryAllExtendedPairVaultsByApp(ctx context.Context, in *QueryAllExtendedPairVaultsByAppRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairVaultsByAppResponse, error) { - out := new(QueryAllExtendedPairVaultsByAppResponse) - err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAllExtendedPairVaultsByApp", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryAllExtendedPairStableVaultsIDByApp(ctx context.Context, in *QueryAllExtendedPairStableVaultsIDByAppRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairStableVaultsIDByAppResponse, error) { - out := new(QueryAllExtendedPairStableVaultsIDByAppResponse) - err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAllExtendedPairStableVaultsIDByApp", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryGovTokenByApp(ctx context.Context, in *QueryGovTokenByAppRequest, opts ...grpc.CallOption) (*QueryGovTokenByAppResponse, error) { - out := new(QueryGovTokenByAppResponse) - err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryGovTokenByApp", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryAllExtendedPairStableVaultsByApp(ctx context.Context, in *QueryAllExtendedPairStableVaultsByAppRequest, opts ...grpc.CallOption) (*QueryAllExtendedPairStableVaultsByAppResponse, error) { - out := new(QueryAllExtendedPairStableVaultsByAppResponse) - err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryAllExtendedPairStableVaultsByApp", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryExtendedPairVaultsByAppWithoutStable(ctx context.Context, in *QueryExtendedPairVaultsByAppWithoutStableRequest, opts ...grpc.CallOption) (*QueryExtendedPairVaultsByAppWithoutStableResponse, error) { - out := new(QueryExtendedPairVaultsByAppWithoutStableResponse) - err := c.cc.Invoke(ctx, "/comdex.asset.v1beta1.Query/QueryExtendedPairVaultsByAppWithoutStable", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - QueryAssets(context.Context, *QueryAssetsRequest) (*QueryAssetsResponse, error) - QueryAsset(context.Context, *QueryAssetRequest) (*QueryAssetResponse, error) - QueryAssetPairs(context.Context, *QueryAssetPairsRequest) (*QueryAssetPairsResponse, error) - QueryAssetPair(context.Context, *QueryAssetPairRequest) (*QueryAssetPairResponse, error) - QueryApps(context.Context, *QueryAppsRequest) (*QueryAppsResponse, error) - QueryApp(context.Context, *QueryAppRequest) (*QueryAppResponse, error) - QueryExtendedPairVault(context.Context, *QueryExtendedPairVaultRequest) (*QueryExtendedPairVaultResponse, error) - QueryAllExtendedPairVaults(context.Context, *QueryAllExtendedPairVaultsRequest) (*QueryAllExtendedPairVaultsResponse, error) - QueryAllExtendedPairVaultsByApp(context.Context, *QueryAllExtendedPairVaultsByAppRequest) (*QueryAllExtendedPairVaultsByAppResponse, error) - QueryAllExtendedPairStableVaultsIDByApp(context.Context, *QueryAllExtendedPairStableVaultsIDByAppRequest) (*QueryAllExtendedPairStableVaultsIDByAppResponse, error) - QueryGovTokenByApp(context.Context, *QueryGovTokenByAppRequest) (*QueryGovTokenByAppResponse, error) - QueryAllExtendedPairStableVaultsByApp(context.Context, *QueryAllExtendedPairStableVaultsByAppRequest) (*QueryAllExtendedPairStableVaultsByAppResponse, error) - QueryExtendedPairVaultsByAppWithoutStable(context.Context, *QueryExtendedPairVaultsByAppWithoutStableRequest) (*QueryExtendedPairVaultsByAppWithoutStableResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) QueryAssets(ctx context.Context, req *QueryAssetsRequest) (*QueryAssetsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryAssets not implemented") -} -func (*UnimplementedQueryServer) QueryAsset(ctx context.Context, req *QueryAssetRequest) (*QueryAssetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryAsset not implemented") -} -func (*UnimplementedQueryServer) QueryAssetPairs(ctx context.Context, req *QueryAssetPairsRequest) (*QueryAssetPairsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryAssetPairs not implemented") -} -func (*UnimplementedQueryServer) QueryAssetPair(ctx context.Context, req *QueryAssetPairRequest) (*QueryAssetPairResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryAssetPair not implemented") -} -func (*UnimplementedQueryServer) QueryApps(ctx context.Context, req *QueryAppsRequest) (*QueryAppsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryApps not implemented") -} -func (*UnimplementedQueryServer) QueryApp(ctx context.Context, req *QueryAppRequest) (*QueryAppResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryApp not implemented") -} -func (*UnimplementedQueryServer) QueryExtendedPairVault(ctx context.Context, req *QueryExtendedPairVaultRequest) (*QueryExtendedPairVaultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryExtendedPairVault not implemented") -} -func (*UnimplementedQueryServer) QueryAllExtendedPairVaults(ctx context.Context, req *QueryAllExtendedPairVaultsRequest) (*QueryAllExtendedPairVaultsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryAllExtendedPairVaults not implemented") -} -func (*UnimplementedQueryServer) QueryAllExtendedPairVaultsByApp(ctx context.Context, req *QueryAllExtendedPairVaultsByAppRequest) (*QueryAllExtendedPairVaultsByAppResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryAllExtendedPairVaultsByApp not implemented") -} -func (*UnimplementedQueryServer) QueryAllExtendedPairStableVaultsIDByApp(ctx context.Context, req *QueryAllExtendedPairStableVaultsIDByAppRequest) (*QueryAllExtendedPairStableVaultsIDByAppResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryAllExtendedPairStableVaultsIDByApp not implemented") -} -func (*UnimplementedQueryServer) QueryGovTokenByApp(ctx context.Context, req *QueryGovTokenByAppRequest) (*QueryGovTokenByAppResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryGovTokenByApp not implemented") -} -func (*UnimplementedQueryServer) QueryAllExtendedPairStableVaultsByApp(ctx context.Context, req *QueryAllExtendedPairStableVaultsByAppRequest) (*QueryAllExtendedPairStableVaultsByAppResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryAllExtendedPairStableVaultsByApp not implemented") -} -func (*UnimplementedQueryServer) QueryExtendedPairVaultsByAppWithoutStable(ctx context.Context, req *QueryExtendedPairVaultsByAppWithoutStableRequest) (*QueryExtendedPairVaultsByAppWithoutStableResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryExtendedPairVaultsByAppWithoutStable not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_QueryAssets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAssetsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryAssets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.asset.v1beta1.Query/QueryAssets", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryAssets(ctx, req.(*QueryAssetsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryAsset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAssetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryAsset(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.asset.v1beta1.Query/QueryAsset", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryAsset(ctx, req.(*QueryAssetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryAssetPairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAssetPairsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryAssetPairs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.asset.v1beta1.Query/QueryAssetPairs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryAssetPairs(ctx, req.(*QueryAssetPairsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryAssetPair_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAssetPairRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryAssetPair(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.asset.v1beta1.Query/QueryAssetPair", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryAssetPair(ctx, req.(*QueryAssetPairRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryApps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAppsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryApps(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.asset.v1beta1.Query/QueryApps", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryApps(ctx, req.(*QueryAppsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAppRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryApp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.asset.v1beta1.Query/QueryApp", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryApp(ctx, req.(*QueryAppRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryExtendedPairVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryExtendedPairVaultRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryExtendedPairVault(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.asset.v1beta1.Query/QueryExtendedPairVault", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryExtendedPairVault(ctx, req.(*QueryExtendedPairVaultRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryAllExtendedPairVaults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllExtendedPairVaultsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryAllExtendedPairVaults(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.asset.v1beta1.Query/QueryAllExtendedPairVaults", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryAllExtendedPairVaults(ctx, req.(*QueryAllExtendedPairVaultsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryAllExtendedPairVaultsByApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllExtendedPairVaultsByAppRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryAllExtendedPairVaultsByApp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.asset.v1beta1.Query/QueryAllExtendedPairVaultsByApp", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryAllExtendedPairVaultsByApp(ctx, req.(*QueryAllExtendedPairVaultsByAppRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryAllExtendedPairStableVaultsIDByApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllExtendedPairStableVaultsIDByAppRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryAllExtendedPairStableVaultsIDByApp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.asset.v1beta1.Query/QueryAllExtendedPairStableVaultsIDByApp", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryAllExtendedPairStableVaultsIDByApp(ctx, req.(*QueryAllExtendedPairStableVaultsIDByAppRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryGovTokenByApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGovTokenByAppRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryGovTokenByApp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.asset.v1beta1.Query/QueryGovTokenByApp", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryGovTokenByApp(ctx, req.(*QueryGovTokenByAppRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryAllExtendedPairStableVaultsByApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllExtendedPairStableVaultsByAppRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryAllExtendedPairStableVaultsByApp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.asset.v1beta1.Query/QueryAllExtendedPairStableVaultsByApp", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryAllExtendedPairStableVaultsByApp(ctx, req.(*QueryAllExtendedPairStableVaultsByAppRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryExtendedPairVaultsByAppWithoutStable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryExtendedPairVaultsByAppWithoutStableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryExtendedPairVaultsByAppWithoutStable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.asset.v1beta1.Query/QueryExtendedPairVaultsByAppWithoutStable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryExtendedPairVaultsByAppWithoutStable(ctx, req.(*QueryExtendedPairVaultsByAppWithoutStableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.asset.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "QueryAssets", - Handler: _Query_QueryAssets_Handler, - }, - { - MethodName: "QueryAsset", - Handler: _Query_QueryAsset_Handler, - }, - { - MethodName: "QueryAssetPairs", - Handler: _Query_QueryAssetPairs_Handler, - }, - { - MethodName: "QueryAssetPair", - Handler: _Query_QueryAssetPair_Handler, - }, - { - MethodName: "QueryApps", - Handler: _Query_QueryApps_Handler, - }, - { - MethodName: "QueryApp", - Handler: _Query_QueryApp_Handler, - }, - { - MethodName: "QueryExtendedPairVault", - Handler: _Query_QueryExtendedPairVault_Handler, - }, - { - MethodName: "QueryAllExtendedPairVaults", - Handler: _Query_QueryAllExtendedPairVaults_Handler, - }, - { - MethodName: "QueryAllExtendedPairVaultsByApp", - Handler: _Query_QueryAllExtendedPairVaultsByApp_Handler, - }, - { - MethodName: "QueryAllExtendedPairStableVaultsIDByApp", - Handler: _Query_QueryAllExtendedPairStableVaultsIDByApp_Handler, - }, - { - MethodName: "QueryGovTokenByApp", - Handler: _Query_QueryGovTokenByApp_Handler, - }, - { - MethodName: "QueryAllExtendedPairStableVaultsByApp", - Handler: _Query_QueryAllExtendedPairStableVaultsByApp_Handler, - }, - { - MethodName: "QueryExtendedPairVaultsByAppWithoutStable", - Handler: _Query_QueryExtendedPairVaultsByAppWithoutStable_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "comdex/asset/v1beta1/query.proto", -} - -func (m *QueryAssetsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAssetsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAssetsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAssetsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAssetsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAssetsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Assets) > 0 { - for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Assets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryAssetRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAssetRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAssetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Id != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryAssetResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAssetResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAssetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Asset.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryAssetPairsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAssetPairsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAssetPairsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAssetPairsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAssetPairsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAssetPairsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.PairsInfo) > 0 { - for iNdEx := len(m.PairsInfo) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PairsInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryAssetPairRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAssetPairRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAssetPairRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Id != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryAssetPairResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAssetPairResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAssetPairResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.PairInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryAppRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAppRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAppRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Id != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryAppResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAppResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAppResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.App.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryGovTokenByAppRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGovTokenByAppRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGovTokenByAppRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryGovTokenByAppResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGovTokenByAppResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGovTokenByAppResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.GovAssetId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.GovAssetId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryAppsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAppsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAppsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAppsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAppsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAppsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Apps) > 0 { - for iNdEx := len(m.Apps) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Apps[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryExtendedPairVaultRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryExtendedPairVaultRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryExtendedPairVaultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Id != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryExtendedPairVaultResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryExtendedPairVaultResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryExtendedPairVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.PairVault.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryAllExtendedPairVaultsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllExtendedPairVaultsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllExtendedPairVaultsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllExtendedPairVaultsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllExtendedPairVaultsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllExtendedPairVaultsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.PairVault) > 0 { - for iNdEx := len(m.PairVault) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PairVault[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryAllExtendedPairVaultsByAppRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllExtendedPairVaultsByAppRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllExtendedPairVaultsByAppRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryAllExtendedPairVaultsByAppResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllExtendedPairVaultsByAppResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllExtendedPairVaultsByAppResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ExtendedPair) > 0 { - for iNdEx := len(m.ExtendedPair) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ExtendedPair[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ExtendedPairsId) > 0 { - dAtA18 := make([]byte, len(m.ExtendedPairsId)*10) - var j17 int - for _, num := range m.ExtendedPairsId { - for num >= 1<<7 { - dAtA18[j17] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j17++ - } - dAtA18[j17] = uint8(num) - j17++ - } - i -= j17 - copy(dAtA[i:], dAtA18[:j17]) - i = encodeVarintQuery(dAtA, i, uint64(j17)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllExtendedPairStableVaultsByAppRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllExtendedPairStableVaultsByAppRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllExtendedPairStableVaultsByAppRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryAllExtendedPairStableVaultsByAppResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAllExtendedPairStableVaultsByAppResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllExtendedPairStableVaultsByAppResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ExtendedPair) > 0 { - for iNdEx := len(m.ExtendedPair) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ExtendedPair[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.ExtendedPair) > 0 { - for iNdEx := len(m.ExtendedPair) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ExtendedPair[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryAssetsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAssetsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Assets) > 0 { - for _, e := range m.Assets { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAssetRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovQuery(uint64(m.Id)) - } - return n -} - -func (m *QueryAssetResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Asset.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAssetPairsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAssetPairsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.PairsInfo) > 0 { - for _, e := range m.PairsInfo { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAssetPairRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovQuery(uint64(m.Id)) - } - return n -} - -func (m *QueryAssetPairResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.PairInfo.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAppRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovQuery(uint64(m.Id)) - } - return n -} - -func (m *QueryAppResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.App.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryGovTokenByAppRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - return n -} - -func (m *QueryGovTokenByAppResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GovAssetId != 0 { - n += 1 + sovQuery(uint64(m.GovAssetId)) - } - return n -} - -func (m *QueryAppsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAppsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Apps) > 0 { - for _, e := range m.Apps { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryExtendedPairVaultRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovQuery(uint64(m.Id)) - } - return n -} - -func (m *QueryExtendedPairVaultResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.PairVault.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllExtendedPairVaultsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllExtendedPairVaultsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.PairVault) > 0 { - for _, e := range m.PairVault { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllExtendedPairVaultsByAppRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllExtendedPairVaultsByAppResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ExtendedPair) > 0 { - for _, e := range m.ExtendedPair { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ExtendedPairsId) > 0 { - l = 0 - for _, e := range m.ExtendedPairsId { - l += sovQuery(uint64(e)) - } - n += 1 + sovQuery(uint64(l)) + l - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllExtendedPairStableVaultsByAppRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllExtendedPairStableVaultsByAppResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ExtendedPair) > 0 { - for _, e := range m.ExtendedPair { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ExtendedPair) > 0 { - for _, e := range m.ExtendedPair { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryAssetsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAssetsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAssetsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAssetsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAssetsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAssetsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Assets = append(m.Assets, Asset{}) - if err := m.Assets[len(m.Assets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAssetRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAssetRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAssetRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAssetResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAssetResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAssetResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Asset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAssetPairsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAssetPairsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAssetPairsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAssetPairsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAssetPairsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAssetPairsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PairsInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PairsInfo = append(m.PairsInfo, PairInfo{}) - if err := m.PairsInfo[len(m.PairsInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAssetPairRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAssetPairRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAssetPairRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAssetPairResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAssetPairResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAssetPairResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PairInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PairInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAppRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAppRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAppRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAppResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAppResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAppResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field App", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.App.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGovTokenByAppRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGovTokenByAppRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGovTokenByAppRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGovTokenByAppResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGovTokenByAppResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGovTokenByAppResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GovAssetId", wireType) - } - m.GovAssetId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GovAssetId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAppsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAppsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAppsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAppsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAppsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAppsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Apps", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Apps = append(m.Apps, AppData{}) - if err := m.Apps[len(m.Apps)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryExtendedPairVaultRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryExtendedPairVaultRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryExtendedPairVaultRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryExtendedPairVaultResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryExtendedPairVaultResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryExtendedPairVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PairVault", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PairVault.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllExtendedPairVaultsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllExtendedPairVaultsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllExtendedPairVaultsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllExtendedPairVaultsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllExtendedPairVaultsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllExtendedPairVaultsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PairVault", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PairVault = append(m.PairVault, ExtendedPairVault{}) - if err := m.PairVault[len(m.PairVault)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllExtendedPairVaultsByAppRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllExtendedPairVaultsByAppRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllExtendedPairVaultsByAppRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllExtendedPairVaultsByAppResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllExtendedPairVaultsByAppResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllExtendedPairVaultsByAppResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtendedPair", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExtendedPair = append(m.ExtendedPair, ExtendedPairVault{}) - if err := m.ExtendedPair[len(m.ExtendedPair)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllExtendedPairStableVaultsIDByAppRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsIDByAppRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsIDByAppRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllExtendedPairStableVaultsIDByAppResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsIDByAppResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsIDByAppResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ExtendedPairsId = append(m.ExtendedPairsId, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.ExtendedPairsId) == 0 { - m.ExtendedPairsId = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ExtendedPairsId = append(m.ExtendedPairsId, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field ExtendedPairsId", wireType) - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllExtendedPairStableVaultsByAppRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsByAppRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsByAppRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllExtendedPairStableVaultsByAppResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsByAppResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllExtendedPairStableVaultsByAppResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtendedPair", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExtendedPair = append(m.ExtendedPair, ExtendedPairVault{}) - if err := m.ExtendedPair[len(m.ExtendedPair)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryExtendedPairVaultsByAppWithoutStableRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryExtendedPairVaultsByAppWithoutStableRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryExtendedPairVaultsByAppWithoutStableRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryExtendedPairVaultsByAppWithoutStableResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryExtendedPairVaultsByAppWithoutStableResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryExtendedPairVaultsByAppWithoutStableResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtendedPair", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExtendedPair = append(m.ExtendedPair, ExtendedPairVault{}) - if err := m.ExtendedPair[len(m.ExtendedPair)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipQuery(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/asset/types/query.pb.gw.go b/github.com/comdex-official/comdex/x/asset/types/query.pb.gw.go deleted file mode 100644 index 4d18ec8d5..000000000 --- a/github.com/comdex-official/comdex/x/asset/types/query.pb.gw.go +++ /dev/null @@ -1,1401 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: comdex/asset/v1beta1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_QueryAssets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_QueryAssets_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAssetsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAssets_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryAssets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryAssets_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAssetsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAssets_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryAssets(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_QueryAsset_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAssetRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := client.QueryAsset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryAsset_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAssetRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := server.QueryAsset(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryAssetPairs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_QueryAssetPairs_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAssetPairsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAssetPairs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryAssetPairs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryAssetPairs_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAssetPairsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAssetPairs_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryAssetPairs(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_QueryAssetPair_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAssetPairRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := client.QueryAssetPair(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryAssetPair_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAssetPairRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := server.QueryAssetPair(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryApps_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_QueryApps_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAppsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryApps_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryApps(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryApps_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAppsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryApps_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryApps(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_QueryApp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAppRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := client.QueryApp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryApp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAppRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := server.QueryApp(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_QueryExtendedPairVault_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryExtendedPairVaultRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := client.QueryExtendedPairVault(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryExtendedPairVault_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryExtendedPairVaultRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := server.QueryExtendedPairVault(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryAllExtendedPairVaults_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_QueryAllExtendedPairVaults_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllExtendedPairVaultsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairVaults_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryAllExtendedPairVaults(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryAllExtendedPairVaults_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllExtendedPairVaultsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairVaults_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryAllExtendedPairVaults(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryAllExtendedPairVaultsByApp_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_QueryAllExtendedPairVaultsByApp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllExtendedPairVaultsByAppRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairVaultsByApp_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryAllExtendedPairVaultsByApp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryAllExtendedPairVaultsByApp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllExtendedPairVaultsByAppRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairVaultsByApp_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryAllExtendedPairVaultsByApp(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryAllExtendedPairStableVaultsIDByApp_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_QueryAllExtendedPairStableVaultsIDByApp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllExtendedPairStableVaultsIDByAppRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairStableVaultsIDByApp_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryAllExtendedPairStableVaultsIDByApp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryAllExtendedPairStableVaultsIDByApp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllExtendedPairStableVaultsIDByAppRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairStableVaultsIDByApp_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryAllExtendedPairStableVaultsIDByApp(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_QueryGovTokenByApp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGovTokenByAppRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - msg, err := client.QueryGovTokenByApp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryGovTokenByApp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGovTokenByAppRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - msg, err := server.QueryGovTokenByApp(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryAllExtendedPairStableVaultsByApp_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_QueryAllExtendedPairStableVaultsByApp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllExtendedPairStableVaultsByAppRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairStableVaultsByApp_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryAllExtendedPairStableVaultsByApp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryAllExtendedPairStableVaultsByApp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllExtendedPairStableVaultsByAppRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllExtendedPairStableVaultsByApp_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryAllExtendedPairStableVaultsByApp(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryExtendedPairVaultsByAppWithoutStable_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_QueryExtendedPairVaultsByAppWithoutStable_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryExtendedPairVaultsByAppWithoutStableRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryExtendedPairVaultsByAppWithoutStable_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryExtendedPairVaultsByAppWithoutStable(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryExtendedPairVaultsByAppWithoutStable_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryExtendedPairVaultsByAppWithoutStableRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryExtendedPairVaultsByAppWithoutStable_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryExtendedPairVaultsByAppWithoutStable(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_QueryAssets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryAssets_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryAsset_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAssetPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryAssetPairs_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAssetPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAssetPair_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryAssetPair_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAssetPair_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryApps_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryApps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryApp_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryExtendedPairVault_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryExtendedPairVault_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryExtendedPairVault_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAllExtendedPairVaults_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryAllExtendedPairVaults_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAllExtendedPairVaults_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAllExtendedPairVaultsByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryAllExtendedPairVaultsByApp_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAllExtendedPairVaultsByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAllExtendedPairStableVaultsIDByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryAllExtendedPairStableVaultsIDByApp_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAllExtendedPairStableVaultsIDByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryGovTokenByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryGovTokenByApp_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryGovTokenByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAllExtendedPairStableVaultsByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryAllExtendedPairStableVaultsByApp_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAllExtendedPairStableVaultsByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryExtendedPairVaultsByAppWithoutStable_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryExtendedPairVaultsByAppWithoutStable_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryExtendedPairVaultsByAppWithoutStable_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_QueryAssets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryAssets_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryAsset_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAssetPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryAssetPairs_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAssetPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAssetPair_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryAssetPair_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAssetPair_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryApps_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryApps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryApp_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryExtendedPairVault_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryExtendedPairVault_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryExtendedPairVault_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAllExtendedPairVaults_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryAllExtendedPairVaults_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAllExtendedPairVaults_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAllExtendedPairVaultsByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryAllExtendedPairVaultsByApp_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAllExtendedPairVaultsByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAllExtendedPairStableVaultsIDByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryAllExtendedPairStableVaultsIDByApp_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAllExtendedPairStableVaultsIDByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryGovTokenByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryGovTokenByApp_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryGovTokenByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAllExtendedPairStableVaultsByApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryAllExtendedPairStableVaultsByApp_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryAllExtendedPairStableVaultsByApp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryExtendedPairVaultsByAppWithoutStable_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryExtendedPairVaultsByAppWithoutStable_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryExtendedPairVaultsByAppWithoutStable_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_QueryAssets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "asset", "v1beta1", "assets"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryAsset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "assets", "id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryAssetPairs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "asset", "v1beta1", "pairs"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryAssetPair_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "pairs", "id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryApps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "asset", "v1beta1", "apps"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryApp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "app", "id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryExtendedPairVault_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "extended_pair_vault", "id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryAllExtendedPairVaults_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "asset", "v1beta1", "extended_pair_vaults"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryAllExtendedPairVaultsByApp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "product_to_extended_pair", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryAllExtendedPairStableVaultsIDByApp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "extended_pair_stable_vault_wise", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryGovTokenByApp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "gov_token_in_an_app", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryAllExtendedPairStableVaultsByApp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "extended_pair_stable_vault_data", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryExtendedPairVaultsByAppWithoutStable_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "asset", "v1beta1", "extended_pair_stable_vault_data_without_stable", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_QueryAssets_0 = runtime.ForwardResponseMessage - - forward_Query_QueryAsset_0 = runtime.ForwardResponseMessage - - forward_Query_QueryAssetPairs_0 = runtime.ForwardResponseMessage - - forward_Query_QueryAssetPair_0 = runtime.ForwardResponseMessage - - forward_Query_QueryApps_0 = runtime.ForwardResponseMessage - - forward_Query_QueryApp_0 = runtime.ForwardResponseMessage - - forward_Query_QueryExtendedPairVault_0 = runtime.ForwardResponseMessage - - forward_Query_QueryAllExtendedPairVaults_0 = runtime.ForwardResponseMessage - - forward_Query_QueryAllExtendedPairVaultsByApp_0 = runtime.ForwardResponseMessage - - forward_Query_QueryAllExtendedPairStableVaultsIDByApp_0 = runtime.ForwardResponseMessage - - forward_Query_QueryGovTokenByApp_0 = runtime.ForwardResponseMessage - - forward_Query_QueryAllExtendedPairStableVaultsByApp_0 = runtime.ForwardResponseMessage - - forward_Query_QueryExtendedPairVaultsByAppWithoutStable_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/comdex-official/comdex/x/auction/types/auction.pb.go b/github.com/comdex-official/comdex/x/auction/types/auction.pb.go deleted file mode 100644 index b3a51395e..000000000 --- a/github.com/comdex-official/comdex/x/auction/types/auction.pb.go +++ /dev/null @@ -1,3531 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auction/v1beta1/auction.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type SurplusAuction struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` - SellToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=sell_token,json=sellToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"sell_token" yaml:"sell_token"` - BuyToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=buy_token,json=buyToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"buy_token" yaml:"buy_token"` - ActiveBiddingId uint64 `protobuf:"varint,4,opt,name=active_bidding_id,json=activeBiddingId,proto3" json:"active_bidding_id,omitempty" yaml:"active_bidding_id"` - Bidder github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,5,opt,name=bidder,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"bidder,omitempty" yaml:"bidder"` - Bid github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=bid,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"bid" yaml:"bid"` - EndTime time.Time `protobuf:"bytes,7,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` - BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` - BiddingIds []*BidOwnerMapping `protobuf:"bytes,9,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` - AuctionStatus uint64 `protobuf:"varint,10,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` - AppId uint64 `protobuf:"varint,11,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AssetId uint64 `protobuf:"varint,12,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - AuctionMappingId uint64 `protobuf:"varint,13,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` - AssetInId uint64 `protobuf:"varint,14,opt,name=asset_in_id,json=assetInId,proto3" json:"asset_in_id,omitempty" yaml:"asset_in_id"` - AssetOutId uint64 `protobuf:"varint,15,opt,name=asset_out_id,json=assetOutId,proto3" json:"asset_out_id,omitempty" yaml:"asset_out_id"` - BidEndTime time.Time `protobuf:"bytes,16,opt,name=bid_end_time,json=bidEndTime,proto3,stdtime" json:"bid_end_time" yaml:"bid_end_time"` -} - -func (m *SurplusAuction) Reset() { *m = SurplusAuction{} } -func (m *SurplusAuction) String() string { return proto.CompactTextString(m) } -func (*SurplusAuction) ProtoMessage() {} -func (*SurplusAuction) Descriptor() ([]byte, []int) { - return fileDescriptor_4bb9aead25d5fe6c, []int{0} -} -func (m *SurplusAuction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SurplusAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SurplusAuction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SurplusAuction) XXX_Merge(src proto.Message) { - xxx_messageInfo_SurplusAuction.Merge(m, src) -} -func (m *SurplusAuction) XXX_Size() int { - return m.Size() -} -func (m *SurplusAuction) XXX_DiscardUnknown() { - xxx_messageInfo_SurplusAuction.DiscardUnknown(m) -} - -var xxx_messageInfo_SurplusAuction proto.InternalMessageInfo - -type DebtAuction struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` - AuctionedToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=auctioned_token,json=auctionedToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"auctioned_token" yaml:"auctioned_token"` - ExpectedUserToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=expected_user_token,json=expectedUserToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"expected_user_token" yaml:"expected_user_token"` - ExpectedMintedToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=expected_minted_token,json=expectedMintedToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"expected_minted_token" yaml:"expected_minted_token"` - EndTime time.Time `protobuf:"bytes,5,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` - ActiveBiddingId uint64 `protobuf:"varint,6,opt,name=active_bidding_id,json=activeBiddingId,proto3" json:"active_bidding_id,omitempty" yaml:"active_bidding_id"` - Bidder github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,7,opt,name=bidder,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"bidder,omitempty" yaml:"bidder"` - CurrentBidAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,8,opt,name=current_bid_amount,json=currentBidAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"current_bid_amount" yaml:"current_bid_amount"` - AuctionStatus uint64 `protobuf:"varint,9,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` - AppId uint64 `protobuf:"varint,10,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AssetId uint64 `protobuf:"varint,11,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - BiddingIds []*BidOwnerMapping `protobuf:"bytes,12,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` - AuctionMappingId uint64 `protobuf:"varint,13,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` - BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,14,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` - AssetInId uint64 `protobuf:"varint,15,opt,name=asset_in_id,json=assetInId,proto3" json:"asset_in_id,omitempty" yaml:"asset_in_id"` - AssetOutId uint64 `protobuf:"varint,16,opt,name=asset_out_id,json=assetOutId,proto3" json:"asset_out_id,omitempty" yaml:"asset_out_id"` - BidEndTime time.Time `protobuf:"bytes,17,opt,name=bid_end_time,json=bidEndTime,proto3,stdtime" json:"bid_end_time" yaml:"bid_end_time"` -} - -func (m *DebtAuction) Reset() { *m = DebtAuction{} } -func (m *DebtAuction) String() string { return proto.CompactTextString(m) } -func (*DebtAuction) ProtoMessage() {} -func (*DebtAuction) Descriptor() ([]byte, []int) { - return fileDescriptor_4bb9aead25d5fe6c, []int{1} -} -func (m *DebtAuction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DebtAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DebtAuction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DebtAuction) XXX_Merge(src proto.Message) { - xxx_messageInfo_DebtAuction.Merge(m, src) -} -func (m *DebtAuction) XXX_Size() int { - return m.Size() -} -func (m *DebtAuction) XXX_DiscardUnknown() { - xxx_messageInfo_DebtAuction.DiscardUnknown(m) -} - -var xxx_messageInfo_DebtAuction proto.InternalMessageInfo - -type DutchAuction struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` - OutflowTokenInitAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=outflow_token_init_amount,json=outflowTokenInitAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_token_init_amount" yaml:"outflow_token_init_amount"` - OutflowTokenCurrentAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=outflow_token_current_amount,json=outflowTokenCurrentAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_token_current_amount" yaml:"outflow_token_current_amount"` - InflowTokenTargetAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=inflow_token_target_amount,json=inflowTokenTargetAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_target_amount" yaml:"inflow_token_target_amount"` - InflowTokenCurrentAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=inflow_token_current_amount,json=inflowTokenCurrentAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_current_amount" yaml:"inflow_token_current_amount"` - OutflowTokenInitialPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=outflow_token_initial_price,json=outflowTokenInitialPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_initial_price" yaml:"outflow_token_initial_price"` - OutflowTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=outflow_token_current_price,json=outflowTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_current_price" yaml:"outflow_token_current_price"` - OutflowTokenEndPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=outflow_token_end_price,json=outflowTokenEndPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"outflow_token_end_price" yaml:"outflow_token_end_price"` - InflowTokenCurrentPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=inflow_token_current_price,json=inflowTokenCurrentPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflow_token_current_price" yaml:"inflow_token_current_price"` - EndTime time.Time `protobuf:"bytes,10,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` - AuctionStatus uint64 `protobuf:"varint,11,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` - StartTime time.Time `protobuf:"bytes,12,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` - BiddingIds []*BidOwnerMapping `protobuf:"bytes,13,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` - AuctionMappingId uint64 `protobuf:"varint,14,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` - AppId uint64 `protobuf:"varint,15,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AssetInId uint64 `protobuf:"varint,16,opt,name=asset_in_id,json=assetInId,proto3" json:"asset_in_id,omitempty" yaml:"asset_in_id"` - AssetOutId uint64 `protobuf:"varint,17,opt,name=asset_out_id,json=assetOutId,proto3" json:"asset_out_id,omitempty" yaml:"asset_out_id"` - LockedVaultId uint64 `protobuf:"varint,18,opt,name=locked_vault_id,json=lockedVaultId,proto3" json:"locked_vault_id,omitempty" yaml:"locked_vault_id"` - VaultOwner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,19,opt,name=vault_owner,json=vaultOwner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"vault_owner,omitempty" yaml:"vault_owner"` - LiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,20,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_penalty" yaml:"liquidatin_penalty"` -} - -func (m *DutchAuction) Reset() { *m = DutchAuction{} } -func (m *DutchAuction) String() string { return proto.CompactTextString(m) } -func (*DutchAuction) ProtoMessage() {} -func (*DutchAuction) Descriptor() ([]byte, []int) { - return fileDescriptor_4bb9aead25d5fe6c, []int{2} -} -func (m *DutchAuction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DutchAuction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DutchAuction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DutchAuction) XXX_Merge(src proto.Message) { - xxx_messageInfo_DutchAuction.Merge(m, src) -} -func (m *DutchAuction) XXX_Size() int { - return m.Size() -} -func (m *DutchAuction) XXX_DiscardUnknown() { - xxx_messageInfo_DutchAuction.DiscardUnknown(m) -} - -var xxx_messageInfo_DutchAuction proto.InternalMessageInfo - -type BidOwnerMapping struct { - BidId uint64 `protobuf:"varint,1,opt,name=bid_id,json=bidId,proto3" json:"bid_id,omitempty"` - BidOwner string `protobuf:"bytes,2,opt,name=bid_owner,json=bidOwner,proto3" json:"bid_owner,omitempty"` -} - -func (m *BidOwnerMapping) Reset() { *m = BidOwnerMapping{} } -func (m *BidOwnerMapping) String() string { return proto.CompactTextString(m) } -func (*BidOwnerMapping) ProtoMessage() {} -func (*BidOwnerMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_4bb9aead25d5fe6c, []int{3} -} -func (m *BidOwnerMapping) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BidOwnerMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BidOwnerMapping.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BidOwnerMapping) XXX_Merge(src proto.Message) { - xxx_messageInfo_BidOwnerMapping.Merge(m, src) -} -func (m *BidOwnerMapping) XXX_Size() int { - return m.Size() -} -func (m *BidOwnerMapping) XXX_DiscardUnknown() { - xxx_messageInfo_BidOwnerMapping.DiscardUnknown(m) -} - -var xxx_messageInfo_BidOwnerMapping proto.InternalMessageInfo - -type ProtocolStatistics struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AssetId uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` - Loss github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=loss,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"loss" yaml:"loss"` -} - -func (m *ProtocolStatistics) Reset() { *m = ProtocolStatistics{} } -func (m *ProtocolStatistics) String() string { return proto.CompactTextString(m) } -func (*ProtocolStatistics) ProtoMessage() {} -func (*ProtocolStatistics) Descriptor() ([]byte, []int) { - return fileDescriptor_4bb9aead25d5fe6c, []int{4} -} -func (m *ProtocolStatistics) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProtocolStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProtocolStatistics.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ProtocolStatistics) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProtocolStatistics.Merge(m, src) -} -func (m *ProtocolStatistics) XXX_Size() int { - return m.Size() -} -func (m *ProtocolStatistics) XXX_DiscardUnknown() { - xxx_messageInfo_ProtocolStatistics.DiscardUnknown(m) -} - -var xxx_messageInfo_ProtocolStatistics proto.InternalMessageInfo - -type AuctionParams struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` - AuctionDurationSeconds uint64 `protobuf:"varint,2,opt,name=auction_duration_seconds,json=auctionDurationSeconds,proto3" json:"auction_duration_seconds,omitempty" yaml:"auction_duration_seconds"` - Buffer github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=buffer,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"buffer" yaml:"buffer"` - Cusp github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=cusp,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"cusp" yaml:"cusp"` - Step github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"step" yaml:"step"` - PriceFunctionType uint64 `protobuf:"varint,6,opt,name=price_function_type,json=priceFunctionType,proto3" json:"price_function_type,omitempty" yaml:"price_function_type"` - SurplusId uint64 `protobuf:"varint,7,opt,name=surplus_id,json=surplusId,proto3" json:"surplus_id,omitempty" yaml:"surplus_id"` - DebtId uint64 `protobuf:"varint,8,opt,name=debt_id,json=debtId,proto3" json:"debt_id,omitempty" yaml:"debt_id"` - DutchId uint64 `protobuf:"varint,9,opt,name=dutch_id,json=dutchId,proto3" json:"dutch_id,omitempty" yaml:"dutch_id"` - BidDurationSeconds uint64 `protobuf:"varint,10,opt,name=bid_duration_seconds,json=bidDurationSeconds,proto3" json:"bid_duration_seconds,omitempty" yaml:"bid_duration_seconds"` -} - -func (m *AuctionParams) Reset() { *m = AuctionParams{} } -func (m *AuctionParams) String() string { return proto.CompactTextString(m) } -func (*AuctionParams) ProtoMessage() {} -func (*AuctionParams) Descriptor() ([]byte, []int) { - return fileDescriptor_4bb9aead25d5fe6c, []int{5} -} -func (m *AuctionParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuctionParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuctionParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AuctionParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuctionParams.Merge(m, src) -} -func (m *AuctionParams) XXX_Size() int { - return m.Size() -} -func (m *AuctionParams) XXX_DiscardUnknown() { - xxx_messageInfo_AuctionParams.DiscardUnknown(m) -} - -var xxx_messageInfo_AuctionParams proto.InternalMessageInfo - -func init() { - proto.RegisterType((*SurplusAuction)(nil), "comdex.auction.v1beta1.SurplusAuction") - proto.RegisterType((*DebtAuction)(nil), "comdex.auction.v1beta1.DebtAuction") - proto.RegisterType((*DutchAuction)(nil), "comdex.auction.v1beta1.DutchAuction") - proto.RegisterType((*BidOwnerMapping)(nil), "comdex.auction.v1beta1.bidOwnerMapping") - proto.RegisterType((*ProtocolStatistics)(nil), "comdex.auction.v1beta1.ProtocolStatistics") - proto.RegisterType((*AuctionParams)(nil), "comdex.auction.v1beta1.AuctionParams") -} - -func init() { - proto.RegisterFile("comdex/auction/v1beta1/auction.proto", fileDescriptor_4bb9aead25d5fe6c) -} - -var fileDescriptor_4bb9aead25d5fe6c = []byte{ - // 1687 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcd, 0x6f, 0x1b, 0x45, - 0x1b, 0xcf, 0xb6, 0x49, 0x1c, 0x8f, 0x93, 0x38, 0xde, 0x7c, 0x39, 0x49, 0xeb, 0x4d, 0xa7, 0xaf, - 0xde, 0x46, 0x7a, 0x55, 0x5b, 0xed, 0xfb, 0xea, 0x95, 0x40, 0x42, 0x10, 0x37,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f, 0x4e, 0x9b, 0x04, 0x95, 0x27, 0x47, 0x39, - 0xe7, 0x15, 0xe9, 0x1c, 0x10, 0xdb, 0xcd, 0xe4, 0x16, 0x66, 0x44, 0xd5, 0xc1, 0x14, 0x76, 0x50, - 0x93, 0x85, 0x63, 0x39, 0xc7, 0x0d, 0xae, 0x56, 0x45, 0xac, 0x56, 0xa3, 0x58, 0xad, 0xee, 0x46, - 0xb1, 0x5a, 0x5f, 0x93, 0x16, 0x8b, 0xc2, 0x62, 0xa4, 0x09, 0x1f, 0xff, 0xa6, 0x29, 0x7a, 0x0e, - 0x3b, 0x88, 0x6d, 0x55, 0x4d, 0x00, 0x4c, 0x82, 0x9a, 0x2d, 0xc3, 0xa2, 0xae, 0x5f, 0x9e, 0xe2, - 0xfe, 0xe1, 0x07, 0xf9, 0x6b, 0x57, 0xfb, 0xf7, 0x21, 0xd8, 0x6d, 0x61, 0x2b, 0x89, 0xb8, 0x04, - 0x09, 0xea, 0x79, 0x93, 0xa0, 0x6b, 0xfc, 0xb7, 0xfa, 0x1e, 0x28, 0x24, 0xe7, 0x13, 0x94, 0xf3, - 0xeb, 0xa7, 0x37, 0x0a, 0x97, 0x2f, 0x54, 0x87, 0x27, 0x65, 0xd5, 0x24, 0xe8, 0xe6, 0x43, 0x07, - 0xfb, 0x37, 0x0c, 0xcf, 0x23, 0x4e, 0xbb, 0xbe, 0xd4, 0xeb, 0x6a, 0x6a, 0x72, 0x5a, 0x12, 0x05, - 0xea, 0xc0, 0x8c, 0x0e, 0x38, 0x50, 0x5f, 0x03, 0xb3, 0x51, 0x0a, 0x05, 0xd4, 0xa0, 0x61, 0x50, - 0x06, 0x3c, 0x50, 0x56, 0x7a, 0x5d, 0x6d, 0x71, 0x30, 0xc5, 0x84, 0x1c, 0xea, 0x33, 0x72, 0x61, - 0x87, 0x3f, 0xab, 0x1b, 0x60, 0xd2, 0xf0, 0x3c, 0x16, 0x62, 0x05, 0xae, 0x59, 0x4a, 0x62, 0x44, - 0xac,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xd0, 0x11, 0xae, 0x63, 0x0a, 0xf2, 0x7e, 0x5c, 0x49, 0xbe, 0x46, 0x0c, 0xd9, - 0x04, 0xf5, 0x12, 0x5f, 0xbd, 0x26, 0x17, 0x77, 0xf7, 0x3c, 0xcc, 0xa6, 0xf3, 0x40, 0x7c, 0xff, - 0x66, 0x67, 0x9b, 0x4b, 0x4f, 0xe7, 0x89, 0x0c, 0xea, 0x79, 0xf9, 0xd0, 0x40, 0xea, 0x7f, 0x40, - 0x0e, 0x61, 0x93, 0x47, 0xe8, 0x14, 0x57, 0x51, 0x7b, 0x5d, 0x6d, 0x56, 0xa8, 0x48, 0x01, 0xd4, - 0x27, 0xd9, 0x2f, 0x11, 0xcf, 0x88, 0x5d, 0x08, 0xd8, 0xee, 0x7c, 0x3a, 0x9e, 0x23, 0x09, 0xd4, - 0x73, 0xfc, 0x27, 0x8f, 0xe7, 0x05, 0x96, 0x5d, 0x07, 0x82, 0x47, 0x5c, 0x47, 0xb5, 0x5e, 0x57, - 0x5b, 0x4b, 0x2e, 0x22, 0x07, 0x03, 0x47, 0x35, 0x09, 0x4a, 0x05, 0x4d, 0x7d, 0xe7, 0xc9, 0x1f, - 0x95, 0xb1, 0xaf, 0xf7, 0x2b, 0x63, 0x4f, 0xf6, 0x2b, 0xca, 0xd3, 0xfd, 0x8a, 0xf2, 0xfb, 0x7e, - 0x45, 0x79, 0xfc, 0xac, 0x32, 0xf6, 0xf4, 0x59, 0x65, 0xec, 0x97, 0x67, 0x95, 0xb1, 0x3b, 0x97, - 0x06, 0x0e, 0x85, 0x75, 0x9a, 0x8b, 0x6e, 0xab, 0x45, 0x2c, 0x62, 0xd8, 0xf2, 0xb9, 0x96, 0xfc, - 0xeb, 0x82, 0x9f, 0x91, 0x39, 0xc9, 0xbb, 0xdc, 0x7f, 0xff, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x07, - 0xc7, 0xb4, 0x31, 0xd9, 0x18, 0x00, 0x00, -} - -func (m *SurplusAuction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SurplusAuction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SurplusAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BidEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BidEndTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintAuction(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - if m.AssetOutId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AssetOutId)) - i-- - dAtA[i] = 0x78 - } - if m.AssetInId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AssetInId)) - i-- - dAtA[i] = 0x70 - } - if m.AuctionMappingId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x68 - } - if m.AssetId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AssetId)) - i-- - dAtA[i] = 0x60 - } - if m.AppId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x58 - } - if m.AuctionStatus != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionStatus)) - i-- - dAtA[i] = 0x50 - } - if len(m.BiddingIds) > 0 { - for iNdEx := len(m.BiddingIds) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BiddingIds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - { - size := m.BidFactor.Size() - i -= size - if _, err := m.BidFactor.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintAuction(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x3a - { - size, err := m.Bid.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintAuction(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0x2a - } - if m.ActiveBiddingId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.ActiveBiddingId)) - i-- - dAtA[i] = 0x20 - } - { - size, err := m.BuyToken.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.SellToken.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.AuctionId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DebtAuction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DebtAuction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DebtAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BidEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BidEndTime):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintAuction(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - if m.AssetOutId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AssetOutId)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x80 - } - if m.AssetInId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AssetInId)) - i-- - dAtA[i] = 0x78 - } - { - size := m.BidFactor.Size() - i -= size - if _, err := m.BidFactor.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - if m.AuctionMappingId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x68 - } - if len(m.BiddingIds) > 0 { - for iNdEx := len(m.BiddingIds) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BiddingIds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - } - if m.AssetId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AssetId)) - i-- - dAtA[i] = 0x58 - } - if m.AppId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x50 - } - if m.AuctionStatus != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionStatus)) - i-- - dAtA[i] = 0x48 - } - { - size, err := m.CurrentBidAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintAuction(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0x3a - } - if m.ActiveBiddingId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.ActiveBiddingId)) - i-- - dAtA[i] = 0x30 - } - n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) - if err8 != nil { - return 0, err8 - } - i -= n8 - i = encodeVarintAuction(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0x2a - { - size, err := m.ExpectedMintedToken.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.ExpectedUserToken.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.AuctionedToken.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.AuctionId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DutchAuction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DutchAuction) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DutchAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.LiquidationPenalty.Size() - i -= size - if _, err := m.LiquidationPenalty.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa2 - if len(m.VaultOwner) > 0 { - i -= len(m.VaultOwner) - copy(dAtA[i:], m.VaultOwner) - i = encodeVarintAuction(dAtA, i, uint64(len(m.VaultOwner))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x9a - } - if m.LockedVaultId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.LockedVaultId)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x90 - } - if m.AssetOutId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AssetOutId)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x88 - } - if m.AssetInId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AssetInId)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x80 - } - if m.AppId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x78 - } - if m.AuctionMappingId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x70 - } - if len(m.BiddingIds) > 0 { - for iNdEx := len(m.BiddingIds) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BiddingIds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - } - } - n12, err12 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) - if err12 != nil { - return 0, err12 - } - i -= n12 - i = encodeVarintAuction(dAtA, i, uint64(n12)) - i-- - dAtA[i] = 0x62 - if m.AuctionStatus != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionStatus)) - i-- - dAtA[i] = 0x58 - } - n13, err13 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) - if err13 != nil { - return 0, err13 - } - i -= n13 - i = encodeVarintAuction(dAtA, i, uint64(n13)) - i-- - dAtA[i] = 0x52 - { - size := m.InflowTokenCurrentPrice.Size() - i -= size - if _, err := m.InflowTokenCurrentPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - { - size := m.OutflowTokenEndPrice.Size() - i -= size - if _, err := m.OutflowTokenEndPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - { - size := m.OutflowTokenCurrentPrice.Size() - i -= size - if _, err := m.OutflowTokenCurrentPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - { - size := m.OutflowTokenInitialPrice.Size() - i -= size - if _, err := m.OutflowTokenInitialPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size, err := m.InflowTokenCurrentAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size, err := m.InflowTokenTargetAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.OutflowTokenCurrentAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.OutflowTokenInitAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.AuctionId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *BidOwnerMapping) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BidOwnerMapping) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BidOwnerMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.BidOwner) > 0 { - i -= len(m.BidOwner) - copy(dAtA[i:], m.BidOwner) - i = encodeVarintAuction(dAtA, i, uint64(len(m.BidOwner))) - i-- - dAtA[i] = 0x12 - } - if m.BidId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.BidId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ProtocolStatistics) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProtocolStatistics) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProtocolStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Loss.Size() - i -= size - if _, err := m.Loss.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.AssetId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AssetId)) - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *AuctionParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuctionParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuctionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.BidDurationSeconds != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.BidDurationSeconds)) - i-- - dAtA[i] = 0x50 - } - if m.DutchId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.DutchId)) - i-- - dAtA[i] = 0x48 - } - if m.DebtId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.DebtId)) - i-- - dAtA[i] = 0x40 - } - if m.SurplusId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.SurplusId)) - i-- - dAtA[i] = 0x38 - } - if m.PriceFunctionType != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.PriceFunctionType)) - i-- - dAtA[i] = 0x30 - } - { - size := m.Step.Size() - i -= size - if _, err := m.Step.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size := m.Cusp.Size() - i -= size - if _, err := m.Cusp.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size := m.Buffer.Size() - i -= size - if _, err := m.Buffer.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.AuctionDurationSeconds != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionDurationSeconds)) - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintAuction(dAtA []byte, offset int, v uint64) int { - offset -= sovAuction(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *SurplusAuction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AuctionId != 0 { - n += 1 + sovAuction(uint64(m.AuctionId)) - } - l = m.SellToken.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.BuyToken.Size() - n += 1 + l + sovAuction(uint64(l)) - if m.ActiveBiddingId != 0 { - n += 1 + sovAuction(uint64(m.ActiveBiddingId)) - } - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovAuction(uint64(l)) - } - l = m.Bid.Size() - n += 1 + l + sovAuction(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) - n += 1 + l + sovAuction(uint64(l)) - l = m.BidFactor.Size() - n += 1 + l + sovAuction(uint64(l)) - if len(m.BiddingIds) > 0 { - for _, e := range m.BiddingIds { - l = e.Size() - n += 1 + l + sovAuction(uint64(l)) - } - } - if m.AuctionStatus != 0 { - n += 1 + sovAuction(uint64(m.AuctionStatus)) - } - if m.AppId != 0 { - n += 1 + sovAuction(uint64(m.AppId)) - } - if m.AssetId != 0 { - n += 1 + sovAuction(uint64(m.AssetId)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovAuction(uint64(m.AuctionMappingId)) - } - if m.AssetInId != 0 { - n += 1 + sovAuction(uint64(m.AssetInId)) - } - if m.AssetOutId != 0 { - n += 1 + sovAuction(uint64(m.AssetOutId)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BidEndTime) - n += 2 + l + sovAuction(uint64(l)) - return n -} - -func (m *DebtAuction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AuctionId != 0 { - n += 1 + sovAuction(uint64(m.AuctionId)) - } - l = m.AuctionedToken.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.ExpectedUserToken.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.ExpectedMintedToken.Size() - n += 1 + l + sovAuction(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) - n += 1 + l + sovAuction(uint64(l)) - if m.ActiveBiddingId != 0 { - n += 1 + sovAuction(uint64(m.ActiveBiddingId)) - } - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovAuction(uint64(l)) - } - l = m.CurrentBidAmount.Size() - n += 1 + l + sovAuction(uint64(l)) - if m.AuctionStatus != 0 { - n += 1 + sovAuction(uint64(m.AuctionStatus)) - } - if m.AppId != 0 { - n += 1 + sovAuction(uint64(m.AppId)) - } - if m.AssetId != 0 { - n += 1 + sovAuction(uint64(m.AssetId)) - } - if len(m.BiddingIds) > 0 { - for _, e := range m.BiddingIds { - l = e.Size() - n += 1 + l + sovAuction(uint64(l)) - } - } - if m.AuctionMappingId != 0 { - n += 1 + sovAuction(uint64(m.AuctionMappingId)) - } - l = m.BidFactor.Size() - n += 1 + l + sovAuction(uint64(l)) - if m.AssetInId != 0 { - n += 1 + sovAuction(uint64(m.AssetInId)) - } - if m.AssetOutId != 0 { - n += 2 + sovAuction(uint64(m.AssetOutId)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BidEndTime) - n += 2 + l + sovAuction(uint64(l)) - return n -} - -func (m *DutchAuction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AuctionId != 0 { - n += 1 + sovAuction(uint64(m.AuctionId)) - } - l = m.OutflowTokenInitAmount.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.OutflowTokenCurrentAmount.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.InflowTokenTargetAmount.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.InflowTokenCurrentAmount.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.OutflowTokenInitialPrice.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.OutflowTokenCurrentPrice.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.OutflowTokenEndPrice.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.InflowTokenCurrentPrice.Size() - n += 1 + l + sovAuction(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) - n += 1 + l + sovAuction(uint64(l)) - if m.AuctionStatus != 0 { - n += 1 + sovAuction(uint64(m.AuctionStatus)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) - n += 1 + l + sovAuction(uint64(l)) - if len(m.BiddingIds) > 0 { - for _, e := range m.BiddingIds { - l = e.Size() - n += 1 + l + sovAuction(uint64(l)) - } - } - if m.AuctionMappingId != 0 { - n += 1 + sovAuction(uint64(m.AuctionMappingId)) - } - if m.AppId != 0 { - n += 1 + sovAuction(uint64(m.AppId)) - } - if m.AssetInId != 0 { - n += 2 + sovAuction(uint64(m.AssetInId)) - } - if m.AssetOutId != 0 { - n += 2 + sovAuction(uint64(m.AssetOutId)) - } - if m.LockedVaultId != 0 { - n += 2 + sovAuction(uint64(m.LockedVaultId)) - } - l = len(m.VaultOwner) - if l > 0 { - n += 2 + l + sovAuction(uint64(l)) - } - l = m.LiquidationPenalty.Size() - n += 2 + l + sovAuction(uint64(l)) - return n -} - -func (m *BidOwnerMapping) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BidId != 0 { - n += 1 + sovAuction(uint64(m.BidId)) - } - l = len(m.BidOwner) - if l > 0 { - n += 1 + l + sovAuction(uint64(l)) - } - return n -} - -func (m *ProtocolStatistics) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovAuction(uint64(m.AppId)) - } - if m.AssetId != 0 { - n += 1 + sovAuction(uint64(m.AssetId)) - } - l = m.Loss.Size() - n += 1 + l + sovAuction(uint64(l)) - return n -} - -func (m *AuctionParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovAuction(uint64(m.AppId)) - } - if m.AuctionDurationSeconds != 0 { - n += 1 + sovAuction(uint64(m.AuctionDurationSeconds)) - } - l = m.Buffer.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.Cusp.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.Step.Size() - n += 1 + l + sovAuction(uint64(l)) - if m.PriceFunctionType != 0 { - n += 1 + sovAuction(uint64(m.PriceFunctionType)) - } - if m.SurplusId != 0 { - n += 1 + sovAuction(uint64(m.SurplusId)) - } - if m.DebtId != 0 { - n += 1 + sovAuction(uint64(m.DebtId)) - } - if m.DutchId != 0 { - n += 1 + sovAuction(uint64(m.DutchId)) - } - if m.BidDurationSeconds != 0 { - n += 1 + sovAuction(uint64(m.BidDurationSeconds)) - } - return n -} - -func sovAuction(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAuction(x uint64) (n int) { - return sovAuction(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *SurplusAuction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SurplusAuction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SurplusAuction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SellToken", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.SellToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BuyToken", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BuyToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ActiveBiddingId", wireType) - } - m.ActiveBiddingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ActiveBiddingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = github_com_cosmos_cosmos_sdk_types.AccAddress(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BidFactor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BidFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingIds", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BiddingIds = append(m.BiddingIds, &BidOwnerMapping{}) - if err := m.BiddingIds[len(m.BiddingIds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) - } - m.AuctionStatus = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionStatus |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) - } - m.AssetId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetInId", wireType) - } - m.AssetInId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetInId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetOutId", wireType) - } - m.AssetOutId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetOutId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BidEndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BidEndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuction(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuction - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DebtAuction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DebtAuction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DebtAuction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionedToken", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AuctionedToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpectedUserToken", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExpectedUserToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpectedMintedToken", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExpectedMintedToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ActiveBiddingId", wireType) - } - m.ActiveBiddingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ActiveBiddingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = github_com_cosmos_cosmos_sdk_types.AccAddress(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentBidAmount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CurrentBidAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) - } - m.AuctionStatus = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionStatus |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) - } - m.AssetId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingIds", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BiddingIds = append(m.BiddingIds, &BidOwnerMapping{}) - if err := m.BiddingIds[len(m.BiddingIds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BidFactor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BidFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetInId", wireType) - } - m.AssetInId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetInId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetOutId", wireType) - } - m.AssetOutId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetOutId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BidEndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BidEndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuction(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuction - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DutchAuction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DutchAuction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DutchAuction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenInitAmount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.OutflowTokenInitAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenCurrentAmount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.OutflowTokenCurrentAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenTargetAmount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InflowTokenTargetAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenCurrentAmount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InflowTokenCurrentAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenInitialPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.OutflowTokenInitialPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenCurrentPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.OutflowTokenCurrentPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenEndPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.OutflowTokenEndPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenCurrentPrice", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InflowTokenCurrentPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) - } - m.AuctionStatus = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionStatus |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingIds", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BiddingIds = append(m.BiddingIds, &BidOwnerMapping{}) - if err := m.BiddingIds[len(m.BiddingIds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetInId", wireType) - } - m.AssetInId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetInId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 17: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetOutId", wireType) - } - m.AssetOutId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetOutId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 18: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LockedVaultId", wireType) - } - m.LockedVaultId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LockedVaultId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 19: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VaultOwner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VaultOwner = github_com_cosmos_cosmos_sdk_types.AccAddress(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 20: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LiquidationPenalty", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LiquidationPenalty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuction(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuction - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BidOwnerMapping) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: bidOwnerMapping: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: bidOwnerMapping: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BidId", wireType) - } - m.BidId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BidId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BidOwner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BidOwner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuction(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuction - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProtocolStatistics) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProtocolStatistics: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProtocolStatistics: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) - } - m.AssetId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AssetId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Loss", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Loss.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuction(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuction - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuctionParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuctionParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuctionParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionDurationSeconds", wireType) - } - m.AuctionDurationSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionDurationSeconds |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Buffer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Buffer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cusp", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Cusp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Step.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceFunctionType", wireType) - } - m.PriceFunctionType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PriceFunctionType |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SurplusId", wireType) - } - m.SurplusId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SurplusId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DebtId", wireType) - } - m.DebtId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DebtId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DutchId", wireType) - } - m.DutchId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DutchId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BidDurationSeconds", wireType) - } - m.BidDurationSeconds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BidDurationSeconds |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipAuction(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuction - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAuction(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAuction - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAuction - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAuction - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthAuction - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAuction - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAuction - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAuction = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAuction = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAuction = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/auction/types/biddings.pb.go b/github.com/comdex-official/comdex/x/auction/types/biddings.pb.go deleted file mode 100644 index 2767b7031..000000000 --- a/github.com/comdex-official/comdex/x/auction/types/biddings.pb.go +++ /dev/null @@ -1,1683 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auction/v1beta1/biddings.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type SurplusBiddings struct { - BiddingId uint64 `protobuf:"varint,1,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` - AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` - AuctionStatus string `protobuf:"bytes,3,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` - AuctionedCollateral github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=auctioned_collateral,json=auctionedCollateral,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"auctioned_collateral" yaml:"auctioned_collateral"` - Bidder string `protobuf:"bytes,5,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` - Bid github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=bid,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"bid" yaml:"bid"` - BiddingTimestamp time.Time `protobuf:"bytes,7,opt,name=bidding_timestamp,json=biddingTimestamp,proto3,stdtime" json:"bidding_timestamp" yaml:"bidding_timestamp"` - BiddingStatus string `protobuf:"bytes,8,opt,name=bidding_status,json=biddingStatus,proto3" json:"bidding_status,omitempty" yaml:"bidding_status"` - AuctionMappingId uint64 `protobuf:"varint,9,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` - AppId uint64 `protobuf:"varint,10,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` -} - -func (m *SurplusBiddings) Reset() { *m = SurplusBiddings{} } -func (m *SurplusBiddings) String() string { return proto.CompactTextString(m) } -func (*SurplusBiddings) ProtoMessage() {} -func (*SurplusBiddings) Descriptor() ([]byte, []int) { - return fileDescriptor_a5a3f4b8597bafd2, []int{0} -} -func (m *SurplusBiddings) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SurplusBiddings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SurplusBiddings.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SurplusBiddings) XXX_Merge(src proto.Message) { - xxx_messageInfo_SurplusBiddings.Merge(m, src) -} -func (m *SurplusBiddings) XXX_Size() int { - return m.Size() -} -func (m *SurplusBiddings) XXX_DiscardUnknown() { - xxx_messageInfo_SurplusBiddings.DiscardUnknown(m) -} - -var xxx_messageInfo_SurplusBiddings proto.InternalMessageInfo - -type DebtBiddings struct { - BiddingId uint64 `protobuf:"varint,1,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` - AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` - AuctionStatus string `protobuf:"bytes,3,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` - OutflowTokens github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=outflow_tokens,json=outflowTokens,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_tokens" yaml:"outflow_tokens"` - Bidder string `protobuf:"bytes,5,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` - Bid github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=bid,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"bid" yaml:"bid"` - BiddingTimestamp time.Time `protobuf:"bytes,7,opt,name=bidding_timestamp,json=biddingTimestamp,proto3,stdtime" json:"bidding_timestamp" yaml:"bidding_timestamp"` - BiddingStatus string `protobuf:"bytes,8,opt,name=bidding_status,json=biddingStatus,proto3" json:"bidding_status,omitempty" yaml:"bidding_status"` - AuctionMappingId uint64 `protobuf:"varint,9,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` - AppId uint64 `protobuf:"varint,10,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` -} - -func (m *DebtBiddings) Reset() { *m = DebtBiddings{} } -func (m *DebtBiddings) String() string { return proto.CompactTextString(m) } -func (*DebtBiddings) ProtoMessage() {} -func (*DebtBiddings) Descriptor() ([]byte, []int) { - return fileDescriptor_a5a3f4b8597bafd2, []int{1} -} -func (m *DebtBiddings) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DebtBiddings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DebtBiddings.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DebtBiddings) XXX_Merge(src proto.Message) { - xxx_messageInfo_DebtBiddings.Merge(m, src) -} -func (m *DebtBiddings) XXX_Size() int { - return m.Size() -} -func (m *DebtBiddings) XXX_DiscardUnknown() { - xxx_messageInfo_DebtBiddings.DiscardUnknown(m) -} - -var xxx_messageInfo_DebtBiddings proto.InternalMessageInfo - -type DutchBiddings struct { - BiddingId uint64 `protobuf:"varint,1,opt,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` - AuctionId uint64 `protobuf:"varint,2,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` - AuctionStatus string `protobuf:"bytes,3,opt,name=auction_status,json=auctionStatus,proto3" json:"auction_status,omitempty" yaml:"auction_status"` - OutflowTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=outflow_token_amount,json=outflowTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"outflow_token_amount" yaml:"outflow_token_amount"` - InflowTokenAmount github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=inflow_token_amount,json=inflowTokenAmount,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"inflow_token_amount" yaml:"inflow_token_amount"` - Bidder string `protobuf:"bytes,6,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` - BiddingTimestamp time.Time `protobuf:"bytes,7,opt,name=bidding_timestamp,json=biddingTimestamp,proto3,stdtime" json:"bidding_timestamp" yaml:"bidding_timestamp"` - BiddingStatus string `protobuf:"bytes,8,opt,name=bidding_status,json=biddingStatus,proto3" json:"bidding_status,omitempty" yaml:"bidding_status"` - AuctionMappingId uint64 `protobuf:"varint,9,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty" yaml:"auction_mapping_id"` - AppId uint64 `protobuf:"varint,10,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` -} - -func (m *DutchBiddings) Reset() { *m = DutchBiddings{} } -func (m *DutchBiddings) String() string { return proto.CompactTextString(m) } -func (*DutchBiddings) ProtoMessage() {} -func (*DutchBiddings) Descriptor() ([]byte, []int) { - return fileDescriptor_a5a3f4b8597bafd2, []int{2} -} -func (m *DutchBiddings) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DutchBiddings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DutchBiddings.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DutchBiddings) XXX_Merge(src proto.Message) { - xxx_messageInfo_DutchBiddings.Merge(m, src) -} -func (m *DutchBiddings) XXX_Size() int { - return m.Size() -} -func (m *DutchBiddings) XXX_DiscardUnknown() { - xxx_messageInfo_DutchBiddings.DiscardUnknown(m) -} - -var xxx_messageInfo_DutchBiddings proto.InternalMessageInfo - -func init() { - proto.RegisterType((*SurplusBiddings)(nil), "comdex.auction.v1beta1.SurplusBiddings") - proto.RegisterType((*DebtBiddings)(nil), "comdex.auction.v1beta1.DebtBiddings") - proto.RegisterType((*DutchBiddings)(nil), "comdex.auction.v1beta1.DutchBiddings") -} - -func init() { - proto.RegisterFile("comdex/auction/v1beta1/biddings.proto", fileDescriptor_a5a3f4b8597bafd2) -} - -var fileDescriptor_a5a3f4b8597bafd2 = []byte{ - // 675 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0xbd, 0x6e, 0xd3, 0x50, - 0x14, 0x8e, 0x69, 0x6b, 0xc8, 0x85, 0x94, 0xc6, 0x6d, 0x91, 0x1b, 0x84, 0x5d, 0x59, 0x20, 0xc2, - 0x50, 0x5b, 0x05, 0x26, 0x24, 0x24, 0x48, 0x3b, 0x10, 0xa1, 0x32, 0xb8, 0x9d, 0x58, 0xa2, 0xeb, - 0x9f, 0xa4, 0x97, 0xda, 0xbe, 0x56, 0x7c, 0x0d, 0xf4, 0x0d, 0x10, 0x53, 0x47, 0x24, 0x60, 0xe7, - 0x51, 0xca, 0xd6, 0x91, 0xc9, 0x40, 0xfa, 0x06, 0x19, 0x99, 0x90, 0xaf, 0x8f, 0xed, 0xba, 0x54, - 0x0a, 0x19, 0x23, 0x75, 0x4a, 0xce, 0xdf, 0x77, 0xbe, 0x9c, 0xf3, 0x1d, 0xe5, 0xa2, 0x7b, 0x36, - 0xf5, 0x1d, 0xf7, 0xbd, 0x81, 0x63, 0x9b, 0x11, 0x1a, 0x18, 0x6f, 0x37, 0x2d, 0x97, 0xe1, 0x4d, - 0xc3, 0x22, 0x8e, 0x43, 0x82, 0x41, 0xa4, 0x87, 0x43, 0xca, 0xa8, 0x74, 0x2b, 0x4b, 0xd3, 0x21, - 0x4d, 0x87, 0xb4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0x40, 0xd8, 0x7e, 0x6c, 0xe9, 0x36, - 0xf5, 0x0d, 0x98, 0x66, 0xf6, 0xb1, 0x11, 0x39, 0x07, 0x06, 0x3b, 0x0c, 0xdd, 0x88, 0xe3, 0x99, - 0xcb, 0x05, 0xc2, 0x56, 0x01, 0x20, 0x3d, 0x40, 0x62, 0x3a, 0x23, 0x77, 0x28, 0x2f, 0xf0, 0x1f, - 0xd6, 0x1c, 0x27, 0x6a, 0xa3, 0x1c, 0xa4, 0x3b, 0xd4, 0x4c, 0x48, 0x90, 0xde, 0xa0, 0x39, 0x8b, - 0x38, 0xb2, 0x38, 0x89, 0xf7, 0x53, 0xe0, 0x8d, 0x0a, 0x98, 0xa9, 0x68, 0xa6, 0x4d, 0x24, 0x1f, - 0x35, 0xf3, 0x3d, 0x16, 0x92, 0x91, 0xaf, 0xf2, 0xce, 0x2d, 0x3d, 0x13, 0x95, 0x9e, 0x8b, 0x4a, - 0xdf, 0xcb, 0x33, 0x3a, 0x77, 0xa1, 0xb5, 0x5c, 0x95, 0x42, 0x01, 0xa1, 0x1d, 0xfd, 0x54, 0x05, - 0x73, 0x09, 0xfc, 0x45, 0x5d, 0xba, 0xe6, 0x3c, 0x17, 0xd6, 0x7c, 0xed, 0xfc, 0x9a, 0xab, 0x71, - 0xcd, 0x6c, 0x80, 0x03, 0xd6, 0xfc, 0x12, 0x49, 0xb9, 0x10, 0x7c, 0x1c, 0x86, 0x20, 0xce, 0x3a, - 0x97, 0xd9, 0x9d, 0x71, 0xa2, 0xae, 0x55, 0xc5, 0x52, 0xe6, 0x68, 0xe6, 0x12, 0x38, 0x77, 0x32, - 0x5f, 0xd7, 0x91, 0xda, 0x48, 0xc4, 0x61, 0x98, 0x02, 0x20, 0x0e, 0x70, 0x66, 0x29, 0x99, 0x5f, - 0x33, 0x17, 0x70, 0x18, 0x76, 0x1d, 0xed, 0x83, 0x88, 0x6e, 0x6c, 0xbb, 0x16, 0x9b, 0xd1, 0xe3, - 0xf8, 0x28, 0xa0, 0x45, 0x1a, 0xb3, 0xbe, 0x47, 0xdf, 0xf5, 0x18, 0x3d, 0x70, 0x83, 0x68, 0xf2, - 0x59, 0xbc, 0x80, 0x1d, 0x43, 0x87, 0x6a, 0xf9, 0x54, 0x4a, 0x6b, 0x40, 0xed, 0x1e, 0x2f, 0xbd, - 0x3c, 0x85, 0xd9, 0x3e, 0x85, 0xef, 0x22, 0x6a, 0x6c, 0xc7, 0xcc, 0xde, 0x9f, 0xd1, 0x5b, 0xf8, - 0x2c, 0xa0, 0x95, 0x8a, 0x98, 0x7b, 0xd8, 0xa7, 0x71, 0xc0, 0xa6, 0xfe, 0xa3, 0xb8, 0x08, 0x64, - 0x2a, 0xd9, 0x49, 0x67, 0xef, 0xe2, 0x39, 0xaf, 0x97, 0x3e, 0x09, 0x68, 0x99, 0x04, 0xff, 0x92, - 0x5b, 0x98, 0x44, 0x6e, 0x07, 0xc8, 0xb5, 0x32, 0x72, 0x17, 0x60, 0x4c, 0xc5, 0xad, 0x99, 0x01, - 0x9c, 0xa5, 0x56, 0xde, 0xad, 0x38, 0xe9, 0x6e, 0x2f, 0x6f, 0xe9, 0xbf, 0x6e, 0xa9, 0xb3, 0x7b, - 0xfc, 0x5b, 0xa9, 0x7d, 0x1b, 0x29, 0xb5, 0xe3, 0x91, 0x22, 0x9c, 0x8c, 0x14, 0xe1, 0xd7, 0x48, - 0x11, 0x8e, 0x4e, 0x95, 0xda, 0xc9, 0xa9, 0x52, 0xfb, 0x71, 0xaa, 0xd4, 0x5e, 0x6f, 0x56, 0x16, - 0x96, 0x3e, 0x09, 0x37, 0x68, 0xbf, 0x4f, 0x6c, 0x82, 0x3d, 0xb0, 0x8d, 0xf2, 0x2d, 0xc9, 0xf7, - 0x67, 0x89, 0x7c, 0xb2, 0x8f, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x0e, 0x99, 0xf1, 0x6a, - 0x0a, 0x00, 0x00, -} - -func (m *SurplusBiddings) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SurplusBiddings) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SurplusBiddings) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AppId != 0 { - i = encodeVarintBiddings(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x50 - } - if m.AuctionMappingId != 0 { - i = encodeVarintBiddings(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x48 - } - if len(m.BiddingStatus) > 0 { - i -= len(m.BiddingStatus) - copy(dAtA[i:], m.BiddingStatus) - i = encodeVarintBiddings(dAtA, i, uint64(len(m.BiddingStatus))) - i-- - dAtA[i] = 0x42 - } - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BiddingTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintBiddings(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x3a - { - size, err := m.Bid.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBiddings(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintBiddings(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0x2a - } - { - size, err := m.AuctionedCollateral.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBiddings(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.AuctionStatus) > 0 { - i -= len(m.AuctionStatus) - copy(dAtA[i:], m.AuctionStatus) - i = encodeVarintBiddings(dAtA, i, uint64(len(m.AuctionStatus))) - i-- - dAtA[i] = 0x1a - } - if m.AuctionId != 0 { - i = encodeVarintBiddings(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x10 - } - if m.BiddingId != 0 { - i = encodeVarintBiddings(dAtA, i, uint64(m.BiddingId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DebtBiddings) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DebtBiddings) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DebtBiddings) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AppId != 0 { - i = encodeVarintBiddings(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x50 - } - if m.AuctionMappingId != 0 { - i = encodeVarintBiddings(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x48 - } - if len(m.BiddingStatus) > 0 { - i -= len(m.BiddingStatus) - copy(dAtA[i:], m.BiddingStatus) - i = encodeVarintBiddings(dAtA, i, uint64(len(m.BiddingStatus))) - i-- - dAtA[i] = 0x42 - } - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BiddingTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintBiddings(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x3a - { - size, err := m.Bid.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBiddings(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintBiddings(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0x2a - } - { - size, err := m.OutflowTokens.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBiddings(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.AuctionStatus) > 0 { - i -= len(m.AuctionStatus) - copy(dAtA[i:], m.AuctionStatus) - i = encodeVarintBiddings(dAtA, i, uint64(len(m.AuctionStatus))) - i-- - dAtA[i] = 0x1a - } - if m.AuctionId != 0 { - i = encodeVarintBiddings(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x10 - } - if m.BiddingId != 0 { - i = encodeVarintBiddings(dAtA, i, uint64(m.BiddingId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DutchBiddings) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DutchBiddings) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DutchBiddings) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AppId != 0 { - i = encodeVarintBiddings(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x50 - } - if m.AuctionMappingId != 0 { - i = encodeVarintBiddings(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x48 - } - if len(m.BiddingStatus) > 0 { - i -= len(m.BiddingStatus) - copy(dAtA[i:], m.BiddingStatus) - i = encodeVarintBiddings(dAtA, i, uint64(len(m.BiddingStatus))) - i-- - dAtA[i] = 0x42 - } - n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BiddingTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp):]) - if err7 != nil { - return 0, err7 - } - i -= n7 - i = encodeVarintBiddings(dAtA, i, uint64(n7)) - i-- - dAtA[i] = 0x3a - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintBiddings(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0x32 - } - { - size, err := m.InflowTokenAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBiddings(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size, err := m.OutflowTokenAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBiddings(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.AuctionStatus) > 0 { - i -= len(m.AuctionStatus) - copy(dAtA[i:], m.AuctionStatus) - i = encodeVarintBiddings(dAtA, i, uint64(len(m.AuctionStatus))) - i-- - dAtA[i] = 0x1a - } - if m.AuctionId != 0 { - i = encodeVarintBiddings(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x10 - } - if m.BiddingId != 0 { - i = encodeVarintBiddings(dAtA, i, uint64(m.BiddingId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintBiddings(dAtA []byte, offset int, v uint64) int { - offset -= sovBiddings(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *SurplusBiddings) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BiddingId != 0 { - n += 1 + sovBiddings(uint64(m.BiddingId)) - } - if m.AuctionId != 0 { - n += 1 + sovBiddings(uint64(m.AuctionId)) - } - l = len(m.AuctionStatus) - if l > 0 { - n += 1 + l + sovBiddings(uint64(l)) - } - l = m.AuctionedCollateral.Size() - n += 1 + l + sovBiddings(uint64(l)) - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovBiddings(uint64(l)) - } - l = m.Bid.Size() - n += 1 + l + sovBiddings(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp) - n += 1 + l + sovBiddings(uint64(l)) - l = len(m.BiddingStatus) - if l > 0 { - n += 1 + l + sovBiddings(uint64(l)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovBiddings(uint64(m.AuctionMappingId)) - } - if m.AppId != 0 { - n += 1 + sovBiddings(uint64(m.AppId)) - } - return n -} - -func (m *DebtBiddings) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BiddingId != 0 { - n += 1 + sovBiddings(uint64(m.BiddingId)) - } - if m.AuctionId != 0 { - n += 1 + sovBiddings(uint64(m.AuctionId)) - } - l = len(m.AuctionStatus) - if l > 0 { - n += 1 + l + sovBiddings(uint64(l)) - } - l = m.OutflowTokens.Size() - n += 1 + l + sovBiddings(uint64(l)) - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovBiddings(uint64(l)) - } - l = m.Bid.Size() - n += 1 + l + sovBiddings(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp) - n += 1 + l + sovBiddings(uint64(l)) - l = len(m.BiddingStatus) - if l > 0 { - n += 1 + l + sovBiddings(uint64(l)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovBiddings(uint64(m.AuctionMappingId)) - } - if m.AppId != 0 { - n += 1 + sovBiddings(uint64(m.AppId)) - } - return n -} - -func (m *DutchBiddings) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BiddingId != 0 { - n += 1 + sovBiddings(uint64(m.BiddingId)) - } - if m.AuctionId != 0 { - n += 1 + sovBiddings(uint64(m.AuctionId)) - } - l = len(m.AuctionStatus) - if l > 0 { - n += 1 + l + sovBiddings(uint64(l)) - } - l = m.OutflowTokenAmount.Size() - n += 1 + l + sovBiddings(uint64(l)) - l = m.InflowTokenAmount.Size() - n += 1 + l + sovBiddings(uint64(l)) - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovBiddings(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BiddingTimestamp) - n += 1 + l + sovBiddings(uint64(l)) - l = len(m.BiddingStatus) - if l > 0 { - n += 1 + l + sovBiddings(uint64(l)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovBiddings(uint64(m.AuctionMappingId)) - } - if m.AppId != 0 { - n += 1 + sovBiddings(uint64(m.AppId)) - } - return n -} - -func sovBiddings(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozBiddings(x uint64) (n int) { - return sovBiddings(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *SurplusBiddings) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SurplusBiddings: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SurplusBiddings: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingId", wireType) - } - m.BiddingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BiddingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - 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 ErrInvalidLengthBiddings - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AuctionStatus = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionedCollateral", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBiddings - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AuctionedCollateral.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - 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 ErrInvalidLengthBiddings - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBiddings - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingTimestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBiddings - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BiddingTimestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingStatus", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - 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 ErrInvalidLengthBiddings - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BiddingStatus = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipBiddings(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBiddings - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DebtBiddings) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DebtBiddings: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DebtBiddings: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingId", wireType) - } - m.BiddingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BiddingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - 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 ErrInvalidLengthBiddings - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AuctionStatus = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokens", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBiddings - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.OutflowTokens.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - 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 ErrInvalidLengthBiddings - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBiddings - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingTimestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBiddings - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BiddingTimestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingStatus", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - 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 ErrInvalidLengthBiddings - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BiddingStatus = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipBiddings(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBiddings - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DutchBiddings) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DutchBiddings: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DutchBiddings: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingId", wireType) - } - m.BiddingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BiddingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionStatus", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - 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 ErrInvalidLengthBiddings - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AuctionStatus = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutflowTokenAmount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBiddings - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.OutflowTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InflowTokenAmount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBiddings - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InflowTokenAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - 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 ErrInvalidLengthBiddings - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingTimestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBiddings - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BiddingTimestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BiddingStatus", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - 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 ErrInvalidLengthBiddings - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBiddings - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BiddingStatus = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBiddings - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipBiddings(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBiddings - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipBiddings(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBiddings - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBiddings - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBiddings - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthBiddings - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupBiddings - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthBiddings - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthBiddings = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBiddings = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupBiddings = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/auction/types/genesis.pb.go b/github.com/comdex-official/comdex/x/auction/types/genesis.pb.go deleted file mode 100644 index 99082bc32..000000000 --- a/github.com/comdex-official/comdex/x/auction/types/genesis.pb.go +++ /dev/null @@ -1,745 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auction/v1beta1/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type GenesisState struct { - SurplusAuction []SurplusAuction `protobuf:"bytes,1,rep,name=surplusAuction,proto3" json:"surplusAuction" yaml:"surplusAuction"` - DebtAuction []DebtAuction `protobuf:"bytes,2,rep,name=debtAuction,proto3" json:"debtAuction" yaml:"debtAuction"` - DutchAuction []DutchAuction `protobuf:"bytes,3,rep,name=dutchAuction,proto3" json:"dutchAuction" yaml:"dutchAuction"` - ProtocolStatistics []ProtocolStatistics `protobuf:"bytes,4,rep,name=protocolStatistics,proto3" json:"protocolStatistics" yaml:"protocolStatistics"` - AuctionParams []AuctionParams `protobuf:"bytes,5,rep,name=auctionParams,proto3" json:"auctionParams" yaml:"auctionParams"` - DutchLendAuction []DutchAuction `protobuf:"bytes,6,rep,name=dutchLendAuction,proto3" json:"dutchLendAuction" yaml:"dutchLendAuction"` - Params Params `protobuf:"bytes,7,opt,name=params,proto3" json:"params"` - UserBiddingID uint64 `protobuf:"varint,8,opt,name=UserBiddingID,proto3" json:"UserBiddingID,omitempty"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_49088f171dd3086d, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetSurplusAuction() []SurplusAuction { - if m != nil { - return m.SurplusAuction - } - return nil -} - -func (m *GenesisState) GetDebtAuction() []DebtAuction { - if m != nil { - return m.DebtAuction - } - return nil -} - -func (m *GenesisState) GetDutchAuction() []DutchAuction { - if m != nil { - return m.DutchAuction - } - return nil -} - -func (m *GenesisState) GetProtocolStatistics() []ProtocolStatistics { - if m != nil { - return m.ProtocolStatistics - } - return nil -} - -func (m *GenesisState) GetAuctionParams() []AuctionParams { - if m != nil { - return m.AuctionParams - } - return nil -} - -func (m *GenesisState) GetDutchLendAuction() []DutchAuction { - if m != nil { - return m.DutchLendAuction - } - return nil -} - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func (m *GenesisState) GetUserBiddingID() uint64 { - if m != nil { - return m.UserBiddingID - } - return 0 -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "comdex.auction.v1beta1.GenesisState") -} - -func init() { - proto.RegisterFile("comdex/auction/v1beta1/genesis.proto", fileDescriptor_49088f171dd3086d) -} - -var fileDescriptor_49088f171dd3086d = []byte{ - // 455 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x4f, 0x6f, 0xd3, 0x30, - 0x1c, 0x86, 0x1b, 0x56, 0x0a, 0x72, 0x37, 0x84, 0xcc, 0x80, 0x50, 0x20, 0x2d, 0x5e, 0x87, 0x2a, - 0x24, 0x12, 0x75, 0xdc, 0x10, 0x97, 0x45, 0x93, 0x10, 0x82, 0xc3, 0xe4, 0x89, 0x0b, 0x37, 0x27, - 0xf1, 0x32, 0x4b, 0x4d, 0x1c, 0x62, 0x07, 0xb1, 0x03, 0x77, 0x8e, 0x7c, 0xac, 0x1d, 0x77, 0xe4, - 0x34, 0xa1, 0xf6, 0x1b, 0xf0, 0x09, 0x50, 0x6c, 0x47, 0x4b, 0x68, 0x7d, 0xd8, 0x2d, 0x7f, 0x5e, - 0x3f, 0x4f, 0x7e, 0x6f, 0x6c, 0x30, 0x8d, 0x79, 0x96, 0xd0, 0xef, 0x01, 0xa9, 0x62, 0xc9, 0x78, - 0x1e, 0x7c, 0x9b, 0x47, 0x54, 0x92, 0x79, 0x90, 0xd2, 0x9c, 0x0a, 0x26, 0xfc, 0xa2, 0xe4, 0x92, - 0xc3, 0x47, 0x3a, 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, 0xb1, 0xda, 0x2c, 0xee, 0x6d, - 0x65, 0xde, 0xb7, 0x99, 0x0f, 0xdb, 0xe1, 0xf0, 0x99, 0x91, 0xee, 0x6a, 0x69, 0x87, 0x84, 0x70, - 0x97, 0x0c, 0xbf, 0x82, 0xfb, 0x6a, 0xf2, 0x4f, 0x34, 0x4f, 0x9a, 0x52, 0x07, 0x37, 0x28, 0x75, - 0x6c, 0x64, 0x8f, 0x5b, 0xa5, 0xb6, 0x58, 0x08, 0xaf, 0xe1, 0xe1, 0x3b, 0x30, 0xd0, 0x67, 0xc0, - 0xbd, 0x33, 0x71, 0x66, 0xc3, 0x03, 0xcf, 0x5a, 0xa8, 0x9e, 0xa7, 0x5f, 0x2b, 0xb0, 0x59, 0x03, - 0xa7, 0x60, 0xe7, 0xb3, 0xa0, 0x65, 0xa8, 0xb7, 0xfe, 0x87, 0x23, 0xf7, 0xee, 0xc4, 0x99, 0xf5, - 0x71, 0xf7, 0x61, 0xf8, 0xf1, 0x62, 0xe9, 0x39, 0x97, 0x4b, 0xcf, 0xf9, 0xb3, 0xf4, 0x9c, 0x5f, - 0x2b, 0xaf, 0x77, 0xb9, 0xf2, 0x7a, 0xbf, 0x57, 0x5e, 0xef, 0xcb, 0x3c, 0x65, 0xf2, 0xac, 0x8a, - 0x6a, 0x67, 0xa0, 0xbd, 0xaf, 0xf9, 0xe9, 0x29, 0x8b, 0x19, 0x59, 0x98, 0xfb, 0xe0, 0xfa, 0xa0, - 0xc9, 0xf3, 0x82, 0x8a, 0x68, 0xa0, 0x7e, 0xd1, 0x9b, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf3, - 0xf6, 0xde, 0xc2, 0x26, 0x04, 0x00, 0x00, -} - -func (m *GenesisState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.UserBiddingID != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.UserBiddingID)) - i-- - dAtA[i] = 0x40 - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - if len(m.DutchLendAuction) > 0 { - for iNdEx := len(m.DutchLendAuction) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DutchLendAuction[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if len(m.AuctionParams) > 0 { - for iNdEx := len(m.AuctionParams) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AuctionParams[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.ProtocolStatistics) > 0 { - for iNdEx := len(m.ProtocolStatistics) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ProtocolStatistics[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.DutchAuction) > 0 { - for iNdEx := len(m.DutchAuction) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DutchAuction[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.DebtAuction) > 0 { - for iNdEx := len(m.DebtAuction) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DebtAuction[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.SurplusAuction) > 0 { - for iNdEx := len(m.SurplusAuction) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SurplusAuction[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.SurplusAuction) > 0 { - for _, e := range m.SurplusAuction { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.DebtAuction) > 0 { - for _, e := range m.DebtAuction { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.DutchAuction) > 0 { - for _, e := range m.DutchAuction { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.ProtocolStatistics) > 0 { - for _, e := range m.ProtocolStatistics { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.AuctionParams) > 0 { - for _, e := range m.AuctionParams { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.DutchLendAuction) > 0 { - for _, e := range m.DutchLendAuction { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - if m.UserBiddingID != 0 { - n += 1 + sovGenesis(uint64(m.UserBiddingID)) - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SurplusAuction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SurplusAuction = append(m.SurplusAuction, SurplusAuction{}) - if err := m.SurplusAuction[len(m.SurplusAuction)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DebtAuction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DebtAuction = append(m.DebtAuction, DebtAuction{}) - if err := m.DebtAuction[len(m.DebtAuction)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DutchAuction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DutchAuction = append(m.DutchAuction, DutchAuction{}) - if err := m.DutchAuction[len(m.DutchAuction)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProtocolStatistics", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProtocolStatistics = append(m.ProtocolStatistics, ProtocolStatistics{}) - if err := m.ProtocolStatistics[len(m.ProtocolStatistics)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AuctionParams = append(m.AuctionParams, AuctionParams{}) - if err := m.AuctionParams[len(m.AuctionParams)-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 DutchLendAuction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DutchLendAuction = append(m.DutchLendAuction, DutchAuction{}) - if err := m.DutchLendAuction[len(m.DutchLendAuction)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UserBiddingID", wireType) - } - m.UserBiddingID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UserBiddingID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/auction/types/params.pb.go b/github.com/comdex-official/comdex/x/auction/types/params.pb.go deleted file mode 100644 index e1c743254..000000000 --- a/github.com/comdex-official/comdex/x/auction/types/params.pb.go +++ /dev/null @@ -1,265 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auction/v1beta1/params.proto - -package types - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Params struct { -} - -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_4370eec7f59a9a46, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Params)(nil), "comdex.auction.v1beta1.Params") -} - -func init() { - proto.RegisterFile("comdex/auction/v1beta1/params.proto", fileDescriptor_4370eec7f59a9a46) -} - -var fileDescriptor_4370eec7f59a9a46 = []byte{ - // 145 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, - 0x49, 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0x12, 0x83, 0x28, 0xd2, 0x83, 0x2a, 0xd2, 0x83, 0x2a, 0x52, 0xe2, 0xe0, 0x62, 0x0b, 0x00, 0xab, - 0x73, 0xf2, 0x3e, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, - 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xc3, 0xf4, 0xcc, - 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x88, 0x31, 0xba, 0xf9, 0x69, 0x69, 0x99, - 0xc9, 0x99, 0x89, 0x39, 0x50, 0xbe, 0x3e, 0xc2, 0xf6, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, - 0xb0, 0xad, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x3e, 0xe4, 0x24, 0x9c, 0x00, 0x00, - 0x00, -} - -func (m *Params) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/auction/types/query.pb.go b/github.com/comdex-official/comdex/x/auction/types/query.pb.go deleted file mode 100644 index 4017bc744..000000000 --- a/github.com/comdex-official/comdex/x/auction/types/query.pb.go +++ /dev/null @@ -1,8289 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auction/v1beta1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type QuerySurplusAuctionRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - AuctionMappingId uint64 `protobuf:"varint,2,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` - AuctionId uint64 `protobuf:"varint,3,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - History bool `protobuf:"varint,4,opt,name=history,proto3" json:"history,omitempty"` -} - -func (m *QuerySurplusAuctionRequest) Reset() { *m = QuerySurplusAuctionRequest{} } -func (m *QuerySurplusAuctionRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySurplusAuctionRequest) ProtoMessage() {} -func (*QuerySurplusAuctionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{0} -} -func (m *QuerySurplusAuctionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySurplusAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySurplusAuctionRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QuerySurplusAuctionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySurplusAuctionRequest.Merge(m, src) -} -func (m *QuerySurplusAuctionRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySurplusAuctionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySurplusAuctionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySurplusAuctionRequest proto.InternalMessageInfo - -type QuerySurplusAuctionResponse struct { - Auction SurplusAuction `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction" yaml:"auction"` -} - -func (m *QuerySurplusAuctionResponse) Reset() { *m = QuerySurplusAuctionResponse{} } -func (m *QuerySurplusAuctionResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySurplusAuctionResponse) ProtoMessage() {} -func (*QuerySurplusAuctionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{1} -} -func (m *QuerySurplusAuctionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySurplusAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySurplusAuctionResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QuerySurplusAuctionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySurplusAuctionResponse.Merge(m, src) -} -func (m *QuerySurplusAuctionResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySurplusAuctionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySurplusAuctionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySurplusAuctionResponse proto.InternalMessageInfo - -type QuerySurplusAuctionsRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - History bool `protobuf:"varint,2,opt,name=history,proto3" json:"history,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QuerySurplusAuctionsRequest) Reset() { *m = QuerySurplusAuctionsRequest{} } -func (m *QuerySurplusAuctionsRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySurplusAuctionsRequest) ProtoMessage() {} -func (*QuerySurplusAuctionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{2} -} -func (m *QuerySurplusAuctionsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySurplusAuctionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySurplusAuctionsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QuerySurplusAuctionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySurplusAuctionsRequest.Merge(m, src) -} -func (m *QuerySurplusAuctionsRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySurplusAuctionsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySurplusAuctionsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySurplusAuctionsRequest proto.InternalMessageInfo - -type QuerySurplusAuctionsResponse struct { - Auctions []SurplusAuction `protobuf:"bytes,1,rep,name=auctions,proto3" json:"auctions" yaml:"auctions"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QuerySurplusAuctionsResponse) Reset() { *m = QuerySurplusAuctionsResponse{} } -func (m *QuerySurplusAuctionsResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySurplusAuctionsResponse) ProtoMessage() {} -func (*QuerySurplusAuctionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{3} -} -func (m *QuerySurplusAuctionsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySurplusAuctionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySurplusAuctionsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QuerySurplusAuctionsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySurplusAuctionsResponse.Merge(m, src) -} -func (m *QuerySurplusAuctionsResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySurplusAuctionsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySurplusAuctionsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySurplusAuctionsResponse proto.InternalMessageInfo - -type QuerySurplusBiddingsRequest struct { - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - History bool `protobuf:"varint,3,opt,name=history,proto3" json:"history,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QuerySurplusBiddingsRequest) Reset() { *m = QuerySurplusBiddingsRequest{} } -func (m *QuerySurplusBiddingsRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySurplusBiddingsRequest) ProtoMessage() {} -func (*QuerySurplusBiddingsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{4} -} -func (m *QuerySurplusBiddingsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySurplusBiddingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySurplusBiddingsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QuerySurplusBiddingsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySurplusBiddingsRequest.Merge(m, src) -} -func (m *QuerySurplusBiddingsRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySurplusBiddingsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySurplusBiddingsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySurplusBiddingsRequest proto.InternalMessageInfo - -type QuerySurplusBiddingsResponse struct { - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` - Biddings []SurplusBiddings `protobuf:"bytes,2,rep,name=biddings,proto3" json:"biddings" yaml:"biddings"` - Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QuerySurplusBiddingsResponse) Reset() { *m = QuerySurplusBiddingsResponse{} } -func (m *QuerySurplusBiddingsResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySurplusBiddingsResponse) ProtoMessage() {} -func (*QuerySurplusBiddingsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{5} -} -func (m *QuerySurplusBiddingsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySurplusBiddingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySurplusBiddingsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QuerySurplusBiddingsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySurplusBiddingsResponse.Merge(m, src) -} -func (m *QuerySurplusBiddingsResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySurplusBiddingsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySurplusBiddingsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySurplusBiddingsResponse proto.InternalMessageInfo - -type QueryDebtAuctionRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - AuctionMappingId uint64 `protobuf:"varint,2,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` - AuctionId uint64 `protobuf:"varint,3,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - History bool `protobuf:"varint,4,opt,name=history,proto3" json:"history,omitempty"` -} - -func (m *QueryDebtAuctionRequest) Reset() { *m = QueryDebtAuctionRequest{} } -func (m *QueryDebtAuctionRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDebtAuctionRequest) ProtoMessage() {} -func (*QueryDebtAuctionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{6} -} -func (m *QueryDebtAuctionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDebtAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDebtAuctionRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDebtAuctionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDebtAuctionRequest.Merge(m, src) -} -func (m *QueryDebtAuctionRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDebtAuctionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDebtAuctionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDebtAuctionRequest proto.InternalMessageInfo - -type QueryDebtAuctionResponse struct { - Auction DebtAuction `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction" yaml:"auction"` - Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryDebtAuctionResponse) Reset() { *m = QueryDebtAuctionResponse{} } -func (m *QueryDebtAuctionResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDebtAuctionResponse) ProtoMessage() {} -func (*QueryDebtAuctionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{7} -} -func (m *QueryDebtAuctionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDebtAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDebtAuctionResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDebtAuctionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDebtAuctionResponse.Merge(m, src) -} -func (m *QueryDebtAuctionResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDebtAuctionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDebtAuctionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDebtAuctionResponse proto.InternalMessageInfo - -type QueryDebtAuctionsRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - History bool `protobuf:"varint,2,opt,name=history,proto3" json:"history,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryDebtAuctionsRequest) Reset() { *m = QueryDebtAuctionsRequest{} } -func (m *QueryDebtAuctionsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDebtAuctionsRequest) ProtoMessage() {} -func (*QueryDebtAuctionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{8} -} -func (m *QueryDebtAuctionsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDebtAuctionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDebtAuctionsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDebtAuctionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDebtAuctionsRequest.Merge(m, src) -} -func (m *QueryDebtAuctionsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDebtAuctionsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDebtAuctionsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDebtAuctionsRequest proto.InternalMessageInfo - -type QueryDebtAuctionsResponse struct { - Auctions []DebtAuction `protobuf:"bytes,1,rep,name=auctions,proto3" json:"auctions" yaml:"auctions"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryDebtAuctionsResponse) Reset() { *m = QueryDebtAuctionsResponse{} } -func (m *QueryDebtAuctionsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDebtAuctionsResponse) ProtoMessage() {} -func (*QueryDebtAuctionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{9} -} -func (m *QueryDebtAuctionsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDebtAuctionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDebtAuctionsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDebtAuctionsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDebtAuctionsResponse.Merge(m, src) -} -func (m *QueryDebtAuctionsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDebtAuctionsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDebtAuctionsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDebtAuctionsResponse proto.InternalMessageInfo - -type QueryDebtBiddingsRequest struct { - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - History bool `protobuf:"varint,3,opt,name=history,proto3" json:"history,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryDebtBiddingsRequest) Reset() { *m = QueryDebtBiddingsRequest{} } -func (m *QueryDebtBiddingsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDebtBiddingsRequest) ProtoMessage() {} -func (*QueryDebtBiddingsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{10} -} -func (m *QueryDebtBiddingsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDebtBiddingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDebtBiddingsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDebtBiddingsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDebtBiddingsRequest.Merge(m, src) -} -func (m *QueryDebtBiddingsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDebtBiddingsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDebtBiddingsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDebtBiddingsRequest proto.InternalMessageInfo - -type QueryDebtBiddingsResponse struct { - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` - Biddings []DebtBiddings `protobuf:"bytes,2,rep,name=biddings,proto3" json:"biddings" yaml:"biddings"` - Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryDebtBiddingsResponse) Reset() { *m = QueryDebtBiddingsResponse{} } -func (m *QueryDebtBiddingsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDebtBiddingsResponse) ProtoMessage() {} -func (*QueryDebtBiddingsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{11} -} -func (m *QueryDebtBiddingsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDebtBiddingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDebtBiddingsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDebtBiddingsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDebtBiddingsResponse.Merge(m, src) -} -func (m *QueryDebtBiddingsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDebtBiddingsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDebtBiddingsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDebtBiddingsResponse proto.InternalMessageInfo - -type QueryDutchAuctionRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - AuctionMappingId uint64 `protobuf:"varint,2,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` - AuctionId uint64 `protobuf:"varint,3,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - History bool `protobuf:"varint,4,opt,name=history,proto3" json:"history,omitempty"` -} - -func (m *QueryDutchAuctionRequest) Reset() { *m = QueryDutchAuctionRequest{} } -func (m *QueryDutchAuctionRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDutchAuctionRequest) ProtoMessage() {} -func (*QueryDutchAuctionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{12} -} -func (m *QueryDutchAuctionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDutchAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDutchAuctionRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDutchAuctionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDutchAuctionRequest.Merge(m, src) -} -func (m *QueryDutchAuctionRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDutchAuctionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDutchAuctionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDutchAuctionRequest proto.InternalMessageInfo - -type QueryDutchAuctionResponse struct { - Auction DutchAuction `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction" yaml:"auction"` -} - -func (m *QueryDutchAuctionResponse) Reset() { *m = QueryDutchAuctionResponse{} } -func (m *QueryDutchAuctionResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDutchAuctionResponse) ProtoMessage() {} -func (*QueryDutchAuctionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{13} -} -func (m *QueryDutchAuctionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDutchAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDutchAuctionResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDutchAuctionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDutchAuctionResponse.Merge(m, src) -} -func (m *QueryDutchAuctionResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDutchAuctionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDutchAuctionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDutchAuctionResponse proto.InternalMessageInfo - -type QueryDutchAuctionsRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - History bool `protobuf:"varint,2,opt,name=history,proto3" json:"history,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryDutchAuctionsRequest) Reset() { *m = QueryDutchAuctionsRequest{} } -func (m *QueryDutchAuctionsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDutchAuctionsRequest) ProtoMessage() {} -func (*QueryDutchAuctionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{14} -} -func (m *QueryDutchAuctionsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDutchAuctionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDutchAuctionsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDutchAuctionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDutchAuctionsRequest.Merge(m, src) -} -func (m *QueryDutchAuctionsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDutchAuctionsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDutchAuctionsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDutchAuctionsRequest proto.InternalMessageInfo - -type QueryDutchAuctionsResponse struct { - Auctions []DutchAuction `protobuf:"bytes,1,rep,name=auctions,proto3" json:"auctions" yaml:"auctions"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryDutchAuctionsResponse) Reset() { *m = QueryDutchAuctionsResponse{} } -func (m *QueryDutchAuctionsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDutchAuctionsResponse) ProtoMessage() {} -func (*QueryDutchAuctionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{15} -} -func (m *QueryDutchAuctionsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDutchAuctionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDutchAuctionsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDutchAuctionsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDutchAuctionsResponse.Merge(m, src) -} -func (m *QueryDutchAuctionsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDutchAuctionsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDutchAuctionsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDutchAuctionsResponse proto.InternalMessageInfo - -type QueryDutchBiddingsRequest struct { - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - History bool `protobuf:"varint,3,opt,name=history,proto3" json:"history,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryDutchBiddingsRequest) Reset() { *m = QueryDutchBiddingsRequest{} } -func (m *QueryDutchBiddingsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDutchBiddingsRequest) ProtoMessage() {} -func (*QueryDutchBiddingsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{16} -} -func (m *QueryDutchBiddingsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDutchBiddingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDutchBiddingsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDutchBiddingsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDutchBiddingsRequest.Merge(m, src) -} -func (m *QueryDutchBiddingsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDutchBiddingsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDutchBiddingsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDutchBiddingsRequest proto.InternalMessageInfo - -type QueryDutchBiddingsResponse struct { - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` - Biddings []DutchBiddings `protobuf:"bytes,2,rep,name=biddings,proto3" json:"biddings" yaml:"biddings"` - Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryDutchBiddingsResponse) Reset() { *m = QueryDutchBiddingsResponse{} } -func (m *QueryDutchBiddingsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDutchBiddingsResponse) ProtoMessage() {} -func (*QueryDutchBiddingsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{17} -} -func (m *QueryDutchBiddingsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDutchBiddingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDutchBiddingsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDutchBiddingsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDutchBiddingsResponse.Merge(m, src) -} -func (m *QueryDutchBiddingsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDutchBiddingsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDutchBiddingsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDutchBiddingsResponse proto.InternalMessageInfo - -type QueryBiddingsForSurplusAuctionRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - AuctionMappingId uint64 `protobuf:"varint,2,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` - AuctionId uint64 `protobuf:"varint,3,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - History bool `protobuf:"varint,4,opt,name=history,proto3" json:"history,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,5,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryBiddingsForSurplusAuctionRequest) Reset() { *m = QueryBiddingsForSurplusAuctionRequest{} } -func (m *QueryBiddingsForSurplusAuctionRequest) String() string { return proto.CompactTextString(m) } -func (*QueryBiddingsForSurplusAuctionRequest) ProtoMessage() {} -func (*QueryBiddingsForSurplusAuctionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{18} -} -func (m *QueryBiddingsForSurplusAuctionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryBiddingsForSurplusAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryBiddingsForSurplusAuctionRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryBiddingsForSurplusAuctionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryBiddingsForSurplusAuctionRequest.Merge(m, src) -} -func (m *QueryBiddingsForSurplusAuctionRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryBiddingsForSurplusAuctionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryBiddingsForSurplusAuctionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryBiddingsForSurplusAuctionRequest proto.InternalMessageInfo - -type QueryBiddingsForSurplusAuctionResponse struct { - Biddings []SurplusBiddings `protobuf:"bytes,1,rep,name=biddings,proto3" json:"biddings" yaml:"biddings"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryBiddingsForSurplusAuctionResponse) Reset() { - *m = QueryBiddingsForSurplusAuctionResponse{} -} -func (m *QueryBiddingsForSurplusAuctionResponse) String() string { return proto.CompactTextString(m) } -func (*QueryBiddingsForSurplusAuctionResponse) ProtoMessage() {} -func (*QueryBiddingsForSurplusAuctionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{19} -} -func (m *QueryBiddingsForSurplusAuctionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryBiddingsForSurplusAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryBiddingsForSurplusAuctionResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryBiddingsForSurplusAuctionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryBiddingsForSurplusAuctionResponse.Merge(m, src) -} -func (m *QueryBiddingsForSurplusAuctionResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryBiddingsForSurplusAuctionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryBiddingsForSurplusAuctionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryBiddingsForSurplusAuctionResponse proto.InternalMessageInfo - -type QueryProtocolStatisticsRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryProtocolStatisticsRequest) Reset() { *m = QueryProtocolStatisticsRequest{} } -func (m *QueryProtocolStatisticsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryProtocolStatisticsRequest) ProtoMessage() {} -func (*QueryProtocolStatisticsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{20} -} -func (m *QueryProtocolStatisticsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryProtocolStatisticsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryProtocolStatisticsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryProtocolStatisticsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProtocolStatisticsRequest.Merge(m, src) -} -func (m *QueryProtocolStatisticsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryProtocolStatisticsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProtocolStatisticsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryProtocolStatisticsRequest proto.InternalMessageInfo - -type QueryProtocolStatisticsResponse struct { - Stats []ProtocolStatistics `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats" yaml:"ProtocolStatistics"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryProtocolStatisticsResponse) Reset() { *m = QueryProtocolStatisticsResponse{} } -func (m *QueryProtocolStatisticsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryProtocolStatisticsResponse) ProtoMessage() {} -func (*QueryProtocolStatisticsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{21} -} -func (m *QueryProtocolStatisticsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryProtocolStatisticsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryProtocolStatisticsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryProtocolStatisticsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProtocolStatisticsResponse.Merge(m, src) -} -func (m *QueryProtocolStatisticsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryProtocolStatisticsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProtocolStatisticsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryProtocolStatisticsResponse proto.InternalMessageInfo - -type QueryGenericAuctionParamRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` -} - -func (m *QueryGenericAuctionParamRequest) Reset() { *m = QueryGenericAuctionParamRequest{} } -func (m *QueryGenericAuctionParamRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGenericAuctionParamRequest) ProtoMessage() {} -func (*QueryGenericAuctionParamRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{22} -} -func (m *QueryGenericAuctionParamRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGenericAuctionParamRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGenericAuctionParamRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryGenericAuctionParamRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGenericAuctionParamRequest.Merge(m, src) -} -func (m *QueryGenericAuctionParamRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGenericAuctionParamRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGenericAuctionParamRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGenericAuctionParamRequest proto.InternalMessageInfo - -type QueryGenericAuctionParamResponse struct { - AuctionParams AuctionParams `protobuf:"bytes,1,opt,name=auctionParams,proto3" json:"auctionParams" yaml:"auction_params"` -} - -func (m *QueryGenericAuctionParamResponse) Reset() { *m = QueryGenericAuctionParamResponse{} } -func (m *QueryGenericAuctionParamResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGenericAuctionParamResponse) ProtoMessage() {} -func (*QueryGenericAuctionParamResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{23} -} -func (m *QueryGenericAuctionParamResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGenericAuctionParamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGenericAuctionParamResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryGenericAuctionParamResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGenericAuctionParamResponse.Merge(m, src) -} -func (m *QueryGenericAuctionParamResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGenericAuctionParamResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGenericAuctionParamResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGenericAuctionParamResponse proto.InternalMessageInfo - -type QueryDutchLendAuctionRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - AuctionMappingId uint64 `protobuf:"varint,2,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` - AuctionId uint64 `protobuf:"varint,3,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - History bool `protobuf:"varint,4,opt,name=history,proto3" json:"history,omitempty"` -} - -func (m *QueryDutchLendAuctionRequest) Reset() { *m = QueryDutchLendAuctionRequest{} } -func (m *QueryDutchLendAuctionRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDutchLendAuctionRequest) ProtoMessage() {} -func (*QueryDutchLendAuctionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{24} -} -func (m *QueryDutchLendAuctionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDutchLendAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDutchLendAuctionRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDutchLendAuctionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDutchLendAuctionRequest.Merge(m, src) -} -func (m *QueryDutchLendAuctionRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDutchLendAuctionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDutchLendAuctionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDutchLendAuctionRequest proto.InternalMessageInfo - -type QueryDutchLendAuctionResponse struct { - Auction DutchAuction `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction" yaml:"auction"` -} - -func (m *QueryDutchLendAuctionResponse) Reset() { *m = QueryDutchLendAuctionResponse{} } -func (m *QueryDutchLendAuctionResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDutchLendAuctionResponse) ProtoMessage() {} -func (*QueryDutchLendAuctionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{25} -} -func (m *QueryDutchLendAuctionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDutchLendAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDutchLendAuctionResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDutchLendAuctionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDutchLendAuctionResponse.Merge(m, src) -} -func (m *QueryDutchLendAuctionResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDutchLendAuctionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDutchLendAuctionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDutchLendAuctionResponse proto.InternalMessageInfo - -type QueryDutchLendAuctionsRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - History bool `protobuf:"varint,2,opt,name=history,proto3" json:"history,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryDutchLendAuctionsRequest) Reset() { *m = QueryDutchLendAuctionsRequest{} } -func (m *QueryDutchLendAuctionsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDutchLendAuctionsRequest) ProtoMessage() {} -func (*QueryDutchLendAuctionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{26} -} -func (m *QueryDutchLendAuctionsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDutchLendAuctionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDutchLendAuctionsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDutchLendAuctionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDutchLendAuctionsRequest.Merge(m, src) -} -func (m *QueryDutchLendAuctionsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDutchLendAuctionsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDutchLendAuctionsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDutchLendAuctionsRequest proto.InternalMessageInfo - -type QueryDutchLendAuctionsResponse struct { - Auctions []DutchAuction `protobuf:"bytes,1,rep,name=auctions,proto3" json:"auctions" yaml:"auctions"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryDutchLendAuctionsResponse) Reset() { *m = QueryDutchLendAuctionsResponse{} } -func (m *QueryDutchLendAuctionsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDutchLendAuctionsResponse) ProtoMessage() {} -func (*QueryDutchLendAuctionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{27} -} -func (m *QueryDutchLendAuctionsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDutchLendAuctionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDutchLendAuctionsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDutchLendAuctionsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDutchLendAuctionsResponse.Merge(m, src) -} -func (m *QueryDutchLendAuctionsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDutchLendAuctionsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDutchLendAuctionsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDutchLendAuctionsResponse proto.InternalMessageInfo - -type QueryDutchLendBiddingsRequest struct { - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` - AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - History bool `protobuf:"varint,3,opt,name=history,proto3" json:"history,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryDutchLendBiddingsRequest) Reset() { *m = QueryDutchLendBiddingsRequest{} } -func (m *QueryDutchLendBiddingsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDutchLendBiddingsRequest) ProtoMessage() {} -func (*QueryDutchLendBiddingsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{28} -} -func (m *QueryDutchLendBiddingsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDutchLendBiddingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDutchLendBiddingsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDutchLendBiddingsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDutchLendBiddingsRequest.Merge(m, src) -} -func (m *QueryDutchLendBiddingsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDutchLendBiddingsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDutchLendBiddingsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDutchLendBiddingsRequest proto.InternalMessageInfo - -type QueryDutchLendBiddingsResponse struct { - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` - Biddings []DutchBiddings `protobuf:"bytes,2,rep,name=biddings,proto3" json:"biddings" yaml:"biddings"` - Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryDutchLendBiddingsResponse) Reset() { *m = QueryDutchLendBiddingsResponse{} } -func (m *QueryDutchLendBiddingsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDutchLendBiddingsResponse) ProtoMessage() {} -func (*QueryDutchLendBiddingsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{29} -} -func (m *QueryDutchLendBiddingsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDutchLendBiddingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDutchLendBiddingsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryDutchLendBiddingsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDutchLendBiddingsResponse.Merge(m, src) -} -func (m *QueryDutchLendBiddingsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDutchLendBiddingsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDutchLendBiddingsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDutchLendBiddingsResponse proto.InternalMessageInfo - -type QueryFilterDutchAuctionsRequest struct { - AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - Denom []string `protobuf:"bytes,2,rep,name=denom,proto3" json:"denom,omitempty"` - History bool `protobuf:"varint,3,opt,name=history,proto3" json:"history,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryFilterDutchAuctionsRequest) Reset() { *m = QueryFilterDutchAuctionsRequest{} } -func (m *QueryFilterDutchAuctionsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryFilterDutchAuctionsRequest) ProtoMessage() {} -func (*QueryFilterDutchAuctionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{30} -} -func (m *QueryFilterDutchAuctionsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryFilterDutchAuctionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryFilterDutchAuctionsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryFilterDutchAuctionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryFilterDutchAuctionsRequest.Merge(m, src) -} -func (m *QueryFilterDutchAuctionsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryFilterDutchAuctionsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryFilterDutchAuctionsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryFilterDutchAuctionsRequest proto.InternalMessageInfo - -type QueryFilterDutchAuctionsResponse struct { - Auctions []DutchAuction `protobuf:"bytes,1,rep,name=auctions,proto3" json:"auctions" yaml:"auctions"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryFilterDutchAuctionsResponse) Reset() { *m = QueryFilterDutchAuctionsResponse{} } -func (m *QueryFilterDutchAuctionsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryFilterDutchAuctionsResponse) ProtoMessage() {} -func (*QueryFilterDutchAuctionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5ff4a64a3f291f95, []int{31} -} -func (m *QueryFilterDutchAuctionsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryFilterDutchAuctionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryFilterDutchAuctionsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryFilterDutchAuctionsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryFilterDutchAuctionsResponse.Merge(m, src) -} -func (m *QueryFilterDutchAuctionsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryFilterDutchAuctionsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryFilterDutchAuctionsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryFilterDutchAuctionsResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*QuerySurplusAuctionRequest)(nil), "comdex.auction.v1beta1.QuerySurplusAuctionRequest") - proto.RegisterType((*QuerySurplusAuctionResponse)(nil), "comdex.auction.v1beta1.QuerySurplusAuctionResponse") - proto.RegisterType((*QuerySurplusAuctionsRequest)(nil), "comdex.auction.v1beta1.QuerySurplusAuctionsRequest") - proto.RegisterType((*QuerySurplusAuctionsResponse)(nil), "comdex.auction.v1beta1.QuerySurplusAuctionsResponse") - proto.RegisterType((*QuerySurplusBiddingsRequest)(nil), "comdex.auction.v1beta1.QuerySurplusBiddingsRequest") - proto.RegisterType((*QuerySurplusBiddingsResponse)(nil), "comdex.auction.v1beta1.QuerySurplusBiddingsResponse") - proto.RegisterType((*QueryDebtAuctionRequest)(nil), "comdex.auction.v1beta1.QueryDebtAuctionRequest") - proto.RegisterType((*QueryDebtAuctionResponse)(nil), "comdex.auction.v1beta1.QueryDebtAuctionResponse") - proto.RegisterType((*QueryDebtAuctionsRequest)(nil), "comdex.auction.v1beta1.QueryDebtAuctionsRequest") - proto.RegisterType((*QueryDebtAuctionsResponse)(nil), "comdex.auction.v1beta1.QueryDebtAuctionsResponse") - proto.RegisterType((*QueryDebtBiddingsRequest)(nil), "comdex.auction.v1beta1.QueryDebtBiddingsRequest") - proto.RegisterType((*QueryDebtBiddingsResponse)(nil), "comdex.auction.v1beta1.QueryDebtBiddingsResponse") - proto.RegisterType((*QueryDutchAuctionRequest)(nil), "comdex.auction.v1beta1.QueryDutchAuctionRequest") - proto.RegisterType((*QueryDutchAuctionResponse)(nil), "comdex.auction.v1beta1.QueryDutchAuctionResponse") - proto.RegisterType((*QueryDutchAuctionsRequest)(nil), "comdex.auction.v1beta1.QueryDutchAuctionsRequest") - proto.RegisterType((*QueryDutchAuctionsResponse)(nil), "comdex.auction.v1beta1.QueryDutchAuctionsResponse") - proto.RegisterType((*QueryDutchBiddingsRequest)(nil), "comdex.auction.v1beta1.QueryDutchBiddingsRequest") - proto.RegisterType((*QueryDutchBiddingsResponse)(nil), "comdex.auction.v1beta1.QueryDutchBiddingsResponse") - proto.RegisterType((*QueryBiddingsForSurplusAuctionRequest)(nil), "comdex.auction.v1beta1.QueryBiddingsForSurplusAuctionRequest") - proto.RegisterType((*QueryBiddingsForSurplusAuctionResponse)(nil), "comdex.auction.v1beta1.QueryBiddingsForSurplusAuctionResponse") - proto.RegisterType((*QueryProtocolStatisticsRequest)(nil), "comdex.auction.v1beta1.QueryProtocolStatisticsRequest") - proto.RegisterType((*QueryProtocolStatisticsResponse)(nil), "comdex.auction.v1beta1.QueryProtocolStatisticsResponse") - proto.RegisterType((*QueryGenericAuctionParamRequest)(nil), "comdex.auction.v1beta1.QueryGenericAuctionParamRequest") - proto.RegisterType((*QueryGenericAuctionParamResponse)(nil), "comdex.auction.v1beta1.QueryGenericAuctionParamResponse") - proto.RegisterType((*QueryDutchLendAuctionRequest)(nil), "comdex.auction.v1beta1.QueryDutchLendAuctionRequest") - proto.RegisterType((*QueryDutchLendAuctionResponse)(nil), "comdex.auction.v1beta1.QueryDutchLendAuctionResponse") - proto.RegisterType((*QueryDutchLendAuctionsRequest)(nil), "comdex.auction.v1beta1.QueryDutchLendAuctionsRequest") - proto.RegisterType((*QueryDutchLendAuctionsResponse)(nil), "comdex.auction.v1beta1.QueryDutchLendAuctionsResponse") - proto.RegisterType((*QueryDutchLendBiddingsRequest)(nil), "comdex.auction.v1beta1.QueryDutchLendBiddingsRequest") - proto.RegisterType((*QueryDutchLendBiddingsResponse)(nil), "comdex.auction.v1beta1.QueryDutchLendBiddingsResponse") - proto.RegisterType((*QueryFilterDutchAuctionsRequest)(nil), "comdex.auction.v1beta1.QueryFilterDutchAuctionsRequest") - proto.RegisterType((*QueryFilterDutchAuctionsResponse)(nil), "comdex.auction.v1beta1.QueryFilterDutchAuctionsResponse") -} - -func init() { - proto.RegisterFile("comdex/auction/v1beta1/query.proto", fileDescriptor_5ff4a64a3f291f95) -} - -var fileDescriptor_5ff4a64a3f291f95 = []byte{ - // 1478 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x5d, 0x4f, 0x1c, 0x55, - 0x18, 0xde, 0xb3, 0x7c, 0x14, 0x8e, 0xa9, 0x96, 0x23, 0xd0, 0x65, 0x2d, 0x0b, 0x8e, 0xa5, 0xad, - 0x8d, 0xee, 0x16, 0x5a, 0x29, 0x92, 0x46, 0xdb, 0x6d, 0x4b, 0x4b, 0xb4, 0x06, 0x97, 0x68, 0x0a, - 0x88, 0x38, 0xbb, 0x33, 0x2c, 0x63, 0x76, 0x77, 0xa6, 0x3b, 0xb3, 0x2a, 0x21, 0x5c, 0xf8, 0x91, - 0x78, 0x67, 0x4c, 0x4c, 0xd4, 0x18, 0x7f, 0x80, 0xd1, 0x18, 0xaf, 0xbd, 0xf0, 0x06, 0x53, 0xcb, - 0x4d, 0x0d, 0x89, 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, 0x94, 0x49, 0x01, 0x3d, 0x05, 0x11, 0xc1, - 0xb0, 0x50, 0xe5, 0x15, 0x45, 0xaa, 0x95, 0xf5, 0x25, 0x49, 0xbc, 0xe4, 0x08, 0xf9, 0xe7, 0x86, - 0xf1, 0xc7, 0xa4, 0x80, 0xfa, 0x21, 0xa4, 0xab, 0x25, 0x21, 0xd5, 0x82, 0x57, 0x75, 0x92, 0x33, - 0x93, 0x02, 0x4a, 0xc1, 0x43, 0x4b, 0x92, 0xaa, 0xc9, 0xf5, 0xe5, 0x54, 0xeb, 0x20, 0x38, 0xd5, - 0x51, 0xa0, 0x87, 0xdc, 0xdb, 0xf0, 0x31, 0x4f, 0x6c, 0xaa, 0x22, 0xd7, 0x54, 0x11, 0xdd, 0x84, - 0x87, 0x48, 0x16, 0x8c, 0xee, 0xa1, 0x91, 0x13, 0x59, 0x6f, 0x49, 0xb2, 0xf6, 0x04, 0xf9, 0xde, - 0xf5, 0xcd, 0x81, 0xc4, 0xce, 0xe6, 0xc0, 0xc3, 0xcb, 0x7c, 0xb5, 0x32, 0xce, 0x91, 0xd5, 0x5c, - 0x81, 0xa6, 0xe3, 0xbe, 0x05, 0x9e, 0x57, 0x56, 0x03, 0xca, 0x62, 0x61, 0x92, 0xb4, 0x31, 0x41, - 0xf3, 0x10, 0x36, 0x4b, 0x8f, 0x4b, 0x60, 0xa0, 0xd5, 0x75, 0xca, 0xea, 0x3a, 0x65, 0x8d, 0xce, - 0xa2, 0x80, 0xa7, 0xf8, 0xb2, 0x48, 0x2e, 0x96, 0xef, 0xd9, 0xd9, 0x1c, 0xe8, 0x32, 0x90, 0x36, - 0x73, 0x70, 0x05, 0x4b, 0x42, 0xee, 0x3e, 0x80, 0xc7, 0xbc, 0xf1, 0x92, 0x52, 0xcd, 0xc1, 0x0e, - 0xc2, 0x4d, 0x4d, 0x81, 0xc1, 0x96, 0x08, 0xb5, 0x3a, 0x4a, 0x6a, 0xf5, 0x88, 0xad, 0x56, 0x2a, - 0x57,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36, 0x80, 0xdd, 0x5e, 0x3b, 0xe4, 0x28, 0x0a, 0x64, 0xda, 0xc3, - 0xe9, 0x73, 0xd1, 0x82, 0x08, 0xd1, 0x3c, 0x26, 0x7a, 0x01, 0x8d, 0x87, 0x23, 0xaa, 0x5a, 0x98, - 0x9a, 0x3c, 0x7e, 0x76, 0xf0, 0xa0, 0x77, 0x7f, 0x38, 0x1e, 0x0e, 0x87, 0x0d, 0xc7, 0xc3, 0x69, - 0x66, 0xdc, 0x0b, 0x98, 0xc7, 0x55, 0x74, 0x39, 0x80, 0x07, 0xb5, 0x9d, 0xdc, 0x8a, 0x61, 0x6d, - 0xab, 0x5e, 0x84, 0xee, 0x01, 0x78, 0xc4, 0xb9, 0xe1, 0x87, 0x72, 0xbe, 0xb8, 0xdc, 0x9b, 0xc6, - 0xe9, 0x33, 0xe1, 0x03, 0x08, 0x89, 0x37, 0x30, 0x89, 0x59, 0x74, 0x93, 0x45, 0x42, 0x10, 0x8b, - 0xda, 0xae, 0x5a, 0xee, 0x7b, 0x00, 0xbb, 0x5c, 0x5b, 0x99, 0x28, 0x34, 0x52, 0x53, 0xa4, 0xe1, - 0x08, 0x11, 0x84, 0xdc, 0xf3, 0x98, 0xdc, 0xb3, 0xe8, 0x7c, 0x08, 0x72, 0x9e, 0x6d, 0xb6, 0x66, - 0xc5, 0x6e, 0xf6, 0x58, 0x30, 0x76, 0x67, 0x83, 0x0d, 0x47, 0x88, 0x20, 0xd8, 0xaf, 0x63, 0xec, - 0x79, 0x74, 0xd1, 0x0f, 0x7b, 0xa8, 0xd6, 0xba, 0x6f, 0x92, 0xb0, 0x98, 0x6f, 0x10, 0x09, 0xf7, - 0xae, 0x5e, 0x10, 0x09, 0x8f, 0xdd, 0x36, 0x8e, 0xc7, 0x24, 0xe6, 0xd0, 0x0c, 0x93, 0x84, 0x1e, - 0xb5, 0xab, 0xf6, 0xfa, 0x01, 0x40, 0xe4, 0xde, 0xca, 0x42, 0xe1, 0xc1, 0x9a, 0x22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3e, 0xa1, 0x4c, 0xe2, 0x01, 0xfd, 0x6c, 0xe4, 0x31, 0x4f, 0x04, 0xdc, 0x5e, 0xec, 0x59, - 0x2a, 0xe0, 0xf6, 0xf2, 0x19, 0x5d, 0xb8, 0x97, 0x30, 0xbd, 0xeb, 0x68, 0x82, 0x45, 0x6f, 0x11, - 0x07, 0xb3, 0x5c, 0x1c, 0x4f, 0x67, 0x16, 0x7e, 0xf9, 0xe9, 0xf5, 0x3f, 0x33, 0x89, 0xaf, 0xb6, - 0x32, 0x89, 0xf5, 0xad, 0x0c, 0xd8, 0xd8, 0xca, 0x80, 0x3f, 0xb6, 0x32, 0xe0, 0xe3, 0xed, 0x4c, - 0x62, 0x63, 0x3b, 0x93, 0xf8, 0x7d, 0x3b, 0x93, 0x98, 0x1d, 0x2e, 0x4b, 0xda, 0x52, 0xa3, 0xa8, - 0x23, 0x26, 0xd7, 0x7c, 0x5a, 0x5e, 0x5c, 0x94, 0x4a, 0x12, 0x5f, 0xa1, 0x18, 0x9a, 0x28, 0xb4, - 0x65, 0x45, 0x54, 0x8b, 0xed, 0xd8, 0xac, 0xce, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xb1, 0xd3, - 0x79, 0x93, 0x8e, 0x25, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - QuerySurplusAuction(ctx context.Context, in *QuerySurplusAuctionRequest, opts ...grpc.CallOption) (*QuerySurplusAuctionResponse, error) - QuerySurplusAuctions(ctx context.Context, in *QuerySurplusAuctionsRequest, opts ...grpc.CallOption) (*QuerySurplusAuctionsResponse, error) - QuerySurplusBiddings(ctx context.Context, in *QuerySurplusBiddingsRequest, opts ...grpc.CallOption) (*QuerySurplusBiddingsResponse, error) - QueryDebtAuction(ctx context.Context, in *QueryDebtAuctionRequest, opts ...grpc.CallOption) (*QueryDebtAuctionResponse, error) - QueryDebtAuctions(ctx context.Context, in *QueryDebtAuctionsRequest, opts ...grpc.CallOption) (*QueryDebtAuctionsResponse, error) - QueryDebtBiddings(ctx context.Context, in *QueryDebtBiddingsRequest, opts ...grpc.CallOption) (*QueryDebtBiddingsResponse, error) - QueryDutchAuction(ctx context.Context, in *QueryDutchAuctionRequest, opts ...grpc.CallOption) (*QueryDutchAuctionResponse, error) - QueryDutchAuctions(ctx context.Context, in *QueryDutchAuctionsRequest, opts ...grpc.CallOption) (*QueryDutchAuctionsResponse, error) - QueryDutchBiddings(ctx context.Context, in *QueryDutchBiddingsRequest, opts ...grpc.CallOption) (*QueryDutchBiddingsResponse, error) - QueryProtocolStatistics(ctx context.Context, in *QueryProtocolStatisticsRequest, opts ...grpc.CallOption) (*QueryProtocolStatisticsResponse, error) - QueryGenericAuctionParams(ctx context.Context, in *QueryGenericAuctionParamRequest, opts ...grpc.CallOption) (*QueryGenericAuctionParamResponse, error) - QueryDutchLendAuction(ctx context.Context, in *QueryDutchLendAuctionRequest, opts ...grpc.CallOption) (*QueryDutchLendAuctionResponse, error) - QueryDutchLendAuctions(ctx context.Context, in *QueryDutchLendAuctionsRequest, opts ...grpc.CallOption) (*QueryDutchLendAuctionsResponse, error) - QueryDutchLendBiddings(ctx context.Context, in *QueryDutchLendBiddingsRequest, opts ...grpc.CallOption) (*QueryDutchLendBiddingsResponse, error) - QueryFilterDutchAuctions(ctx context.Context, in *QueryFilterDutchAuctionsRequest, opts ...grpc.CallOption) (*QueryFilterDutchAuctionsResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) QuerySurplusAuction(ctx context.Context, in *QuerySurplusAuctionRequest, opts ...grpc.CallOption) (*QuerySurplusAuctionResponse, error) { - out := new(QuerySurplusAuctionResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QuerySurplusAuction", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QuerySurplusAuctions(ctx context.Context, in *QuerySurplusAuctionsRequest, opts ...grpc.CallOption) (*QuerySurplusAuctionsResponse, error) { - out := new(QuerySurplusAuctionsResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QuerySurplusAuctions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QuerySurplusBiddings(ctx context.Context, in *QuerySurplusBiddingsRequest, opts ...grpc.CallOption) (*QuerySurplusBiddingsResponse, error) { - out := new(QuerySurplusBiddingsResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QuerySurplusBiddings", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDebtAuction(ctx context.Context, in *QueryDebtAuctionRequest, opts ...grpc.CallOption) (*QueryDebtAuctionResponse, error) { - out := new(QueryDebtAuctionResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDebtAuction", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDebtAuctions(ctx context.Context, in *QueryDebtAuctionsRequest, opts ...grpc.CallOption) (*QueryDebtAuctionsResponse, error) { - out := new(QueryDebtAuctionsResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDebtAuctions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDebtBiddings(ctx context.Context, in *QueryDebtBiddingsRequest, opts ...grpc.CallOption) (*QueryDebtBiddingsResponse, error) { - out := new(QueryDebtBiddingsResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDebtBiddings", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDutchAuction(ctx context.Context, in *QueryDutchAuctionRequest, opts ...grpc.CallOption) (*QueryDutchAuctionResponse, error) { - out := new(QueryDutchAuctionResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDutchAuction", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDutchAuctions(ctx context.Context, in *QueryDutchAuctionsRequest, opts ...grpc.CallOption) (*QueryDutchAuctionsResponse, error) { - out := new(QueryDutchAuctionsResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDutchAuctions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDutchBiddings(ctx context.Context, in *QueryDutchBiddingsRequest, opts ...grpc.CallOption) (*QueryDutchBiddingsResponse, error) { - out := new(QueryDutchBiddingsResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDutchBiddings", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryProtocolStatistics(ctx context.Context, in *QueryProtocolStatisticsRequest, opts ...grpc.CallOption) (*QueryProtocolStatisticsResponse, error) { - out := new(QueryProtocolStatisticsResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryProtocolStatistics", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryGenericAuctionParams(ctx context.Context, in *QueryGenericAuctionParamRequest, opts ...grpc.CallOption) (*QueryGenericAuctionParamResponse, error) { - out := new(QueryGenericAuctionParamResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryGenericAuctionParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDutchLendAuction(ctx context.Context, in *QueryDutchLendAuctionRequest, opts ...grpc.CallOption) (*QueryDutchLendAuctionResponse, error) { - out := new(QueryDutchLendAuctionResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDutchLendAuction", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDutchLendAuctions(ctx context.Context, in *QueryDutchLendAuctionsRequest, opts ...grpc.CallOption) (*QueryDutchLendAuctionsResponse, error) { - out := new(QueryDutchLendAuctionsResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDutchLendAuctions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryDutchLendBiddings(ctx context.Context, in *QueryDutchLendBiddingsRequest, opts ...grpc.CallOption) (*QueryDutchLendBiddingsResponse, error) { - out := new(QueryDutchLendBiddingsResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryDutchLendBiddings", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryFilterDutchAuctions(ctx context.Context, in *QueryFilterDutchAuctionsRequest, opts ...grpc.CallOption) (*QueryFilterDutchAuctionsResponse, error) { - out := new(QueryFilterDutchAuctionsResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Query/QueryFilterDutchAuctions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - QuerySurplusAuction(context.Context, *QuerySurplusAuctionRequest) (*QuerySurplusAuctionResponse, error) - QuerySurplusAuctions(context.Context, *QuerySurplusAuctionsRequest) (*QuerySurplusAuctionsResponse, error) - QuerySurplusBiddings(context.Context, *QuerySurplusBiddingsRequest) (*QuerySurplusBiddingsResponse, error) - QueryDebtAuction(context.Context, *QueryDebtAuctionRequest) (*QueryDebtAuctionResponse, error) - QueryDebtAuctions(context.Context, *QueryDebtAuctionsRequest) (*QueryDebtAuctionsResponse, error) - QueryDebtBiddings(context.Context, *QueryDebtBiddingsRequest) (*QueryDebtBiddingsResponse, error) - QueryDutchAuction(context.Context, *QueryDutchAuctionRequest) (*QueryDutchAuctionResponse, error) - QueryDutchAuctions(context.Context, *QueryDutchAuctionsRequest) (*QueryDutchAuctionsResponse, error) - QueryDutchBiddings(context.Context, *QueryDutchBiddingsRequest) (*QueryDutchBiddingsResponse, error) - QueryProtocolStatistics(context.Context, *QueryProtocolStatisticsRequest) (*QueryProtocolStatisticsResponse, error) - QueryGenericAuctionParams(context.Context, *QueryGenericAuctionParamRequest) (*QueryGenericAuctionParamResponse, error) - QueryDutchLendAuction(context.Context, *QueryDutchLendAuctionRequest) (*QueryDutchLendAuctionResponse, error) - QueryDutchLendAuctions(context.Context, *QueryDutchLendAuctionsRequest) (*QueryDutchLendAuctionsResponse, error) - QueryDutchLendBiddings(context.Context, *QueryDutchLendBiddingsRequest) (*QueryDutchLendBiddingsResponse, error) - QueryFilterDutchAuctions(context.Context, *QueryFilterDutchAuctionsRequest) (*QueryFilterDutchAuctionsResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) QuerySurplusAuction(ctx context.Context, req *QuerySurplusAuctionRequest) (*QuerySurplusAuctionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QuerySurplusAuction not implemented") -} -func (*UnimplementedQueryServer) QuerySurplusAuctions(ctx context.Context, req *QuerySurplusAuctionsRequest) (*QuerySurplusAuctionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QuerySurplusAuctions not implemented") -} -func (*UnimplementedQueryServer) QuerySurplusBiddings(ctx context.Context, req *QuerySurplusBiddingsRequest) (*QuerySurplusBiddingsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QuerySurplusBiddings not implemented") -} -func (*UnimplementedQueryServer) QueryDebtAuction(ctx context.Context, req *QueryDebtAuctionRequest) (*QueryDebtAuctionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDebtAuction not implemented") -} -func (*UnimplementedQueryServer) QueryDebtAuctions(ctx context.Context, req *QueryDebtAuctionsRequest) (*QueryDebtAuctionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDebtAuctions not implemented") -} -func (*UnimplementedQueryServer) QueryDebtBiddings(ctx context.Context, req *QueryDebtBiddingsRequest) (*QueryDebtBiddingsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDebtBiddings not implemented") -} -func (*UnimplementedQueryServer) QueryDutchAuction(ctx context.Context, req *QueryDutchAuctionRequest) (*QueryDutchAuctionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDutchAuction not implemented") -} -func (*UnimplementedQueryServer) QueryDutchAuctions(ctx context.Context, req *QueryDutchAuctionsRequest) (*QueryDutchAuctionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDutchAuctions not implemented") -} -func (*UnimplementedQueryServer) QueryDutchBiddings(ctx context.Context, req *QueryDutchBiddingsRequest) (*QueryDutchBiddingsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDutchBiddings not implemented") -} -func (*UnimplementedQueryServer) QueryProtocolStatistics(ctx context.Context, req *QueryProtocolStatisticsRequest) (*QueryProtocolStatisticsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryProtocolStatistics not implemented") -} -func (*UnimplementedQueryServer) QueryGenericAuctionParams(ctx context.Context, req *QueryGenericAuctionParamRequest) (*QueryGenericAuctionParamResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryGenericAuctionParams not implemented") -} -func (*UnimplementedQueryServer) QueryDutchLendAuction(ctx context.Context, req *QueryDutchLendAuctionRequest) (*QueryDutchLendAuctionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDutchLendAuction not implemented") -} -func (*UnimplementedQueryServer) QueryDutchLendAuctions(ctx context.Context, req *QueryDutchLendAuctionsRequest) (*QueryDutchLendAuctionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDutchLendAuctions not implemented") -} -func (*UnimplementedQueryServer) QueryDutchLendBiddings(ctx context.Context, req *QueryDutchLendBiddingsRequest) (*QueryDutchLendBiddingsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryDutchLendBiddings not implemented") -} -func (*UnimplementedQueryServer) QueryFilterDutchAuctions(ctx context.Context, req *QueryFilterDutchAuctionsRequest) (*QueryFilterDutchAuctionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryFilterDutchAuctions not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_QuerySurplusAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySurplusAuctionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QuerySurplusAuction(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QuerySurplusAuction", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QuerySurplusAuction(ctx, req.(*QuerySurplusAuctionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QuerySurplusAuctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySurplusAuctionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QuerySurplusAuctions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QuerySurplusAuctions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QuerySurplusAuctions(ctx, req.(*QuerySurplusAuctionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QuerySurplusBiddings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySurplusBiddingsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QuerySurplusBiddings(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QuerySurplusBiddings", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QuerySurplusBiddings(ctx, req.(*QuerySurplusBiddingsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDebtAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDebtAuctionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDebtAuction(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QueryDebtAuction", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDebtAuction(ctx, req.(*QueryDebtAuctionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDebtAuctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDebtAuctionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDebtAuctions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QueryDebtAuctions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDebtAuctions(ctx, req.(*QueryDebtAuctionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDebtBiddings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDebtBiddingsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDebtBiddings(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QueryDebtBiddings", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDebtBiddings(ctx, req.(*QueryDebtBiddingsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDutchAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDutchAuctionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDutchAuction(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QueryDutchAuction", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDutchAuction(ctx, req.(*QueryDutchAuctionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDutchAuctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDutchAuctionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDutchAuctions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QueryDutchAuctions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDutchAuctions(ctx, req.(*QueryDutchAuctionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDutchBiddings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDutchBiddingsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDutchBiddings(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QueryDutchBiddings", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDutchBiddings(ctx, req.(*QueryDutchBiddingsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryProtocolStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryProtocolStatisticsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryProtocolStatistics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QueryProtocolStatistics", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryProtocolStatistics(ctx, req.(*QueryProtocolStatisticsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryGenericAuctionParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGenericAuctionParamRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryGenericAuctionParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QueryGenericAuctionParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryGenericAuctionParams(ctx, req.(*QueryGenericAuctionParamRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDutchLendAuction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDutchLendAuctionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDutchLendAuction(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QueryDutchLendAuction", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDutchLendAuction(ctx, req.(*QueryDutchLendAuctionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDutchLendAuctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDutchLendAuctionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDutchLendAuctions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QueryDutchLendAuctions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDutchLendAuctions(ctx, req.(*QueryDutchLendAuctionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryDutchLendBiddings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDutchLendBiddingsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryDutchLendBiddings(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QueryDutchLendBiddings", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryDutchLendBiddings(ctx, req.(*QueryDutchLendBiddingsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryFilterDutchAuctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryFilterDutchAuctionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryFilterDutchAuctions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Query/QueryFilterDutchAuctions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryFilterDutchAuctions(ctx, req.(*QueryFilterDutchAuctionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.auction.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "QuerySurplusAuction", - Handler: _Query_QuerySurplusAuction_Handler, - }, - { - MethodName: "QuerySurplusAuctions", - Handler: _Query_QuerySurplusAuctions_Handler, - }, - { - MethodName: "QuerySurplusBiddings", - Handler: _Query_QuerySurplusBiddings_Handler, - }, - { - MethodName: "QueryDebtAuction", - Handler: _Query_QueryDebtAuction_Handler, - }, - { - MethodName: "QueryDebtAuctions", - Handler: _Query_QueryDebtAuctions_Handler, - }, - { - MethodName: "QueryDebtBiddings", - Handler: _Query_QueryDebtBiddings_Handler, - }, - { - MethodName: "QueryDutchAuction", - Handler: _Query_QueryDutchAuction_Handler, - }, - { - MethodName: "QueryDutchAuctions", - Handler: _Query_QueryDutchAuctions_Handler, - }, - { - MethodName: "QueryDutchBiddings", - Handler: _Query_QueryDutchBiddings_Handler, - }, - { - MethodName: "QueryProtocolStatistics", - Handler: _Query_QueryProtocolStatistics_Handler, - }, - { - MethodName: "QueryGenericAuctionParams", - Handler: _Query_QueryGenericAuctionParams_Handler, - }, - { - MethodName: "QueryDutchLendAuction", - Handler: _Query_QueryDutchLendAuction_Handler, - }, - { - MethodName: "QueryDutchLendAuctions", - Handler: _Query_QueryDutchLendAuctions_Handler, - }, - { - MethodName: "QueryDutchLendBiddings", - Handler: _Query_QueryDutchLendBiddings_Handler, - }, - { - MethodName: "QueryFilterDutchAuctions", - Handler: _Query_QueryFilterDutchAuctions_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "comdex/auction/v1beta1/query.proto", -} - -func (m *QuerySurplusAuctionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QuerySurplusAuctionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySurplusAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.AuctionId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x18 - } - if m.AuctionMappingId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QuerySurplusAuctionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QuerySurplusAuctionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySurplusAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Auction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QuerySurplusAuctionsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QuerySurplusAuctionsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySurplusAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QuerySurplusAuctionsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QuerySurplusAuctionsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySurplusAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Auctions) > 0 { - for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QuerySurplusBiddingsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QuerySurplusBiddingsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySurplusBiddingsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x10 - } - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySurplusBiddingsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QuerySurplusBiddingsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySurplusBiddingsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Biddings) > 0 { - for iNdEx := len(m.Biddings) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Biddings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDebtAuctionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDebtAuctionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDebtAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.AuctionId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x18 - } - if m.AuctionMappingId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryDebtAuctionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDebtAuctionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDebtAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - { - size, err := m.Auction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryDebtAuctionsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDebtAuctionsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDebtAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryDebtAuctionsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDebtAuctionsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDebtAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Auctions) > 0 { - for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryDebtBiddingsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDebtBiddingsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDebtBiddingsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x10 - } - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDebtBiddingsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDebtBiddingsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDebtBiddingsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Biddings) > 0 { - for iNdEx := len(m.Biddings) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Biddings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDutchAuctionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDutchAuctionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDutchAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.AuctionId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x18 - } - if m.AuctionMappingId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryDutchAuctionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDutchAuctionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDutchAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Auction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryDutchAuctionsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDutchAuctionsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDutchAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryDutchAuctionsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDutchAuctionsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDutchAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Auctions) > 0 { - for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryDutchBiddingsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDutchBiddingsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDutchBiddingsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x10 - } - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDutchBiddingsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDutchBiddingsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDutchBiddingsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Biddings) > 0 { - for iNdEx := len(m.Biddings) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Biddings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryBiddingsForSurplusAuctionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryBiddingsForSurplusAuctionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryBiddingsForSurplusAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.AuctionId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x18 - } - if m.AuctionMappingId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryBiddingsForSurplusAuctionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryBiddingsForSurplusAuctionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryBiddingsForSurplusAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Biddings) > 0 { - for iNdEx := len(m.Biddings) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Biddings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryProtocolStatisticsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryProtocolStatisticsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryProtocolStatisticsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryProtocolStatisticsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryProtocolStatisticsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryProtocolStatisticsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Stats) > 0 { - for iNdEx := len(m.Stats) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Stats[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryGenericAuctionParamRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGenericAuctionParamRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGenericAuctionParamRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryGenericAuctionParamResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryGenericAuctionParamResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGenericAuctionParamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.AuctionParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryDutchLendAuctionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDutchLendAuctionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDutchLendAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.AuctionId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x18 - } - if m.AuctionMappingId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryDutchLendAuctionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDutchLendAuctionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDutchLendAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Auction.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryDutchLendAuctionsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDutchLendAuctionsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDutchLendAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryDutchLendAuctionsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDutchLendAuctionsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDutchLendAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Auctions) > 0 { - for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryDutchLendBiddingsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDutchLendBiddingsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDutchLendBiddingsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x10 - } - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDutchLendBiddingsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryDutchLendBiddingsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDutchLendBiddingsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Biddings) > 0 { - for iNdEx := len(m.Biddings) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Biddings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryFilterDutchAuctionsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryFilterDutchAuctionsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryFilterDutchAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.History { - i-- - if m.History { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.Denom) > 0 { - for iNdEx := len(m.Denom) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denom[iNdEx]) - copy(dAtA[i:], m.Denom[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if m.AppId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryFilterDutchAuctionsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryFilterDutchAuctionsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryFilterDutchAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Auctions) > 0 { - for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QuerySurplusAuctionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovQuery(uint64(m.AuctionMappingId)) - } - if m.AuctionId != 0 { - n += 1 + sovQuery(uint64(m.AuctionId)) - } - if m.History { - n += 2 - } - return n -} - -func (m *QuerySurplusAuctionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Auction.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QuerySurplusAuctionsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.History { - n += 2 - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySurplusAuctionsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Auctions) > 0 { - for _, e := range m.Auctions { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySurplusBiddingsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.History { - n += 2 - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySurplusBiddingsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if len(m.Biddings) > 0 { - for _, e := range m.Biddings { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDebtAuctionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovQuery(uint64(m.AuctionMappingId)) - } - if m.AuctionId != 0 { - n += 1 + sovQuery(uint64(m.AuctionId)) - } - if m.History { - n += 2 - } - return n -} - -func (m *QueryDebtAuctionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Auction.Size() - n += 1 + l + sovQuery(uint64(l)) - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDebtAuctionsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.History { - n += 2 - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDebtAuctionsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Auctions) > 0 { - for _, e := range m.Auctions { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDebtBiddingsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.History { - n += 2 - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDebtBiddingsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if len(m.Biddings) > 0 { - for _, e := range m.Biddings { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDutchAuctionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovQuery(uint64(m.AuctionMappingId)) - } - if m.AuctionId != 0 { - n += 1 + sovQuery(uint64(m.AuctionId)) - } - if m.History { - n += 2 - } - return n -} - -func (m *QueryDutchAuctionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Auction.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryDutchAuctionsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.History { - n += 2 - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDutchAuctionsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Auctions) > 0 { - for _, e := range m.Auctions { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDutchBiddingsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.History { - n += 2 - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDutchBiddingsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if len(m.Biddings) > 0 { - for _, e := range m.Biddings { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryBiddingsForSurplusAuctionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovQuery(uint64(m.AuctionMappingId)) - } - if m.AuctionId != 0 { - n += 1 + sovQuery(uint64(m.AuctionId)) - } - if m.History { - n += 2 - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryBiddingsForSurplusAuctionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Biddings) > 0 { - for _, e := range m.Biddings { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryProtocolStatisticsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryProtocolStatisticsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Stats) > 0 { - for _, e := range m.Stats { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGenericAuctionParamRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - return n -} - -func (m *QueryGenericAuctionParamResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.AuctionParams.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryDutchLendAuctionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovQuery(uint64(m.AuctionMappingId)) - } - if m.AuctionId != 0 { - n += 1 + sovQuery(uint64(m.AuctionId)) - } - if m.History { - n += 2 - } - return n -} - -func (m *QueryDutchLendAuctionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Auction.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryDutchLendAuctionsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.History { - n += 2 - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDutchLendAuctionsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Auctions) > 0 { - for _, e := range m.Auctions { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDutchLendBiddingsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if m.History { - n += 2 - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDutchLendBiddingsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if len(m.Biddings) > 0 { - for _, e := range m.Biddings { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryFilterDutchAuctionsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppId != 0 { - n += 1 + sovQuery(uint64(m.AppId)) - } - if len(m.Denom) > 0 { - for _, s := range m.Denom { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.History { - n += 2 - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryFilterDutchAuctionsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Auctions) > 0 { - for _, e := range m.Auctions { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QuerySurplusAuctionRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QuerySurplusAuctionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySurplusAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySurplusAuctionResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QuerySurplusAuctionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySurplusAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Auction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySurplusAuctionsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QuerySurplusAuctionsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySurplusAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySurplusAuctionsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QuerySurplusAuctionsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySurplusAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Auctions = append(m.Auctions, SurplusAuction{}) - if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySurplusBiddingsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QuerySurplusBiddingsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySurplusBiddingsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySurplusBiddingsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QuerySurplusBiddingsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySurplusBiddingsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Biddings", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Biddings = append(m.Biddings, SurplusBiddings{}) - if err := m.Biddings[len(m.Biddings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDebtAuctionRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDebtAuctionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDebtAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDebtAuctionResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDebtAuctionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDebtAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Auction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDebtAuctionsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDebtAuctionsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDebtAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDebtAuctionsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDebtAuctionsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDebtAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Auctions = append(m.Auctions, DebtAuction{}) - if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDebtBiddingsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDebtBiddingsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDebtBiddingsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDebtBiddingsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDebtBiddingsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDebtBiddingsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Biddings", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Biddings = append(m.Biddings, DebtBiddings{}) - if err := m.Biddings[len(m.Biddings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDutchAuctionRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDutchAuctionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDutchAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDutchAuctionResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDutchAuctionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDutchAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Auction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDutchAuctionsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDutchAuctionsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDutchAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDutchAuctionsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDutchAuctionsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDutchAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Auctions = append(m.Auctions, DutchAuction{}) - if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDutchBiddingsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDutchBiddingsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDutchBiddingsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDutchBiddingsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDutchBiddingsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDutchBiddingsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Biddings", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Biddings = append(m.Biddings, DutchBiddings{}) - if err := m.Biddings[len(m.Biddings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryBiddingsForSurplusAuctionRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryBiddingsForSurplusAuctionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBiddingsForSurplusAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryBiddingsForSurplusAuctionResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryBiddingsForSurplusAuctionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBiddingsForSurplusAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Biddings", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Biddings = append(m.Biddings, SurplusBiddings{}) - if err := m.Biddings[len(m.Biddings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryProtocolStatisticsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryProtocolStatisticsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProtocolStatisticsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryProtocolStatisticsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryProtocolStatisticsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProtocolStatisticsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Stats = append(m.Stats, ProtocolStatistics{}) - if err := m.Stats[len(m.Stats)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGenericAuctionParamRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGenericAuctionParamRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGenericAuctionParamRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGenericAuctionParamResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGenericAuctionParamResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGenericAuctionParamResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AuctionParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDutchLendAuctionRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDutchLendAuctionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDutchLendAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDutchLendAuctionResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDutchLendAuctionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDutchLendAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Auction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDutchLendAuctionsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDutchLendAuctionsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDutchLendAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDutchLendAuctionsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDutchLendAuctionsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDutchLendAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Auctions = append(m.Auctions, DutchAuction{}) - if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDutchLendBiddingsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDutchLendBiddingsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDutchLendBiddingsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDutchLendBiddingsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryDutchLendBiddingsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDutchLendBiddingsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Biddings", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Biddings = append(m.Biddings, DutchBiddings{}) - if err := m.Biddings[len(m.Biddings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryFilterDutchAuctionsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryFilterDutchAuctionsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryFilterDutchAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = append(m.Denom, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.History = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryFilterDutchAuctionsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryFilterDutchAuctionsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryFilterDutchAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Auctions = append(m.Auctions, DutchAuction{}) - if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipQuery(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/comdex-official/comdex/x/auction/types/query.pb.gw.go b/github.com/comdex-official/comdex/x/auction/types/query.pb.gw.go deleted file mode 100644 index 4ee152426..000000000 --- a/github.com/comdex-official/comdex/x/auction/types/query.pb.gw.go +++ /dev/null @@ -1,2355 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: comdex/auction/v1beta1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_QuerySurplusAuction_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySurplusAuctionRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["auction_mapping_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") - } - - protoReq.AuctionMappingId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) - } - - val, ok = pathParams["auction_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") - } - - protoReq.AuctionId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - msg, err := client.QuerySurplusAuction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QuerySurplusAuction_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySurplusAuctionRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["auction_mapping_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") - } - - protoReq.AuctionMappingId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) - } - - val, ok = pathParams["auction_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") - } - - protoReq.AuctionId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - msg, err := server.QuerySurplusAuction(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QuerySurplusAuctions_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0, "history": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} -) - -func request_Query_QuerySurplusAuctions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySurplusAuctionsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySurplusAuctions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QuerySurplusAuctions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QuerySurplusAuctions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySurplusAuctionsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySurplusAuctions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QuerySurplusAuctions(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QuerySurplusBiddings_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "app_id": 1, "history": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} -) - -func request_Query_QuerySurplusBiddings_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySurplusBiddingsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["bidder"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") - } - - protoReq.Bidder, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) - } - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySurplusBiddings_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QuerySurplusBiddings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QuerySurplusBiddings_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySurplusBiddingsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["bidder"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") - } - - protoReq.Bidder, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) - } - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QuerySurplusBiddings_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QuerySurplusBiddings(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_QueryDebtAuction_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDebtAuctionRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["auction_mapping_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") - } - - protoReq.AuctionMappingId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) - } - - val, ok = pathParams["auction_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") - } - - protoReq.AuctionId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - msg, err := client.QueryDebtAuction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryDebtAuction_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDebtAuctionRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["auction_mapping_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") - } - - protoReq.AuctionMappingId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) - } - - val, ok = pathParams["auction_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") - } - - protoReq.AuctionId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - msg, err := server.QueryDebtAuction(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryDebtAuctions_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0, "history": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} -) - -func request_Query_QueryDebtAuctions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDebtAuctionsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDebtAuctions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryDebtAuctions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryDebtAuctions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDebtAuctionsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDebtAuctions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryDebtAuctions(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryDebtBiddings_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "app_id": 1, "history": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} -) - -func request_Query_QueryDebtBiddings_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDebtBiddingsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["bidder"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") - } - - protoReq.Bidder, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) - } - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDebtBiddings_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryDebtBiddings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryDebtBiddings_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDebtBiddingsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["bidder"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") - } - - protoReq.Bidder, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) - } - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDebtBiddings_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryDebtBiddings(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_QueryDutchAuction_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDutchAuctionRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["auction_mapping_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") - } - - protoReq.AuctionMappingId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) - } - - val, ok = pathParams["auction_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") - } - - protoReq.AuctionId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - msg, err := client.QueryDutchAuction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryDutchAuction_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDutchAuctionRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["auction_mapping_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") - } - - protoReq.AuctionMappingId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) - } - - val, ok = pathParams["auction_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") - } - - protoReq.AuctionId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - msg, err := server.QueryDutchAuction(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryDutchAuctions_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0, "history": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} -) - -func request_Query_QueryDutchAuctions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDutchAuctionsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchAuctions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryDutchAuctions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryDutchAuctions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDutchAuctionsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchAuctions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryDutchAuctions(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryDutchBiddings_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "app_id": 1, "history": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} -) - -func request_Query_QueryDutchBiddings_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDutchBiddingsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["bidder"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") - } - - protoReq.Bidder, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) - } - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchBiddings_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryDutchBiddings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryDutchBiddings_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDutchBiddingsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["bidder"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") - } - - protoReq.Bidder, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) - } - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchBiddings_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryDutchBiddings(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryProtocolStatistics_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_QueryProtocolStatistics_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProtocolStatisticsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryProtocolStatistics_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryProtocolStatistics(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryProtocolStatistics_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProtocolStatisticsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryProtocolStatistics_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryProtocolStatistics(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_QueryGenericAuctionParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGenericAuctionParamRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - msg, err := client.QueryGenericAuctionParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryGenericAuctionParams_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGenericAuctionParamRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - msg, err := server.QueryGenericAuctionParams(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_QueryDutchLendAuction_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDutchLendAuctionRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["auction_mapping_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") - } - - protoReq.AuctionMappingId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) - } - - val, ok = pathParams["auction_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") - } - - protoReq.AuctionId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - msg, err := client.QueryDutchLendAuction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryDutchLendAuction_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDutchLendAuctionRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["auction_mapping_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_mapping_id") - } - - protoReq.AuctionMappingId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_mapping_id", err) - } - - val, ok = pathParams["auction_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") - } - - protoReq.AuctionId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - msg, err := server.QueryDutchLendAuction(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryDutchLendAuctions_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0, "history": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} -) - -func request_Query_QueryDutchLendAuctions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDutchLendAuctionsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchLendAuctions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryDutchLendAuctions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryDutchLendAuctions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDutchLendAuctionsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchLendAuctions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryDutchLendAuctions(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryDutchLendBiddings_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "app_id": 1, "history": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} -) - -func request_Query_QueryDutchLendBiddings_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDutchLendBiddingsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["bidder"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") - } - - protoReq.Bidder, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) - } - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchLendBiddings_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryDutchLendBiddings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryDutchLendBiddings_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDutchLendBiddingsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["bidder"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") - } - - protoReq.Bidder, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) - } - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryDutchLendBiddings_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryDutchLendBiddings(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryFilterDutchAuctions_0 = &utilities.DoubleArray{Encoding: map[string]int{"app_id": 0, "denom": 1, "history": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} -) - -func request_Query_QueryFilterDutchAuctions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryFilterDutchAuctionsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") - } - - protoReq.Denom, err = runtime.StringSlice(val, ",") - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryFilterDutchAuctions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryFilterDutchAuctions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryFilterDutchAuctions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryFilterDutchAuctionsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") - } - - protoReq.Denom, err = runtime.StringSlice(val, ",") - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) - } - - val, ok = pathParams["history"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") - } - - protoReq.History, err = runtime.Bool(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryFilterDutchAuctions_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryFilterDutchAuctions(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_QuerySurplusAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QuerySurplusAuction_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QuerySurplusAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QuerySurplusAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QuerySurplusAuctions_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QuerySurplusAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QuerySurplusBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QuerySurplusBiddings_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QuerySurplusBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDebtAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryDebtAuction_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDebtAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDebtAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryDebtAuctions_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDebtAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDebtBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryDebtBiddings_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDebtBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDutchAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryDutchAuction_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDutchAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDutchAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryDutchAuctions_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDutchAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDutchBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryDutchBiddings_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDutchBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryProtocolStatistics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryProtocolStatistics_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryProtocolStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryGenericAuctionParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryGenericAuctionParams_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryGenericAuctionParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDutchLendAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryDutchLendAuction_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDutchLendAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDutchLendAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryDutchLendAuctions_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDutchLendAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDutchLendBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryDutchLendBiddings_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDutchLendBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryFilterDutchAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryFilterDutchAuctions_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryFilterDutchAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_QuerySurplusAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QuerySurplusAuction_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QuerySurplusAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QuerySurplusAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QuerySurplusAuctions_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QuerySurplusAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QuerySurplusBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QuerySurplusBiddings_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QuerySurplusBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDebtAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryDebtAuction_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDebtAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDebtAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryDebtAuctions_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDebtAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDebtBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryDebtBiddings_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDebtBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDutchAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryDutchAuction_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDutchAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDutchAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryDutchAuctions_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDutchAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDutchBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryDutchBiddings_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDutchBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryProtocolStatistics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryProtocolStatistics_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryProtocolStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryGenericAuctionParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryGenericAuctionParams_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryGenericAuctionParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDutchLendAuction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryDutchLendAuction_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDutchLendAuction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDutchLendAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryDutchLendAuctions_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDutchLendAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryDutchLendBiddings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryDutchLendBiddings_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryDutchLendBiddings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryFilterDutchAuctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryFilterDutchAuctions_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryFilterDutchAuctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_QuerySurplusAuction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"comdex", "auction", "v1beta1", "surplusauction", "app_id", "auction_mapping_id", "auction_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QuerySurplusAuctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auction", "v1beta1", "surplusauctions", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QuerySurplusBiddings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auction", "v1beta1", "surplusbiddings", "bidder", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryDebtAuction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"comdex", "auction", "v1beta1", "debtauction", "app_id", "auction_mapping_id", "auction_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryDebtAuctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auction", "v1beta1", "debtauctions", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryDebtBiddings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auction", "v1beta1", "debtbiddings", "bidder", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryDutchAuction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"comdex", "auction", "v1beta1", "dutchauction", "app_id", "auction_mapping_id", "auction_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryDutchAuctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auction", "v1beta1", "dutchauctions", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryDutchBiddings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auction", "v1beta1", "dutchbiddings", "bidder", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryProtocolStatistics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "auction", "v1beta1", "protocolstats", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryGenericAuctionParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "auction", "v1beta1", "auctionparams", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryDutchLendAuction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6, 1, 0, 4, 1, 5, 7}, []string{"comdex", "auction", "v1beta1", "dutchlendauction", "app_id", "auction_mapping_id", "auction_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryDutchLendAuctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auction", "v1beta1", "dutchlendauctions", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryDutchLendBiddings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auction", "v1beta1", "dutchlendbiddings", "bidder", "app_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryFilterDutchAuctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auction", "v1beta1", "filterdutchauctions", "app_id", "denom", "history"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_QuerySurplusAuction_0 = runtime.ForwardResponseMessage - - forward_Query_QuerySurplusAuctions_0 = runtime.ForwardResponseMessage - - forward_Query_QuerySurplusBiddings_0 = runtime.ForwardResponseMessage - - forward_Query_QueryDebtAuction_0 = runtime.ForwardResponseMessage - - forward_Query_QueryDebtAuctions_0 = runtime.ForwardResponseMessage - - forward_Query_QueryDebtBiddings_0 = runtime.ForwardResponseMessage - - forward_Query_QueryDutchAuction_0 = runtime.ForwardResponseMessage - - forward_Query_QueryDutchAuctions_0 = runtime.ForwardResponseMessage - - forward_Query_QueryDutchBiddings_0 = runtime.ForwardResponseMessage - - forward_Query_QueryProtocolStatistics_0 = runtime.ForwardResponseMessage - - forward_Query_QueryGenericAuctionParams_0 = runtime.ForwardResponseMessage - - forward_Query_QueryDutchLendAuction_0 = runtime.ForwardResponseMessage - - forward_Query_QueryDutchLendAuctions_0 = runtime.ForwardResponseMessage - - forward_Query_QueryDutchLendBiddings_0 = runtime.ForwardResponseMessage - - forward_Query_QueryFilterDutchAuctions_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/comdex-official/comdex/x/auction/types/tx.pb.go b/github.com/comdex-official/comdex/x/auction/types/tx.pb.go deleted file mode 100644 index 7a3389403..000000000 --- a/github.com/comdex-official/comdex/x/auction/types/tx.pb.go +++ /dev/null @@ -1,2056 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auction/v1beta1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type MsgPlaceSurplusBidRequest struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` - Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` - AppId uint64 `protobuf:"varint,4,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - AuctionMappingId uint64 `protobuf:"varint,5,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` -} - -func (m *MsgPlaceSurplusBidRequest) Reset() { *m = MsgPlaceSurplusBidRequest{} } -func (m *MsgPlaceSurplusBidRequest) String() string { return proto.CompactTextString(m) } -func (*MsgPlaceSurplusBidRequest) ProtoMessage() {} -func (*MsgPlaceSurplusBidRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a8457d7b1ca5de6a, []int{0} -} -func (m *MsgPlaceSurplusBidRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgPlaceSurplusBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgPlaceSurplusBidRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgPlaceSurplusBidRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgPlaceSurplusBidRequest.Merge(m, src) -} -func (m *MsgPlaceSurplusBidRequest) XXX_Size() int { - return m.Size() -} -func (m *MsgPlaceSurplusBidRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MsgPlaceSurplusBidRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgPlaceSurplusBidRequest proto.InternalMessageInfo - -type MsgPlaceSurplusBidResponse struct { -} - -func (m *MsgPlaceSurplusBidResponse) Reset() { *m = MsgPlaceSurplusBidResponse{} } -func (m *MsgPlaceSurplusBidResponse) String() string { return proto.CompactTextString(m) } -func (*MsgPlaceSurplusBidResponse) ProtoMessage() {} -func (*MsgPlaceSurplusBidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a8457d7b1ca5de6a, []int{1} -} -func (m *MsgPlaceSurplusBidResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgPlaceSurplusBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgPlaceSurplusBidResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgPlaceSurplusBidResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgPlaceSurplusBidResponse.Merge(m, src) -} -func (m *MsgPlaceSurplusBidResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgPlaceSurplusBidResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgPlaceSurplusBidResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgPlaceSurplusBidResponse proto.InternalMessageInfo - -type MsgPlaceDebtBidRequest struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` - Bid types.Coin `protobuf:"bytes,3,opt,name=bid,proto3" json:"bid"` - ExpectedUserToken types.Coin `protobuf:"bytes,4,opt,name=expectedUserToken,proto3" json:"expectedUserToken"` - AppId uint64 `protobuf:"varint,5,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - AuctionMappingId uint64 `protobuf:"varint,6,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` -} - -func (m *MsgPlaceDebtBidRequest) Reset() { *m = MsgPlaceDebtBidRequest{} } -func (m *MsgPlaceDebtBidRequest) String() string { return proto.CompactTextString(m) } -func (*MsgPlaceDebtBidRequest) ProtoMessage() {} -func (*MsgPlaceDebtBidRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a8457d7b1ca5de6a, []int{2} -} -func (m *MsgPlaceDebtBidRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgPlaceDebtBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgPlaceDebtBidRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgPlaceDebtBidRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgPlaceDebtBidRequest.Merge(m, src) -} -func (m *MsgPlaceDebtBidRequest) XXX_Size() int { - return m.Size() -} -func (m *MsgPlaceDebtBidRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MsgPlaceDebtBidRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgPlaceDebtBidRequest proto.InternalMessageInfo - -type MsgPlaceDebtBidResponse struct { -} - -func (m *MsgPlaceDebtBidResponse) Reset() { *m = MsgPlaceDebtBidResponse{} } -func (m *MsgPlaceDebtBidResponse) String() string { return proto.CompactTextString(m) } -func (*MsgPlaceDebtBidResponse) ProtoMessage() {} -func (*MsgPlaceDebtBidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a8457d7b1ca5de6a, []int{3} -} -func (m *MsgPlaceDebtBidResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgPlaceDebtBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgPlaceDebtBidResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgPlaceDebtBidResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgPlaceDebtBidResponse.Merge(m, src) -} -func (m *MsgPlaceDebtBidResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgPlaceDebtBidResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgPlaceDebtBidResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgPlaceDebtBidResponse proto.InternalMessageInfo - -type MsgPlaceDutchBidRequest struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` - Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` - AppId uint64 `protobuf:"varint,4,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - AuctionMappingId uint64 `protobuf:"varint,5,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` -} - -func (m *MsgPlaceDutchBidRequest) Reset() { *m = MsgPlaceDutchBidRequest{} } -func (m *MsgPlaceDutchBidRequest) String() string { return proto.CompactTextString(m) } -func (*MsgPlaceDutchBidRequest) ProtoMessage() {} -func (*MsgPlaceDutchBidRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a8457d7b1ca5de6a, []int{4} -} -func (m *MsgPlaceDutchBidRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgPlaceDutchBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgPlaceDutchBidRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgPlaceDutchBidRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgPlaceDutchBidRequest.Merge(m, src) -} -func (m *MsgPlaceDutchBidRequest) XXX_Size() int { - return m.Size() -} -func (m *MsgPlaceDutchBidRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MsgPlaceDutchBidRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgPlaceDutchBidRequest proto.InternalMessageInfo - -type MsgPlaceDutchBidResponse struct { -} - -func (m *MsgPlaceDutchBidResponse) Reset() { *m = MsgPlaceDutchBidResponse{} } -func (m *MsgPlaceDutchBidResponse) String() string { return proto.CompactTextString(m) } -func (*MsgPlaceDutchBidResponse) ProtoMessage() {} -func (*MsgPlaceDutchBidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a8457d7b1ca5de6a, []int{5} -} -func (m *MsgPlaceDutchBidResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgPlaceDutchBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgPlaceDutchBidResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgPlaceDutchBidResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgPlaceDutchBidResponse.Merge(m, src) -} -func (m *MsgPlaceDutchBidResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgPlaceDutchBidResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgPlaceDutchBidResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgPlaceDutchBidResponse proto.InternalMessageInfo - -type MsgPlaceDutchLendBidRequest struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` - Bidder string `protobuf:"bytes,2,opt,name=bidder,proto3" json:"bidder,omitempty"` - Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` - AppId uint64 `protobuf:"varint,4,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - AuctionMappingId uint64 `protobuf:"varint,5,opt,name=auction_mapping_id,json=auctionMappingId,proto3" json:"auction_mapping_id,omitempty"` -} - -func (m *MsgPlaceDutchLendBidRequest) Reset() { *m = MsgPlaceDutchLendBidRequest{} } -func (m *MsgPlaceDutchLendBidRequest) String() string { return proto.CompactTextString(m) } -func (*MsgPlaceDutchLendBidRequest) ProtoMessage() {} -func (*MsgPlaceDutchLendBidRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a8457d7b1ca5de6a, []int{6} -} -func (m *MsgPlaceDutchLendBidRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgPlaceDutchLendBidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgPlaceDutchLendBidRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgPlaceDutchLendBidRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgPlaceDutchLendBidRequest.Merge(m, src) -} -func (m *MsgPlaceDutchLendBidRequest) XXX_Size() int { - return m.Size() -} -func (m *MsgPlaceDutchLendBidRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MsgPlaceDutchLendBidRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgPlaceDutchLendBidRequest proto.InternalMessageInfo - -type MsgPlaceDutchLendBidResponse struct { -} - -func (m *MsgPlaceDutchLendBidResponse) Reset() { *m = MsgPlaceDutchLendBidResponse{} } -func (m *MsgPlaceDutchLendBidResponse) String() string { return proto.CompactTextString(m) } -func (*MsgPlaceDutchLendBidResponse) ProtoMessage() {} -func (*MsgPlaceDutchLendBidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a8457d7b1ca5de6a, []int{7} -} -func (m *MsgPlaceDutchLendBidResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgPlaceDutchLendBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgPlaceDutchLendBidResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgPlaceDutchLendBidResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgPlaceDutchLendBidResponse.Merge(m, src) -} -func (m *MsgPlaceDutchLendBidResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgPlaceDutchLendBidResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgPlaceDutchLendBidResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgPlaceDutchLendBidResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgPlaceSurplusBidRequest)(nil), "comdex.auction.v1beta1.MsgPlaceSurplusBidRequest") - proto.RegisterType((*MsgPlaceSurplusBidResponse)(nil), "comdex.auction.v1beta1.MsgPlaceSurplusBidResponse") - proto.RegisterType((*MsgPlaceDebtBidRequest)(nil), "comdex.auction.v1beta1.MsgPlaceDebtBidRequest") - proto.RegisterType((*MsgPlaceDebtBidResponse)(nil), "comdex.auction.v1beta1.MsgPlaceDebtBidResponse") - proto.RegisterType((*MsgPlaceDutchBidRequest)(nil), "comdex.auction.v1beta1.MsgPlaceDutchBidRequest") - proto.RegisterType((*MsgPlaceDutchBidResponse)(nil), "comdex.auction.v1beta1.MsgPlaceDutchBidResponse") - proto.RegisterType((*MsgPlaceDutchLendBidRequest)(nil), "comdex.auction.v1beta1.MsgPlaceDutchLendBidRequest") - proto.RegisterType((*MsgPlaceDutchLendBidResponse)(nil), "comdex.auction.v1beta1.MsgPlaceDutchLendBidResponse") -} - -func init() { proto.RegisterFile("comdex/auction/v1beta1/tx.proto", fileDescriptor_a8457d7b1ca5de6a) } - -var fileDescriptor_a8457d7b1ca5de6a = []byte{ - // 523 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xf5, 0x36, 0x4d, 0xa4, 0x0e, 0x07, 0xca, 0xaa, 0x84, 0xc4, 0x94, 0x6d, 0x94, 0x53, 0x0e, - 0x60, 0xe3, 0x14, 0x89, 0x7b, 0xe0, 0x12, 0x89, 0x48, 0x28, 0x85, 0x0b, 0x17, 0x64, 0x7b, 0xb7, - 0xee, 0x8a, 0xc4, 0xbb,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4e, 0x02, 0xde, 0x5e, 0x64, 0x75, 0x07, 0xec, 0x87, 0xe5, 0x13, 0x0c, 0xed, 0x47, - 0x04, 0x07, 0x9b, 0x3e, 0x08, 0x3e, 0x2e, 0x55, 0x6a, 0x75, 0x24, 0xed, 0x47, 0x57, 0x4b, 0x2a, - 0x34, 0xf4, 0x4e, 0xa6, 0xbf, 0x88, 0xf5, 0x65, 0x4e, 0xac, 0xe9, 0x9c, 0xa0, 0xd9, 0x9c, 0xa0, - 0x9f, 0x73, 0x82, 0x3e, 0x2d, 0x88, 0x35, 0x5b, 0x10, 0xeb, 0xfb, 0x82, 0x58, 0xaf, 0xbc, 0x88, - 0xeb, 0xb3, 0x34, 0xc8, 0xaa, 0xbb, 0x05, 0xc3, 0x03, 0x71, 0x7a, 0xca, 0x43, 0xee, 0x8f, 0xcc, - 0xd9, 0xfd, 0xf7, 0x50, 0xe9, 0xf7, 0x92, 0xa9, 0xa0, 0x96, 0x3f, 0x2b, 0xc7, 0x7f, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x7f, 0x4f, 0x7a, 0x59, 0xc7, 0x06, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - MsgPlaceSurplusBid(ctx context.Context, in *MsgPlaceSurplusBidRequest, opts ...grpc.CallOption) (*MsgPlaceSurplusBidResponse, error) - MsgPlaceDebtBid(ctx context.Context, in *MsgPlaceDebtBidRequest, opts ...grpc.CallOption) (*MsgPlaceDebtBidResponse, error) - MsgPlaceDutchBid(ctx context.Context, in *MsgPlaceDutchBidRequest, opts ...grpc.CallOption) (*MsgPlaceDutchBidResponse, error) - MsgPlaceDutchLendBid(ctx context.Context, in *MsgPlaceDutchLendBidRequest, opts ...grpc.CallOption) (*MsgPlaceDutchLendBidResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) MsgPlaceSurplusBid(ctx context.Context, in *MsgPlaceSurplusBidRequest, opts ...grpc.CallOption) (*MsgPlaceSurplusBidResponse, error) { - out := new(MsgPlaceSurplusBidResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Msg/MsgPlaceSurplusBid", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) MsgPlaceDebtBid(ctx context.Context, in *MsgPlaceDebtBidRequest, opts ...grpc.CallOption) (*MsgPlaceDebtBidResponse, error) { - out := new(MsgPlaceDebtBidResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Msg/MsgPlaceDebtBid", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) MsgPlaceDutchBid(ctx context.Context, in *MsgPlaceDutchBidRequest, opts ...grpc.CallOption) (*MsgPlaceDutchBidResponse, error) { - out := new(MsgPlaceDutchBidResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Msg/MsgPlaceDutchBid", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) MsgPlaceDutchLendBid(ctx context.Context, in *MsgPlaceDutchLendBidRequest, opts ...grpc.CallOption) (*MsgPlaceDutchLendBidResponse, error) { - out := new(MsgPlaceDutchLendBidResponse) - err := c.cc.Invoke(ctx, "/comdex.auction.v1beta1.Msg/MsgPlaceDutchLendBid", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - MsgPlaceSurplusBid(context.Context, *MsgPlaceSurplusBidRequest) (*MsgPlaceSurplusBidResponse, error) - MsgPlaceDebtBid(context.Context, *MsgPlaceDebtBidRequest) (*MsgPlaceDebtBidResponse, error) - MsgPlaceDutchBid(context.Context, *MsgPlaceDutchBidRequest) (*MsgPlaceDutchBidResponse, error) - MsgPlaceDutchLendBid(context.Context, *MsgPlaceDutchLendBidRequest) (*MsgPlaceDutchLendBidResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) MsgPlaceSurplusBid(ctx context.Context, req *MsgPlaceSurplusBidRequest) (*MsgPlaceSurplusBidResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MsgPlaceSurplusBid not implemented") -} -func (*UnimplementedMsgServer) MsgPlaceDebtBid(ctx context.Context, req *MsgPlaceDebtBidRequest) (*MsgPlaceDebtBidResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MsgPlaceDebtBid not implemented") -} -func (*UnimplementedMsgServer) MsgPlaceDutchBid(ctx context.Context, req *MsgPlaceDutchBidRequest) (*MsgPlaceDutchBidResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MsgPlaceDutchBid not implemented") -} -func (*UnimplementedMsgServer) MsgPlaceDutchLendBid(ctx context.Context, req *MsgPlaceDutchLendBidRequest) (*MsgPlaceDutchLendBidResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MsgPlaceDutchLendBid not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_MsgPlaceSurplusBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgPlaceSurplusBidRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).MsgPlaceSurplusBid(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Msg/MsgPlaceSurplusBid", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).MsgPlaceSurplusBid(ctx, req.(*MsgPlaceSurplusBidRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_MsgPlaceDebtBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgPlaceDebtBidRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).MsgPlaceDebtBid(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Msg/MsgPlaceDebtBid", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).MsgPlaceDebtBid(ctx, req.(*MsgPlaceDebtBidRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_MsgPlaceDutchBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgPlaceDutchBidRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).MsgPlaceDutchBid(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Msg/MsgPlaceDutchBid", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).MsgPlaceDutchBid(ctx, req.(*MsgPlaceDutchBidRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_MsgPlaceDutchLendBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgPlaceDutchLendBidRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).MsgPlaceDutchLendBid(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auction.v1beta1.Msg/MsgPlaceDutchLendBid", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).MsgPlaceDutchLendBid(ctx, req.(*MsgPlaceDutchLendBidRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.auction.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "MsgPlaceSurplusBid", - Handler: _Msg_MsgPlaceSurplusBid_Handler, - }, - { - MethodName: "MsgPlaceDebtBid", - Handler: _Msg_MsgPlaceDebtBid_Handler, - }, - { - MethodName: "MsgPlaceDutchBid", - Handler: _Msg_MsgPlaceDutchBid_Handler, - }, - { - MethodName: "MsgPlaceDutchLendBid", - Handler: _Msg_MsgPlaceDutchLendBid_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "comdex/auction/v1beta1/tx.proto", -} - -func (m *MsgPlaceSurplusBidRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgPlaceSurplusBidRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgPlaceSurplusBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AuctionMappingId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x28 - } - if m.AppId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x20 - } - { - size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0x12 - } - if m.AuctionId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgPlaceSurplusBidResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgPlaceSurplusBidResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgPlaceSurplusBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgPlaceDebtBidRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgPlaceDebtBidRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgPlaceDebtBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AuctionMappingId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x30 - } - if m.AppId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x28 - } - { - size, err := m.ExpectedUserToken.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.Bid.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0x12 - } - if m.AuctionId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgPlaceDebtBidResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgPlaceDebtBidResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgPlaceDebtBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgPlaceDutchBidRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgPlaceDutchBidRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgPlaceDutchBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AuctionMappingId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x28 - } - if m.AppId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x20 - } - { - size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0x12 - } - if m.AuctionId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgPlaceDutchBidResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgPlaceDutchBidResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgPlaceDutchBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgPlaceDutchLendBidRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgPlaceDutchLendBidRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgPlaceDutchLendBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AuctionMappingId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.AuctionMappingId)) - i-- - dAtA[i] = 0x28 - } - if m.AppId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.AppId)) - i-- - dAtA[i] = 0x20 - } - { - size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0x12 - } - if m.AuctionId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.AuctionId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgPlaceDutchLendBidResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgPlaceDutchLendBidResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgPlaceDutchLendBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgPlaceSurplusBidRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AuctionId != 0 { - n += 1 + sovTx(uint64(m.AuctionId)) - } - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Amount.Size() - n += 1 + l + sovTx(uint64(l)) - if m.AppId != 0 { - n += 1 + sovTx(uint64(m.AppId)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovTx(uint64(m.AuctionMappingId)) - } - return n -} - -func (m *MsgPlaceSurplusBidResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgPlaceDebtBidRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AuctionId != 0 { - n += 1 + sovTx(uint64(m.AuctionId)) - } - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Bid.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.ExpectedUserToken.Size() - n += 1 + l + sovTx(uint64(l)) - if m.AppId != 0 { - n += 1 + sovTx(uint64(m.AppId)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovTx(uint64(m.AuctionMappingId)) - } - return n -} - -func (m *MsgPlaceDebtBidResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgPlaceDutchBidRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AuctionId != 0 { - n += 1 + sovTx(uint64(m.AuctionId)) - } - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Amount.Size() - n += 1 + l + sovTx(uint64(l)) - if m.AppId != 0 { - n += 1 + sovTx(uint64(m.AppId)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovTx(uint64(m.AuctionMappingId)) - } - return n -} - -func (m *MsgPlaceDutchBidResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgPlaceDutchLendBidRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AuctionId != 0 { - n += 1 + sovTx(uint64(m.AuctionId)) - } - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Amount.Size() - n += 1 + l + sovTx(uint64(l)) - if m.AppId != 0 { - n += 1 + sovTx(uint64(m.AppId)) - } - if m.AuctionMappingId != 0 { - n += 1 + sovTx(uint64(m.AuctionMappingId)) - } - return n -} - -func (m *MsgPlaceDutchLendBidResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgPlaceSurplusBidRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgPlaceSurplusBidRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPlaceSurplusBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgPlaceSurplusBidResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgPlaceSurplusBidResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPlaceSurplusBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgPlaceDebtBidRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgPlaceDebtBidRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPlaceDebtBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpectedUserToken", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExpectedUserToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgPlaceDebtBidResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgPlaceDebtBidResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPlaceDebtBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgPlaceDutchBidRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgPlaceDutchBidRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPlaceDutchBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgPlaceDutchBidResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgPlaceDutchBidResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPlaceDutchBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgPlaceDutchLendBidRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgPlaceDutchLendBidRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPlaceDutchLendBidRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) - } - m.AuctionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) - } - m.AppId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionMappingId", wireType) - } - m.AuctionMappingId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuctionMappingId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgPlaceDutchLendBidResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgPlaceDutchLendBidResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPlaceDutchLendBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index 34d800da9..6f037fe0f 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -15,9 +15,9 @@ message AuctionHistorical{ Auction auction_historical=2[ (gogoproto.moretags) = "yaml:\"auction_historical\"" ]; - LockedVault locked_vault= 3[ - (gogoproto.moretags) = "yaml:\"locked_vault\"" - ]; + // LockedVault locked_vault= 3[ + // (gogoproto.moretags) = "yaml:\"locked_vault\"" + // ]; } message Auction{ diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index 80c1818a7..6c8b56486 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + _ "github.com/comdex-official/comdex/x/liquidationsV2/types" _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" @@ -31,7 +32,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type AuctionHistorical struct { AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` - AuctionHistorical *Auction `protobuf:"bytes,2,opt,name=auction_historical,json=auctionHistorical,proto3" json:"auction_historical,omitempty" yaml:"auction_data"` + AuctionHistorical *Auction `protobuf:"bytes,2,opt,name=auction_historical,json=auctionHistorical,proto3" json:"auction_historical,omitempty" yaml:"auction_historical"` } func (m *AuctionHistorical) Reset() { *m = AuctionHistorical{} } @@ -291,63 +292,65 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 895 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x4f, 0x8f, 0xdb, 0x44, - 0x14, 0x5f, 0xd3, 0x76, 0x77, 0x33, 0xd9, 0x25, 0x8d, 0xbb, 0xed, 0xa6, 0x59, 0x6a, 0xa7, 0x73, - 0x68, 0x23, 0xa4, 0xda, 0xea, 0xd2, 0x13, 0xe2, 0x52, 0x17, 0x50, 0x83, 0x44, 0x8b, 0x86, 0xa8, - 0x42, 0x5c, 0xac, 0xb1, 0x67, 0x92, 0x0e, 0xeb, 0x78, 0x2c, 0x7b, 0xb2, 0x65, 0x3f, 0x02, 0x17, - 0xb4, 0x27, 0x24, 0xbe, 0x03, 0x57, 0xbe, 0x43, 0x8f, 0x3d, 0x22, 0x0e, 0x06, 0xed, 0x7e, 0x03, - 0x1f, 0x39, 0xa1, 0xf9, 0xe3, 0x38, 0xc9, 0x16, 0xca, 0x72, 0x4a, 0xe6, 0xcd, 0xef, 0xfd, 0xde, - 0x6f, 0x9e, 0x7f, 0xf3, 0x06, 0xdc, 0x8f, 0xf9, 0x8c, 0xd0, 0xef, 0x7d, 0x3c, 0x8f, 0x05, 0xe3, - 0x69, 0xf1, 0xe2, 0xd0, 0x3f, 0x7e, 0x18, 0x51, 0x81, 0x1f, 0xd6, 0x21, 0x2f, 0xcb, 0xb9, 0xe0, - 0xf6, 0x6d, 0x0d, 0xf4, 0x1a, 0xa0, 0x67, 0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c, 0x58, 0xcc, 0x70, 0x62, 0xd6, 0xfe, 0xca, 0xfb, 0xaf, 0x9c, 0x1c, 0x6d, 0xaa, 0x6f, 0xfa, - 0xd1, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xbb, 0x0a, 0xb9, 0x21, 0x08, 0x00, 0x00, + // 913 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0xdc, 0x44, + 0x18, 0x8e, 0x69, 0xf3, 0xb1, 0xb3, 0x09, 0xdb, 0x75, 0xd3, 0x76, 0xb3, 0x21, 0xeb, 0xed, 0x1c, + 0xda, 0x15, 0x52, 0x6c, 0x35, 0xf4, 0x84, 0xb8, 0xd4, 0x05, 0xd4, 0x45, 0xa2, 0x45, 0x43, 0x54, + 0x21, 0x2e, 0xd6, 0xd8, 0x33, 0xbb, 0x1d, 0xc5, 0xeb, 0x31, 0xf6, 0x6c, 0x4a, 0x7e, 0x02, 0x17, + 0x94, 0x13, 0x12, 0xff, 0x81, 0x7f, 0xc0, 0x1f, 0xe8, 0xb1, 0x47, 0xc4, 0xc1, 0xa0, 0xe4, 0x1f, + 0xf8, 0xc8, 0x09, 0xcd, 0x87, 0xd7, 0xbb, 0x6e, 0xa1, 0x84, 0x53, 0x76, 0xde, 0x79, 0xde, 0xe7, + 0x7d, 0xe6, 0x9d, 0x67, 0x5e, 0x07, 0xdc, 0x8f, 0xf8, 0x8c, 0xd0, 0xef, 0x3d, 0x3c, 0x8f, 0x04, + 0xe3, 0x49, 0xfe, 0xfc, 0xc8, 0x3b, 0x7d, 0x10, 0x52, 0x81, 0x1f, 0x54, 0x21, 0x37, 0xcd, 0xb8, + 0xe0, 0xf6, 0x9e, 0x06, 0xba, 0x35, 0xd0, 0x35, 0xc0, 0xfe, 0xee, 0x94, 0x4f, 0xb9, 0x42, 0x79, + 0xf2, 0x97, 0x4e, 0xe8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0x7c, 0x2b, 0x87, 0xda, + 0x21, 0x9f, 0x4c, 0x58, 0xc4, 0x70, 0x6c, 0xd6, 0xde, 0xca, 0x3f, 0x0d, 0xca, 0xc9, 0xe1, 0x86, + 0xba, 0xd3, 0x8f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x35, 0x34, 0x9d, 0x5d, 0x56, 0x08, 0x00, + 0x00, } func (m *AuctionHistorical) Marshal() (dAtA []byte, err error) { diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index ac3759c18..380fdbdb8 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + lendtypes "github.com/comdex-official/comdex/x/lend/types" utils "github.com/comdex-official/comdex/types" @@ -135,7 +136,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error } - err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "vault", whitelistingData.IsDutchActivated, isCMST, extPair.PairId) + err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "vault", whitelistingData.IsDutchActivated, isCMST, pair.AssetIn, pair.AssetOut) if err != nil { return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for Vault %d", vault.Id) } @@ -158,7 +159,7 @@ func (k Keeper) ReturnCoin(ctx sdk.Context, assetID uint64, amount sdk.Int) sdk. return sdk.NewCoin(asset.Denom, amount) } -func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Coin, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, bonusToBeGiven sdk.Int, initiatorType string, auctionType bool, isDebtCmst bool, pairId uint64) error { +func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Coin, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, bonusToBeGiven sdk.Int, initiatorType string, auctionType bool, isDebtCmst bool, collateralID uint64, DebtId uint64) error { lockedVaultID := k.GetLockedVaultID(ctx) value := types.LockedVault{ @@ -177,12 +178,12 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair BonusToBeGiven: bonusToBeGiven, //just for calculation purpose IsInternalKeeper: isInternalKeeper, InternalKeeperAddress: internalKeeperAddress, - IsExternalKeeper: isExternalKeeper, ExternalKeeperAddress: externalKeeperAddress, InitiatorType: initiatorType, AuctionType: auctionType, IsDebtCmst: isDebtCmst, - PairId: pairId, + CollateralAssetId: collateralID, + DebtAssetId: DebtId, } //To understand a condition in which case target debt becomes equal to dollar value of collateral token //at some point in the auction diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index 0fd6ede39..d9f098198 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -215,7 +215,11 @@ type LockedVault struct { InitiatorType string `protobuf:"bytes,18,opt,name=initiator_type,json=initiatorType,proto3" json:"initiator_type,omitempty" yaml:"initiator_type"` AuctionType bool `protobuf:"varint,19,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` IsDebtCmst bool `protobuf:"varint,20,opt,name=is_debt_cmst,json=isDebtCmst,proto3" json:"is_debt_cmst,omitempty" yaml:"is_debt_cmst"` - PairId uint64 `protobuf:"varint,21,opt,name=pair_id,json=pairId,proto3" json:"pair_id,omitempty" yaml:"pair_id"` + // uint64 pair_id = 21 [ + // (gogoproto.customname) = "PairId", + // (gogoproto.moretags) = "yaml:\"pair_id\""]; + CollateralAssetId uint64 `protobuf:"varint,21,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` + DebtAssetId uint64 `protobuf:"varint,22,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` } func (m *LockedVault) Reset() { *m = LockedVault{} } @@ -264,95 +268,97 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 1403 bytes of a gzipped FileDescriptorProto + // 1426 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xcf, 0xa6, 0x4d, 0x52, 0x8f, 0xf3, 0xc3, 0x9e, 0xc4, 0xcd, 0x36, 0xdf, 0xd6, 0x93, 0xef, - 0x4a, 0xed, 0x37, 0xfa, 0x4a, 0xb1, 0x9b, 0x54, 0x15, 0x08, 0x0e, 0x34, 0x4e, 0xd2, 0x62, 0x88, - 0xd4, 0x76, 0x55, 0x15, 0xa9, 0x02, 0x96, 0xf5, 0xee, 0xd8, 0x19, 0xc5, 0xde, 0x35, 0xbb, 0xe3, - 0x90, 0x5e, 0x90, 0x38, 0x21, 0xc4, 0x81, 0x72,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0x4e, 0x15, 0x10, 0x90, 0xc4, 0x03, 0xdc, 0xa2, 0xf0, 0x5b, 0x0d, - 0x54, 0x32, 0x9d, 0xd6, 0x4a, 0x06, 0x38, 0xd1, 0xf1, 0x8a, 0xbb, 0x1b, 0x35, 0x39, 0xe2, 0xd5, - 0xe2, 0x11, 0xaf, 0xf6, 0x28, 0x46, 0xc8, 0x4e, 0x14, 0x31, 0xb4, 0x96, 0xa9, 0x70, 0x89, 0x35, - 0xed, 0xbd, 0xb9, 0xf2, 0xc6, 0xb3, 0xdf, 0x90, 0x66, 0xae, 0x75, 0x73, 0x98, 0xf0, 0x63, 0x31, - 0x84, 0x11, 0x8f, 0xe2, 0x80, 0x57, 0x21, 0xd9, 0x3b, 0xf5, 0x45, 0x31, 0x89, 0xdc, 0x94, 0x43, - 0x58, 0x53, 0x19, 0xdf, 0x17, 0xb6, 0x21, 0x43, 0x7a, 0x32, 0x87, 0x70, 0x5e, 0x4a, 0x13, 0x33, - 0xd8, 0x28, 0x1a, 0x86, 0x60, 0x7d, 0x4c, 0xdc, 0xb2, 0x5d, 0x37, 0xc0, 0x61, 0xa8, 0x2f, 0x89, - 0xec, 0x7e, 0x3b, 0x62, 0xa8, 0x32, 0x4a, 0xda, 0x93, 0x80, 0x34, 0x33, 0x5e, 0xa1, 0x60, 0x98, - 0x15, 0x92, 0x47, 0xe4, 0x4e, 0x79, 0xd9, 0xca, 0x73, 0xba, 0x92, 0x3a, 0x3d, 0x3c, 0x3b, 0xd7, - 0xe9, 0x2b, 0x14, 0x0c, 0xb3, 0x82, 0xf3, 0x88, 0xf0, 0x1b, 0x0d, 0xac, 0xb6, 0x31, 0x56, 0xcf, - 0x80, 0xe7, 0x21, 0x76, 0xf8, 0x54, 0x57, 0x12, 0x1e, 0x3f, 0x99, 0xae, 0xef, 0xf1, 0x93, 0xbf, - 0x8b, 0x31, 0xcf, 0xe1, 0xfd, 0x58, 0x29, 0x1d, 0x34, 0x73, 0xdc, 0x18, 0x66, 0xa9,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c, 0x45, 0x92, 0xc5, 0xc1, 0x26, 0x58, 0x88, 0x07, 0x4c, 0x21, 0xb8, + 0x22, 0x52, 0xf6, 0x7a, 0xc4, 0x50, 0x51, 0xdd, 0x7a, 0x25, 0xb7, 0xa2, 0xbe, 0x5e, 0x32, 0x60, + 0xc3, 0x2c, 0xda, 0x29, 0x06, 0xde, 0x01, 0x0b, 0xfc, 0x83, 0x82, 0x97, 0x74, 0xa7, 0x17, 0x52, + 0x7d, 0x55, 0x48, 0x5d, 0x8b, 0x18, 0x02, 0xcd, 0x90, 0xdf, 0xdc, 0xbd, 0x5e, 0x48, 0x53, 0xa5, + 0x2c, 0xd6, 0x30, 0x01, 0x49, 0x20, 0xf0, 0x03, 0xb0, 0x92, 0xa9, 0x87, 0x76, 0x18, 0x62, 0xd1, + 0x7e, 0x2b, 0x72, 0x7e, 0x48, 0xcf, 0x2f, 0x07, 0x64, 0x98, 0xe5, 0x74, 0x75, 0x97, 0x2f, 0x36, + 0x5d, 0xf8, 0x36, 0x58, 0x14, 0x9e, 0x12, 0xa5, 0x4b, 0x42, 0x49, 0x1f, 0x32, 0xb4, 0x9a, 0xe9, + 0x43, 0xa9, 0x46, 0x91, 0x3f, 0x2b, 0x76, 0xe3, 0xd1, 0xd3, 0xbf, 0xaa, 0x33, 0x3f, 0x46, 0xd5, + 0x99, 0xa7, 0x51, 0x55, 0x7b, 0x16, 0x55, 0xb5, 0x3f, 0xa3, 0xaa, 0xf6, 0xe4, 0x79, 0x75, 0xe6, + 0xd9, 0xf3, 0xea, 0xcc, 0x6f, 0xcf, 0xab, 0x33, 0x8f, 0xde, 0x18, 0x39, 0x7c, 0xfe, 0x25, 0xb0, + 0xe5, 0xb7, 0xdb, 0xc4, 0x21, 0x76, 0x57, 0x3d, 0xd7, 0x27, 0xbe, 0x69, 0x45, 0x4a, 0xb4, 0xe6, + 0x45, 0x89, 0xba, 0xf9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa2, 0xe7, 0xb0, 0x1f, 0xf9, 0x0e, + 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -581,8 +587,15 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.PairId != 0 { - i = encodeVarintLiquidate(dAtA, i, uint64(m.PairId)) + if m.DebtAssetId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.DebtAssetId)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb0 + } + if m.CollateralAssetId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.CollateralAssetId)) i-- dAtA[i] = 0x1 i-- @@ -896,8 +909,11 @@ func (m *LockedVault) Size() (n int) { if m.IsDebtCmst { n += 3 } - if m.PairId != 0 { - n += 2 + sovLiquidate(uint64(m.PairId)) + if m.CollateralAssetId != 0 { + n += 2 + sovLiquidate(uint64(m.CollateralAssetId)) + } + if m.DebtAssetId != 0 { + n += 2 + sovLiquidate(uint64(m.DebtAssetId)) } return n } @@ -2010,9 +2026,28 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { m.IsDebtCmst = bool(v != 0) case 21: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PairId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CollateralAssetId", wireType) + } + m.CollateralAssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CollateralAssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 22: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtAssetId", wireType) } - m.PairId = 0 + m.DebtAssetId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowLiquidate @@ -2022,7 +2057,7 @@ func (m *LockedVault) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.PairId |= uint64(b&0x7F) << shift + m.DebtAssetId |= uint64(b&0x7F) << shift if b < 0x80 { break } From 80dba795cc096bbfe510f300d72882ad93b10619 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sat, 27 May 2023 14:54:58 +0530 Subject: [PATCH 072/155] updating PlaceDutcBid --- x/auctionsV2/keeper/auctions.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index d76ae6d5f..245444220 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -46,13 +46,13 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati } dutchAuctionParams := liquidationWhitelistingAppData.DutchAuctionParam - pair, _ := k.asset.GetPair(ctx, liquidationData.PairId) + // pair, _ := k.asset.GetPair(ctx, liquidationData.PairId) - twaDataCollateral, found := k.market.GetTwa(ctx, pair.AssetIn) + twaDataCollateral, found := k.market.GetTwa(ctx,liquidationData.CollateralAssetId) if !found || !twaDataCollateral.IsPriceActive { return auctionsV2types.ErrorPrices } - twaDataDebt, found := k.market.GetTwa(ctx, pair.AssetOut) + twaDataDebt, found := k.market.GetTwa(ctx, liquidationData.DebtAssetId) if !found || !twaDataDebt.IsPriceActive { return auctionsV2types.ErrorPrices } @@ -72,7 +72,7 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati auctionParams, _ := k.GetAuctionParams(ctx) //Saving liquidation data to the auction struct - auctionData := types.Auctions{ + auctionData := types.Auction{ AuctionId: auctionID + 1, CollateralToken: liquidationData.CollateralToken, DebtToken: liquidationData.TargetDebt, @@ -113,7 +113,7 @@ func (k Keeper) EnglishAuctionActivator(ctx sdk.Context, liquidationData liquida } // englishAuctionParams := liquidationWhitelistingAppData.EnglishAuctionParam auctionParams, _ := k.GetAuctionParams(ctx) - auctionData := types.Auctions{ + auctionData := types.Auction{ AuctionId: auctionID + 1, CollateralToken: liquidationData.CollateralToken, DebtToken: liquidationData.TargetDebt, @@ -255,7 +255,7 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { // return nil // } -func (k Keeper) RestartDutchAuction(ctx sdk.Context, dutchAuction types.Auctions) error { +func (k Keeper) RestartDutchAuction(ctx sdk.Context, dutchAuction types.Auction) error { auctionParams, _ := k.GetAuctionParams(ctx) liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, dutchAuction.AppId) @@ -301,7 +301,7 @@ func (k Keeper) RestartDutchAuction(ctx sdk.Context, dutchAuction types.Auctions return nil } -func (k Keeper) UpdateDutchAuction(ctx sdk.Context, dutchAuction types.Auctions) error { +func (k Keeper) UpdateDutchAuction(ctx sdk.Context, dutchAuction types.Auction) error { auctionParams, _ := k.GetAuctionParams(ctx) liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, dutchAuction.AppId) @@ -351,7 +351,7 @@ func (k Keeper) UpdateDutchAuction(ctx sdk.Context, dutchAuction types.Auctions) return nil } -func (k Keeper) RestartEnglishAuction(ctx sdk.Context, englishAuction types.Auctions) error { +func (k Keeper) RestartEnglishAuction(ctx sdk.Context, englishAuction types.Auction) error { auctionParams, _ := k.GetAuctionParams(ctx) englishAuction.EndTime = ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)) @@ -363,7 +363,7 @@ func (k Keeper) RestartEnglishAuction(ctx sdk.Context, englishAuction types.Auct } -func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctions) error { +func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auction) error { //Send Collateral To the user //Delete Auction Data From 1054533174573954e61f154761963bebfb8916da Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sat, 27 May 2023 23:34:46 +0530 Subject: [PATCH 073/155] updating PlaceDutcBid --- proto/comdex/auctionsV2/v1beta1/auction.proto | 6 +- .../liquidationsV2/v1beta1/liquidate.proto | 35 +++ x/auctionsV2/keeper/bid.go | 11 +- x/auctionsV2/types/auction.pb.go | 203 ++++++++++++------ 4 files changed, 180 insertions(+), 75 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index 6f037fe0f..ba1cf27eb 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -15,9 +15,9 @@ message AuctionHistorical{ Auction auction_historical=2[ (gogoproto.moretags) = "yaml:\"auction_historical\"" ]; - // LockedVault locked_vault= 3[ - // (gogoproto.moretags) = "yaml:\"locked_vault\"" - // ]; + comdex.liquidationsV2.v1beta1.LockedVault locked_vault= 3[ + (gogoproto.moretags) = "yaml:\"locked_vault\"" + ]; } message Auction{ diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index e457c55f4..b0861eab5 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -49,6 +49,41 @@ message LiquidationWhiteListing { (gogoproto.moretags) = "yaml:\"keeper_incentive\"" ]; } +message AppReserveFunds{ + uint64 app_id = 1 [ + (gogoproto.customname) = "AppId", + (gogoproto.moretags) = "yaml:\"app_id\""]; + uint64 asset_id = 2 [ + (gogoproto.customname) = "AppId", + (gogoproto.moretags) = "yaml:\"asset_id\""]; + cosmos.base.v1beta1.Coin token_quantity = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.moretags) = "yaml:\"token_quantity\"", + (gogoproto.nullable) = false]; + +} +message AppReserveFundsTxData{ + uint64 app_id = 1 [ + (gogoproto.customname) = "AppId", + (gogoproto.moretags) = "yaml:\"app_id\""]; + repeated AssetTxData asset_tx_data =2[ + (gogoproto.customname) = "AssetTxData", + (gogoproto.moretags) = "yaml:\"asset_tx_data\""]; + +} +message AssetTxData{ + + uint64 asset_id = 1 [ + (gogoproto.customname) = "AppId", + (gogoproto.moretags) = "yaml:\"asset_id\""]; + string tx_type = 2 [ + (gogoproto.moretags) = "yaml:\"tx_type\"" + ]; + cosmos.base.v1beta1.Coin token_quantity = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.moretags) = "yaml:\"token_quantity\"", + (gogoproto.nullable) = false]; +} message DutchAuctionParam{ diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 4eec18700..4b1ee5bbc 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -136,7 +136,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{bidding_id, string(bidder)} auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMapppingData) //Savinga auction data to auction historical - auctionHistoricalData := auctionsV2types.AuctionHistorical{auctionID, &auctionData, liquidationData} + auctionHistoricalData := auctionsV2types.AuctionHistorical{auctionID, &auctionData, &liquidationData} k.SetAuctionHistorical(ctx, auctionHistoricalData) //Close Auction k.DeleteAuction(ctx, auctionData) @@ -153,6 +153,14 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //else call the module account to give funds to compensate the user. + leftOverCollateral := auctionData.CollateralToken.Amount + _, debtTokenForLeftOverCollateral, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice, leftOverCollateral, auctionData.DebtAssetId, debtPrice) + + + //Amount to call from reserve account for adjusting the auction target debt + debtGettingLeft := auctionData.DebtToken.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, debtTokenForLeftOverCollateral)) + + } } else { @@ -176,6 +184,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s } else { //Not sure if this condition will arise in which partial bids also arent able to be fulfilled due to shortage of collateral token + // Technically this case will also close the auction } //Deducting auction bonus value from liquidation data also for next bid. diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index 6c8b56486..43b2ccc43 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -5,7 +5,7 @@ package types import ( fmt "fmt" - _ "github.com/comdex-official/comdex/x/liquidationsV2/types" + types "github.com/comdex-official/comdex/x/liquidationsV2/types" _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" @@ -31,8 +31,9 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type AuctionHistorical struct { - AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` - AuctionHistorical *Auction `protobuf:"bytes,2,opt,name=auction_historical,json=auctionHistorical,proto3" json:"auction_historical,omitempty" yaml:"auction_historical"` + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` + AuctionHistorical *Auction `protobuf:"bytes,2,opt,name=auction_historical,json=auctionHistorical,proto3" json:"auction_historical,omitempty" yaml:"auction_historical"` + LockedVault *types.LockedVault `protobuf:"bytes,3,opt,name=locked_vault,json=lockedVault,proto3" json:"locked_vault,omitempty" yaml:"locked_vault"` } func (m *AuctionHistorical) Reset() { *m = AuctionHistorical{} } @@ -82,6 +83,13 @@ func (m *AuctionHistorical) GetAuctionHistorical() *Auction { return nil } +func (m *AuctionHistorical) GetLockedVault() *types.LockedVault { + if m != nil { + return m.LockedVault + } + return nil +} + type Auction struct { AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` CollateralToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=collateral_token,json=collateralToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token" yaml:"collateral_token"` @@ -292,65 +300,66 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 913 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0xdc, 0x44, - 0x18, 0x8e, 0x69, 0xf3, 0xb1, 0xb3, 0x09, 0xdb, 0x75, 0xd3, 0x76, 0xb3, 0x21, 0xeb, 0xed, 0x1c, - 0xda, 0x15, 0x52, 0x6c, 0x35, 0xf4, 0x84, 0xb8, 0xd4, 0x05, 0xd4, 0x45, 0xa2, 0x45, 0x43, 0x54, - 0x21, 0x2e, 0xd6, 0xd8, 0x33, 0xbb, 0x1d, 0xc5, 0xeb, 0x31, 0xf6, 0x6c, 0x4a, 0x7e, 0x02, 0x17, - 0x94, 0x13, 0x12, 0xff, 0x81, 0x7f, 0xc0, 0x1f, 0xe8, 0xb1, 0x47, 0xc4, 0xc1, 0xa0, 0xe4, 0x1f, - 0xf8, 0xc8, 0x09, 0xcd, 0x87, 0xd7, 0xbb, 0x6e, 0xa1, 0x84, 0x53, 0x76, 0xde, 0x79, 0xde, 0xe7, - 0x7d, 0xe6, 0x9d, 0x67, 0x5e, 0x07, 0xdc, 0x8f, 0xf8, 0x8c, 0xd0, 0xef, 0x3d, 0x3c, 0x8f, 0x04, - 0xe3, 0x49, 0xfe, 0xfc, 0xc8, 0x3b, 0x7d, 0x10, 0x52, 0x81, 0x1f, 0x54, 0x21, 0x37, 0xcd, 0xb8, - 0xe0, 0xf6, 0x9e, 0x06, 0xba, 0x35, 0xd0, 0x35, 0xc0, 0xfe, 0xee, 0x94, 0x4f, 0xb9, 0x42, 0x79, -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0xda, 0xb7, 0x0f, 0x57, 0x7c, 0x2b, 0x87, 0xda, - 0x21, 0x9f, 0x4c, 0x58, 0xc4, 0x70, 0x6c, 0xd6, 0xde, 0xca, 0x3f, 0x0d, 0xca, 0xc9, 0xe1, 0x86, - 0xba, 0xd3, 0x8f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x35, 0x34, 0x9d, 0x5d, 0x56, 0x08, 0x00, - 0x00, + // 942 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0xdb, 0x36, + 0x18, 0x8e, 0x9a, 0xe6, 0xc3, 0x74, 0x32, 0xd7, 0x6a, 0xda, 0x28, 0xce, 0x62, 0xb9, 0x3c, 0xb4, + 0xc1, 0x80, 0xc8, 0x68, 0xd7, 0xd3, 0xb0, 0x4b, 0xd5, 0x6d, 0xa8, 0x87, 0xad, 0x1d, 0x38, 0xa3, + 0x18, 0x76, 0x11, 0x28, 0x91, 0x76, 0x89, 0xc8, 0xa2, 0x66, 0xd1, 0xe9, 0xf2, 0x13, 0x76, 0x19, + 0x72, 0x1a, 0xb0, 0xf3, 0xae, 0xfb, 0x21, 0x3d, 0xf6, 0x38, 0xec, 0xa0, 0x0d, 0xc9, 0x3f, 0xd0, + 0x71, 0xa7, 0x81, 0x1f, 0xb2, 0x64, 0x27, 0x43, 0x97, 0x9e, 0x2c, 0xbe, 0x7c, 0xdf, 0xe7, 0x79, + 0xf8, 0xf2, 0x21, 0x69, 0xf0, 0x20, 0xe2, 0x13, 0x42, 0x7f, 0xec, 0xe3, 0x59, 0x24, 0x18, 0x4f, + 0xb2, 0x97, 0x8f, 0xfa, 0x27, 0x0f, 0x43, 0x2a, 0xf0, 0xc3, 0x32, 0xe4, 0xa5, 0x53, 0x2e, 0xb8, + 0xbd, 0xa7, 0x13, 0xbd, 0x2a, 0xd1, 0x33, 0x89, 0x9d, 0x9d,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x0f, + 0xe4, 0x61, 0x0f, 0xb8, 0x4c, 0x55, 0xcf, 0x41, 0x03, 0x6d, 0x96, 0xa5, 0xfe, 0xf3, 0x37, 0xe7, + 0x5d, 0xeb, 0xed, 0x79, 0xd7, 0xfa, 0xfb, 0xbc, 0x6b, 0x9d, 0x5d, 0x74, 0x57, 0xde, 0x5e, 0x74, + 0x57, 0xfe, 0xb8, 0xe8, 0xae, 0x7c, 0xff, 0x78, 0xc1, 0xb7, 0xf2, 0x52, 0x3b, 0xe2, 0xa3, 0x11, + 0x8b, 0x18, 0x8e, 0xcd, 0xb8, 0xbf, 0xf0, 0xe7, 0x44, 0x39, 0x39, 0x5c, 0x57, 0x7b, 0xfa, 0xf1, + 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4d, 0xa3, 0x11, 0xd1, 0xbe, 0x08, 0x00, 0x00, } func (m *AuctionHistorical) Marshal() (dAtA []byte, err error) { @@ -373,6 +382,18 @@ func (m *AuctionHistorical) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.LockedVault != nil { + { + size, err := m.LockedVault.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } if m.AuctionHistorical != nil { { size, err := m.AuctionHistorical.MarshalToSizedBuffer(dAtA[:i]) @@ -440,21 +461,21 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x68 } - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintAuction(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x62 - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) if err3 != nil { return 0, err3 } i -= n3 i = encodeVarintAuction(dAtA, i, uint64(n3)) i-- + dAtA[i] = 0x62 + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintAuction(dAtA, i, uint64(n4)) + i-- dAtA[i] = 0x5a if m.LockedVaultId != 0 { i = encodeVarintAuction(dAtA, i, uint64(m.LockedVaultId)) @@ -607,6 +628,10 @@ func (m *AuctionHistorical) Size() (n int) { l = m.AuctionHistorical.Size() n += 1 + l + sovAuction(uint64(l)) } + if m.LockedVault != nil { + l = m.LockedVault.Size() + n += 1 + l + sovAuction(uint64(l)) + } return n } @@ -768,6 +793,42 @@ func (m *AuctionHistorical) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LockedVault", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LockedVault == nil { + m.LockedVault = &types.LockedVault{} + } + if err := m.LockedVault.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAuction(dAtA[iNdEx:]) From 811a4a787354599e7b9e1273ed603436b2381a24 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sun, 28 May 2023 01:21:45 +0530 Subject: [PATCH 074/155] updating PlaceDutcBid --- x/auctionsV2/keeper/bid.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 4b1ee5bbc..dd1ad1220 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -154,12 +154,24 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //else call the module account to give funds to compensate the user. leftOverCollateral := auctionData.CollateralToken.Amount - _, debtTokenForLeftOverCollateral, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice, leftOverCollateral, auctionData.DebtAssetId, debtPrice) - + + _, debtTokenAgainstLeftOverCollateral, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice, leftOverCollateral, auctionData.DebtAssetId, debtPrice) //Amount to call from reserve account for adjusting the auction target debt - debtGettingLeft := auctionData.DebtToken.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, debtTokenForLeftOverCollateral)) - + debtGettingLeft := auctionData.DebtToken.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, debtTokenAgainstLeftOverCollateral)) + + //Calling reserve account for debt adjustment : debtGettingLeft + + //Taking debtTokenAgainstLeftOverCollateral from user + //Sending leftOverCollateral to the user + //Burn Debt Token, + //Creating user bid struct + + //Based on app type call perform specific function - external , internal and /or keeper incentive + //See if this was keeper initiated transaction- then incentivisation will be in place based on the percentage + //For apps that are external to comdex chain + + //Add bidder data in auction } From 1691fedb3755eb944196b0d78ed5e0bd6fb3b42e Mon Sep 17 00:00:00 2001 From: Pratik Date: Sun, 28 May 2023 01:30:13 +0530 Subject: [PATCH 075/155] adding AppReserveFunds txn cmd --- .../liquidationsV2/v1beta1/liquidate.proto | 73 +- proto/comdex/liquidationsV2/v1beta1/tx.proto | 18 +- x/liquidationsV2/client/cli/tx.go | 41 + x/liquidationsV2/expected/keeper.go | 1 + x/liquidationsV2/handler.go | 4 + x/liquidationsV2/keeper/liquidate.go | 87 ++ x/liquidationsV2/keeper/msg_server.go | 8 + x/liquidationsV2/types/keys.go | 11 + x/liquidationsV2/types/liquidate.pb.go | 870 ++++++++++++++++-- x/liquidationsV2/types/msg.go | 38 + x/liquidationsV2/types/tx.pb.go | 482 +++++++++- 11 files changed, 1470 insertions(+), 163 deletions(-) diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index b0861eab5..af9a3415f 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -50,39 +50,42 @@ message LiquidationWhiteListing { ]; } message AppReserveFunds{ - uint64 app_id = 1 [ + uint64 app_id = 1 [ (gogoproto.customname) = "AppId", (gogoproto.moretags) = "yaml:\"app_id\""]; - uint64 asset_id = 2 [ - (gogoproto.customname) = "AppId", + uint64 asset_id = 2 [ + (gogoproto.customname) = "AssetId", (gogoproto.moretags) = "yaml:\"asset_id\""]; - cosmos.base.v1beta1.Coin token_quantity = 3 [ - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.moretags) = "yaml:\"token_quantity\"", - (gogoproto.nullable) = false]; - + cosmos.base.v1beta1.Coin token_quantity = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.moretags) = "yaml:\"token_quantity\"", + (gogoproto.nullable) = false + ]; } message AppReserveFundsTxData{ - uint64 app_id = 1 [ + uint64 app_id = 1 [ (gogoproto.customname) = "AppId", - (gogoproto.moretags) = "yaml:\"app_id\""]; - repeated AssetTxData asset_tx_data =2[ - (gogoproto.customname) = "AssetTxData", - (gogoproto.moretags) = "yaml:\"asset_tx_data\""]; + (gogoproto.moretags) = "yaml:\"app_id\"" + ]; + repeated AssetTxData asset_tx_data = 2[ + (gogoproto.customname) = "AssetTxData", + (gogoproto.moretags) = "yaml:\"asset_tx_data\"", + (gogoproto.nullable) = false + ]; } message AssetTxData{ - uint64 asset_id = 1 [ - (gogoproto.customname) = "AppId", + (gogoproto.customname) = "AssetId", (gogoproto.moretags) = "yaml:\"asset_id\""]; - string tx_type = 2 [ - (gogoproto.moretags) = "yaml:\"tx_type\"" - ]; - cosmos.base.v1beta1.Coin token_quantity = 3 [ - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.moretags) = "yaml:\"token_quantity\"", - (gogoproto.nullable) = false]; + string tx_type = 2 [ + (gogoproto.moretags) = "yaml:\"tx_type\"" + ]; + cosmos.base.v1beta1.Coin token_quantity = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.moretags) = "yaml:\"token_quantity\"", + (gogoproto.nullable) = false + ]; } message DutchAuctionParam{ @@ -144,8 +147,6 @@ message LockedVault { (gogoproto.customname) = "ExtendedPairId", (gogoproto.moretags) = "yaml:\"extended_pair_vault_id\""]; - - string owner = 5 [ (gogoproto.customname) = "Owner", (gogoproto.moretags) = "yaml:\"owner\""]; @@ -219,20 +220,20 @@ message LockedVault { (gogoproto.customname) = "AuctionType", (gogoproto.moretags) = "yaml:\"auction_type\""]; bool is_debt_cmst = 20 [ - (gogoproto.customname) = "IsDebtCmst", - (gogoproto.moretags) = "yaml:\"is_debt_cmst\""]; - - // uint64 pair_id = 21 [ - // (gogoproto.customname) = "PairId", - // (gogoproto.moretags) = "yaml:\"pair_id\""]; - uint64 collateral_asset_id = 21 [ - (gogoproto.moretags) = "yaml:\"collateral_asset_id\"" - ]; - uint64 debt_asset_id = 22 [ - (gogoproto.moretags) = "yaml:\"debt_asset_id\"" + (gogoproto.customname) = "IsDebtCmst", + (gogoproto.moretags) = "yaml:\"is_debt_cmst\""]; + + // uint64 pair_id = 21 [ + // (gogoproto.customname) = "PairId", + // (gogoproto.moretags) = "yaml:\"pair_id\""]; + uint64 collateral_asset_id = 21 [ + (gogoproto.moretags) = "yaml:\"collateral_asset_id\"" + ]; + uint64 debt_asset_id = 22 [ + (gogoproto.moretags) = "yaml:\"debt_asset_id\"" - ]; + ]; } diff --git a/proto/comdex/liquidationsV2/v1beta1/tx.proto b/proto/comdex/liquidationsV2/v1beta1/tx.proto index 5416ba675..4819257a0 100644 --- a/proto/comdex/liquidationsV2/v1beta1/tx.proto +++ b/proto/comdex/liquidationsV2/v1beta1/tx.proto @@ -11,10 +11,11 @@ option (gogoproto.goproto_getters_all) = false; service Msg { rpc MsgLiquidateInternalKeeper(MsgLiquidateInternalKeeperRequest) returns (MsgLiquidateInternalKeeperResponse); + rpc MsgAppReserveFunds(MsgAppReserveFundsRequest) returns (MsgAppReserveFundsResponse); } message MsgLiquidateInternalKeeperRequest { - string from = 1 [ (gogoproto.moretags) = "yaml:\"from\"" ]; + string from = 1 [(gogoproto.moretags) = "yaml:\"from\""]; uint64 liq_type = 2 [ (gogoproto.customname) = "LiqType", @@ -25,3 +26,18 @@ message MsgLiquidateInternalKeeperRequest { (gogoproto.moretags) = "yaml:\"id\""]; } message MsgLiquidateInternalKeeperResponse{} + +message MsgAppReserveFundsRequest { + uint64 app_id = 1 [ + (gogoproto.customname) = "AppId", + (gogoproto.moretags) = "yaml:\"app_id\"" + ]; + uint64 asset_id = 2 [ + (gogoproto.customname) = "AssetId", + (gogoproto.moretags) = "yaml:\"asset_id\"" + ]; + cosmos.base.v1beta1.Coin token_quantity = 3 [(gogoproto.nullable) = false]; + string from = 4 [(gogoproto.moretags) = "yaml:\"from\""]; + +} +message MsgAppReserveFundsResponse{} diff --git a/x/liquidationsV2/client/cli/tx.go b/x/liquidationsV2/client/cli/tx.go index f17367d05..8947c7f1c 100644 --- a/x/liquidationsV2/client/cli/tx.go +++ b/x/liquidationsV2/client/cli/tx.go @@ -39,6 +39,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand( txLiquidateInternalKeeper(), + txAppReserveFunds(), ) return cmd } @@ -78,6 +79,46 @@ func txLiquidateInternalKeeper() *cobra.Command { return cmd } +func txAppReserveFunds() *cobra.Command { + cmd := &cobra.Command{ + Use: "app-reserve-funds [app-id] [asset-id] [amount]", + Short: "app reserve funds", + Args: cobra.ExactArgs(4), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + appId, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + + assetId, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + + amount, err := sdk.ParseCoinNormalized(args[2]) + if err != nil { + return err + } + + msg := types.NewMsgAppReserveFundsRequest(ctx.GetFromAddress().String(), appId, assetId, amount) + + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(ctx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + func NewCmdSubmitWhitelistingLiquidationProposal() *cobra.Command { cmd := &cobra.Command{ Use: "add-liquidation-whitelisting [flags]", diff --git a/x/liquidationsV2/expected/keeper.go b/x/liquidationsV2/expected/keeper.go index 3f543d320..4a0a02a2b 100644 --- a/x/liquidationsV2/expected/keeper.go +++ b/x/liquidationsV2/expected/keeper.go @@ -23,6 +23,7 @@ type BankKeeper interface { SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin SendCoinsFromModuleToAccount(ctx sdk.Context, name string, address sdk.AccAddress, coins sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, address sdk.AccAddress, name string, coins sdk.Coins) error } type AssetKeeper interface { diff --git a/x/liquidationsV2/handler.go b/x/liquidationsV2/handler.go index 7dbf74f1f..02b556408 100644 --- a/x/liquidationsV2/handler.go +++ b/x/liquidationsV2/handler.go @@ -19,6 +19,10 @@ func NewHandler(k keeper.Keeper) sdk.Handler { case *types.MsgLiquidateInternalKeeperRequest: res, err := server.MsgLiquidateInternalKeeper(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgAppReserveFundsRequest: + res, err := server.MsgAppReserveFunds(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + default: return nil, sdkerrors.Wrapf(types.ErrorUnknownMsgType, "%T", msg) } diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 380fdbdb8..214c922de 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -465,3 +465,90 @@ func (k Keeper) getDebtSellTokenAmount(ctx sdk.Context, AssetInID, AssetOutID ui } return sdk.NewCoin(collateralAsset.Denom, debtLotSize), sdk.NewCoin(debtAsset.Denom, lotSize) } + +func (k Keeper) MsgAppReserveFundsFn(ctx sdk.Context, from string, appId, assetId uint64, tokenQuantity sdk.Coin) error { + appReserveFunds, found := k.GetAppReserveFunds(ctx, appId, assetId) + if !found { + appReserveFunds = types.AppReserveFunds{ + AppId: appId, + AssetId: assetId, + TokenQuantity: tokenQuantity, + } + } else { + appReserveFunds.TokenQuantity.Amount = appReserveFunds.TokenQuantity.Amount.Add(tokenQuantity.Amount) + } + + addr, err := sdk.AccAddressFromBech32(from) + if err != nil { + return err + } + + err = k.bank.SendCoinsFromAccountToModule(ctx, addr, types.ModuleName, sdk.NewCoins(tokenQuantity)) + if err != nil { + return err + } + k.SetAppReserveFunds(ctx, appReserveFunds) + + // trigger AppReserveFundsTxData + + assetTxData := types.AssetTxData{ + AssetId: assetId, + TxType: "credit", + TokenQuantity: tokenQuantity, + } + + appReserveFundsTxData, _ := k.GetAppReserveFundsTxData(ctx, appId) + appReserveFundsTxData.AssetTxData = append(appReserveFundsTxData.AssetTxData, assetTxData) + k.SetAppReserveFundsTxData(ctx, appReserveFundsTxData) + return nil +} + +func (k Keeper) SetAppReserveFunds(ctx sdk.Context, appReserveFunds types.AppReserveFunds) { + var ( + store = k.Store(ctx) + key = types.AppReserveFundsKey(appReserveFunds.AppId, appReserveFunds.AssetId) + value = k.cdc.MustMarshal(&appReserveFunds) + ) + + store.Set(key, value) +} + +func (k Keeper) GetAppReserveFunds(ctx sdk.Context, appId, assetId uint64) (appReserveFunds types.AppReserveFunds, found bool) { + var ( + store = k.Store(ctx) + key = types.AppReserveFundsKey(appId, assetId) + value = store.Get(key) + ) + + if value == nil { + return appReserveFunds, false + } + + k.cdc.MustUnmarshal(value, &appReserveFunds) + return appReserveFunds, true +} + +func (k Keeper) SetAppReserveFundsTxData(ctx sdk.Context, appReserveFundsTxData types.AppReserveFundsTxData) { + var ( + store = k.Store(ctx) + key = types.AppReserveFundsTxDataKey(appReserveFundsTxData.AppId) + value = k.cdc.MustMarshal(&appReserveFundsTxData) + ) + + store.Set(key, value) +} + +func (k Keeper) GetAppReserveFundsTxData(ctx sdk.Context, appId uint64) (appReserveFundsTxData types.AppReserveFundsTxData, found bool) { + var ( + store = k.Store(ctx) + key = types.AppReserveFundsTxDataKey(appId) + value = store.Get(key) + ) + + if value == nil { + return appReserveFundsTxData, false + } + + k.cdc.MustUnmarshal(value, &appReserveFundsTxData) + return appReserveFundsTxData, true +} diff --git a/x/liquidationsV2/keeper/msg_server.go b/x/liquidationsV2/keeper/msg_server.go index 07d248848..2e59bc955 100644 --- a/x/liquidationsV2/keeper/msg_server.go +++ b/x/liquidationsV2/keeper/msg_server.go @@ -34,3 +34,11 @@ func (m msgServer) MsgLiquidateInternalKeeper(c context.Context, req *types.MsgL }) return &types.MsgLiquidateInternalKeeperResponse{}, nil } + +func (m msgServer) MsgAppReserveFunds(c context.Context, req *types.MsgAppReserveFundsRequest) (*types.MsgAppReserveFundsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + if err := m.keeper.MsgAppReserveFundsFn(ctx, req.From, req.AppId, req.AssetId, req.TxType, req.TokenQuantity); err != nil { + return nil, err + } + return &types.MsgAppReserveFundsResponse{}, nil +} diff --git a/x/liquidationsV2/types/keys.go b/x/liquidationsV2/types/keys.go index d9b7a6b8a..ad7218921 100644 --- a/x/liquidationsV2/types/keys.go +++ b/x/liquidationsV2/types/keys.go @@ -21,11 +21,14 @@ const ( var ( TypeMsgLiquidateRequest = ModuleName + ":liquidate" + TypeAppReserveFundsRequest = ModuleName + ":app_reserve_funds" AppIdsKeyPrefix = []byte{0x01} LiquidationOffsetHolderKeyPrefix = []byte{0x02} LockedVaultIDKey = []byte{0x03} LockedVaultKeyPrefix = []byte{0x04} LiquidationWhiteListingKeyPrefix = []byte{0x05} + AppReserveFundsKeyPrefix = []byte{0x06} + AppReserveFundsTxDataKeyPrefix = []byte{0x07} ) // LengthPrefixString returns length-prefixed bytes representation @@ -60,3 +63,11 @@ func LockedVaultKeyByApp(appID uint64) []byte { func LiquidationWhiteListingKey(appId uint64) []byte { return append(LiquidationWhiteListingKeyPrefix, sdk.Uint64ToBigEndian(appId)...) } + +func AppReserveFundsKey(appID, assetID uint64) []byte { + return append(append(AppReserveFundsKeyPrefix, sdk.Uint64ToBigEndian(appID)...), sdk.Uint64ToBigEndian(assetID)...) +} + +func AppReserveFundsTxDataKey(appId uint64) []byte { + return append(AppReserveFundsTxDataKeyPrefix, sdk.Uint64ToBigEndian(appId)...) +} diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index d9f098198..182927080 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -80,6 +80,122 @@ func (m *LiquidationWhiteListing) XXX_DiscardUnknown() { var xxx_messageInfo_LiquidationWhiteListing proto.InternalMessageInfo +type AppReserveFunds struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AssetId uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + TokenQuantity github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=token_quantity,json=tokenQuantity,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"token_quantity" yaml:"token_quantity"` +} + +func (m *AppReserveFunds) Reset() { *m = AppReserveFunds{} } +func (m *AppReserveFunds) String() string { return proto.CompactTextString(m) } +func (*AppReserveFunds) ProtoMessage() {} +func (*AppReserveFunds) Descriptor() ([]byte, []int) { + return fileDescriptor_631048b9d11253bf, []int{1} +} +func (m *AppReserveFunds) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AppReserveFunds) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AppReserveFunds.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AppReserveFunds) XXX_Merge(src proto.Message) { + xxx_messageInfo_AppReserveFunds.Merge(m, src) +} +func (m *AppReserveFunds) XXX_Size() int { + return m.Size() +} +func (m *AppReserveFunds) XXX_DiscardUnknown() { + xxx_messageInfo_AppReserveFunds.DiscardUnknown(m) +} + +var xxx_messageInfo_AppReserveFunds proto.InternalMessageInfo + +type AppReserveFundsTxData struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AssetTxData []AssetTxData `protobuf:"bytes,2,rep,name=asset_tx_data,json=assetTxData,proto3" json:"asset_tx_data" yaml:"asset_tx_data"` +} + +func (m *AppReserveFundsTxData) Reset() { *m = AppReserveFundsTxData{} } +func (m *AppReserveFundsTxData) String() string { return proto.CompactTextString(m) } +func (*AppReserveFundsTxData) ProtoMessage() {} +func (*AppReserveFundsTxData) Descriptor() ([]byte, []int) { + return fileDescriptor_631048b9d11253bf, []int{2} +} +func (m *AppReserveFundsTxData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AppReserveFundsTxData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AppReserveFundsTxData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AppReserveFundsTxData) XXX_Merge(src proto.Message) { + xxx_messageInfo_AppReserveFundsTxData.Merge(m, src) +} +func (m *AppReserveFundsTxData) XXX_Size() int { + return m.Size() +} +func (m *AppReserveFundsTxData) XXX_DiscardUnknown() { + xxx_messageInfo_AppReserveFundsTxData.DiscardUnknown(m) +} + +var xxx_messageInfo_AppReserveFundsTxData proto.InternalMessageInfo + +type AssetTxData struct { + AssetId uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + TxType string `protobuf:"bytes,2,opt,name=tx_type,json=txType,proto3" json:"tx_type,omitempty" yaml:"tx_type"` + TokenQuantity github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=token_quantity,json=tokenQuantity,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"token_quantity" yaml:"token_quantity"` +} + +func (m *AssetTxData) Reset() { *m = AssetTxData{} } +func (m *AssetTxData) String() string { return proto.CompactTextString(m) } +func (*AssetTxData) ProtoMessage() {} +func (*AssetTxData) Descriptor() ([]byte, []int) { + return fileDescriptor_631048b9d11253bf, []int{3} +} +func (m *AssetTxData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AssetTxData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AssetTxData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AssetTxData) XXX_Merge(src proto.Message) { + xxx_messageInfo_AssetTxData.Merge(m, src) +} +func (m *AssetTxData) XXX_Size() int { + return m.Size() +} +func (m *AssetTxData) XXX_DiscardUnknown() { + xxx_messageInfo_AssetTxData.DiscardUnknown(m) +} + +var xxx_messageInfo_AssetTxData proto.InternalMessageInfo + type DutchAuctionParam struct { Premium github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=premium,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"premium" yaml:"premium"` Discount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=discount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"discount" yaml:"discount"` @@ -90,7 +206,7 @@ func (m *DutchAuctionParam) Reset() { *m = DutchAuctionParam{} } func (m *DutchAuctionParam) String() string { return proto.CompactTextString(m) } func (*DutchAuctionParam) ProtoMessage() {} func (*DutchAuctionParam) Descriptor() ([]byte, []int) { - return fileDescriptor_631048b9d11253bf, []int{1} + return fileDescriptor_631048b9d11253bf, []int{4} } func (m *DutchAuctionParam) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -127,7 +243,7 @@ func (m *EnglishAuctionParam) Reset() { *m = EnglishAuctionParam{} } func (m *EnglishAuctionParam) String() string { return proto.CompactTextString(m) } func (*EnglishAuctionParam) ProtoMessage() {} func (*EnglishAuctionParam) Descriptor() ([]byte, []int) { - return fileDescriptor_631048b9d11253bf, []int{2} + return fileDescriptor_631048b9d11253bf, []int{5} } func (m *EnglishAuctionParam) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -164,7 +280,7 @@ func (m *LiquidationOffsetHolder) Reset() { *m = LiquidationOffsetHolder func (m *LiquidationOffsetHolder) String() string { return proto.CompactTextString(m) } func (*LiquidationOffsetHolder) ProtoMessage() {} func (*LiquidationOffsetHolder) Descriptor() ([]byte, []int) { - return fileDescriptor_631048b9d11253bf, []int{3} + return fileDescriptor_631048b9d11253bf, []int{6} } func (m *LiquidationOffsetHolder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -226,7 +342,7 @@ func (m *LockedVault) Reset() { *m = LockedVault{} } func (m *LockedVault) String() string { return proto.CompactTextString(m) } func (*LockedVault) ProtoMessage() {} func (*LockedVault) Descriptor() ([]byte, []int) { - return fileDescriptor_631048b9d11253bf, []int{4} + return fileDescriptor_631048b9d11253bf, []int{7} } func (m *LockedVault) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -257,6 +373,9 @@ var xxx_messageInfo_LockedVault proto.InternalMessageInfo func init() { proto.RegisterType((*LiquidationWhiteListing)(nil), "comdex.liquidationsV2.v1beta1.LiquidationWhiteListing") + proto.RegisterType((*AppReserveFunds)(nil), "comdex.liquidationsV2.v1beta1.AppReserveFunds") + proto.RegisterType((*AppReserveFundsTxData)(nil), "comdex.liquidationsV2.v1beta1.AppReserveFundsTxData") + proto.RegisterType((*AssetTxData)(nil), "comdex.liquidationsV2.v1beta1.AssetTxData") proto.RegisterType((*DutchAuctionParam)(nil), "comdex.liquidationsV2.v1beta1.DutchAuctionParam") proto.RegisterType((*EnglishAuctionParam)(nil), "comdex.liquidationsV2.v1beta1.EnglishAuctionParam") proto.RegisterType((*LiquidationOffsetHolder)(nil), "comdex.liquidationsV2.v1beta1.LiquidationOffsetHolder") @@ -268,97 +387,107 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 1426 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xcf, 0xa6, 0x4d, 0x5a, 0x8f, 0xf3, 0xc3, 0x9e, 0xc4, 0xcd, 0x36, 0xdf, 0xd6, 0x93, 0xef, - 0x4a, 0x2d, 0x11, 0x52, 0xec, 0x26, 0x15, 0x02, 0x01, 0x12, 0x8d, 0x93, 0xb4, 0x18, 0x22, 0xda, - 0xae, 0xaa, 0x22, 0x55, 0xc0, 0xb2, 0xde, 0x1d, 0x3b, 0xa3, 0xd8, 0xbb, 0x66, 0x77, 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, 0xdb, 0xbd, 0xee, 0x9b, 0x86, 0x04, 0x18, 0xe6, 0x9c, 0xcd, 0xd7, 0xe1, 0x3b, 0xa0, 0x40, - 0x3c, 0x42, 0x89, 0x4d, 0xfd, 0x40, 0x9f, 0xdf, 0xd0, 0x36, 0x2f, 0x36, 0xfe, 0x1f, 0x31, 0x54, - 0x68, 0xc6, 0x8b, 0x43, 0x86, 0x4a, 0x92, 0x99, 0xe0, 0x0c, 0x33, 0xe5, 0x40, 0x0b, 0x40, 0x12, - 0x5a, 0xee, 0x80, 0x3a, 0x47, 0x96, 0xed, 0x50, 0x72, 0x62, 0x53, 0xec, 0xea, 0x17, 0x84, 0xd2, - 0x76, 0xc4, 0x50, 0xa9, 0x19, 0xee, 0x73, 0xe3, 0x6e, 0x6c, 0x1b, 0x32, 0x74, 0x59, 0x09, 0x4e, - 0xf0, 0x0c, 0xb3, 0x44, 0xc6, 0xe0, 0xf0, 0x7b, 0x0d, 0xac, 0x28, 0xd8, 0xc0, 0xe1, 0xaf, 0x6c, - 0xf5, 0xed, 0xc0, 0xee, 0xe9, 0x17, 0x37, 0xb4, 0xcd, 0xe2, 0xce, 0x8d, 0xda, 0x99, 0xa7, 0x50, - 0x93, 0x62, 0x92, 0x78, 0x8f, 0xf3, 0x1a, 0x37, 0x23, 0x86, 0xca, 0x13, 0xcb, 0x43, 0x86, 0xd6, - 0x65, 0x54, 0x39, 0xbe, 0x0c, 0xb3, 0xec, 0x8e, 0x13, 0x60, 0x07, 0xac, 0x92, 0xd0, 0xc2, 0x5e, - 0xa7, 0x4b, 0xc2, 0xec, 0xab, 0x17, 0xc4, 0xab, 0xbf, 0x16, 0x31, 0x04, 0x9b, 0xe1, 0x81, 0x34, - 0x67, 0x5f, 0xfe, 0x7f, 0xc9, 0xcb, 0x4f, 0x70, 0x0d, 0x13, 0x92, 0x09, 0x0a, 0xfc, 0x41, 0x03, - 0x95, 0x04, 0x3a, 0xb2, 0x05, 0x40, 0x6c, 0xc1, 0xce, 0x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39, 0xbc, 0x17, 0x2b, 0xa5, 0x83, 0x66, 0x8e, 0x1b, 0xc3, 0x2c, 0xb5, 0xc7, 0xf0, - 0xf0, 0x2b, 0x0d, 0x94, 0x5b, 0xbe, 0x37, 0x08, 0x15, 0xb8, 0x43, 0x4e, 0xb0, 0xa7, 0x97, 0x45, - 0x3c, 0x1f, 0x4d, 0x1d, 0xcf, 0x52, 0x83, 0x4b, 0x71, 0x0f, 0x77, 0xb8, 0x4e, 0x9a, 0x07, 0x13, - 0x2e, 0x0c, 0x73, 0xa9, 0x35, 0x82, 0x85, 0xf7, 0xc1, 0x52, 0x32, 0xf7, 0x5b, 0x5c, 0x54, 0x87, - 0x22, 0x8a, 0x57, 0x79, 0x4f, 0x4d, 0x3e, 0x18, 0x1e, 0x3c, 0xee, 0xe3, 0x21, 0x43, 0x95, 0xb1, - 0x8f, 0x06, 0x41, 0x30, 0xcc, 0x45, 0x92, 0xc5, 0xc1, 0x26, 0x58, 0x88, 0x07, 0x4c, 0x21, 0xb8, - 0x22, 0x52, 0xf6, 0x7a, 0xc4, 0x50, 0x51, 0xdd, 0x7a, 0x25, 0xb7, 0xa2, 0xbe, 0x5e, 0x32, 0x60, - 0xc3, 0x2c, 0xda, 0x29, 0x06, 0xde, 0x01, 0x0b, 0xfc, 0x83, 0x82, 0x97, 0x74, 0xa7, 0x17, 0x52, - 0x7d, 0x55, 0x48, 0x5d, 0x8b, 0x18, 0x02, 0xcd, 0x90, 0xdf, 0xdc, 0xbd, 0x5e, 0x48, 0x53, 0xa5, - 0x2c, 0xd6, 0x30, 0x01, 0x49, 0x20, 0xf0, 0x03, 0xb0, 0x92, 0xa9, 0x87, 0x76, 0x18, 0x62, 0xd1, - 0x7e, 0x2b, 0x72, 0x7e, 0x48, 0xcf, 0x2f, 0x07, 0x64, 0x98, 0xe5, 0x74, 0x75, 0x97, 0x2f, 0x36, - 0x5d, 0xf8, 0x36, 0x58, 0x14, 0x9e, 0x12, 0xa5, 0x4b, 0x42, 0x49, 0x1f, 0x32, 0xb4, 0x9a, 0xe9, - 0x43, 0xa9, 0x46, 0x91, 0x3f, 0x2b, 0x76, 0xe3, 0xd1, 0xd3, 0xbf, 0xaa, 0x33, 0x3f, 0x46, 0xd5, - 0x99, 0xa7, 0x51, 0x55, 0x7b, 0x16, 0x55, 0xb5, 0x3f, 0xa3, 0xaa, 0xf6, 0xe4, 0x79, 0x75, 0xe6, - 0xd9, 0xf3, 0xea, 0xcc, 0x6f, 0xcf, 0xab, 0x33, 0x8f, 0xde, 0x18, 0x39, 0x7c, 0xfe, 0x25, 0xb0, - 0xe5, 0xb7, 0xdb, 0xc4, 0x21, 0x76, 0x57, 0x3d, 0xd7, 0x27, 0xbe, 0x69, 0x45, 0x4a, 0xb4, 0xe6, - 0x45, 0x89, 0xba, 0xf9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa2, 0xe7, 0xb0, 0x1f, 0xf9, 0x0e, - 0x00, 0x00, + // 1600 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4b, 0x6f, 0x1b, 0x47, + 0x12, 0xd6, 0x48, 0xd6, 0x83, 0x4d, 0x51, 0x22, 0x5b, 0xa2, 0x45, 0x6b, 0x6d, 0x8e, 0x76, 0x00, + 0x7b, 0x05, 0x1b, 0x22, 0x2d, 0x19, 0x8b, 0x7d, 0x02, 0x6b, 0x51, 0x92, 0x6d, 0xee, 0x0a, 0x6b, + 0x7b, 0x20, 0x78, 0x01, 0x63, 0x77, 0x27, 0xcd, 0x99, 0x26, 0xd5, 0x10, 0x39, 0x43, 0xcf, 0x34, + 0x15, 0x0a, 0x01, 0x02, 0x24, 0x97, 0x20, 0x0f, 0x20, 0xce, 0x21, 0xe7, 0x5c, 0x93, 0x7f, 0x91, + 0x43, 0x80, 0x18, 0x39, 0xf9, 0x18, 0xe4, 0x30, 0x49, 0xc6, 0xff, 0x80, 0xc7, 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d, 0x76, 0x1b, 0x51, 0xec, 0xa2, 0xb6, 0xc1, 0xcf, 0x22, 0xef, 0x88, + 0xce, 0x3d, 0xfd, 0xff, 0x94, 0xa7, 0x5f, 0xee, 0x80, 0x61, 0x81, 0x89, 0xce, 0xff, 0x72, 0xcc, + 0x3e, 0x62, 0x64, 0xf8, 0x36, 0x00, 0x16, 0x6e, 0x50, 0x19, 0xcb, 0xfc, 0xab, 0x62, 0xd9, 0x97, + 0xb1, 0x14, 0xc2, 0xdd, 0x18, 0x52, 0x27, 0x8a, 0x22, 0xc3, 0x78, 0xc2, 0xff, 0x97, 0x0a, 0x50, + 0xc3, 0x2d, 0x19, 0xc7, 0x46, 0x3c, 0xbe, 0x77, 0x0d, 0x97, 0xfd, 0xf0, 0x36, 0x2c, 0x53, 0xeb, + 0x4f, 0x56, 0x27, 0x02, 0x5f, 0xbd, 0xbc, 0x27, 0x84, 0xf7, 0xa4, 0x6e, 0x28, 0xab, 0xb3, 0x7f, + 0x07, 0xbe, 0x7a, 0x4d, 0x26, 0xf4, 0x7c, 0xf7, 0x9a, 0x7e, 0xc5, 0x4c, 0xeb, 0xa0, 0x94, 0x10, + 0xfc, 0x42, 0x01, 0xeb, 0xa9, 0x45, 0x31, 0x1a, 0x38, 0xec, 0x69, 0x64, 0xb3, 0x76, 0x6e, 0x4e, + 0x1f, 0xca, 0x9c, 0x96, 0x45, 0x38, 0x7b, 0x89, 0x15, 0xaa, 0xe1, 0xdd, 0x50, 0x67, 0xa2, 0x04, + 0xaf, 0x99, 0xe3, 0x45, 0xe0, 0x3b, 0x0a, 0xc8, 0x52, 0xe4, 0xb6, 0x30, 0x35, 0xd8, 0x1a, 0xc8, + 0xf6, 0xee, 0x9c, 0xe0, 0x0e, 0x64, 0x70, 0x50, 0x5e, 0x3d, 0x31, 0x77, 0xa2, 0x80, 0x80, 0x20, + 0xee, 0xe3, 0x06, 0x85, 0x9f, 0x28, 0xa0, 0x98, 0xb8, 0xda, 0x8d, 0xe8, 0x79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41, 0x59, 0x79, 0xfa, 0xa2, 0x3c, 0xf5, 0xfc, 0x45, + 0x79, 0xea, 0xdb, 0x17, 0xe5, 0xa9, 0xc7, 0x7f, 0x4e, 0x2d, 0x3e, 0x7b, 0x7a, 0x6c, 0x39, 0xcd, + 0x26, 0x31, 0x09, 0x6a, 0xcb, 0xef, 0xea, 0xc8, 0x5f, 0x6c, 0xf8, 0x96, 0x68, 0xcc, 0xf1, 0x12, + 0x75, 0xeb, 0xe7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x51, 0xce, 0x1c, 0xd7, 0x11, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -453,6 +582,136 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *AppReserveFunds) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AppReserveFunds) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AppReserveFunds) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.TokenQuantity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.AssetId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.AssetId)) + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AppReserveFundsTxData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AppReserveFundsTxData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AppReserveFundsTxData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AssetTxData) > 0 { + for iNdEx := len(m.AssetTxData) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AssetTxData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.AppId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AssetTxData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AssetTxData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssetTxData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.TokenQuantity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLiquidate(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.TxType) > 0 { + i -= len(m.TxType) + copy(dAtA[i:], m.TxType) + i = encodeVarintLiquidate(dAtA, i, uint64(len(m.TxType))) + i-- + dAtA[i] = 0x12 + } + if m.AssetId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.AssetId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *DutchAuctionParam) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -682,12 +941,12 @@ func (m *LockedVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x60 } - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LiquidationTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LiquidationTimestamp):]) - if err3 != nil { - return 0, err3 + n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LiquidationTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LiquidationTimestamp):]) + if err5 != nil { + return 0, err5 } - i -= n3 - i = encodeVarintLiquidate(dAtA, i, uint64(n3)) + i -= n5 + i = encodeVarintLiquidate(dAtA, i, uint64(n5)) i-- dAtA[i] = 0x5a { @@ -812,6 +1071,59 @@ func (m *LiquidationWhiteListing) Size() (n int) { return n } +func (m *AppReserveFunds) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovLiquidate(uint64(m.AppId)) + } + if m.AssetId != 0 { + n += 1 + sovLiquidate(uint64(m.AssetId)) + } + l = m.TokenQuantity.Size() + n += 1 + l + sovLiquidate(uint64(l)) + return n +} + +func (m *AppReserveFundsTxData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovLiquidate(uint64(m.AppId)) + } + if len(m.AssetTxData) > 0 { + for _, e := range m.AssetTxData { + l = e.Size() + n += 1 + l + sovLiquidate(uint64(l)) + } + } + return n +} + +func (m *AssetTxData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AssetId != 0 { + n += 1 + sovLiquidate(uint64(m.AssetId)) + } + l = len(m.TxType) + if l > 0 { + n += 1 + l + sovLiquidate(uint64(l)) + } + l = m.TokenQuantity.Size() + n += 1 + l + sovLiquidate(uint64(l)) + return n +} + func (m *DutchAuctionParam) Size() (n int) { if m == nil { return 0 @@ -1159,6 +1471,364 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { } return nil } +func (m *AppReserveFunds) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AppReserveFunds: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AppReserveFunds: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + m.AssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenQuantity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLiquidate + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TokenQuantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLiquidate(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLiquidate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AppReserveFundsTxData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AppReserveFundsTxData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AppReserveFundsTxData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetTxData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLiquidate + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssetTxData = append(m.AssetTxData, AssetTxData{}) + if err := m.AssetTxData[len(m.AssetTxData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLiquidate(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLiquidate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AssetTxData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AssetTxData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AssetTxData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + m.AssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + 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 ErrInvalidLengthLiquidate + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TxType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenQuantity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLiquidate + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLiquidate + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TokenQuantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLiquidate(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLiquidate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *DutchAuctionParam) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/liquidationsV2/types/msg.go b/x/liquidationsV2/types/msg.go index 77ae0b57d..f5e4924d3 100644 --- a/x/liquidationsV2/types/msg.go +++ b/x/liquidationsV2/types/msg.go @@ -44,3 +44,41 @@ func (m *MsgLiquidateInternalKeeperRequest) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{from} } + +func NewMsgAppReserveFundsRequest(from string, appId, assetId uint64, TokenQuantity sdk.Coin) *MsgAppReserveFundsRequest { + return &MsgAppReserveFundsRequest{ + AppId: appId, + AssetId: assetId, + TokenQuantity: TokenQuantity, + From: from, + } +} + +func (m *MsgAppReserveFundsRequest) Route() string { + return RouterKey +} + +func (m *MsgAppReserveFundsRequest) Type() string { + return TypeAppReserveFundsRequest +} + +func (m *MsgAppReserveFundsRequest) ValidateBasic() error { + if m.AppId == 0 || m.AssetId == 0 || m.TokenQuantity.Amount == sdk.NewInt(0) { + return errors.Wrap(ErrVaultIDInvalid, "id cannot be zero") + } + + return nil +} + +func (m *MsgAppReserveFundsRequest) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) +} + +func (m *MsgAppReserveFundsRequest) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(m.From) + if err != nil { + panic(err) + } + + return []sdk.AccAddress{from} +} diff --git a/x/liquidationsV2/types/tx.pb.go b/x/liquidationsV2/types/tx.pb.go index 83043ea24..d8c1ea60d 100644 --- a/x/liquidationsV2/types/tx.pb.go +++ b/x/liquidationsV2/types/tx.pb.go @@ -6,7 +6,7 @@ package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -105,9 +105,87 @@ func (m *MsgLiquidateInternalKeeperResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgLiquidateInternalKeeperResponse proto.InternalMessageInfo +type MsgAppReserveFundsRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + AssetId uint64 `protobuf:"varint,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + TokenQuantity types.Coin `protobuf:"bytes,3,opt,name=token_quantity,json=tokenQuantity,proto3" json:"token_quantity"` + From string `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` +} + +func (m *MsgAppReserveFundsRequest) Reset() { *m = MsgAppReserveFundsRequest{} } +func (m *MsgAppReserveFundsRequest) String() string { return proto.CompactTextString(m) } +func (*MsgAppReserveFundsRequest) ProtoMessage() {} +func (*MsgAppReserveFundsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_51c735c845851e88, []int{2} +} +func (m *MsgAppReserveFundsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAppReserveFundsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAppReserveFundsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAppReserveFundsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAppReserveFundsRequest.Merge(m, src) +} +func (m *MsgAppReserveFundsRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgAppReserveFundsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAppReserveFundsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAppReserveFundsRequest proto.InternalMessageInfo + +type MsgAppReserveFundsResponse struct { +} + +func (m *MsgAppReserveFundsResponse) Reset() { *m = MsgAppReserveFundsResponse{} } +func (m *MsgAppReserveFundsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAppReserveFundsResponse) ProtoMessage() {} +func (*MsgAppReserveFundsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51c735c845851e88, []int{3} +} +func (m *MsgAppReserveFundsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAppReserveFundsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAppReserveFundsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAppReserveFundsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAppReserveFundsResponse.Merge(m, src) +} +func (m *MsgAppReserveFundsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAppReserveFundsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAppReserveFundsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAppReserveFundsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgLiquidateInternalKeeperRequest)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateInternalKeeperRequest") proto.RegisterType((*MsgLiquidateInternalKeeperResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateInternalKeeperResponse") + proto.RegisterType((*MsgAppReserveFundsRequest)(nil), "comdex.liquidationsV2.v1beta1.MsgAppReserveFundsRequest") + proto.RegisterType((*MsgAppReserveFundsResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgAppReserveFundsResponse") } func init() { @@ -115,31 +193,41 @@ func init() { } var fileDescriptor_51c735c845851e88 = []byte{ - // 384 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0x3f, 0x8e, 0x9b, 0x40, - 0x18, 0xc5, 0x19, 0x6c, 0xc5, 0xf1, 0xa4, 0xb0, 0x44, 0x52, 0x58, 0x48, 0x19, 0x1c, 0x1c, 0x45, - 0x6e, 0xc2, 0xc8, 0x4e, 0x93, 0xa4, 0x4a, 0xdc, 0x59, 0xb1, 0x1b, 0x14, 0xa5, 0x70, 0x13, 0xf1, - 0x67, 0x20, 0x23, 0x01, 0x03, 0xcc, 0x10, 0xd9, 0xb7, 0xc8, 0x15, 0xd2, 0x79, 0x6f, 0xe2, 0xd2, - 0xe5, 0x56, 0x68, 0x17, 0xdf,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 0x48, 0x6a, 0xda, 0x18, - 0xaa, 0xd4, 0x1f, 0x76, 0x1a, 0xd3, 0xeb, 0xaa, 0x34, 0xd4, 0x85, 0x7f, 0x2a, 0x8d, 0xbe, 0xe4, - 0xa9, 0x6f, 0xda, 0x2a, 0xf5, 0xcd, 0xf7, 0xd0, 0x3c, 0xb7, 0x29, 0x4f, 0x59, 0xc2, 0xc9, 0xec, - 0x02, 0xc0, 0xce, 0x8a, 0x87, 0xda, 0x7f, 0x00, 0xf5, 0xc7, 0x71, 0xed, 0x9b, 0x75, 0xb6, 0x6e, - 0xeb, 0xc9, 0x4e, 0xf4, 0xef, 0xcf, 0x38, 0x41, 0xee, 0x3a, 0x5f, 0xef, 0xaf, 0x91, 0xb2, 0xab, - 0x90, 0xb2, 0xaf, 0x10, 0x38, 0x54, 0x08, 0x5c, 0x55, 0x08, 0xfc, 0x3b, 0x22, 0xe5, 0x70, 0x44, - 0xca, 0xe5, 0x11, 0x29, 0xeb, 0xcf, 0x21, 0x15, 0x7f, 0x0a, 0xb7, 0x8e, 0xc2, 0x32, 0xee, 0x23, - 0x0b, 0x02, 0xea, 0x51, 0x27, 0x6a, 0x67, 0xfc, 0xe0, 0x65, 0xd5, 0xdd, 0x72, 0xf7, 0x45, 0x73, - 0xbf, 0x9f, 0x6e, 0x02, 0x00, 0x00, 0xff, 0xff, 0x38, 0x0d, 0x9d, 0x54, 0x7f, 0x02, 0x00, 0x00, + // 536 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0xb5, 0xd3, 0xb4, 0xa1, 0x5b, 0x95, 0x4a, 0x86, 0x43, 0x6a, 0x81, 0x5d, 0xb6, 0x08, 0xf5, + 0x82, 0xad, 0x84, 0x4b, 0xcb, 0x89, 0x04, 0xa9, 0x52, 0x45, 0x73, 0xc0, 0x42, 0x1c, 0x7a, 0x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db, 0xd2, 0xfe, + 0x5a, 0x43, 0x6b, 0x3d, 0x11, 0x59, 0x5f, 0x4c, 0x05, 0xfb, 0x4b, 0x17, 0xad, 0x57, 0xde, 0xca, + 0x2d, 0xf4, 0xee, 0x5c, 0x15, 0xbb, 0xf3, 0x1f, 0x2f, 0xe8, 0x5a, 0xad, 0x4f, 0x26, 0xb2, 0x6e, + 0x5a, 0xb1, 0x0e, 0xef, 0x7e, 0xf9, 0xf6, 0xa9, 0xdb, 0x47, 0xff, 0xc0, 0xd4, 0xb5, 0x74, 0xcf, + 0x66, 0x3f, 0x1c, 0xe3, 0xb2, 0x70, 0x8c, 0x59, 0xe1, 0x98, 0x57, 0x85, 0x63, 0x7e, 0x2f, 0x1c, + 0xf3, 0xf3, 0xdc, 0x31, 0xae, 0xe6, 0x8e, 0xf1, 0x6d, 0xee, 0x18, 0x67, 0x87, 0x11, 0x95, 0x1f, + 0xb2, 0x41, 0x29, 0xe1, 0x6b, 0x99, 0xe7, 0x6c, 0x34, 0xa2, 0x43, 0x4a, 0xe2, 0xea, 0xee, 0xdf, + 0xf8, 0xfc, 0xe5, 0xfa, 0x8b, 0xc1, 0x86, 0xfa, 0x82, 0x2f, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, + 0x74, 0xde, 0x62, 0x41, 0x22, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -155,6 +243,7 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { MsgLiquidateInternalKeeper(ctx context.Context, in *MsgLiquidateInternalKeeperRequest, opts ...grpc.CallOption) (*MsgLiquidateInternalKeeperResponse, error) + MsgAppReserveFunds(ctx context.Context, in *MsgAppReserveFundsRequest, opts ...grpc.CallOption) (*MsgAppReserveFundsResponse, error) } type msgClient struct { @@ -174,9 +263,19 @@ func (c *msgClient) MsgLiquidateInternalKeeper(ctx context.Context, in *MsgLiqui return out, nil } +func (c *msgClient) MsgAppReserveFunds(ctx context.Context, in *MsgAppReserveFundsRequest, opts ...grpc.CallOption) (*MsgAppReserveFundsResponse, error) { + out := new(MsgAppReserveFundsResponse) + err := c.cc.Invoke(ctx, "/comdex.liquidationsV2.v1beta1.Msg/MsgAppReserveFunds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { MsgLiquidateInternalKeeper(context.Context, *MsgLiquidateInternalKeeperRequest) (*MsgLiquidateInternalKeeperResponse, error) + MsgAppReserveFunds(context.Context, *MsgAppReserveFundsRequest) (*MsgAppReserveFundsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -186,6 +285,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) MsgLiquidateInternalKeeper(ctx context.Context, req *MsgLiquidateInternalKeeperRequest) (*MsgLiquidateInternalKeeperResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MsgLiquidateInternalKeeper not implemented") } +func (*UnimplementedMsgServer) MsgAppReserveFunds(ctx context.Context, req *MsgAppReserveFundsRequest) (*MsgAppReserveFundsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgAppReserveFunds not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -209,6 +311,24 @@ func _Msg_MsgLiquidateInternalKeeper_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _Msg_MsgAppReserveFunds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAppReserveFundsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgAppReserveFunds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.liquidationsV2.v1beta1.Msg/MsgAppReserveFunds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgAppReserveFunds(ctx, req.(*MsgAppReserveFundsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.liquidationsV2.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -217,6 +337,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MsgLiquidateInternalKeeper", Handler: _Msg_MsgLiquidateInternalKeeper_Handler, }, + { + MethodName: "MsgAppReserveFunds", + Handler: _Msg_MsgAppReserveFunds_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/liquidationsV2/v1beta1/tx.proto", @@ -285,6 +409,79 @@ func (m *MsgLiquidateInternalKeeperResponse) MarshalToSizedBuffer(dAtA []byte) ( return len(dAtA) - i, nil } +func (m *MsgAppReserveFundsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAppReserveFundsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAppReserveFundsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.From) > 0 { + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintTx(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.TokenQuantity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.AssetId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AssetId)) + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgAppReserveFundsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAppReserveFundsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAppReserveFundsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -324,6 +521,36 @@ func (m *MsgLiquidateInternalKeeperResponse) Size() (n int) { return n } +func (m *MsgAppReserveFundsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovTx(uint64(m.AppId)) + } + if m.AssetId != 0 { + n += 1 + sovTx(uint64(m.AssetId)) + } + l = m.TokenQuantity.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAppReserveFundsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -500,6 +727,209 @@ func (m *MsgLiquidateInternalKeeperResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAppReserveFundsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAppReserveFundsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAppReserveFundsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + m.AssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenQuantity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TokenQuantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAppReserveFundsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAppReserveFundsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAppReserveFundsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 1a20899689d0481fa5abfd96287aef4b84478fec Mon Sep 17 00:00:00 2001 From: Pratik Date: Sun, 28 May 2023 01:34:02 +0530 Subject: [PATCH 076/155] updating codec for txn --- x/liquidationsV2/types/codec.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/liquidationsV2/types/codec.go b/x/liquidationsV2/types/codec.go index bc84c6a97..ab42b922d 100644 --- a/x/liquidationsV2/types/codec.go +++ b/x/liquidationsV2/types/codec.go @@ -12,12 +12,14 @@ import ( func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgLiquidateInternalKeeperRequest{}, "comdex/liquidation/MsgLiquidateInternalKeeperRequest", nil) + cdc.RegisterConcrete(&MsgAppReserveFundsRequest{}, "comdex/liquidation/MsgAppReserveFundsRequest", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgLiquidateInternalKeeperRequest{}, + &MsgAppReserveFundsRequest{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } From 3f633520a7109f29394945041d73dd43072bd18d Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sun, 28 May 2023 19:55:46 +0530 Subject: [PATCH 077/155] updating PlaceDutcBid --- x/auctionsV2/keeper/bid.go | 184 ++++++++++++++++++++++++++++++++++++- 1 file changed, 183 insertions(+), 1 deletion(-) diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index dd1ad1220..0587eb99a 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -155,7 +155,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s leftOverCollateral := auctionData.CollateralToken.Amount - _, debtTokenAgainstLeftOverCollateral, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice, leftOverCollateral, auctionData.DebtAssetId, debtPrice) + _, debtTokenAgainstLeftOverCollateral, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice, leftOverCollateral.Sub(collateralTokenQuanitityForBonus), auctionData.DebtAssetId, debtPrice) //Amount to call from reserve account for adjusting the auction target debt debtGettingLeft := auctionData.DebtToken.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, debtTokenAgainstLeftOverCollateral)) @@ -210,6 +210,188 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s return nil } +func (k Keeper) PlaceDutchAuctionBid2(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction) error { + //The bid is in debt token - This is different from the earliar auction model at comdex + if bid.Amount.Equal(sdk.ZeroInt()) { + return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid amount can't be Zero") + } + liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, auctionData.AppId) + + if bid.Denom != auctionData.DebtToken.Denom { + return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the debt token ", bid.Denom) + } + liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, auctionData.AppId, auctionData.LockedVaultId) + //Price data of the token from market module + debtToken, _ := k.market.GetTwa(ctx, auctionData.DebtAssetId) + debtPrice := sdk.NewDecFromInt(sdk.NewInt(int64(debtToken.Twa))) + //Price data of the token from market module + collateralToken, _ := k.market.GetTwa(ctx, auctionData.CollateralAssetId) + collateralPrice := sdk.NewDecFromInt(sdk.NewInt(int64(collateralToken.Twa))) + + //only if debt token is CMST , we consider it as $1 + if liquidationData.IsDebtCmst { + debtPrice = sdk.NewDecFromInt(sdk.NewInt(int64(1000000))) + + } + isBidFinalBid := false + //If user has sent a bigger bid than the target amount , + if bid.Amount.GTE(auctionData.DebtToken.Amount) { + bid.Amount = auctionData.DebtToken.Amount + isBidFinalBid = true + // bidPercent := 0 + debtuDollar, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + //From auction bonus quantity , use the available quantity to calculate the collateral value + _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, liquidationData.BonusToBeGiven, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + + //Checking if the auction bonus and the collateral to be given to user isnt more than available colalteral + totalCollateralTokenQuanitity := collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus) + if !totalCollateralTokenQuanitity.LTE(auctionData.CollateralToken.Amount) { + + //This means that there is less collateral available . + + leftOverCollateral := auctionData.CollateralToken.Amount + _, debtTokenAgainstLeftOverCollateral, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice, leftOverCollateral.Sub(collateralTokenQuanitityForBonus), auctionData.DebtAssetId, debtPrice) + bid.Amount = debtTokenAgainstLeftOverCollateral + totalCollateralTokenQuanitity = leftOverCollateral + //Amount to call from reserve account for adjusting the auction target debt + //So we call the module account to give funds to compensate the user. + debtGettingLeft := auctionData.DebtToken.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, debtTokenAgainstLeftOverCollateral)) + + //Calling reserve account for debt adjustment : debtGettingLeft + //Updating the protocol was in loss stuct + } + //Take Debt Token from user , + if bid.Amount.GT(sdk.ZeroInt()) { + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) + if err != nil { + return err + } + } + + //Send Collateral To bidder + if totalCollateralTokenQuanitity.GT(sdk.ZeroInt()) { + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) + if err != nil { + return err + } + } + + //Burn Debt Token, + liquidationPenalty := sdk.NewCoin(auctionData.DebtToken.Denom, liquidationData.FeeToBeCollected) + tokensToBurn := auctionData.DebtToken.Sub(liquidationPenalty) + + if tokensToBurn.Amount.GT(sdk.ZeroInt()) { + err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(tokensToBurn)) + if err != nil { + return err + } + } + + //Send rest tokens to the user + OwnerLeftOverCapital := auctionData.CollateralToken.Amount.Sub(totalCollateralTokenQuanitity) + if OwnerLeftOverCapital.GT(sdk.ZeroInt()) { + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, OwnerLeftOverCapital))) + if err != nil { + return err + } + } + //Add bid data to struct + //Creating user bid struct + bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") + if err != nil { + return err + } + + //Based on app type call perform specific function - external , internal and /or keeper incentive + //See if this was keeper initiated transaction- then incentivisation will be in place based on the percentage + //For apps that are external to comdex chain + + if liquidationData.InitiatorType == "external" { + + //but if an app is external - will have to check the auction bonus , liquidation penalty , module account mechanism + + } else if liquidationData.InitiatorType == "vault" { + //Check if they are initiated through a keeper, if so they will be incentivised + if liquidationData.IsInternalKeeper { + + keeperIncentive := (liquidationWhitelistingAppData.KeeeperIncentive.Mul(sdk.NewDecFromInt(liquidationPenalty.Amount))).TruncateInt() + if keeperIncentive.GT(sdk.ZeroInt()) { + liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.InternalKeeperAddress), sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) + if err != nil { + return err + } + + } + } + //Send Liquidation Penalty to the Collector Module + if liquidationPenalty.Amount.GT(sdk.ZeroInt()) { + err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(liquidationPenalty)) + if err != nil { + return err + } + } + //Update Collector Data for CMST + // Updating fees data in collector + err = k.collector.SetNetFeeCollectedData(ctx, auctionData.AppId, auctionData.CollateralAssetId, liquidationPenalty.Amount) + if err != nil { + return err + } + //Updating mapping data of vault + k.vault.UpdateTokenMintedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, tokensToBurn.Amount, false) + k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, auctionData.CollateralToken.Amount, false) + + } else if liquidationData.InitiatorType == "borrow" { + //Check if they are initiated through a keeper, if so they will be incentivised + + } + + //Add bidder data in auction + bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{bidding_id, string(bidder)} + auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMapppingData) + //Savinga auction data to auction historical + auctionHistoricalData := auctionsV2types.AuctionHistorical{auctionID, &auctionData, &liquidationData} + k.SetAuctionHistorical(ctx, auctionHistoricalData) + //Close Auction + k.DeleteAuction(ctx, auctionData) + //Delete liquidation Data + k.LiquidationsV2.DeleteLockedVault(ctx, liquidationData.LockedVaultId) + + } else { + //if bid amount is less than the target bid + + //Checking if bid isnt leaving dust amount less than allowed -for collateral & debt + + //Calculating collateral token value from bid(debt) token value + debtuDollar, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, collateralPrice) + //From auction bonus quantity , use the available quantity to calculate the collateral value + + //Checking bid.Amount -> to targetbid ratio + //using that ratio data to calculate auction bonus to be given for the bid + //first taking the debt percentage data + //then calculating the collateral token data + _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, liquidationData.BonusToBeGiven, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + + if collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus).LTE(auctionData.CollateralToken.Amount) { + //If there is sufficient collalteral + + } else { + + //Not sure if this condition will arise in which partial bids also arent able to be fulfilled due to shortage of collateral token + // Technically this case will also close the auction + } + + //Deducting auction bonus value from liquidation data also for next bid. + } + //Deducting the auction bonus + + //Now checking if the bid is not the final bid, we will check the dust amount left by the bidder + //if the dust check passes, it is good to go. + //Dust check for debt token + + return nil +} + func (k Keeper) CreateUserBid(ctx sdk.Context, appID uint64, BidderAddress string, auctionID uint64, collateralToken sdk.Coin, debtToken sdk.Coin, bidType string) (bidding_id uint64, err error) { userBidId := k.GetUserBidID(ctx) From 5729012b06b67e8198267267a700c8af334f28f8 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Mon, 29 May 2023 04:31:33 +0530 Subject: [PATCH 078/155] finalised dutchAuction --- proto/comdex/auctionsV2/v1beta1/auction.proto | 19 +- proto/comdex/auctionsV2/v1beta1/bid.proto | 3 + x/auctionsV2/expected/keeper.go | 1 + x/auctionsV2/keeper/auctions.go | 30 +- x/auctionsV2/keeper/bid.go | 511 +++++++++--------- x/auctionsV2/types/auction.pb.go | 189 ++++--- x/auctionsV2/types/bid.pb.go | 140 +++-- x/auctionsV2/types/errors.go | 2 + x/liquidationsV2/keeper/liquidate.go | 33 +- x/liquidationsV2/types/errors.go | 7 +- 10 files changed, 534 insertions(+), 401 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index ba1cf27eb..42bde961f 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -29,21 +29,20 @@ message Auction{ (gogoproto.moretags) = "yaml:\"collateral_token\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - // cosmos.base.v1beta1.Coin outflow_token_current_amount = 3 [ - // (gogoproto.nullable) = false, - // (gogoproto.moretags) = "yaml:\"outflow_token_current_amount\"", - // (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" - // ]; + cosmos.base.v1beta1.Coin debt_token = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"inflow_token_target_amount\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - // cosmos.base.v1beta1.Coin inflow_token_current_amount = 5 [ + // string collateral_figure = 2 [ // (gogoproto.nullable) = false, - // (gogoproto.moretags) = "yaml:\"inflow_token_current_amount\"", + // (gogoproto.moretags) = "yaml:\"collateral_token\"", // (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" // ]; + + + uint64 active_bidding_id = 4 [ (gogoproto.moretags) = "yaml:\"active_bidding_id\"" ]; @@ -102,7 +101,11 @@ message Auction{ uint64 debt_asset_id = 16 [ (gogoproto.moretags) = "yaml:\"debt_asset_id\"" ]; - + string bonus_amount = 17 [ + (gogoproto.moretags) = "yaml:\"bonus_amount\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + ]; } diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto index 27277ef6b..85b0b69fc 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -102,6 +102,9 @@ message AuctionParams{ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"closing_fee\"" ]; + uint64 min_usd_value_left=5[ + (gogoproto.moretags) = "yaml:\"min_usd_value_left\"" + ]; } diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go index 58f83b966..99370d5c1 100644 --- a/x/auctionsV2/expected/keeper.go +++ b/x/auctionsV2/expected/keeper.go @@ -14,6 +14,7 @@ type LiquidationsV2Keeper interface { GetLiquidationWhiteListing(ctx sdk.Context, appId uint64) (liquidationWhiteListing liquidationsV2types.LiquidationWhiteListing, found bool) GetLockedVault(ctx sdk.Context, appID, id uint64) (lockedVault liquidationsV2types.LockedVault, found bool) DeleteLockedVault(ctx sdk.Context,id uint64) + WithdrawAppReserveFundsFn(ctx sdk.Context, appId, assetId uint64, tokenQuantity sdk.Coin) } type MarketKeeper interface { diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 245444220..66dedb983 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -5,8 +5,8 @@ import ( utils "github.com/comdex-official/comdex/types" - auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" "github.com/comdex-official/comdex/x/auctionsV2/types" + auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -48,13 +48,13 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati // pair, _ := k.asset.GetPair(ctx, liquidationData.PairId) - twaDataCollateral, found := k.market.GetTwa(ctx,liquidationData.CollateralAssetId) + twaDataCollateral, found := k.market.GetTwa(ctx, liquidationData.CollateralAssetId) if !found || !twaDataCollateral.IsPriceActive { - return auctionsV2types.ErrorPrices + return auctionsV2types.ErrorPriceNotFound } twaDataDebt, found := k.market.GetTwa(ctx, liquidationData.DebtAssetId) if !found || !twaDataDebt.IsPriceActive { - return auctionsV2types.ErrorPrices + return auctionsV2types.ErrorPriceNotFound } //Checking if DEBT token is CMST then setting its price to $1 , else all tokens price will come from oracle. if liquidationData.IsDebtCmst { @@ -84,8 +84,9 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), AppId: liquidationData.AppId, AuctionType: liquidationData.AuctionType, - CollateralAssetId: pair.AssetIn, - DebtAssetId: pair.AssetOut, + CollateralAssetId: liquidationData.CollateralAssetId, + DebtAssetId: liquidationData.DebtAssetId, + BonusAmount: liquidationData.BonusToBeGiven, } k.SetAuctionID(ctx, auctionData.AuctionId) @@ -148,13 +149,14 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { //FOr esm , can also check vault as initiator exists or not just to be sure if found && esmStatus.Status { //Checking if auction price is supposed to be reduced or restared - //Check here if initiator is vault , then for vault do esm trigger option accordingly //Checking condition if ctx.BlockTime().After(auction.EndTime) { //If restart - DO ESM specific operation - //MOst Probably Close Auction + //Most Probably Close Auction + + //Check here if initiator is vault , then for vault do esm trigger option accordingly } else { //Else reduce - normal operation @@ -165,7 +167,7 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { } - } else if !found { + } else if !found || !esmStatus.Status { //This app is not eligible for ESM //Continue normal operation @@ -196,7 +198,7 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { //English auction does not require price so no important operation if ctx.BlockTime().After(auction.EndTime) { - if auction.ActiveBiddingId != nil { + if auction.ActiveBiddingId != uint64(0) { //If atleast there is one bidding on the auction err := k.CloseEnglishAuction(ctx, auction) if err != nil { @@ -263,11 +265,11 @@ func (k Keeper) RestartDutchAuction(ctx sdk.Context, dutchAuction types.Auction) twaDataCollateral, found := k.market.GetTwa(ctx, dutchAuction.CollateralAssetId) if !found || !twaDataCollateral.IsPriceActive { - return auctiontypes.ErrorPrices + return auctionsV2types.ErrorPriceNotFound } twaDataDebt, found := k.market.GetTwa(ctx, dutchAuction.DebtAssetId) if !found || !twaDataDebt.IsPriceActive { - return auctiontypes.ErrorPrices + return auctionsV2types.ErrorPriceNotFound } liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, dutchAuction.AppId, dutchAuction.LockedVaultId) //Checking if DEBT token is CMST then setting its price to $1 , else all tokens price will come from oracle. @@ -309,11 +311,11 @@ func (k Keeper) UpdateDutchAuction(ctx sdk.Context, dutchAuction types.Auction) twaDataCollateral, found := k.market.GetTwa(ctx, dutchAuction.CollateralAssetId) if !found || !twaDataCollateral.IsPriceActive { - return auctiontypes.ErrorPrices + return auctionsV2types.ErrorPriceNotFound } twaDataDebt, found := k.market.GetTwa(ctx, dutchAuction.DebtAssetId) if !found || !twaDataDebt.IsPriceActive { - return auctiontypes.ErrorPrices + return auctionsV2types.ErrorPriceNotFound } liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, dutchAuction.AppId, dutchAuction.LockedVaultId) //Checking if DEBT token is CMST then setting its price to $1 , else all tokens price will come from oracle. diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 0587eb99a..00cd7b283 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -10,8 +10,208 @@ import ( protobuftypes "github.com/gogo/protobuf/types" ) +// func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction) error { +// //The bid is in debt token - This is different from the earliar auction model at comdex +// if bid.Amount.Equal(sdk.ZeroInt()) { +// return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid amount can't be Zero") +// } +// liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, auctionData.AppId) + +// if bid.Denom != auctionData.DebtToken.Denom { +// return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the debt token ", bid.Denom) +// } +// liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, auctionData.AppId, auctionData.LockedVaultId) +// //Price data of the token from market module +// debtToken, _ := k.market.GetTwa(ctx, auctionData.DebtAssetId) +// debtPrice := sdk.NewDecFromInt(sdk.NewInt(int64(debtToken.Twa))) +// //Price data of the token from market module +// collateralToken, _ := k.market.GetTwa(ctx, auctionData.CollateralAssetId) +// collateralPrice := sdk.NewDecFromInt(sdk.NewInt(int64(collateralToken.Twa))) + +// //only if debt token is CMST , we consider it as $1 +// if liquidationData.IsDebtCmst { +// debtPrice = sdk.NewDecFromInt(sdk.NewInt(int64(1000000))) + +// } +// isBidFinalBid := false +// //If user has sent a bigger bid than the target amount , +// if bid.Amount.GTE(auctionData.DebtToken.Amount) { +// bid.Amount = auctionData.DebtToken.Amount +// isBidFinalBid = true +// // bidPercent := 0 +// debtuDollar, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) +// //From auction bonus quantity , use the available quantity to calculate the collateral value +// _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, liquidationData.BonusToBeGiven, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + +// //Checking if the auction bonus and the collateral to be given to user isnt more than available colalteral +// totalCollateralTokenQuanitity := collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus) +// if totalCollateralTokenQuanitity.LTE(auctionData.CollateralToken.Amount) { +// //If everything is correct + +// //Take Debt Token from user , +// if bid.Amount.GT(sdk.ZeroInt()) { +// err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) +// if err != nil { +// return err +// } +// } + +// //Send Collateral To bidder +// if bid.Amount.GT(sdk.ZeroInt()) { +// err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) +// if err != nil { +// return err +// } +// } + +// //Burn Debt Token, +// liquidationPenalty := sdk.NewCoin(auctionData.DebtToken.Denom, liquidationData.FeeToBeCollected) +// tokensToBurn := auctionData.DebtToken.Sub(liquidationPenalty) + +// if tokensToBurn.Amount.GT(sdk.ZeroInt()) { +// err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(tokensToBurn)) +// if err != nil { +// return err +// } +// } + +// //Send rest tokens to the user +// OwnerLeftOverCapital := auctionData.CollateralToken.Amount.Sub(totalCollateralTokenQuanitity) +// if bid.Amount.GT(sdk.ZeroInt()) { +// err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, OwnerLeftOverCapital))) +// if err != nil { +// return err +// } +// } +// //Add bid data to struct +// //Creating user bid struct +// bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") +// if err != nil { +// return err +// } +// //Based on app type call perform specific function - external , internal and /or keeper incentive +// //See if this was keeper initiated transaction- then incentivisation will be in place based on the percentage +// //For apps that are external to comdex chain +// if liquidationData.InitiatorType == "external" { + +// //but if an app is external - will have to check the auction bonus , liquidation penalty , module account mechanism + +// } else if liquidationData.InitiatorType == "vault" { +// //Check if they are initiated through a keeper, if so they will be incentivised +// if liquidationData.IsInternalKeeper { + +// keeperIncentive := (liquidationWhitelistingAppData.KeeeperIncentive.Mul(sdk.NewDecFromInt(liquidationPenalty.Amount))).TruncateInt() +// if keeperIncentive.GT(sdk.ZeroInt()) { +// liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) +// err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.InternalKeeperAddress), sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) +// if err != nil { +// return err +// } + +// } +// } +// //Send Liquidation Penalty to the Collector Module +// if liquidationPenalty.Amount.GT(sdk.ZeroInt()) { +// err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(liquidationPenalty)) +// if err != nil { +// return err +// } +// } +// //Update Collector Data for CMST +// // Updating fees data in collector +// err = k.collector.SetNetFeeCollectedData(ctx, auctionData.AppId, auctionData.CollateralAssetId, liquidationPenalty.Amount) +// if err != nil { +// return err +// } +// //Updating mapping data of vault +// k.vault.UpdateTokenMintedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, tokensToBurn.Amount, false) +// k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, auctionData.CollateralToken.Amount, false) + +// } else if liquidationData.InitiatorType == "borrow" { +// //Check if they are initiated through a keeper, if so they will be incentivised + +// } + +// //Add bidder data in auction +// bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{bidding_id, string(bidder)} +// auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMapppingData) +// //Savinga auction data to auction historical +// auctionHistoricalData := auctionsV2types.AuctionHistorical{auctionID, &auctionData, &liquidationData} +// k.SetAuctionHistorical(ctx, auctionHistoricalData) +// //Close Auction +// k.DeleteAuction(ctx, auctionData) +// //Delete liquidation Data +// k.LiquidationsV2.DeleteLockedVault(ctx, liquidationData.LockedVaultId) + +// } else { +// //This means that there is less collateral available . +// //So we first try to compensate the difference through the liquidation penalty + +// //check the difference in collateral - +// //check if nullifing liquidation penalty helps +// //if yes - go for it + +// //else call the module account to give funds to compensate the user. + +// leftOverCollateral := auctionData.CollateralToken.Amount + +// _, debtTokenAgainstLeftOverCollateral, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice, leftOverCollateral.Sub(collateralTokenQuanitityForBonus), auctionData.DebtAssetId, debtPrice) + +// //Amount to call from reserve account for adjusting the auction target debt +// debtGettingLeft := auctionData.DebtToken.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, debtTokenAgainstLeftOverCollateral)) + +// //Calling reserve account for debt adjustment : debtGettingLeft + +// //Taking debtTokenAgainstLeftOverCollateral from user +// //Sending leftOverCollateral to the user +// //Burn Debt Token, +// //Creating user bid struct + +// //Based on app type call perform specific function - external , internal and /or keeper incentive +// //See if this was keeper initiated transaction- then incentivisation will be in place based on the percentage +// //For apps that are external to comdex chain + +// //Add bidder data in auction + +// } + +// } else { +// //if bid amount is less than the target bid + +// //Checking if bid isnt leaving dust amount less than allowed -for collateral & debt + +// //Calculating collateral token value from bid(debt) token value +// debtuDollar, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, collateralPrice) +// //From auction bonus quantity , use the available quantity to calculate the collateral value + +// //Checking bid.Amount -> to targetbid ratio +// //using that ratio data to calculate auction bonus to be given for the bid +// //first taking the debt percentage data +// //then calculating the collateral token data +// _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, liquidationData.BonusToBeGiven, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + +// if collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus).LTE(auctionData.CollateralToken.Amount) { +// //If there is sufficient collalteral + +// } else { + +// //Not sure if this condition will arise in which partial bids also arent able to be fulfilled due to shortage of collateral token +// // Technically this case will also close the auction +// } + +// //Deducting auction bonus value from liquidation data also for next bid. +// } +// //Deducting the auction bonus + +// //Now checking if the bid is not the final bid, we will check the dust amount left by the bidder +// //if the dust check passes, it is good to go. +// //Dust check for debt token + +// return nil +// } + func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction) error { - //The bid is in debt token - This is different from the earliar auction model at comdex + auctionParams, _ := k.GetAuctionParams(ctx) if bid.Amount.Equal(sdk.ZeroInt()) { return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid amount can't be Zero") } @@ -24,231 +224,28 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //Price data of the token from market module debtToken, _ := k.market.GetTwa(ctx, auctionData.DebtAssetId) debtPrice := sdk.NewDecFromInt(sdk.NewInt(int64(debtToken.Twa))) - //Price data of the token from market module - collateralToken, _ := k.market.GetTwa(ctx, auctionData.CollateralAssetId) - collateralPrice := sdk.NewDecFromInt(sdk.NewInt(int64(collateralToken.Twa))) - //only if debt token is CMST , we consider it as $1 if liquidationData.IsDebtCmst { debtPrice = sdk.NewDecFromInt(sdk.NewInt(int64(1000000))) - } - isBidFinalBid := false - //If user has sent a bigger bid than the target amount , + //Check to update bid.Amount + fullBid := false + if bid.Amount.GTE(auctionData.DebtToken.Amount) { bid.Amount = auctionData.DebtToken.Amount - isBidFinalBid = true - // bidPercent := 0 - debtuDollar, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) - //From auction bonus quantity , use the available quantity to calculate the collateral value - _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, liquidationData.BonusToBeGiven, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) - - //Checking if the auction bonus and the collateral to be given to user isnt more than available colalteral - totalCollateralTokenQuanitity := collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus) - if totalCollateralTokenQuanitity.LTE(auctionData.CollateralToken.Amount) { - //If everything is correct - - //Take Debt Token from user , - if bid.Amount.GT(sdk.ZeroInt()) { - err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) - if err != nil { - return err - } - } - - //Send Collateral To bidder - if bid.Amount.GT(sdk.ZeroInt()) { - err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) - if err != nil { - return err - } - } - - //Burn Debt Token, - liquidationPenalty := sdk.NewCoin(auctionData.DebtToken.Denom, liquidationData.FeeToBeCollected) - tokensToBurn := auctionData.DebtToken.Sub(liquidationPenalty) - - if tokensToBurn.Amount.GT(sdk.ZeroInt()) { - err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(tokensToBurn)) - if err != nil { - return err - } - } - - //Send rest tokens to the user - OwnerLeftOverCapital := auctionData.CollateralToken.Amount.Sub(totalCollateralTokenQuanitity) - if bid.Amount.GT(sdk.ZeroInt()) { - err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, OwnerLeftOverCapital))) - if err != nil { - return err - } - } - //Add bid data to struct - //Creating user bid struct - bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") - if err != nil { - return err - } - //Based on app type call perform specific function - external , internal and /or keeper incentive - //See if this was keeper initiated transaction- then incentivisation will be in place based on the percentage - //For apps that are external to comdex chain - if liquidationData.InitiatorType == "external" { - - //but if an app is external - will have to check the auction bonus , liquidation penalty , module account mechanism - - } else if liquidationData.InitiatorType == "vault" { - //Check if they are initiated through a keeper, if so they will be incentivised - if liquidationData.IsInternalKeeper { - - keeperIncentive := (liquidationWhitelistingAppData.KeeeperIncentive.Mul(sdk.NewDecFromInt(liquidationPenalty.Amount))).TruncateInt() - if keeperIncentive.GT(sdk.ZeroInt()) { - liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) - err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.InternalKeeperAddress), sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) - if err != nil { - return err - } - - } - } - //Send Liquidation Penalty to the Collector Module - if liquidationPenalty.Amount.GT(sdk.ZeroInt()) { - err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(liquidationPenalty)) - if err != nil { - return err - } - } - //Update Collector Data for CMST - // Updating fees data in collector - err = k.collector.SetNetFeeCollectedData(ctx, auctionData.AppId, auctionData.CollateralAssetId, liquidationPenalty.Amount) - if err != nil { - return err - } - //Updating mapping data of vault - k.vault.UpdateTokenMintedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, tokensToBurn.Amount, false) - k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, auctionData.CollateralToken.Amount, false) - - } else if liquidationData.InitiatorType == "borrow" { - //Check if they are initiated through a keeper, if so they will be incentivised - - } - - //Add bidder data in auction - bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{bidding_id, string(bidder)} - auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMapppingData) - //Savinga auction data to auction historical - auctionHistoricalData := auctionsV2types.AuctionHistorical{auctionID, &auctionData, &liquidationData} - k.SetAuctionHistorical(ctx, auctionHistoricalData) - //Close Auction - k.DeleteAuction(ctx, auctionData) - //Delete liquidation Data - k.LiquidationsV2.DeleteLockedVault(ctx, liquidationData.LockedVaultId) - - } else { - //This means that there is less collateral available . - //So we first try to compensate the difference through the liquidation penalty - - //check the difference in collateral - - //check if nullifing liquidation penalty helps - //if yes - go for it - - //else call the module account to give funds to compensate the user. - - leftOverCollateral := auctionData.CollateralToken.Amount - - _, debtTokenAgainstLeftOverCollateral, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice, leftOverCollateral.Sub(collateralTokenQuanitityForBonus), auctionData.DebtAssetId, debtPrice) - - //Amount to call from reserve account for adjusting the auction target debt - debtGettingLeft := auctionData.DebtToken.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, debtTokenAgainstLeftOverCollateral)) - - //Calling reserve account for debt adjustment : debtGettingLeft - - //Taking debtTokenAgainstLeftOverCollateral from user - //Sending leftOverCollateral to the user - //Burn Debt Token, - //Creating user bid struct - - //Based on app type call perform specific function - external , internal and /or keeper incentive - //See if this was keeper initiated transaction- then incentivisation will be in place based on the percentage - //For apps that are external to comdex chain - - //Add bidder data in auction - - } - - } else { - //if bid amount is less than the target bid - - //Checking if bid isnt leaving dust amount less than allowed -for collateral & debt - - //Calculating collateral token value from bid(debt) token value - debtuDollar, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, collateralPrice) - //From auction bonus quantity , use the available quantity to calculate the collateral value - - //Checking bid.Amount -> to targetbid ratio - //using that ratio data to calculate auction bonus to be given for the bid - //first taking the debt percentage data - //then calculating the collateral token data - _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, liquidationData.BonusToBeGiven, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) - - if collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus).LTE(auctionData.CollateralToken.Amount) { - //If there is sufficient collalteral - - } else { - - //Not sure if this condition will arise in which partial bids also arent able to be fulfilled due to shortage of collateral token - // Technically this case will also close the auction - } - - //Deducting auction bonus value from liquidation data also for next bid. - } - //Deducting the auction bonus - - //Now checking if the bid is not the final bid, we will check the dust amount left by the bidder - //if the dust check passes, it is good to go. - //Dust check for debt token - - return nil -} - -func (k Keeper) PlaceDutchAuctionBid2(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction) error { - //The bid is in debt token - This is different from the earliar auction model at comdex - if bid.Amount.Equal(sdk.ZeroInt()) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid amount can't be Zero") - } - liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, auctionData.AppId) - - if bid.Denom != auctionData.DebtToken.Denom { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the debt token ", bid.Denom) - } - liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, auctionData.AppId, auctionData.LockedVaultId) - //Price data of the token from market module - debtToken, _ := k.market.GetTwa(ctx, auctionData.DebtAssetId) - debtPrice := sdk.NewDecFromInt(sdk.NewInt(int64(debtToken.Twa))) - //Price data of the token from market module - collateralToken, _ := k.market.GetTwa(ctx, auctionData.CollateralAssetId) - collateralPrice := sdk.NewDecFromInt(sdk.NewInt(int64(collateralToken.Twa))) - - //only if debt token is CMST , we consider it as $1 - if liquidationData.IsDebtCmst { - debtPrice = sdk.NewDecFromInt(sdk.NewInt(int64(1000000))) + fullBid = true } - isBidFinalBid := false + _, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + //From auction bonus quantity , use the available quantity to calculate the collateral value + _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, auctionData.BonusAmount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + //Checking if the auction bonus and the collateral to be given to user isnt more than available colalteral + totalCollateralTokenQuanitity := collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus) //If user has sent a bigger bid than the target amount , - if bid.Amount.GTE(auctionData.DebtToken.Amount) { - bid.Amount = auctionData.DebtToken.Amount - isBidFinalBid = true - // bidPercent := 0 - debtuDollar, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) - //From auction bonus quantity , use the available quantity to calculate the collateral value - _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, liquidationData.BonusToBeGiven, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + if fullBid || !totalCollateralTokenQuanitity.LTE(auctionData.CollateralToken.Amount) { - //Checking if the auction bonus and the collateral to be given to user isnt more than available colalteral - totalCollateralTokenQuanitity := collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus) if !totalCollateralTokenQuanitity.LTE(auctionData.CollateralToken.Amount) { - //This means that there is less collateral available . - leftOverCollateral := auctionData.CollateralToken.Amount _, debtTokenAgainstLeftOverCollateral, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice, leftOverCollateral.Sub(collateralTokenQuanitityForBonus), auctionData.DebtAssetId, debtPrice) bid.Amount = debtTokenAgainstLeftOverCollateral @@ -256,9 +253,9 @@ func (k Keeper) PlaceDutchAuctionBid2(ctx sdk.Context, auctionID uint64, bidder //Amount to call from reserve account for adjusting the auction target debt //So we call the module account to give funds to compensate the user. debtGettingLeft := auctionData.DebtToken.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, debtTokenAgainstLeftOverCollateral)) - //Calling reserve account for debt adjustment : debtGettingLeft //Updating the protocol was in loss stuct + k.LiquidationsV2.WithdrawAppReserveFundsFn(ctx, auctionData.AppId, auctionData.DebtAssetId, debtGettingLeft) } //Take Debt Token from user , if bid.Amount.GT(sdk.ZeroInt()) { @@ -267,7 +264,6 @@ func (k Keeper) PlaceDutchAuctionBid2(ctx sdk.Context, auctionID uint64, bidder return err } } - //Send Collateral To bidder if totalCollateralTokenQuanitity.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) @@ -275,22 +271,19 @@ func (k Keeper) PlaceDutchAuctionBid2(ctx sdk.Context, auctionID uint64, bidder return err } } - //Burn Debt Token, liquidationPenalty := sdk.NewCoin(auctionData.DebtToken.Denom, liquidationData.FeeToBeCollected) - tokensToBurn := auctionData.DebtToken.Sub(liquidationPenalty) - + tokensToBurn := liquidationData.TargetDebt.Sub(liquidationPenalty) if tokensToBurn.Amount.GT(sdk.ZeroInt()) { err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(tokensToBurn)) if err != nil { return err } } - //Send rest tokens to the user OwnerLeftOverCapital := auctionData.CollateralToken.Amount.Sub(totalCollateralTokenQuanitity) if OwnerLeftOverCapital.GT(sdk.ZeroInt()) { - err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, OwnerLeftOverCapital))) + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.Owner), sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, OwnerLeftOverCapital))) if err != nil { return err } @@ -301,15 +294,13 @@ func (k Keeper) PlaceDutchAuctionBid2(ctx sdk.Context, auctionID uint64, bidder if err != nil { return err } - //Based on app type call perform specific function - external , internal and /or keeper incentive //See if this was keeper initiated transaction- then incentivisation will be in place based on the percentage //For apps that are external to comdex chain if liquidationData.InitiatorType == "external" { - + //but if an app is external - will have to check the auction bonus , liquidation penalty , module account mechanism - } else if liquidationData.InitiatorType == "vault" { //Check if they are initiated through a keeper, if so they will be incentivised if liquidationData.IsInternalKeeper { @@ -321,7 +312,6 @@ func (k Keeper) PlaceDutchAuctionBid2(ctx sdk.Context, auctionID uint64, bidder if err != nil { return err } - } } //Send Liquidation Penalty to the Collector Module @@ -340,12 +330,9 @@ func (k Keeper) PlaceDutchAuctionBid2(ctx sdk.Context, auctionID uint64, bidder //Updating mapping data of vault k.vault.UpdateTokenMintedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, tokensToBurn.Amount, false) k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, auctionData.CollateralToken.Amount, false) - } else if liquidationData.InitiatorType == "borrow" { //Check if they are initiated through a keeper, if so they will be incentivised - } - //Add bidder data in auction bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{bidding_id, string(bidder)} auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMapppingData) @@ -356,39 +343,57 @@ func (k Keeper) PlaceDutchAuctionBid2(ctx sdk.Context, auctionID uint64, bidder k.DeleteAuction(ctx, auctionData) //Delete liquidation Data k.LiquidationsV2.DeleteLockedVault(ctx, liquidationData.LockedVaultId) - } else { //if bid amount is less than the target bid - - //Checking if bid isnt leaving dust amount less than allowed -for collateral & debt - //Calculating collateral token value from bid(debt) token value - debtuDollar, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, collateralPrice) - //From auction bonus quantity , use the available quantity to calculate the collateral value + _, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + debtLeft := bid.Amount.Sub(bid.Amount) + debtuDollar, _ := k.CalcDollarValueForToken(ctx, debtPrice, debtLeft) + if !(debtuDollar).GT(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.MinUsdValueLeft))) { + return types.ErrCannotLeaveDebtLessThanDust + } + //From auction bonus quantity , use the available quantity to calculate the collateral value //Checking bid.Amount -> to targetbid ratio + bidToTargetDebtRatio := (bid.Amount).Quo(auctionData.DebtToken.Amount) + expectedBonusShareForCurrentBid := liquidationData.BonusToBeGiven.Mul(bidToTargetDebtRatio) + //If somehow bonus to be given is less than what is there in the protocol + if expectedBonusShareForCurrentBid.GT(auctionData.BonusAmount) { + expectedBonusShareForCurrentBid = auctionData.BonusAmount + } //using that ratio data to calculate auction bonus to be given for the bid //first taking the debt percentage data //then calculating the collateral token data - _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, liquidationData.BonusToBeGiven, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) - - if collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus).LTE(auctionData.CollateralToken.Amount) { - //If there is sufficient collalteral - - } else { - - //Not sure if this condition will arise in which partial bids also arent able to be fulfilled due to shortage of collateral token - // Technically this case will also close the auction + _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, expectedBonusShareForCurrentBid, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + totalCollateralTokenQuanitity := collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus) + if bid.Amount.GT(sdk.ZeroInt()) { + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) + if err != nil { + return err + } + } + //Send Collateral To bidder + if totalCollateralTokenQuanitity.GT(sdk.ZeroInt()) { + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) + if err != nil { + return err + } + } + bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") + if err != nil { + return err } + //Add bidder data in auction + bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{bidding_id, string(bidder)} + auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMapppingData) - //Deducting auction bonus value from liquidation data also for next bid. + //Reduce Auction collateral and debt value + auctionData.CollateralToken.Amount = auctionData.CollateralToken.Amount.Sub(totalCollateralTokenQuanitity) + auctionData.DebtToken.Amount = auctionData.DebtToken.Amount.Sub(bid.Amount) + auctionData.BonusAmount = auctionData.BonusAmount.Sub(expectedBonusShareForCurrentBid) + //Set Auction + k.SetAuction(ctx, auctionData) } - //Deducting the auction bonus - - //Now checking if the bid is not the final bid, we will check the dust amount left by the bidder - //if the dust check passes, it is good to go. - //Dust check for debt token - return nil } @@ -597,3 +602,9 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater k.SetUserLimitBidData(ctx, userLimitBid, DebtTokenId, CollateralTokenId, PremiumDiscount) return nil } + +func (k Keeper) CalcDollarValueForToken(ctx sdk.Context, rate sdk.Dec, amt sdk.Int) (price sdk.Dec, err error) { + numerator := sdk.NewDecFromInt(amt).Mul(rate) + denominator := sdk.NewDecFromInt(asset.Decimals) + return numerator.Quo(denominator), nil +} diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index 43b2ccc43..d7695cdef 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -93,20 +93,10 @@ func (m *AuctionHistorical) GetLockedVault() *types.LockedVault { type Auction struct { AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" yaml:"auction_id"` CollateralToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,2,opt,name=collateral_token,json=collateralToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token" yaml:"collateral_token"` - // cosmos.base.v1beta1.Coin outflow_token_current_amount = 3 [ - // (gogoproto.nullable) = false, - // (gogoproto.moretags) = "yaml:\"outflow_token_current_amount\"", - // (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" - // ]; - DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"inflow_token_target_amount"` - // cosmos.base.v1beta1.Coin inflow_token_current_amount = 5 [ - // (gogoproto.nullable) = false, - // (gogoproto.moretags) = "yaml:\"inflow_token_current_amount\"", - // (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" - // ]; - ActiveBiddingId uint64 `protobuf:"varint,4,opt,name=active_bidding_id,json=activeBiddingId,proto3" json:"active_bidding_id,omitempty" yaml:"active_bidding_id"` - BiddingIds []*BidOwnerMapping `protobuf:"bytes,5,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` - BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` + DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"inflow_token_target_amount"` + ActiveBiddingId uint64 `protobuf:"varint,4,opt,name=active_bidding_id,json=activeBiddingId,proto3" json:"active_bidding_id,omitempty" yaml:"active_bidding_id"` + BiddingIds []*BidOwnerMapping `protobuf:"bytes,5,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` + BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` // price indicator only for dutch auctions CollateralTokenAuctionPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=collateral_token_auction_price,json=collateralTokenAuctionPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_auction_price" yaml:"outflow_token_auction_price"` CollateralTokenOraclePrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=collateral_token_oracle_price,json=collateralTokenOraclePrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_oracle_price" yaml:"outflow_token_oracle_price"` @@ -118,6 +108,7 @@ type Auction struct { AuctionType bool `protobuf:"varint,14,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` CollateralAssetId uint64 `protobuf:"varint,15,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` DebtAssetId uint64 `protobuf:"varint,16,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` + BonusAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,17,opt,name=bonus_amount,json=bonusAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bonus_amount" yaml:"bonus_amount"` } func (m *Auction) Reset() { *m = Auction{} } @@ -300,66 +291,68 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 942 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0xdb, 0x36, - 0x18, 0x8e, 0x9a, 0xe6, 0xc3, 0x74, 0x32, 0xd7, 0x6a, 0xda, 0x28, 0xce, 0x62, 0xb9, 0x3c, 0xb4, - 0xc1, 0x80, 0xc8, 0x68, 0xd7, 0xd3, 0xb0, 0x4b, 0xd5, 0x6d, 0xa8, 0x87, 0xad, 0x1d, 0x38, 0xa3, - 0x18, 0x76, 0x11, 0x28, 0x91, 0x76, 0x89, 0xc8, 0xa2, 0x66, 0xd1, 0xe9, 0xf2, 0x13, 0x76, 0x19, - 0x72, 0x1a, 0xb0, 0xf3, 0xae, 0xfb, 0x21, 0x3d, 0xf6, 0x38, 0xec, 0xa0, 0x0d, 0xc9, 0x3f, 0xd0, - 0x71, 0xa7, 0x81, 0x1f, 0xb2, 0x64, 0x27, 0x43, 0x97, 0x9e, 0x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 0x4f, - 0x64, 0x70, 0x40, 0xec, 0x4f, 0xc1, 0xb6, 0x72, 0xd0, 0x1c, 0xe9, 0x96, 0x42, 0x72, 0x8a, 0xdc, - 0xdd, 0xd1, 0x48, 0x0b, 0xd3, 0x10, 0x35, 0xe5, 0xd8, 0x54, 0xc3, 0xcf, 0x41, 0x6b, 0xe9, 0x42, - 0xb1, 0xef, 0x80, 0x75, 0x79, 0xc4, 0xcb, 0x17, 0x03, 0xad, 0x85, 0x8c, 0x0c, 0x88, 0xbd, 0x0f, - 0xe4, 0x61, 0x0f, 0xb8, 0x4c, 0x55, 0xcf, 0x41, 0x03, 0x6d, 0x96, 0xa5, 0xfe, 0xf3, 0x37, 0xe7, - 0x5d, 0xeb, 0xed, 0x79, 0xd7, 0xfa, 0xfb, 0xbc, 0x6b, 0x9d, 0x5d, 0x74, 0x57, 0xde, 0x5e, 0x74, - 0x57, 0xfe, 0xb8, 0xe8, 0xae, 0x7c, 0xff, 0x78, 0xc1, 0xb7, 0xf2, 0x52, 0x3b, 0xe2, 0xa3, 0x11, - 0x8b, 0x18, 0x8e, 0xcd, 0xb8, 0xbf, 0xf0, 0xe7, 0x44, 0x39, 0x39, 0x5c, 0x57, 0x7b, 0xfa, 0xf1, - 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4d, 0xa3, 0x11, 0xd1, 0xbe, 0x08, 0x00, 0x00, + // 968 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0x36, 0xe3, 0xf8, 0x47, 0x2b, 0xab, 0x8a, 0x18, 0x27, 0xa6, 0xe5, 0x5a, 0x54, 0xf6, 0x90, + 0x08, 0x05, 0x4c, 0x21, 0x69, 0x4e, 0x45, 0x2f, 0x66, 0x9a, 0x22, 0x2a, 0xda, 0xa4, 0x60, 0x85, + 0xa0, 0xe8, 0x85, 0x58,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0x50, 0x35, 0x28, 0x09, 0x00, 0x00, } func (m *AuctionHistorical) Marshal() (dAtA []byte, err error) { @@ -434,6 +427,18 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.BonusAmount.Size() + i -= size + if _, err := m.BonusAmount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a if m.DebtAssetId != 0 { i = encodeVarintAuction(dAtA, i, uint64(m.DebtAssetId)) i-- @@ -684,6 +689,8 @@ func (m *Auction) Size() (n int) { if m.DebtAssetId != 0 { n += 2 + sovAuction(uint64(m.DebtAssetId)) } + l = m.BonusAmount.Size() + n += 2 + l + sovAuction(uint64(l)) return n } @@ -1315,6 +1322,40 @@ func (m *Auction) Unmarshal(dAtA []byte) error { break } } + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BonusAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BonusAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAuction(dAtA[iNdEx:]) diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index 7d316cca7..9b4844c15 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -211,6 +211,7 @@ type AuctionParams struct { Step github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=step,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"step" yaml:"step"` WithdrawalFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=withdrawal_fee,json=withdrawalFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"withdrawal_fee" yaml:"withdrawal_fee"` ClosingFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=closing_fee,json=closingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"closing_fee" yaml:"closing_fee"` + MinUsdValueLeft uint64 `protobuf:"varint,5,opt,name=min_usd_value_left,json=minUsdValueLeft,proto3" json:"min_usd_value_left,omitempty" yaml:"min_usd_value_left"` } func (m *AuctionParams) Reset() { *m = AuctionParams{} } @@ -253,6 +254,13 @@ func (m *AuctionParams) GetAuctionDurationSeconds() uint64 { return 0 } +func (m *AuctionParams) GetMinUsdValueLeft() uint64 { + if m != nil { + return m.MinUsdValueLeft + } + return 0 +} + func init() { proto.RegisterType((*Bid)(nil), "comdex.auctionsV2.v1beta1.Bid") proto.RegisterType((*LimitOrderBid)(nil), "comdex.auctionsV2.v1beta1.LimitOrderBid") @@ -264,57 +272,60 @@ func init() { } var fileDescriptor_6f6db8f3a6a396ec = []byte{ - // 796 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6e, 0xf3, 0x44, - 0x14, 0x8d, 0xbf, 0xfc, 0x7c, 0xcd, 0x54, 0x69, 0x1b, 0xf7, 0x2f, 0x0d, 0x22, 0x0e, 0x2e, 0x82, - 0x6c, 0x6a, 0xab, 0xa5, 0x0b, 0x84, 0xc4, 0xa2, 0x21, 0x2a, 0x8a, 0x04, 0x05, 0x4c, 0xd5, 0x05, - 0x12, 0xb2, 0xc6, 0x9e, 0x49, 0x3a, 0xaa, 0xed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 0xff, 0xff, 0x73, 0x38, 0xf1, 0x86, 0x9c, 0x07, 0x00, 0x00, + // 840 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x8e, 0xdb, 0x44, + 0x18, 0x5f, 0x77, 0xb3, 0xdb, 0x66, 0x56, 0x69, 0x36, 0x6e, 0xb7, 0xcd, 0x06, 0x35, 0x0e, 0x53, + 0x04, 0xb9, 0xd4, 0x56, 0x4b, 0x0f, 0x08, 0x89, 0xc3, 0x86, 0x08, 0x14, 0x54, 0x0a, 0x98, 0x65, + 0x0f, 0x48, 0xc8, 0x1a, 0x7b, 0x26, 0xe9, 0xa8, 0xb6, 0xc7, 0xf2, 0x8c, 0xbb, 0xf4, 0xc2, 0x1b, + 0x20, 0xf5, 0xc0, 0x0b, 0xf0, 0x04, 0xbc, 0x46, 0x8f, 0x3d, 0x22, 0x24, 0x0c, 0xda, 0xe5, 0x09, + 0x7c, 0xe4, 0x84, 0xe6, 0x4f, 0xe2, 0x24, 0x5b, 0x69, 0x37, 0xe2, 0x94, 0x99, 0xef, 0xcf, 0xef, + 0xfb, 0x7d, 0xdf, 0xfc, 0xf2, 0x19, 0xdc, 0x8f, 0x58, 0x82, 0xc9, 0x8f, 0x1e, 0x2a, 0x22, 0x41, + 0x59, 0xca, 0x4f, 0x1e, 0x79, 0x2f, 0x1e, 0x86, 0x44, 0xa0, 0x87, 0x5e, 0x48, 0xb1, 0x9b, 0xe5, + 0x4c, 0x30, 0xfb, 0x50, 0x07, 0xb9, 0x75, 0x90, 0x6b, 0x82, 0x7a, 0xb7, 0x67, 0x6c, 0xc6, 0x54, + 0x94, 0x27, 0x4f, 0x3a, 0xa1, 0xe7, 0xcc, 0x18, 0x9b, 0xc5, 0xc4, 0x53, 0xb7, 0xb0, 0x98, 0x7a, + 0x82, 0x26, 0x84, 0x0b, 0x94, 0x64, 0x26, 0xa0, 0x1f, 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8c, 0xcb, 0x37, 0x94, 0xc5, 0x1a, 0xaa, + 0xd8, 0x78, 0xe3, 0x62, 0xb6, 0x2e, 0xb6, 0x04, 0x05, 0x7d, 0x60, 0x6e, 0xb2, 0xcc, 0x17, 0xc0, + 0x4e, 0x68, 0x1a, 0x14, 0x1c, 0x07, 0x2f, 0x50, 0x5c, 0x90, 0x20, 0x26, 0x53, 0xa1, 0x36, 0x60, + 0x63, 0x74, 0xaf, 0x2a, 0x9d, 0x43, 0x9d, 0x7f, 0x31, 0x06, 0xfa, 0xed, 0x84, 0xa6, 0xdf, 0x71, + 0x7c, 0x22, 0x4d, 0x4f, 0xc8, 0x54, 0x8c, 0x9e, 0xbe, 0x3e, 0xeb, 0x5b, 0x6f, 0xce, 0xfa, 0xd6, + 0xdf, 0x67, 0x7d, 0xeb, 0xd5, 0x79, 0x7f, 0xeb, 0xcd, 0x79, 0x7f, 0xeb, 0xf7, 0xf3, 0xfe, 0xd6, + 0xf7, 0x8f, 0x57, 0xf8, 0xca, 0xef, 0xf1, 0x03, 0x36, 0x9d, 0xd2, 0x88, 0xa2, 0xd8, 0xdc, 0xbd, + 0x95, 0xcf, 0xb8, 0xea, 0x20, 0xdc, 0x55, 0xcb, 0xf3, 0xc3, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, + 0xf8, 0x21, 0x5c, 0xf9, 0xe8, 0x07, 0x00, 0x00, } func (m *Bid) Marshal() (dAtA []byte, err error) { @@ -500,6 +511,11 @@ func (m *AuctionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.MinUsdValueLeft != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.MinUsdValueLeft)) + i-- + dAtA[i] = 0x28 + } { size := m.ClosingFee.Size() i -= size @@ -625,6 +641,9 @@ func (m *AuctionParams) Size() (n int) { n += 1 + l + sovBid(uint64(l)) l = m.ClosingFee.Size() n += 1 + l + sovBid(uint64(l)) + if m.MinUsdValueLeft != 0 { + n += 1 + sovBid(uint64(m.MinUsdValueLeft)) + } return n } @@ -1331,6 +1350,25 @@ func (m *AuctionParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinUsdValueLeft", wireType) + } + m.MinUsdValueLeft = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinUsdValueLeft |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipBid(dAtA[iNdEx:]) diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index 0069ce0dc..41ccc61cb 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -10,4 +10,6 @@ import ( var ( ErrDutchAuctionDisabled = sdkerrors.Register(ModuleName, 701, "Dutch auction not enabled for the app") ErrEnglishAuctionDisabled = sdkerrors.Register(ModuleName, 702, "English auction not enabled for the app") + ErrCannotLeaveDebtLessThanDust= sdkerrors.Register(ModuleName, 703, "You need to leave debt atleast equal to dust value or greater. Try making a full bid, or a smaller bid. Your current bid is just short of the dust value , hence it fails.") + ErrorPriceNotFound= sdkerrors.Register(ModuleName, 704, "price not found") ) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 214c922de..d12ea794d 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -6,6 +6,7 @@ import ( lendtypes "github.com/comdex-official/comdex/x/lend/types" utils "github.com/comdex-official/comdex/types" + auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" "github.com/comdex-official/comdex/x/liquidationsV2/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -144,12 +145,15 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error k.vault.SetLengthOfVault(ctx, length-1) //Removing data from existing structs - k.vault.DeleteVault(ctx, vault.Id) + var rewards rewardstypes.VaultInterestTracker rewards.AppMappingId = vault.AppId rewards.VaultId = vault.Id k.rewards.DeleteVaultInterestTracker(ctx, rewards) k.vault.DeleteAddressFromAppExtendedPairVaultMapping(ctx, vault.ExtendedPairVaultID, vault.Id, vault.AppId) + k.vault.DeleteUserVaultExtendedPairMapping(ctx, vault.Owner, vault.AppId, vault.ExtendedPairVaultID) + k.vault.DeleteVault(ctx, vault.Id) + } return nil @@ -502,6 +506,33 @@ func (k Keeper) MsgAppReserveFundsFn(ctx sdk.Context, from string, appId, assetI k.SetAppReserveFundsTxData(ctx, appReserveFundsTxData) return nil } +func (k Keeper) WithdrawAppReserveFundsFn(ctx sdk.Context, appId, assetId uint64, tokenQuantity sdk.Coin) error { + appReserveFunds, found := k.GetAppReserveFunds(ctx, appId, assetId) + if !found { + return types.ErrorInvalidAppOrAssetData + } + + if appReserveFunds.TokenQuantity.Amount.Sub(tokenQuantity.Amount).GTE(sdk.ZeroInt()) { + if tokenQuantity.Amount.GT(sdk.ZeroInt()) { + err := k.bank.SendCoinsFromModuleToModule(ctx, types.ModuleName, auctionsV2types.ModuleName, sdk.NewCoins(tokenQuantity)) + if err != nil { + return err + } + } + } + appReserveFunds.TokenQuantity.Amount = appReserveFunds.TokenQuantity.Amount.Sub(tokenQuantity.Amount) + k.SetAppReserveFunds(ctx, appReserveFunds) + // trigger AppReserveFundsTxData + assetTxData := types.AssetTxData{ + AssetId: assetId, + TxType: "debt", + TokenQuantity: tokenQuantity, + } + appReserveFundsTxData, _ := k.GetAppReserveFundsTxData(ctx, appId) + appReserveFundsTxData.AssetTxData = append(appReserveFundsTxData.AssetTxData, assetTxData) + k.SetAppReserveFundsTxData(ctx, appReserveFundsTxData) + return nil +} func (k Keeper) SetAppReserveFunds(ctx sdk.Context, appReserveFunds types.AppReserveFunds) { var ( diff --git a/x/liquidationsV2/types/errors.go b/x/liquidationsV2/types/errors.go index 4a59c9449..0f4cd5be5 100644 --- a/x/liquidationsV2/types/errors.go +++ b/x/liquidationsV2/types/errors.go @@ -8,7 +8,8 @@ import ( // x/liquidationsV2 module sentinel errors var ( - ErrVaultIDInvalid = sdkerrors.Register(ModuleName, 1501, "Vault Id invalid") - ErrorUnknownMsgType = sdkerrors.Register(ModuleName, 1502, "Unknown msg type") - ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 1503, "unknown proposal type") + ErrVaultIDInvalid = sdkerrors.Register(ModuleName, 1501, "Vault Id invalid") + ErrorUnknownMsgType = sdkerrors.Register(ModuleName, 1502, "Unknown msg type") + ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 1503, "unknown proposal type") + ErrorInvalidAppOrAssetData = sdkerrors.Register(ModuleName, 1504, "Invalid data of app , or asset has not been added to the app , or low funds") ) From 5516aab25ce62c56b1f6f750c86631331c22d5ce Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Thu, 1 Jun 2023 01:35:19 +0530 Subject: [PATCH 079/155] finalising auto bid --- .../liquidationsV2/v1beta1/liquidate.proto | 4 + x/auctionsV2/keeper/auctions.go | 10 +- x/auctionsV2/keeper/bid.go | 51 ++-- x/auctionsV2/types/keys.go | 1 + x/liquidationsV2/keeper/liquidate.go | 17 +- x/liquidationsV2/keeper/offset.go | 4 +- x/liquidationsV2/types/liquidate.pb.go | 230 ++++++++++-------- 7 files changed, 179 insertions(+), 138 deletions(-) diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index af9a3415f..67a9e8338 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -119,6 +119,10 @@ message EnglishAuctionParam{ message LiquidationOffsetHolder { + uint64 app_id = 1 [ + (gogoproto.customname) = "AppId", + (gogoproto.moretags) = "yaml:\"id\""]; + uint64 current_offset = 2; } diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 66dedb983..33f785732 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -394,8 +394,9 @@ func (k Keeper) LimitOrderBid(ctx sdk.Context) error { for _, individualBids := range biddingData { addr, _ := sdk.AccAddressFromBech32(individualBids.BidderAddress) if individualBids.DebtToken.Amount.GTE(auction.DebtToken.Amount) { - // the auction is completed here, and now we will update user's limit bid data - err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr, auction.DebtToken, auction) + //User has more tokens than target debt, so their bid will close the auction + ///Placing a user bid + bidding_id, err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr, individualBids.DebtToken, auction, true) if err != nil { return err } @@ -404,11 +405,10 @@ func (k Keeper) LimitOrderBid(ctx sdk.Context) error { return nil } individualBids.DebtToken.Amount = individualBids.DebtToken.Amount.Sub(auction.DebtToken.Amount) - //Todo: append bidding ID - //individualBids.BiddingId = append(individualBids.BiddingId, id) + individualBids.BiddingId = append(individualBids.BiddingId, bidding_id) k.SetUserLimitBidData(ctx, individualBids, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt().String()) } else { - err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr, individualBids.DebtToken, auction) + _, err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr, individualBids.DebtToken, auction, true) if err != nil { return err } diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 00cd7b283..25343482f 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -210,7 +210,7 @@ import ( // return nil // } -func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction) error { +func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction, isAutoBid bool) (bidId unit64,error) { auctionParams, _ := k.GetAuctionParams(ctx) if bid.Amount.Equal(sdk.ZeroInt()) { return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid amount can't be Zero") @@ -258,17 +258,22 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s k.LiquidationsV2.WithdrawAppReserveFundsFn(ctx, auctionData.AppId, auctionData.DebtAssetId, debtGettingLeft) } //Take Debt Token from user , - if bid.Amount.GT(sdk.ZeroInt()) { - err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) - if err != nil { - return err + + if !isAutoBid { + if bid.Amount.GT(sdk.ZeroInt()) { + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) + if err != nil { + return nil,err + } } - } + + } + //Send Collateral To bidder if totalCollateralTokenQuanitity.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) if err != nil { - return err + return nil,err } } //Burn Debt Token, @@ -277,7 +282,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if tokensToBurn.Amount.GT(sdk.ZeroInt()) { err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(tokensToBurn)) if err != nil { - return err + return nil,err } } //Send rest tokens to the user @@ -285,21 +290,21 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if OwnerLeftOverCapital.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.Owner), sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, OwnerLeftOverCapital))) if err != nil { - return err + return nil,err } } //Add bid data to struct //Creating user bid struct bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") if err != nil { - return err + return nil,err } //Based on app type call perform specific function - external , internal and /or keeper incentive //See if this was keeper initiated transaction- then incentivisation will be in place based on the percentage //For apps that are external to comdex chain if liquidationData.InitiatorType == "external" { - + //but if an app is external - will have to check the auction bonus , liquidation penalty , module account mechanism } else if liquidationData.InitiatorType == "vault" { //Check if they are initiated through a keeper, if so they will be incentivised @@ -310,7 +315,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.InternalKeeperAddress), sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) if err != nil { - return err + return nil,err } } } @@ -318,14 +323,14 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if liquidationPenalty.Amount.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(liquidationPenalty)) if err != nil { - return err + return nil,err } } //Update Collector Data for CMST // Updating fees data in collector err = k.collector.SetNetFeeCollectedData(ctx, auctionData.AppId, auctionData.CollateralAssetId, liquidationPenalty.Amount) if err != nil { - return err + return nil,err } //Updating mapping data of vault k.vault.UpdateTokenMintedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, tokensToBurn.Amount, false) @@ -366,22 +371,24 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //then calculating the collateral token data _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, expectedBonusShareForCurrentBid, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) totalCollateralTokenQuanitity := collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus) - if bid.Amount.GT(sdk.ZeroInt()) { - err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) - if err != nil { - return err + if !isAutoBid { + if bid.Amount.GT(sdk.ZeroInt()) { + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) + if err != nil { + return nil,err + } } - } + } //Send Collateral To bidder if totalCollateralTokenQuanitity.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) if err != nil { - return err + return nil,err } } bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") if err != nil { - return err + return nil,err } //Add bidder data in auction bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{bidding_id, string(bidder)} @@ -394,7 +401,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //Set Auction k.SetAuction(ctx, auctionData) } - return nil + return bidding_id,nil } func (k Keeper) CreateUserBid(ctx sdk.Context, appID uint64, BidderAddress string, auctionID uint64, collateralToken sdk.Coin, debtToken sdk.Coin, bidType string) (bidding_id uint64, err error) { diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index 257b077ce..74d81b91f 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -45,6 +45,7 @@ func AuctionHistoricalKey(auctionID uint64) []byte { func UserBidKey(userBidId uint64) []byte { return append(append(UserBidKeyPrefix, sdk.Uint64ToBigEndian(userBidId)...)) +} func UserLimitBidKey(debtTokenID, collateralTokenID uint64, premium, address string) []byte { return append(append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), premium...), address...) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index d12ea794d..bc7601eb3 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -14,12 +14,12 @@ import ( func (k Keeper) Liquidate(ctx sdk.Context) error { - err := k.LiquidateVaults(ctx) + err := k.LiquidateVaults(ctx,0) if err != nil { return err } - err = k.LiquidateBorrows(ctx) + err = k.LiquidateBorrows(ctx,1) if err != nil { return err } @@ -34,13 +34,13 @@ func (k Keeper) Liquidate(ctx sdk.Context) error { // Liquidate Vaults function can liquidate all vaults created using the vault module. //All vauts are looped and check if their underlying app has enabled liquidations. -func (k Keeper) LiquidateVaults(ctx sdk.Context) error { +func (k Keeper) LiquidateVaults(ctx sdk.Context,offsetCounterId uint64) error { params := k.GetParams(ctx) //This allows us to loop over a slice of vaults per block , which doesnt stresses the abci. //Eg: if there exists 1,000,000 vaults and the batch size is 100,000. then at every block 100,000 vaults will be looped and it will take //a total of 10 blocks to loop over all vaults. - liquidationOffsetHolder, found := k.GetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix) + liquidationOffsetHolder, found := k.GetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix,offsetCounterId) if !found { liquidationOffsetHolder = types.NewLiquidationOffsetHolder(0) } @@ -70,6 +70,7 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context) error { } liquidationOffsetHolder.CurrentOffset = uint64(end) + liquidationOffsetHolder.AppId=offsetCounterId k.SetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix, liquidationOffsetHolder) return nil @@ -163,7 +164,7 @@ func (k Keeper) ReturnCoin(ctx sdk.Context, assetID uint64, amount sdk.Int) sdk. return sdk.NewCoin(asset.Denom, amount) } -func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Coin, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, isExternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, bonusToBeGiven sdk.Int, initiatorType string, auctionType bool, isDebtCmst bool, collateralID uint64, DebtId uint64) error { +func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPairId uint64, Owner string, AmountIn, AmountOut, CollateralToBeAuctioned, TargetDebt sdk.Coin, collateralizationRatio sdk.Dec, appID uint64, isInternalKeeper bool, internalKeeperAddress string, externalKeeperAddress string, feesToBeCollected sdk.Int, bonusToBeGiven sdk.Int, initiatorType string, auctionType bool, isDebtCmst bool, collateralID uint64, DebtId uint64) error { lockedVaultID := k.GetLockedVaultID(ctx) value := types.LockedVault{ @@ -211,14 +212,14 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair return nil } -func (k Keeper) LiquidateBorrows(ctx sdk.Context) error { +func (k Keeper) LiquidateBorrows(ctx sdk.Context,offsetCounterId uint64) error { borrows, found := k.lend.GetBorrows(ctx) params := k.GetParams(ctx) if !found { ctx.Logger().Error("Params Not Found in Liquidation, liquidate_borrow.go") return nil } - liquidationOffsetHolder, found := k.GetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix) + liquidationOffsetHolder, found := k.GetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix,offsetCounterId) if !found { liquidationOffsetHolder = types.NewLiquidationOffsetHolder(0) } @@ -349,7 +350,7 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsse //Calculating auction bonus to be given auctionBonusToBeGiven := sdk.NewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationBonus).TruncateInt() - err := k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, true, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false, 0) + err := k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false, ) if err != nil { return err } diff --git a/x/liquidationsV2/keeper/offset.go b/x/liquidationsV2/keeper/offset.go index a33026623..cb2d29a27 100644 --- a/x/liquidationsV2/keeper/offset.go +++ b/x/liquidationsV2/keeper/offset.go @@ -16,9 +16,9 @@ func (k Keeper) SetLiquidationOffsetHolder(ctx sdk.Context, liquidatonPrefix str } // GetLiquidationOffsetHolder returns liquidationOffsetHolder object for the given app id, pool id and farmer. -func (k Keeper) GetLiquidationOffsetHolder(ctx sdk.Context, liquidatonPrefix string) (liquidationOffsetHolder types.LiquidationOffsetHolder, found bool) { +func (k Keeper) GetLiquidationOffsetHolder(ctx sdk.Context, liquidatonPrefix string,offsetCounterId uint64) (liquidationOffsetHolder types.LiquidationOffsetHolder, found bool) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.GetLiquidationOffsetHolderKey(appID, liquidatonPrefix)) + bz := store.Get(types.GetLiquidationOffsetHolderKey(offsetCounterId, liquidatonPrefix)) if bz == nil { return } diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index 182927080..3161ba275 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -273,6 +273,7 @@ func (m *EnglishAuctionParam) XXX_DiscardUnknown() { var xxx_messageInfo_EnglishAuctionParam proto.InternalMessageInfo type LiquidationOffsetHolder struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"id"` CurrentOffset uint64 `protobuf:"varint,2,opt,name=current_offset,json=currentOffset,proto3" json:"current_offset,omitempty"` } @@ -387,107 +388,107 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 1600 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4b, 0x6f, 0x1b, 0x47, - 0x12, 0xd6, 0x48, 0xd6, 0x83, 0x4d, 0x51, 0x22, 0x5b, 0xa2, 0x45, 0x6b, 0x6d, 0x8e, 0x76, 0x00, - 0x7b, 0x05, 0x1b, 0x22, 0x2d, 0x19, 0x8b, 0x7d, 0x02, 0x6b, 0x51, 0x92, 0x6d, 0xee, 0x0a, 0x6b, - 0x7b, 0x20, 0x78, 0x01, 0x63, 0x77, 0x27, 0xcd, 0x99, 0x26, 0xd5, 0x10, 0x39, 0x43, 0xcf, 0x34, - 0x15, 0x0a, 0x01, 0x02, 0x24, 0x97, 0x20, 0x0f, 0x20, 0xce, 0x21, 0xe7, 0x5c, 0x93, 0x7f, 0x91, - 0x43, 0x80, 0x18, 0x39, 0xf9, 0x18, 0xe4, 0x30, 0x49, 0xc6, 0xff, 0x80, 0xc7, 0x9c, 0x82, 0x7e, - 0xcc, 0x8b, 0xa4, 0xe5, 0xd0, 0x40, 0x80, 0x5c, 0x4c, 0x4f, 0xd7, 0xf7, 0x7d, 0x55, 0x5d, 0xdd, - 0x5d, 0x5d, 0x2d, 0xb0, 0x65, 0x3a, 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0x31, 0x09, 0x6a, 0xcb, 0xef, 0xea, 0xc8, 0x5f, 0x6c, 0xf8, 0x96, 0x68, 0xcc, 0xf1, 0x12, - 0x75, 0xeb, 0xe7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x51, 0xce, 0x1c, 0xd7, 0x11, 0x00, 0x00, + // 1599 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, + 0x15, 0xd7, 0x52, 0xd6, 0x07, 0x87, 0xa2, 0x44, 0x8e, 0x44, 0x8b, 0x56, 0x6d, 0xae, 0xba, 0x80, + 0x5d, 0xc1, 0x86, 0x48, 0x4b, 0x46, 0xd1, 0x4f, 0xa0, 0x15, 0x25, 0xd9, 0x66, 0x2b, 0xd4, 0xf6, + 0x42, 0x70, 0x01, 0xa3, 0xed, 0x76, 0xb8, 0x3b, 0xa4, 0x06, 0x22, 0x77, 0xe9, 0xdd, 0xa1, 0x4a, + 0xa1, 0x40, 0x81, 0xf6, 0x52, 0xe4, 0x03, 0x88, 0x73, 0xc8, 0x39, 0xd7, 0xe4, 0xbf, 0xc8, 0x21, + 0x40, 0x8c, 0x9c, 0x7c, 0x0c, 0x72, 0xd8, 0x24, 0xeb, 0xff, 0x80, 0xc7, 0x9c, 0x82, 0xf9, 0xd8, + 0x2f, 0x92, 0x96, 0x4d, 0x03, 0x01, 0x72, 0x31, 0xbd, 0xf3, 0xde, 0xef, 0xf7, 0xde, 0xbc, 0x79, + 0xf3, 0xe6, 0x3d, 0x81, 0x6d, 0xd3, 0xe9, 0x5a, 0x78, 0x50, 0xeb, 0x90, 0xa7, 0x7d, 0x62, 0x21, + 0x4a, 0x1c, 0xdb, 0x7b, 0xbc, 0x5b, 0x3b, 0xdb, 0x69, 0x62, 0x8a, 0x76, 0xa2, 0x65, 0x5c, 0xed, + 0xb9, 0x0e, 0x75, 0xe0, 0x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, 0x00, + 0x35, 0x4c, 0xc9, 0xd8, 0x37, 0xe2, 0xf1, 0x54, 0x37, 0x5c, 0xf6, 0xc3, 0xbb, 0xb6, 0x6c, 0x7d, + 0x30, 0x5d, 0x59, 0x09, 0x7c, 0xf5, 0xea, 0xbe, 0x20, 0xde, 0x97, 0xbc, 0x21, 0xad, 0xce, 0xfe, + 0x1d, 0xfa, 0xea, 0x0d, 0x19, 0xd0, 0x8b, 0xcd, 0x6b, 0xfa, 0x35, 0x33, 0xcd, 0x83, 0x52, 0x44, + 0xf0, 0x53, 0x05, 0x6c, 0xa4, 0x0e, 0xc5, 0x68, 0xe2, 0xb0, 0x05, 0x92, 0xbd, 0xdd, 0x85, 0x31, + 0x7d, 0x24, 0x63, 0x5a, 0x11, 0xee, 0xec, 0x27, 0x4e, 0xa8, 0x8e, 0xf7, 0x42, 0x9e, 0xa9, 0x02, + 0xbc, 0x6e, 0x4e, 0x26, 0x81, 0xff, 0x55, 0x40, 0x8e, 0x22, 0xb7, 0x8d, 0xa9, 0xc1, 0xce, 0x40, + 0x76, 0x83, 0x17, 0x38, 0x77, 0x28, 0x9d, 0x83, 0xf2, 0xa5, 0x8a, 0xb1, 0x53, 0x39, 0x04, 0x04, + 0xf0, 0x00, 0x37, 0x29, 0xfc, 0x50, 0x01, 0xa5, 0x44, 0x27, 0x60, 0x44, 0xd3, 0x0c, 0x6f, 0xff, + 0x72, 0xbb, 0x1b, 0x55, 0x31, 0xef, 0x54, 0xc3, 0x79, 0xa7, 0x7a, 0x1c, 0x6a, 0x88, 0x87, 0x2b, + 0xf0, 0xd5, 0xb5, 0x44, 0x41, 0x8c, 0xa4, 0x71, 0x23, 0x3a, 0x91, 0x5e, 0x7b, 0xf6, 0x8d, 0xaa, + 0xe8, 0x6b, 0x9d, 0x09, 0x48, 0xf8, 0x0f, 0x3e, 0x91, 0x10, 0x9b, 0x62, 0x97, 0x55, 0x21, 0xd1, + 0x48, 0x96, 0x97, 0x78, 0x5b, 0x7e, 0x5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x60, 0x03, 0x2c, + 0x85, 0xd3, 0x16, 0x27, 0x5c, 0xe5, 0x29, 0x7b, 0x83, 0x77, 0xd0, 0x62, 0x5d, 0xd2, 0xad, 0xca, + 0x6e, 0x37, 0xa1, 0xcc, 0x1a, 0xe8, 0x58, 0x07, 0xde, 0x03, 0x4b, 0x6c, 0xba, 0x66, 0x25, 0xdd, + 0xec, 0x7a, 0xb4, 0xbc, 0xc6, 0xa9, 0xae, 0x07, 0xbe, 0x0a, 0x1a, 0x1e, 0xbb, 0xb9, 0xfb, 0x5d, + 0x8f, 0xc6, 0x4c, 0x49, 0x5d, 0x4d, 0x07, 0x24, 0x52, 0x81, 0x7f, 0x01, 0xab, 0x89, 0x7a, 0x18, + 0x35, 0xe1, 0x25, 0xd1, 0x3f, 0xc4, 0xe7, 0x37, 0x41, 0x49, 0xd3, 0x8b, 0xf1, 0xaa, 0x6c, 0xd5, + 0xe1, 0xef, 0x41, 0x9e, 0x5b, 0x8a, 0x98, 0x2e, 0x73, 0xa6, 0x72, 0x3c, 0x17, 0xa4, 0xc4, 0x9a, + 0x9e, 0x63, 0xdf, 0x12, 0x5d, 0x7f, 0xf2, 0xfc, 0xbb, 0xca, 0xcc, 0x27, 0x41, 0x65, 0xe6, 0x79, + 0x50, 0x51, 0x5e, 0x04, 0x15, 0xe5, 0xdb, 0xa0, 0xa2, 0x3c, 0x7b, 0x59, 0x99, 0x79, 0xf1, 0xb2, + 0x32, 0xf3, 0xd5, 0xcb, 0xca, 0xcc, 0x93, 0x5f, 0xa7, 0x0e, 0x9f, 0x4d, 0x2a, 0xdb, 0x4e, 0xab, + 0x45, 0x4c, 0x82, 0x3a, 0xf2, 0xbb, 0x36, 0xf6, 0x07, 0x1e, 0x9e, 0x12, 0xcd, 0x79, 0x5e, 0xa2, + 0xee, 0xfc, 0x10, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x02, 0x97, 0xb4, 0x06, 0x12, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -823,6 +824,11 @@ func (m *LiquidationOffsetHolder) MarshalToSizedBuffer(dAtA []byte) (int, error) i-- dAtA[i] = 0x10 } + if m.AppId != 0 { + i = encodeVarintLiquidate(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } @@ -1156,6 +1162,9 @@ func (m *LiquidationOffsetHolder) Size() (n int) { } var l int _ = l + if m.AppId != 0 { + n += 1 + sovLiquidate(uint64(m.AppId)) + } if m.CurrentOffset != 0 { n += 1 + sovLiquidate(uint64(m.CurrentOffset)) } @@ -2094,6 +2103,25 @@ func (m *LiquidationOffsetHolder) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: LiquidationOffsetHolder: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiquidate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CurrentOffset", wireType) From e68c67cae19d6e17697964e006ec51a77b898687 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Thu, 1 Jun 2023 17:52:27 +0530 Subject: [PATCH 080/155] finalising auto bid --- x/auctionsV2/keeper/msg_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auctionsV2/keeper/msg_server.go b/x/auctionsV2/keeper/msg_server.go index 8fa4fb06d..e8fe08cfe 100644 --- a/x/auctionsV2/keeper/msg_server.go +++ b/x/auctionsV2/keeper/msg_server.go @@ -34,7 +34,7 @@ func (k msgServer) MsgPlaceMarketBid(goCtx context.Context, msg *types.MsgPlaceM //If true triggering Dutch Auction Bid Request if auctionData.AuctionType { - err = k.PlaceDutchAuctionBid(ctx, msg.AuctionId, bidder, msg.Amount, auctionData) + _,err = k.PlaceDutchAuctionBid(ctx, msg.AuctionId, bidder, msg.Amount, auctionData) if err != nil { return nil, err } From cdd62647de946fa317513a59c19373e75ee9214d Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Fri, 2 Jun 2023 17:02:27 +0530 Subject: [PATCH 081/155] resolving bugs --- proto/comdex/vault/v1beta1/vault.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/comdex/vault/v1beta1/vault.proto b/proto/comdex/vault/v1beta1/vault.proto index 3f3e29034..8c6aa850d 100644 --- a/proto/comdex/vault/v1beta1/vault.proto +++ b/proto/comdex/vault/v1beta1/vault.proto @@ -9,7 +9,7 @@ option go_package = "github.com/comdex-official/comdex/x/vault/types"; option (gogoproto.equal_all) = false; option (gogoproto.goproto_getters_all) = false; -//app_vault_type_id will be the key for the KVStore for this value. +//app_vault_type_id will be the key for the KVStore for this value message Vault { uint64 id = 1 ; uint64 app_id = 2 From 121669fb38654506867933802ea24b5dff4f98d1 Mon Sep 17 00:00:00 2001 From: Pratik Date: Sat, 3 Jun 2023 01:52:50 +0530 Subject: [PATCH 082/155] updating KV store functions for user limit bid data for user --- proto/comdex/auctionsV2/v1beta1/bid.proto | 12 +- x/auctionsV2/keeper/auctions.go | 3 + x/auctionsV2/keeper/bid.go | 86 +++++- x/auctionsV2/types/bid.pb.go | 343 ++++++++++++++++++---- x/auctionsV2/types/keys.go | 29 +- 5 files changed, 390 insertions(+), 83 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto index 85b0b69fc..2f14ff758 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -102,14 +102,22 @@ message AuctionParams{ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"closing_fee\"" ]; - uint64 min_usd_value_left=5[ + uint64 min_usd_value_left = 5[ (gogoproto.moretags) = "yaml:\"min_usd_value_left\"" ]; } - +message LimitOrderBidsForUser{ + string bidder_address = 1 [ + (gogoproto.moretags) = "yaml:\"bidder\"" + ]; + repeated LimitOrderBid limit_order_bid = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"limit_order_bid\"" + ]; +} // Bidding Structs //1. Market Bid diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 33f785732..dba6e2757 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -402,17 +402,20 @@ func (k Keeper) LimitOrderBid(ctx sdk.Context) error { } if individualBids.DebtToken.Amount.Equal(auction.DebtToken.Amount) { k.DeleteUserLimitBidData(ctx, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt().String(), individualBids.BidderAddress) + k.AppendUserLimitBidDataForAddress(ctx, individualBids, false) return nil } individualBids.DebtToken.Amount = individualBids.DebtToken.Amount.Sub(auction.DebtToken.Amount) individualBids.BiddingId = append(individualBids.BiddingId, bidding_id) k.SetUserLimitBidData(ctx, individualBids, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt().String()) + k.AppendUserLimitBidDataForAddress(ctx, individualBids, true) } else { _, err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr, individualBids.DebtToken, auction, true) if err != nil { return err } k.DeleteUserLimitBidData(ctx, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt().String(), individualBids.BidderAddress) + k.AppendUserLimitBidDataForAddress(ctx, individualBids, false) } } diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 25343482f..d1c09e0a4 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -210,7 +210,7 @@ import ( // return nil // } -func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction, isAutoBid bool) (bidId unit64,error) { +func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction, isAutoBid bool) (bidId unit64, error) { auctionParams, _ := k.GetAuctionParams(ctx) if bid.Amount.Equal(sdk.ZeroInt()) { return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid amount can't be Zero") @@ -263,17 +263,17 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if bid.Amount.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) if err != nil { - return nil,err + return nil, err } } - } + } //Send Collateral To bidder if totalCollateralTokenQuanitity.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) if err != nil { - return nil,err + return nil, err } } //Burn Debt Token, @@ -282,7 +282,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if tokensToBurn.Amount.GT(sdk.ZeroInt()) { err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(tokensToBurn)) if err != nil { - return nil,err + return nil, err } } //Send rest tokens to the user @@ -290,14 +290,14 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if OwnerLeftOverCapital.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.Owner), sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, OwnerLeftOverCapital))) if err != nil { - return nil,err + return nil, err } } //Add bid data to struct //Creating user bid struct bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") if err != nil { - return nil,err + return nil, err } //Based on app type call perform specific function - external , internal and /or keeper incentive //See if this was keeper initiated transaction- then incentivisation will be in place based on the percentage @@ -315,7 +315,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.InternalKeeperAddress), sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) if err != nil { - return nil,err + return nil, err } } } @@ -323,14 +323,14 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if liquidationPenalty.Amount.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(liquidationPenalty)) if err != nil { - return nil,err + return nil, err } } //Update Collector Data for CMST // Updating fees data in collector err = k.collector.SetNetFeeCollectedData(ctx, auctionData.AppId, auctionData.CollateralAssetId, liquidationPenalty.Amount) if err != nil { - return nil,err + return nil, err } //Updating mapping data of vault k.vault.UpdateTokenMintedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, tokensToBurn.Amount, false) @@ -375,20 +375,20 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if bid.Amount.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) if err != nil { - return nil,err + return nil, err } } - } + } //Send Collateral To bidder if totalCollateralTokenQuanitity.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) if err != nil { - return nil,err + return nil, err } } bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") if err != nil { - return nil,err + return nil, err } //Add bidder data in auction bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{bidding_id, string(bidder)} @@ -401,7 +401,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //Set Auction k.SetAuction(ctx, auctionData) } - return bidding_id,nil + return bidding_id, nil } func (k Keeper) CreateUserBid(ctx sdk.Context, appID uint64, BidderAddress string, auctionID uint64, collateralToken sdk.Coin, debtToken sdk.Coin, bidType string) (bidding_id uint64, err error) { @@ -558,6 +558,7 @@ func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, Collatera // Set ID and LimitBid Data k.SetLimitAuctionBidID(ctx, userLimitBid.LimitOrderBiddingId) k.SetUserLimitBidData(ctx, userLimitBid, DebtTokenId, CollateralTokenId, PremiumDiscount) + k.AppendUserLimitBidDataForAddress(ctx, userLimitBid, true) return nil } @@ -579,6 +580,7 @@ func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenI // delete userLimitBid from KV store k.DeleteUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) + k.AppendUserLimitBidDataForAddress(ctx, userLimitBid, false) return nil } @@ -607,6 +609,7 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater } userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(amount.Amount) k.SetUserLimitBidData(ctx, userLimitBid, DebtTokenId, CollateralTokenId, PremiumDiscount) + k.AppendUserLimitBidDataForAddress(ctx, userLimitBid, true) return nil } @@ -615,3 +618,56 @@ func (k Keeper) CalcDollarValueForToken(ctx sdk.Context, rate sdk.Dec, amt sdk.I denominator := sdk.NewDecFromInt(asset.Decimals) return numerator.Quo(denominator), nil } + +func (k Keeper) SetUserLimitBidDataForAddress(ctx sdk.Context, userLimitBidData types.LimitOrderBidsForUser) { + var ( + store = k.Store(ctx) + key = types.UserLimitBidKeyForAddress(userLimitBidData.BidderAddress) + value = k.cdc.MustMarshal(&userLimitBidData) + ) + + store.Set(key, value) +} + +func (k Keeper) AppendUserLimitBidDataForAddress(ctx sdk.Context, userLimitBid types.LimitOrderBid, inc bool) { + userLimitBidForAddress, found := k.GetUserLimitBidDataForAddress(ctx, userLimitBid.BidderAddress) + if inc { + if !found { + userLimitBidForAddress.BidderAddress = userLimitBid.BidderAddress + userLimitBidForAddress.LimitOrderBid = append(userLimitBidForAddress.LimitOrderBid, userLimitBid) + } else { + for _, individualLimitOrderBid := range userLimitBidForAddress.LimitOrderBid { + if individualLimitOrderBid.LimitOrderBiddingId == userLimitBid.LimitOrderBiddingId { + individualLimitOrderBid = userLimitBid + } + } + } + } else { + if !found { + userLimitBidForAddress.BidderAddress = userLimitBid.BidderAddress + } else { + for index, individualLimitOrderBid := range userLimitBidForAddress.LimitOrderBid { + if individualLimitOrderBid.LimitOrderBiddingId == userLimitBid.LimitOrderBiddingId { + userLimitBidForAddress.LimitOrderBid = append(userLimitBidForAddress.LimitOrderBid[:index], userLimitBidForAddress.LimitOrderBid[index+1:]...) + } + } + } + } + + k.SetUserLimitBidDataForAddress(ctx, userLimitBidForAddress) +} + +func (k Keeper) GetUserLimitBidDataForAddress(ctx sdk.Context, address string) (mappingData types.LimitOrderBidsForUser, found bool) { + var ( + store = k.Store(ctx) + key = types.UserLimitBidKeyForAddress(address) + value = store.Get(key) + ) + + if value == nil { + return mappingData, false + } + + k.cdc.MustUnmarshal(value, &mappingData) + return mappingData, true +} diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index 9b4844c15..588e5fecb 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -261,10 +261,63 @@ func (m *AuctionParams) GetMinUsdValueLeft() uint64 { return 0 } +type LimitOrderBidsForUser struct { + BidderAddress string `protobuf:"bytes,1,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` + LimitOrderBid []LimitOrderBid `protobuf:"bytes,2,rep,name=limit_order_bid,json=limitOrderBid,proto3" json:"limit_order_bid" yaml:"limit_order_bid"` +} + +func (m *LimitOrderBidsForUser) Reset() { *m = LimitOrderBidsForUser{} } +func (m *LimitOrderBidsForUser) String() string { return proto.CompactTextString(m) } +func (*LimitOrderBidsForUser) ProtoMessage() {} +func (*LimitOrderBidsForUser) Descriptor() ([]byte, []int) { + return fileDescriptor_6f6db8f3a6a396ec, []int{3} +} +func (m *LimitOrderBidsForUser) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LimitOrderBidsForUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LimitOrderBidsForUser.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LimitOrderBidsForUser) XXX_Merge(src proto.Message) { + xxx_messageInfo_LimitOrderBidsForUser.Merge(m, src) +} +func (m *LimitOrderBidsForUser) XXX_Size() int { + return m.Size() +} +func (m *LimitOrderBidsForUser) XXX_DiscardUnknown() { + xxx_messageInfo_LimitOrderBidsForUser.DiscardUnknown(m) +} + +var xxx_messageInfo_LimitOrderBidsForUser proto.InternalMessageInfo + +func (m *LimitOrderBidsForUser) GetBidderAddress() string { + if m != nil { + return m.BidderAddress + } + return "" +} + +func (m *LimitOrderBidsForUser) GetLimitOrderBid() []LimitOrderBid { + if m != nil { + return m.LimitOrderBid + } + return nil +} + func init() { proto.RegisterType((*Bid)(nil), "comdex.auctionsV2.v1beta1.Bid") proto.RegisterType((*LimitOrderBid)(nil), "comdex.auctionsV2.v1beta1.LimitOrderBid") proto.RegisterType((*AuctionParams)(nil), "comdex.auctionsV2.v1beta1.AuctionParams") + proto.RegisterType((*LimitOrderBidsForUser)(nil), "comdex.auctionsV2.v1beta1.LimitOrderBidsForUser") } func init() { @@ -272,60 +325,63 @@ func init() { } var fileDescriptor_6f6db8f3a6a396ec = []byte{ - // 840 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x8e, 0xdb, 0x44, - 0x18, 0x5f, 0x77, 0xb3, 0xdb, 0x66, 0x56, 0x69, 0x36, 0x6e, 0xb7, 0xcd, 0x06, 0x35, 0x0e, 0x53, - 0x04, 0xb9, 0xd4, 0x56, 0x4b, 0x0f, 0x08, 0x89, 0xc3, 0x86, 0x08, 0x14, 0x54, 0x0a, 0x98, 0x65, - 0x0f, 0x48, 0xc8, 0x1a, 0x7b, 0x26, 0xe9, 0xa8, 0xb6, 0xc7, 0xf2, 0x8c, 0xbb, 0xf4, 0xc2, 0x1b, - 0x20, 0xf5, 0xc0, 0x0b, 0xf0, 0x04, 0xbc, 0x46, 0x8f, 0x3d, 0x22, 0x24, 0x0c, 0xda, 0xe5, 0x09, - 0x7c, 0xe4, 0x84, 0xe6, 0x4f, 0xe2, 0x24, 0x5b, 0x69, 0x37, 0xe2, 0x94, 0x99, 0xef, 0xcf, 0xef, - 0xfb, 0x7d, 0xdf, 0xfc, 0xf2, 0x19, 0xdc, 0x8f, 0x58, 0x82, 0xc9, 0x8f, 0x1e, 0x2a, 0x22, 0x41, - 0x59, 0xca, 0x4f, 0x1e, 0x79, 0x2f, 0x1e, 0x86, 0x44, 0xa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0x64, 0xe3, 0xd6, 0xf6, 0x74, 0x61, - 0x89, 0x01, 0x7d, 0x05, 0x65, 0xa7, 0xe0, 0xe6, 0x29, 0x15, 0xcf, 0x70, 0x8e, 0x4e, 0x51, 0x1c, - 0x4c, 0x09, 0x51, 0xe2, 0x6b, 0x6a, 0x85, 0x6d, 0x04, 0x7e, 0xa0, 0xc1, 0x57, 0xd1, 0xa0, 0xdf, - 0xaa, 0x0d, 0x9f, 0x11, 0x62, 0x13, 0xb0, 0x17, 0xc5, 0x8c, 0xcb, 0x37, 0x94, 0xc5, 0x1a, 0xaa, - 0xd8, 0x78, 0xe3, 0x62, 0xb6, 0x2e, 0xb6, 0x04, 0x05, 0x7d, 0x60, 0x6e, 0xb2, 0xcc, 0x17, 0xc0, - 0x4e, 0x68, 0x1a, 0x14, 0x1c, 0x07, 0x2f, 0x50, 0x5c, 0x90, 0x20, 0x26, 0x53, 0xa1, 0x36, 0x60, - 0x63, 0x74, 0xaf, 0x2a, 0x9d, 0x43, 0x9d, 0x7f, 0x31, 0x06, 0xfa, 0xed, 0x84, 0xa6, 0xdf, 0x71, - 0x7c, 0x22, 0x4d, 0x4f, 0xc8, 0x54, 0x8c, 0x9e, 0xbe, 0x3e, 0xeb, 0x5b, 0x6f, 0xce, 0xfa, 0xd6, - 0xdf, 0x67, 0x7d, 0xeb, 0xd5, 0x79, 0x7f, 0xeb, 0xcd, 0x79, 0x7f, 0xeb, 0xf7, 0xf3, 0xfe, 0xd6, - 0xf7, 0x8f, 0x57, 0xf8, 0xca, 0xef, 0xf1, 0x03, 0x36, 0x9d, 0xd2, 0x88, 0xa2, 0xd8, 0xdc, 0xbd, - 0x95, 0xcf, 0xb8, 0xea, 0x20, 0xdc, 0x55, 0xcb, 0xf3, 0xc3, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, - 0xf8, 0x21, 0x5c, 0xf9, 0xe8, 0x07, 0x00, 0x00, + // 893 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 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, 0xbe, 0x5a, 0xc5, 0x23, 0x43, 0xc4, 0x3c, 0xe3, 0x2a, 0x75, 0x29, + 0x16, 0xad, 0xb9, 0x78, 0x17, 0xa6, 0xcb, 0x5a, 0xbf, 0x71, 0xad, 0xe9, 0x22, 0xc0, 0x66, 0x96, + 0x93, 0x84, 0x16, 0x49, 0x80, 0x29, 0x8f, 0xd4, 0x0b, 0x5c, 0x57, 0x37, 0x70, 0x28, 0x09, 0xfe, + 0x5e, 0x3a, 0xef, 0x5f, 0x83, 0xcb, 0x88, 0x44, 0xd3, 0xd2, 0xb9, 0xab, 0x2b, 0x2d, 0xe2, 0x41, + 0xbf, 0x63, 0x4c, 0xa3, 0x99, 0xe5, 0xef, 0x06, 0x68, 0x1f, 0xe8, 0x59, 0xf5, 0x15, 0xca, 0x51, + 0xc2, 0xed, 0xef, 0x40, 0x77, 0x36, 0xc9, 0x70, 0x91, 0x23, 0xb5, 0xe0, 0x24, 0x62, 0x29, 0xe6, + 0x46, 0x61, 0xf7, 0xa7, 0xa5, 0xe3, 0xd4, 0x67, 0xde, 0x62, 0x24, 0xf4, 0x77, 0x8c, 0x6b, 0x64, + 0x3c, 0xdf, 0x68, 0x87, 0xfd, 0x35, 0x68, 0x72, 0x41, 0x32, 0x23, 0xae, 0x4f, 0x96, 0x3e, 0xda, + 0x86, 0x2e, 0x2c, 0x31, 0xa0, 0xaf, 0xa0, 0xec, 0x14, 0xdc, 0x3a, 0xa1, 0xe2, 0x39, 0xce, 0xd1, + 0x09, 0x8a, 0x83, 0x31, 0x21, 0x4a, 0x7c, 0x2d, 0xad, 0xb0, 0xa5, 0xc0, 0xb7, 0x35, 0x78, 0x1d, + 0x0d, 0xfa, 0xed, 0xca, 0xf0, 0x98, 0x10, 0x9b, 0x80, 0x8d, 0x28, 0x66, 0x5c, 0xde, 0xa1, 0x2c, + 0xd6, 0x54, 0xc5, 0x46, 0x4b, 0x17, 0xb3, 0x75, 0xb1, 0x73, 0x50, 0xd0, 0x07, 0x66, 0x27, 0xcb, + 0x7c, 0x0e, 0xec, 0x84, 0xa6, 0x41, 0xc1, 0x71, 0xf0, 0x12, 0xc5, 0x05, 0x09, 0x62, 0x32, 0x16, + 0x6a, 0x02, 0x36, 0x87, 0xf7, 0xa6, 0xa5, 0xb3, 0xab, 0xf3, 0x2f, 0xc6, 0x40, 0xbf, 0x93, 0xd0, + 0xf4, 0x19, 0xc7, 0xc7, 0xd2, 0xf4, 0x44, 0x5a, 0x7e, 0xb5, 0xc0, 0x76, 0x6d, 0x8c, 0xf0, 0xc7, + 0x2c, 0x7f, 0xc6, 0x49, 0x7e, 0xc9, 0xb3, 0xb7, 0xae, 0xf9, 0xec, 0x33, 0xd0, 0x59, 0x18, 0x30, + 0xdd, 0xd5, 0x7e, 0x63, 0xb0, 0xb1, 0x3f, 0x70, 0xff, 0xf3, 0xc3, 0xee, 0xd6, 0x48, 0x0c, 0x7b, + 0xe6, 0xe9, 0xed, 0x5c, 0x3a, 0xaf, 0xa0, 0xdf, 0xae, 0x0d, 0xaa, 0xe1, 0xd3, 0x37, 0xa7, 0x3d, + 0xeb, 0xed, 0x69, 0xcf, 0xfa, 0xeb, 0xb4, 0x67, 0xbd, 0x3e, 0xeb, 0xad, 0xbc, 0x3d, 0xeb, 0xad, + 0xfc, 0x76, 0xd6, 0x5b, 0xf9, 0xf6, 0x51, 0xad, 0xeb, 0xb2, 0xf8, 0x03, 0x36, 0x1e, 0xd3, 0x88, + 0xa2, 0xd8, 0xec, 0xbd, 0xda, 0x9f, 0x11, 0x75, 0x0f, 0xe1, 0xba, 0xfa, 0x04, 0x7c, 0xf8, 0x6f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x94, 0xf3, 0xa5, 0xae, 0x08, 0x00, 0x00, } func (m *Bid) Marshal() (dAtA []byte, err error) { @@ -554,6 +610,50 @@ func (m *AuctionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *LimitOrderBidsForUser) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LimitOrderBidsForUser) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LimitOrderBidsForUser) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.LimitOrderBid) > 0 { + for iNdEx := len(m.LimitOrderBid) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LimitOrderBid[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.BidderAddress) > 0 { + i -= len(m.BidderAddress) + copy(dAtA[i:], m.BidderAddress) + i = encodeVarintBid(dAtA, i, uint64(len(m.BidderAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintBid(dAtA []byte, offset int, v uint64) int { offset -= sovBid(v) base := offset @@ -647,6 +747,25 @@ func (m *AuctionParams) Size() (n int) { return n } +func (m *LimitOrderBidsForUser) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BidderAddress) + if l > 0 { + n += 1 + l + sovBid(uint64(l)) + } + if len(m.LimitOrderBid) > 0 { + for _, e := range m.LimitOrderBid { + l = e.Size() + n += 1 + l + sovBid(uint64(l)) + } + } + return n +} + func sovBid(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1390,6 +1509,122 @@ func (m *AuctionParams) Unmarshal(dAtA []byte) error { } return nil } +func (m *LimitOrderBidsForUser) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LimitOrderBidsForUser: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LimitOrderBidsForUser: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidderAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BidderAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderBid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBid + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LimitOrderBid = append(m.LimitOrderBid, LimitOrderBid{}) + if err := m.LimitOrderBid[len(m.LimitOrderBid)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBid(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBid + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipBid(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index 74d81b91f..3e16ccb2c 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -22,18 +22,19 @@ const ( ) var ( - TypePlaceMarketBidRequest = ModuleName + ":market-bid-request" - TypePlaceLimitBidRequest = ModuleName + ":limit-bid-request" - TypeCancelLimitBidRequest = ModuleName + ":cancel-limit-bid-request" - TypeWithdrawLimitBidRequest = ModuleName + ":withdraw-limit-bid-request" - AuctionIDKey = []byte{0x01} - AuctionKeyPrefix = []byte{0x02} - LimitAuctionBidIDKey = []byte{0x03} - AuctionParamsKey = []byte{0x04} - UserBidIDKey = []byte{0x05} - UserBidKeyPrefix = []byte{0x06} - AuctionHistoricalKeyPrefix = []byte{0x07} - UserLimitBidMappingKeyPrefix = []byte{0x08} + TypePlaceMarketBidRequest = ModuleName + ":market-bid-request" + TypePlaceLimitBidRequest = ModuleName + ":limit-bid-request" + TypeCancelLimitBidRequest = ModuleName + ":cancel-limit-bid-request" + TypeWithdrawLimitBidRequest = ModuleName + ":withdraw-limit-bid-request" + AuctionIDKey = []byte{0x01} + AuctionKeyPrefix = []byte{0x02} + LimitAuctionBidIDKey = []byte{0x03} + AuctionParamsKey = []byte{0x04} + UserBidIDKey = []byte{0x05} + UserBidKeyPrefix = []byte{0x06} + AuctionHistoricalKeyPrefix = []byte{0x07} + UserLimitBidMappingKeyPrefix = []byte{0x08} + UserLimitBidMappingKeyForAddressPrefix = []byte{0x09} ) func AuctionKey(auctionID uint64) []byte { @@ -54,3 +55,7 @@ func UserLimitBidKey(debtTokenID, collateralTokenID uint64, premium, address str func UserLimitBidKeyForPremium(debtTokenID, collateralTokenID uint64, premium string) []byte { return append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), premium...) } + +func UserLimitBidKeyForAddress(address string) []byte { + return append(UserLimitBidMappingKeyForAddressPrefix, address...) +} From 2f38e10dd24e0b3b20c818790553cd5dd53e5be8 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sat, 3 Jun 2023 20:35:52 +0530 Subject: [PATCH 083/155] finalising esm trigger in auction --- x/auctionsV2/expected/keeper.go | 9 +++--- x/auctionsV2/keeper/auctions.go | 51 +++++++++++++++++++++++++++++++++ x/auctionsV2/keeper/bid.go | 41 ++++++++++++++------------ x/auctionsV2/types/errors.go | 1 + x/vault/keeper/vault.go | 2 ++ 5 files changed, 81 insertions(+), 23 deletions(-) diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go index 99370d5c1..03b620be2 100644 --- a/x/auctionsV2/expected/keeper.go +++ b/x/auctionsV2/expected/keeper.go @@ -13,7 +13,7 @@ import ( type LiquidationsV2Keeper interface { GetLiquidationWhiteListing(ctx sdk.Context, appId uint64) (liquidationWhiteListing liquidationsV2types.LiquidationWhiteListing, found bool) GetLockedVault(ctx sdk.Context, appID, id uint64) (lockedVault liquidationsV2types.LockedVault, found bool) - DeleteLockedVault(ctx sdk.Context,id uint64) + DeleteLockedVault(ctx sdk.Context, id uint64) WithdrawAppReserveFundsFn(ctx sdk.Context, appId, assetId uint64, tokenQuantity sdk.Coin) } @@ -53,6 +53,7 @@ type VaultKeeper interface { GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdk.Dec, amt1 sdk.Int, id2 uint64, rate2 sdk.Dec) (sdk.Dec, sdk.Int, error) UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) + CreateNewVault(ctx sdk.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdk.Int, AmountOut sdk.Int) } type CollectorKeeper interface { // GetAppidToAssetCollectorMapping(ctx sdk.Context, appID, assetID uint64) (appAssetCollectorData types.AppToAssetIdCollectorMapping, found bool) @@ -63,6 +64,6 @@ type CollectorKeeper interface { // GetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64) (netFeeData types.AppAssetIdToFeeCollectedData, found bool) // GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, amount sdk.Int) (sdk.Int, error) SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdk.Int) error -// SetAuctionMappingForApp(ctx sdk.Context, records types.AppAssetIdToAuctionLookupTable) error -// GetAllAuctionMappingForApp(ctx sdk.Context) (collectorAuctionLookupTable []types.AppAssetIdToAuctionLookupTable, found bool) -} \ No newline at end of file + // SetAuctionMappingForApp(ctx sdk.Context, records types.AppAssetIdToAuctionLookupTable) error + // GetAllAuctionMappingForApp(ctx sdk.Context) (collectorAuctionLookupTable []types.AppAssetIdToAuctionLookupTable, found bool) +} diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 33f785732..5da843a93 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -7,6 +7,7 @@ import ( "github.com/comdex-official/comdex/x/auctionsV2/types" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" + collectortypes "github.com/comdex-official/comdex/x/collector/types" liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -157,6 +158,15 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { //Most Probably Close Auction //Check here if initiator is vault , then for vault do esm trigger option accordingly + liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, auction.AppId, auction.LockedVaultId) + if liquidationData.InitiatorType == "vault" { + + err := k.TriggerEsm(ctx, auction, liquidationData) + if err != nil { + return err + } + + } } else { //Else reduce - normal operation @@ -374,6 +384,47 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio } +func (k Keeper) TriggerEsm(ctx sdk.Context, auctionData types.Auction, liquidationData liquidationtypes.LockedVault) error { + + //Check if liquidation penalty has been recovered + debtCollected := liquidationData.TargetDebt.Sub(auctionData.DebtToken) + collateralAuctioned := liquidationData.CollateralToken.Amount.Sub(auctionData.CollateralToken.Amount) + tokensToTransfer := debtCollected + //If more debt collected, send liquidation penalty to collector, and open the vault from the rest amount and update params + if debtCollected.Amount.GT(liquidationData.FeeToBeCollected) { + //Send Liquidation Penalty to the Collector Module + tokensToTransfer = sdk.NewCoin(auctionData.DebtToken.Denom, liquidationData.FeeToBeCollected) + //burning rest collected tokens + tokensToBurn := debtCollected.Amount.Sub(liquidationData.FeeToBeCollected) + if tokensToBurn.GT(sdk.ZeroInt()) { + err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, tokensToBurn))) + if err != nil { + return err + } + } + //updating token minted + //updating collateral locked data + k.vault.UpdateTokenMintedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, tokensToBurn, false) + } + + err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(tokensToTransfer)) + if err != nil { + return err + } + //Update Collector Data for CMST + // Updating fees data in collector + err = k.collector.SetNetFeeCollectedData(ctx, auctionData.AppId, auctionData.CollateralAssetId, tokensToTransfer.Amount) + if err != nil { + return err + } + //Opening vault + k.vault.CreateNewVault(ctx, liquidationData.Owner, auctionData.AppId, liquidationData.ExtendedPairId, auctionData.CollateralToken.Amount, auctionData.DebtToken.Amount) + k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, collateralAuctioned, false) + + return nil + +} + func (k Keeper) LimitOrderBid(ctx sdk.Context) error { // Get Auctions One by One and for that particular auction check the current discount // if we find any active limit bid for that premium then we will execute it and update both diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 25343482f..41e197c05 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -210,15 +210,15 @@ import ( // return nil // } -func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction, isAutoBid bool) (bidId unit64,error) { +func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction, isAutoBid bool) (bidId uint64, err error) { auctionParams, _ := k.GetAuctionParams(ctx) if bid.Amount.Equal(sdk.ZeroInt()) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid amount can't be Zero") + return bidId, types.ErrBidCannotBeZero } liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, auctionData.AppId) if bid.Denom != auctionData.DebtToken.Denom { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the debt token ", bid.Denom) + return bidId, sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the debt token ", bid.Denom) } liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, auctionData.AppId, auctionData.LockedVaultId) //Price data of the token from market module @@ -263,17 +263,17 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if bid.Amount.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) if err != nil { - return nil,err + return bidId, err } } - } + } //Send Collateral To bidder if totalCollateralTokenQuanitity.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) if err != nil { - return nil,err + return bidId, err } } //Burn Debt Token, @@ -282,7 +282,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if tokensToBurn.Amount.GT(sdk.ZeroInt()) { err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(tokensToBurn)) if err != nil { - return nil,err + return bidId, err } } //Send rest tokens to the user @@ -290,14 +290,14 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if OwnerLeftOverCapital.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.Owner), sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, OwnerLeftOverCapital))) if err != nil { - return nil,err + return bidId, err } } //Add bid data to struct //Creating user bid struct bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") if err != nil { - return nil,err + return bidId, err } //Based on app type call perform specific function - external , internal and /or keeper incentive //See if this was keeper initiated transaction- then incentivisation will be in place based on the percentage @@ -315,7 +315,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.InternalKeeperAddress), sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) if err != nil { - return nil,err + return bidId, err } } } @@ -323,18 +323,18 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if liquidationPenalty.Amount.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(liquidationPenalty)) if err != nil { - return nil,err + return bidId, err } } //Update Collector Data for CMST // Updating fees data in collector err = k.collector.SetNetFeeCollectedData(ctx, auctionData.AppId, auctionData.CollateralAssetId, liquidationPenalty.Amount) if err != nil { - return nil,err + return bidId, err } //Updating mapping data of vault k.vault.UpdateTokenMintedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, tokensToBurn.Amount, false) - k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, auctionData.CollateralToken.Amount, false) + k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, liquidationData.CollateralToken.Amount, false) } else if liquidationData.InitiatorType == "borrow" { //Check if they are initiated through a keeper, if so they will be incentivised } @@ -348,6 +348,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s k.DeleteAuction(ctx, auctionData) //Delete liquidation Data k.LiquidationsV2.DeleteLockedVault(ctx, liquidationData.LockedVaultId) + bidId = bidding_id } else { //if bid amount is less than the target bid //Calculating collateral token value from bid(debt) token value @@ -355,7 +356,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s debtLeft := bid.Amount.Sub(bid.Amount) debtuDollar, _ := k.CalcDollarValueForToken(ctx, debtPrice, debtLeft) if !(debtuDollar).GT(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.MinUsdValueLeft))) { - return types.ErrCannotLeaveDebtLessThanDust + return bidId, types.ErrCannotLeaveDebtLessThanDust } //From auction bonus quantity , use the available quantity to calculate the collateral value @@ -375,20 +376,20 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if bid.Amount.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) if err != nil { - return nil,err + return bidId, err } } - } + } //Send Collateral To bidder if totalCollateralTokenQuanitity.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) if err != nil { - return nil,err + return bidId, err } } bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") if err != nil { - return nil,err + return bidId, err } //Add bidder data in auction bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{bidding_id, string(bidder)} @@ -400,8 +401,10 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s auctionData.BonusAmount = auctionData.BonusAmount.Sub(expectedBonusShareForCurrentBid) //Set Auction k.SetAuction(ctx, auctionData) + bidId = bidding_id } - return bidding_id,nil + + return bidId, nil } func (k Keeper) CreateUserBid(ctx sdk.Context, appID uint64, BidderAddress string, auctionID uint64, collateralToken sdk.Coin, debtToken sdk.Coin, bidType string) (bidding_id uint64, err error) { diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index 41ccc61cb..91abcafa9 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -12,4 +12,5 @@ var ( ErrEnglishAuctionDisabled = sdkerrors.Register(ModuleName, 702, "English auction not enabled for the app") ErrCannotLeaveDebtLessThanDust= sdkerrors.Register(ModuleName, 703, "You need to leave debt atleast equal to dust value or greater. Try making a full bid, or a smaller bid. Your current bid is just short of the dust value , hence it fails.") ErrorPriceNotFound= sdkerrors.Register(ModuleName, 704, "price not found") + ErrBidCannotBeZero=sdkerrors.Register(ModuleName,705,"Bid amount can't be Zero") ) diff --git a/x/vault/keeper/vault.go b/x/vault/keeper/vault.go index 59853cd47..0a966864e 100644 --- a/x/vault/keeper/vault.go +++ b/x/vault/keeper/vault.go @@ -591,6 +591,8 @@ func (k Keeper) CreateNewVault(ctx sdk.Context, From string, AppID uint64, Exten newVault.ExtendedPairVaultID = extendedPairVault.Id k.SetVault(ctx, newVault) k.SetIDForVault(ctx, newID) + length := k.GetLengthOfVault(ctx) + k.SetLengthOfVault(ctx, length+1) var mappingData types.OwnerAppExtendedPairVaultMappingData mappingData.Owner = From From 0589e248bf75575cbb1f69178fc5fdd0b7e6de15 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Sat, 3 Jun 2023 20:42:17 +0530 Subject: [PATCH 084/155] resolving bug in CalcDollarValueForToken function --- x/auctionsV2/keeper/bid.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 02ef47a61..f61e7f43a 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -354,7 +354,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //Calculating collateral token value from bid(debt) token value _, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) debtLeft := bid.Amount.Sub(bid.Amount) - debtuDollar, _ := k.CalcDollarValueForToken(ctx, debtPrice, debtLeft) + debtuDollar, _ := k.CalcDollarValueForToken(ctx,auctionData.DebtAssetId, debtPrice, debtLeft) if !(debtuDollar).GT(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.MinUsdValueLeft))) { return bidId, types.ErrCannotLeaveDebtLessThanDust } @@ -616,7 +616,8 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater return nil } -func (k Keeper) CalcDollarValueForToken(ctx sdk.Context, rate sdk.Dec, amt sdk.Int) (price sdk.Dec, err error) { +func (k Keeper) CalcDollarValueForToken(ctx sdk.Context,id uint64, rate sdk.Dec, amt sdk.Int) (price sdk.Dec, err error) { + asset, _ := k.asset.GetAsset(ctx, id) numerator := sdk.NewDecFromInt(amt).Mul(rate) denominator := sdk.NewDecFromInt(asset.Decimals) return numerator.Quo(denominator), nil From 208ba8aa9a1cf4b70edce6941332f768a4705330 Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 5 Jun 2023 09:40:00 +0530 Subject: [PATCH 085/155] english bid --- x/auctionsV2/keeper/auctions.go | 4 +- x/auctionsV2/keeper/bid.go | 118 +++++++++++++++++++++++++-- x/auctionsV2/types/errors.go | 12 +-- x/liquidationsV2/keeper/liquidate.go | 18 ++-- 4 files changed, 127 insertions(+), 25 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index dfd957eea..6254e15d3 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -447,7 +447,7 @@ func (k Keeper) LimitOrderBid(ctx sdk.Context) error { if individualBids.DebtToken.Amount.GTE(auction.DebtToken.Amount) { //User has more tokens than target debt, so their bid will close the auction ///Placing a user bid - bidding_id, err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr, individualBids.DebtToken, auction, true) + biddingId, err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr, individualBids.DebtToken, auction, true) if err != nil { return err } @@ -457,7 +457,7 @@ func (k Keeper) LimitOrderBid(ctx sdk.Context) error { return nil } individualBids.DebtToken.Amount = individualBids.DebtToken.Amount.Sub(auction.DebtToken.Amount) - individualBids.BiddingId = append(individualBids.BiddingId, bidding_id) + individualBids.BiddingId = append(individualBids.BiddingId, biddingId) k.SetUserLimitBidData(ctx, individualBids, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt().String()) k.AppendUserLimitBidDataForAddress(ctx, individualBids, true) } else { diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index f61e7f43a..940ba1b7a 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -4,6 +4,7 @@ import ( assettypes "github.com/comdex-official/comdex/x/asset/types" "github.com/comdex-official/comdex/x/auctionsV2/types" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" + auctiontypes "github.com/comdex-official/comdex/x/auctionsV2/types" collectortypes "github.com/comdex-official/comdex/x/collector/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -295,7 +296,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s } //Add bid data to struct //Creating user bid struct - bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") + biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") if err != nil { return bidId, err } @@ -339,22 +340,28 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //Check if they are initiated through a keeper, if so they will be incentivised } //Add bidder data in auction - bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{bidding_id, string(bidder)} + bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{biddingId, string(bidder)} auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMapppingData) //Savinga auction data to auction historical auctionHistoricalData := auctionsV2types.AuctionHistorical{auctionID, &auctionData, &liquidationData} - k.SetAuctionHistorical(ctx, auctionHistoricalData) + err = k.SetAuctionHistorical(ctx, auctionHistoricalData) + if err != nil { + return 0, err + } //Close Auction - k.DeleteAuction(ctx, auctionData) + err = k.DeleteAuction(ctx, auctionData) + if err != nil { + return 0, err + } //Delete liquidation Data k.LiquidationsV2.DeleteLockedVault(ctx, liquidationData.LockedVaultId) - bidId = bidding_id + bidId = biddingId } else { //if bid amount is less than the target bid //Calculating collateral token value from bid(debt) token value _, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) debtLeft := bid.Amount.Sub(bid.Amount) - debtuDollar, _ := k.CalcDollarValueForToken(ctx,auctionData.DebtAssetId, debtPrice, debtLeft) + debtuDollar, _ := k.CalcDollarValueForToken(ctx, auctionData.DebtAssetId, debtPrice, debtLeft) if !(debtuDollar).GT(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.MinUsdValueLeft))) { return bidId, types.ErrCannotLeaveDebtLessThanDust } @@ -400,7 +407,10 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s auctionData.DebtToken.Amount = auctionData.DebtToken.Amount.Sub(bid.Amount) auctionData.BonusAmount = auctionData.BonusAmount.Sub(expectedBonusShareForCurrentBid) //Set Auction - k.SetAuction(ctx, auctionData) + err = k.SetAuction(ctx, auctionData) + if err != nil { + return 0, err + } bidId = bidding_id } @@ -416,7 +426,7 @@ func (k Keeper) CreateUserBid(ctx sdk.Context, appID uint64, BidderAddress strin CollateralTokenAmount: collateralToken, DebtTokenAmount: debtToken, BidderAddress: BidderAddress, - BiddingTimestamp: ctx.BlockHeader().Time, + BiddingTimestamp: ctx.BlockTime(), AppId: appID, BidType: bidType, } @@ -429,6 +439,96 @@ func (k Keeper) CreateUserBid(ctx sdk.Context, appID uint64, BidderAddress strin } func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction) error { + if bid.Amount.Equal(sdk.ZeroInt()) { + return types.ErrBidCannotBeZero + } + //TODO: an identifier for surplus or debt auction + if true { // for surplus auction + if bid.Denom != auctionData.DebtToken.Denom { + return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the debt token ", bid.Denom) + } + if auctionData.BiddingIds != nil { + change := auctionData.BidFactor.MulInt(auctionData.DebtToken.Amount).Ceil().TruncateInt() + minBidAmount := auctionData.DebtToken.Amount.Add(change) + if bid.Amount.LT(minBidAmount) { + return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be greater than or equal to %d ", minBidAmount) + } + } else { + if bid.Amount.LTE(auctionData.DebtToken.Amount) { + return auctiontypes.ErrorLowBidAmount + } + } + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctiontypes.ModuleName, sdk.NewCoins(bid)) + if err != nil { + return err + } + biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, auctionData.CollateralToken, sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") + if err != nil { + return err + } + if auctionData.ActiveBiddingId != 0 { + userBid, err := k.GetUserBid(ctx, auctionData.ActiveBiddingId) + if err != nil { + return err + } + addr, _ := sdk.AccAddressFromBech32(userBid.BidderAddress) + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, addr, sdk.NewCoins(auctionData.DebtToken)) + if err != nil { + return err + } + } + + auctionData.DebtToken.Amount = bid.Amount + auctionData.ActiveBiddingId = biddingId + bidIDOwner := &auctiontypes.BidOwnerMapping{BidId: biddingId, BidOwner: bidder.String()} + auctionData.BiddingIds = append(auctionData.BiddingIds, bidIDOwner) + + } else { // for debt auction + if bid.Denom != auctionData.CollateralToken.Denom { + return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the CollateralToken token ", bid.Denom) + } + if auctionData.BiddingIds != nil { + change := auctionData.BidFactor.MulInt(auctionData.CollateralToken.Amount).Ceil().TruncateInt() + maxBidAmount := auctionData.CollateralToken.Amount.Sub(change) + if bid.Amount.GT(maxBidAmount) { + return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be less than or equal to %d ", maxBidAmount.Uint64()) + } + } else { + if bid.Amount.GT(auctionData.CollateralToken.Amount) { + return auctiontypes.ErrorMaxBidAmount + } + } + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctiontypes.ModuleName, sdk.NewCoins(bid)) + if err != nil { + return err + } + biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, bid.Amount), auctionData.DebtToken, "dutch") + if err != nil { + return err + } + if auctionData.ActiveBiddingId != 0 { + userBid, err := k.GetUserBid(ctx, auctionData.ActiveBiddingId) + if err != nil { + return err + } + addr, _ := sdk.AccAddressFromBech32(userBid.BidderAddress) + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, addr, sdk.NewCoins(auctionData.CollateralToken)) + if err != nil { + return err + } + + } + auctionData.CollateralToken.Amount = bid.Amount + auctionData.ActiveBiddingId = biddingId + bidIDOwner := &auctiontypes.BidOwnerMapping{BidId: biddingId, BidOwner: bidder.String()} + auctionData.BiddingIds = append(auctionData.BiddingIds, bidIDOwner) + + } + err := k.SetAuction(ctx, auctionData) + if err != nil { + return err + } + return nil } @@ -616,7 +716,7 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater return nil } -func (k Keeper) CalcDollarValueForToken(ctx sdk.Context,id uint64, rate sdk.Dec, amt sdk.Int) (price sdk.Dec, err error) { +func (k Keeper) CalcDollarValueForToken(ctx sdk.Context, id uint64, rate sdk.Dec, amt sdk.Int) (price sdk.Dec, err error) { asset, _ := k.asset.GetAsset(ctx, id) numerator := sdk.NewDecFromInt(amt).Mul(rate) denominator := sdk.NewDecFromInt(asset.Decimals) diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index 91abcafa9..74899e252 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -8,9 +8,11 @@ import ( // x/auctionsV2 module sentinel errors var ( - ErrDutchAuctionDisabled = sdkerrors.Register(ModuleName, 701, "Dutch auction not enabled for the app") - ErrEnglishAuctionDisabled = sdkerrors.Register(ModuleName, 702, "English auction not enabled for the app") - ErrCannotLeaveDebtLessThanDust= sdkerrors.Register(ModuleName, 703, "You need to leave debt atleast equal to dust value or greater. Try making a full bid, or a smaller bid. Your current bid is just short of the dust value , hence it fails.") - ErrorPriceNotFound= sdkerrors.Register(ModuleName, 704, "price not found") - ErrBidCannotBeZero=sdkerrors.Register(ModuleName,705,"Bid amount can't be Zero") + ErrDutchAuctionDisabled = sdkerrors.Register(ModuleName, 701, "Dutch auction not enabled for the app") + ErrEnglishAuctionDisabled = sdkerrors.Register(ModuleName, 702, "English auction not enabled for the app") + ErrCannotLeaveDebtLessThanDust = sdkerrors.Register(ModuleName, 703, "You need to leave debt atleast equal to dust value or greater. Try making a full bid, or a smaller bid. Your current bid is just short of the dust value , hence it fails.") + ErrorPriceNotFound = sdkerrors.Register(ModuleName, 704, "price not found") + ErrBidCannotBeZero = sdkerrors.Register(ModuleName, 705, "Bid amount can't be Zero") + ErrorLowBidAmount = sdkerrors.Register(ModuleName, 706, "bidding amount is lower than expected") + ErrorMaxBidAmount = sdkerrors.Register(ModuleName, 707, "bidding amount is greater than maximum bidding amount") ) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index bc7601eb3..fc21d882e 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -14,12 +14,12 @@ import ( func (k Keeper) Liquidate(ctx sdk.Context) error { - err := k.LiquidateVaults(ctx,0) + err := k.LiquidateVaults(ctx, 0) if err != nil { return err } - err = k.LiquidateBorrows(ctx,1) + err = k.LiquidateBorrows(ctx, 1) if err != nil { return err } @@ -34,13 +34,13 @@ func (k Keeper) Liquidate(ctx sdk.Context) error { // Liquidate Vaults function can liquidate all vaults created using the vault module. //All vauts are looped and check if their underlying app has enabled liquidations. -func (k Keeper) LiquidateVaults(ctx sdk.Context,offsetCounterId uint64) error { +func (k Keeper) LiquidateVaults(ctx sdk.Context, offsetCounterId uint64) error { params := k.GetParams(ctx) //This allows us to loop over a slice of vaults per block , which doesnt stresses the abci. //Eg: if there exists 1,000,000 vaults and the batch size is 100,000. then at every block 100,000 vaults will be looped and it will take //a total of 10 blocks to loop over all vaults. - liquidationOffsetHolder, found := k.GetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix,offsetCounterId) + liquidationOffsetHolder, found := k.GetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix, offsetCounterId) if !found { liquidationOffsetHolder = types.NewLiquidationOffsetHolder(0) } @@ -70,7 +70,7 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context,offsetCounterId uint64) error { } liquidationOffsetHolder.CurrentOffset = uint64(end) - liquidationOffsetHolder.AppId=offsetCounterId + liquidationOffsetHolder.AppId = offsetCounterId k.SetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix, liquidationOffsetHolder) return nil @@ -212,14 +212,14 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair return nil } -func (k Keeper) LiquidateBorrows(ctx sdk.Context,offsetCounterId uint64) error { +func (k Keeper) LiquidateBorrows(ctx sdk.Context, offsetCounterId uint64) error { borrows, found := k.lend.GetBorrows(ctx) params := k.GetParams(ctx) if !found { ctx.Logger().Error("Params Not Found in Liquidation, liquidate_borrow.go") return nil } - liquidationOffsetHolder, found := k.GetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix,offsetCounterId) + liquidationOffsetHolder, found := k.GetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix, offsetCounterId) if !found { liquidationOffsetHolder = types.NewLiquidationOffsetHolder(0) } @@ -350,7 +350,7 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsse //Calculating auction bonus to be given auctionBonusToBeGiven := sdk.NewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationBonus).TruncateInt() - err := k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false, ) + err := k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false) if err != nil { return err } @@ -437,7 +437,7 @@ func (k Keeper) CheckNetFeesCollectedStatsForSurplusAndDebt(ctx sdk.Context, app debtAssetID := collector.SecondaryAssetId // net = 200 debtThreshold = 500 , lotSize = 100 collateralToken, debtToken := k.getDebtSellTokenAmount(ctx, collateralAssetID, debtAssetID, collector.LotSize, collector.DebtLotSize) - err := k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, true, false, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "", false, true, 0) + err := k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, true, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "", false, true, collateralAssetID, collateralAssetID) if err != nil { return err } From 01b468833331cc5755d37fb62c0645cd39c4d1f5 Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 5 Jun 2023 09:51:12 +0530 Subject: [PATCH 086/155] resolving address type --- x/auctionsV2/keeper/bid.go | 33 +++++++++++++++++-------------- x/auctionsV2/keeper/msg_server.go | 4 ++-- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 940ba1b7a..31b01df54 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -211,11 +211,13 @@ import ( // return nil // } -func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction, isAutoBid bool) (bidId uint64, err error) { +func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder string, bid sdk.Coin, auctionData types.Auction, isAutoBid bool) (bidId uint64, err error) { auctionParams, _ := k.GetAuctionParams(ctx) if bid.Amount.Equal(sdk.ZeroInt()) { return bidId, types.ErrBidCannotBeZero } + bidderAddr, _ := sdk.AccAddressFromBech32(bidder) + liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, auctionData.AppId) if bid.Denom != auctionData.DebtToken.Denom { @@ -262,7 +264,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if !isAutoBid { if bid.Amount.GT(sdk.ZeroInt()) { - err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) if err != nil { return bidId, err } @@ -272,7 +274,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //Send Collateral To bidder if totalCollateralTokenQuanitity.GT(sdk.ZeroInt()) { - err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidderAddr, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) if err != nil { return bidId, err } @@ -296,7 +298,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s } //Add bid data to struct //Creating user bid struct - biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") + biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, bidder, auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") if err != nil { return bidId, err } @@ -381,7 +383,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s totalCollateralTokenQuanitity := collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus) if !isAutoBid { if bid.Amount.GT(sdk.ZeroInt()) { - err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) if err != nil { return bidId, err } @@ -389,17 +391,17 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s } //Send Collateral To bidder if totalCollateralTokenQuanitity.GT(sdk.ZeroInt()) { - err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidderAddr, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) if err != nil { return bidId, err } } - bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") + biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, bidder, auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") if err != nil { return bidId, err } //Add bidder data in auction - bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{bidding_id, string(bidder)} + bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{biddingId, string(bidder)} auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMapppingData) //Reduce Auction collateral and debt value @@ -411,7 +413,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if err != nil { return 0, err } - bidId = bidding_id + bidId = biddingId } return bidId, nil @@ -438,10 +440,11 @@ func (k Keeper) CreateUserBid(ctx sdk.Context, appID uint64, BidderAddress strin return bidding.BiddingId, nil } -func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction) error { +func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder string, bid sdk.Coin, auctionData types.Auction) error { if bid.Amount.Equal(sdk.ZeroInt()) { return types.ErrBidCannotBeZero } + bidderAddr, _ := sdk.AccAddressFromBech32(bidder) //TODO: an identifier for surplus or debt auction if true { // for surplus auction if bid.Denom != auctionData.DebtToken.Denom { @@ -458,11 +461,11 @@ func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder return auctiontypes.ErrorLowBidAmount } } - err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctiontypes.ModuleName, sdk.NewCoins(bid)) + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctiontypes.ModuleName, sdk.NewCoins(bid)) if err != nil { return err } - biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, auctionData.CollateralToken, sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") + biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, bidder, auctionID, auctionData.CollateralToken, sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") if err != nil { return err } @@ -480,7 +483,7 @@ func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder auctionData.DebtToken.Amount = bid.Amount auctionData.ActiveBiddingId = biddingId - bidIDOwner := &auctiontypes.BidOwnerMapping{BidId: biddingId, BidOwner: bidder.String()} + bidIDOwner := &auctiontypes.BidOwnerMapping{BidId: biddingId, BidOwner: bidder} auctionData.BiddingIds = append(auctionData.BiddingIds, bidIDOwner) } else { // for debt auction @@ -498,7 +501,7 @@ func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder return auctiontypes.ErrorMaxBidAmount } } - err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctiontypes.ModuleName, sdk.NewCoins(bid)) + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctiontypes.ModuleName, sdk.NewCoins(bid)) if err != nil { return err } @@ -520,7 +523,7 @@ func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder } auctionData.CollateralToken.Amount = bid.Amount auctionData.ActiveBiddingId = biddingId - bidIDOwner := &auctiontypes.BidOwnerMapping{BidId: biddingId, BidOwner: bidder.String()} + bidIDOwner := &auctiontypes.BidOwnerMapping{BidId: biddingId, BidOwner: bidder} auctionData.BiddingIds = append(auctionData.BiddingIds, bidIDOwner) } diff --git a/x/auctionsV2/keeper/msg_server.go b/x/auctionsV2/keeper/msg_server.go index e8fe08cfe..cb56994a7 100644 --- a/x/auctionsV2/keeper/msg_server.go +++ b/x/auctionsV2/keeper/msg_server.go @@ -34,14 +34,14 @@ func (k msgServer) MsgPlaceMarketBid(goCtx context.Context, msg *types.MsgPlaceM //If true triggering Dutch Auction Bid Request if auctionData.AuctionType { - _,err = k.PlaceDutchAuctionBid(ctx, msg.AuctionId, bidder, msg.Amount, auctionData) + _, err = k.PlaceDutchAuctionBid(ctx, msg.AuctionId, bidder, msg.Amount, auctionData) if err != nil { return nil, err } } else { //Else ENGLISH - triggering English Auction Bid Request - err = k.PlaceEnglishAuctionBid(ctx, msg.AuctionId, bidder, msg.Amount, auctionData) + err = k.PlaceEnglishAuctionBid(ctx, msg.AuctionId, msg.Bidder, msg.Amount, auctionData) if err != nil { return nil, err } From 2240c1a384d50702066a2352d3b8761ace8983cd Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 5 Jun 2023 12:35:40 +0530 Subject: [PATCH 087/155] liquidate exteranl keeper fn added --- proto/comdex/liquidationsV2/v1beta1/tx.proto | 51 ++ x/auctionsV2/keeper/auctions.go | 6 +- x/liquidationsV2/handler.go | 3 + x/liquidationsV2/keeper/liquidate.go | 49 +- x/liquidationsV2/keeper/msg_server.go | 10 +- x/liquidationsV2/types/codec.go | 2 + x/liquidationsV2/types/keys.go | 1 + x/liquidationsV2/types/msg.go | 54 ++ x/liquidationsV2/types/tx.pb.go | 805 ++++++++++++++++++- x/vault/types/vault.pb.go | 2 +- 10 files changed, 936 insertions(+), 47 deletions(-) diff --git a/proto/comdex/liquidationsV2/v1beta1/tx.proto b/proto/comdex/liquidationsV2/v1beta1/tx.proto index 4819257a0..710ff0f41 100644 --- a/proto/comdex/liquidationsV2/v1beta1/tx.proto +++ b/proto/comdex/liquidationsV2/v1beta1/tx.proto @@ -12,6 +12,7 @@ option (gogoproto.goproto_getters_all) = false; service Msg { rpc MsgLiquidateInternalKeeper(MsgLiquidateInternalKeeperRequest) returns (MsgLiquidateInternalKeeperResponse); rpc MsgAppReserveFunds(MsgAppReserveFundsRequest) returns (MsgAppReserveFundsResponse); + rpc MsgLiquidateExternalKeeper(MsgLiquidateExternalKeeperRequest) returns (MsgLiquidateExternalKeeperResponse); } message MsgLiquidateInternalKeeperRequest { @@ -41,3 +42,53 @@ message MsgAppReserveFundsRequest { } message MsgAppReserveFundsResponse{} + +message MsgLiquidateExternalKeeperRequest { + string from = 1 [(gogoproto.moretags) = "yaml:\"from\""]; + + uint64 app_id = 2 [ + (gogoproto.customname) = "AppId", + (gogoproto.moretags) = "yaml:\"app_id\""]; + + string owner = 3 [ + (gogoproto.customname) = "Owner", + (gogoproto.moretags) = "yaml:\"owner\""]; + + cosmos.base.v1beta1.Coin collateral_token = 4 [ + (gogoproto.nullable) = false, + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.moretags) = "yaml:\"collateral_token\"" + ]; + + cosmos.base.v1beta1.Coin debt_token = 5 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.moretags) = "yaml:\"debt_token\"", + (gogoproto.nullable) = false]; + + string fee_to_be_collected = 6 [ + (gogoproto.customname) = "FeeToBeCollected", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"fee_to_be_collected\""]; + + string bonus_to_be_given = 7 [ + (gogoproto.customname) = "BonusToBeGiven", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"bonus_to_be_given\""]; + + bool auction_type = 8 [ + (gogoproto.customname) = "AuctionType", + (gogoproto.moretags) = "yaml:\"auction_type\""]; + + uint64 collateral_asset_id = 9 [ + (gogoproto.moretags) = "yaml:\"collateral_asset_id\""]; + + uint64 debt_asset_id = 10 [ + (gogoproto.moretags) = "yaml:\"debt_asset_id\""]; + + string initiator_type = 11 [ + (gogoproto.customname) = "InitiatorType", + (gogoproto.moretags) = "yaml:\"initiator_type\""]; +} +message MsgLiquidateExternalKeeperResponse{} diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 6254e15d3..af820756c 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -20,17 +20,15 @@ func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtyp //Trigger Dutch Auction err := k.DutchAuctionActivator(ctx, liquidationData) if err != nil { - + return err } - } else { //Trigger English Auction err := k.EnglishAuctionActivator(ctx, liquidationData) if err != nil { - + return err } } - return nil } diff --git a/x/liquidationsV2/handler.go b/x/liquidationsV2/handler.go index 02b556408..1bc73fefd 100644 --- a/x/liquidationsV2/handler.go +++ b/x/liquidationsV2/handler.go @@ -22,6 +22,9 @@ func NewHandler(k keeper.Keeper) sdk.Handler { case *types.MsgAppReserveFundsRequest: res, err := server.MsgAppReserveFunds(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgLiquidateExternalKeeperRequest: + res, err := server.MsgLiquidateExternalKeeper(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(types.ErrorUnknownMsgType, "%T", msg) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index fc21d882e..9eda11395 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + assettypes "github.com/comdex-official/comdex/x/asset/types" lendtypes "github.com/comdex-official/comdex/x/lend/types" @@ -131,8 +132,8 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error isCMST := !extPair.AssetOutOraclePrice //Creating locked vault struct , which will trigger auction - //This function will only triggger dutch auction - //before creating locked vault, checking that dutch auction is already there in the whitelisted liquidation data + //This function will only trigger Dutch auction + //before creating locked vault, checking that Dutch auction is already there in the whitelisted liquidation data if !whitelistingData.IsDutchActivated { return fmt.Errorf("Error , dutch auction not activated by the app, this function is only to trigger dutch auctions %d", whitelistingData.IsDutchActivated) @@ -194,9 +195,9 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair //at some point in the auction //1. what happens in that case //2. what if the bid on the auction makes the auction lossy, - //should be use the liquidation penalty ? most probably yes to cover the difference. + //should be used the liquidation penalty ? most probably yes to cover the difference. //what if then liquidation penalty still falls short, should we then reduce the auction bonus from the debt , to make things even? - //will this be enough to make sure auction does not not gets bid due to collateral not being able to cover the debt? + //will this be enough to make sure auction does not get bid due to collateral not being able to cover the debt? //can a case occur in which liquidation penalty and auction bonus are still not enough? k.SetLockedVault(ctx, value) @@ -206,8 +207,8 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair if err != nil { return fmt.Errorf("Auction could not be initiated for %d %d", value, err) } - //struct for auction will stay same for english and dutch - // based on type recieved from + //struct for auction will stay same for english and Dutch + // based on type received from return nil } @@ -584,3 +585,39 @@ func (k Keeper) GetAppReserveFundsTxData(ctx sdk.Context, appId uint64) (appRese k.cdc.MustUnmarshal(value, &appReserveFundsTxData) return appReserveFundsTxData, true } + +func (k Keeper) MsgLiquidateExternal(ctx sdk.Context, from string, appID uint64, owner string, collateralToken, debtToken sdk.Coin, liquidationFee, auctionBonus sdk.Dec, auctionType bool, collateralAssetId, debtAssetId uint64, initiatorType string) error { + // check if the assets exists + // check if reserve funds are added for the debt or not + // send tokens from the liquidator's address to the auction module + + _, found := k.asset.GetAsset(ctx, collateralAssetId) + if !found { + return assettypes.ErrorAssetDoesNotExist + } + _, found = k.asset.GetAsset(ctx, debtAssetId) + if !found { + return assettypes.ErrorAssetDoesNotExist + } + + appReserveFunds, found := k.GetAppReserveFunds(ctx, appID, debtAssetId) + if !found || appReserveFunds.TokenQuantity.Amount.LTE(sdk.NewInt(0)) { + return fmt.Errorf("reserve funds not added for debt asset id") + } + + feeToBeCollected := sdk.NewDecFromInt(debtToken.Amount).Mul(liquidationFee).TruncateInt() + //Calculating auction bonus to be given + bonusToBeGiven := sdk.NewDecFromInt(debtToken.Amount).Mul(auctionBonus).TruncateInt() + + addr, err := sdk.AccAddressFromBech32(from) + err = k.bank.SendCoinsFromAccountToModule(ctx, addr, auctionsV2types.ModuleName, sdk.NewCoins(collateralToken)) + if err != nil { + return err + } + err = k.CreateLockedVault(ctx, 0, 0, owner, collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, false, "", from, feeToBeCollected, bonusToBeGiven, initiatorType, auctionType, false, collateralAssetId, debtAssetId) + if err != nil { + return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for External liquidation ") + } + + return nil +} diff --git a/x/liquidationsV2/keeper/msg_server.go b/x/liquidationsV2/keeper/msg_server.go index 2e59bc955..e264be949 100644 --- a/x/liquidationsV2/keeper/msg_server.go +++ b/x/liquidationsV2/keeper/msg_server.go @@ -37,8 +37,16 @@ func (m msgServer) MsgLiquidateInternalKeeper(c context.Context, req *types.MsgL func (m msgServer) MsgAppReserveFunds(c context.Context, req *types.MsgAppReserveFundsRequest) (*types.MsgAppReserveFundsResponse, error) { ctx := sdk.UnwrapSDKContext(c) - if err := m.keeper.MsgAppReserveFundsFn(ctx, req.From, req.AppId, req.AssetId, req.TxType, req.TokenQuantity); err != nil { + if err := m.keeper.MsgAppReserveFundsFn(ctx, req.From, req.AppId, req.AssetId, req.TokenQuantity); err != nil { return nil, err } return &types.MsgAppReserveFundsResponse{}, nil } + +func (m msgServer) MsgLiquidateExternalKeeper(c context.Context, req *types.MsgLiquidateExternalKeeperRequest) (*types.MsgLiquidateExternalKeeperResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + if err := m.keeper.MsgLiquidateExternal(ctx, req.From, req.AppId, req.Owner, req.CollateralToken, req.DebtToken, req.FeeToBeCollected, req.BonusToBeGiven, req.AuctionType, req.CollateralAssetId, req.DebtAssetId, req.InitiatorType); err != nil { + return nil, err + } + return &types.MsgLiquidateExternalKeeperResponse{}, nil +} diff --git a/x/liquidationsV2/types/codec.go b/x/liquidationsV2/types/codec.go index ab42b922d..44b043da0 100644 --- a/x/liquidationsV2/types/codec.go +++ b/x/liquidationsV2/types/codec.go @@ -13,6 +13,7 @@ import ( func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgLiquidateInternalKeeperRequest{}, "comdex/liquidation/MsgLiquidateInternalKeeperRequest", nil) cdc.RegisterConcrete(&MsgAppReserveFundsRequest{}, "comdex/liquidation/MsgAppReserveFundsRequest", nil) + cdc.RegisterConcrete(&MsgLiquidateExternalKeeperRequest{}, "comdex/liquidation/MsgLiquidateExternalKeeperRequest", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -20,6 +21,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { (*sdk.Msg)(nil), &MsgLiquidateInternalKeeperRequest{}, &MsgAppReserveFundsRequest{}, + &MsgLiquidateExternalKeeperRequest{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/liquidationsV2/types/keys.go b/x/liquidationsV2/types/keys.go index ad7218921..b2cc957de 100644 --- a/x/liquidationsV2/types/keys.go +++ b/x/liquidationsV2/types/keys.go @@ -21,6 +21,7 @@ const ( var ( TypeMsgLiquidateRequest = ModuleName + ":liquidate" + TypeMsgLiquidateExternalRequest = ModuleName + ":liquidate_external" TypeAppReserveFundsRequest = ModuleName + ":app_reserve_funds" AppIdsKeyPrefix = []byte{0x01} LiquidationOffsetHolderKeyPrefix = []byte{0x02} diff --git a/x/liquidationsV2/types/msg.go b/x/liquidationsV2/types/msg.go index f5e4924d3..d79514b85 100644 --- a/x/liquidationsV2/types/msg.go +++ b/x/liquidationsV2/types/msg.go @@ -82,3 +82,57 @@ func (m *MsgAppReserveFundsRequest) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{from} } + +func NewMsgLiquidateExternalKeeperRequest( + from sdk.AccAddress, + appId uint64, + owner string, + collateralToken, debtToken sdk.Coin, + feeToBeCollected, bonusToBeGiven sdk.Dec, + auctionType bool, + collateralAssetId, debtAssetId uint64, + initiatorType string, +) *MsgLiquidateExternalKeeperRequest { + return &MsgLiquidateExternalKeeperRequest{ + From: from.String(), + AppId: appId, + Owner: owner, + CollateralToken: collateralToken, + DebtToken: debtToken, + FeeToBeCollected: feeToBeCollected, + BonusToBeGiven: bonusToBeGiven, + AuctionType: auctionType, + CollateralAssetId: collateralAssetId, + DebtAssetId: debtAssetId, + InitiatorType: initiatorType, + } +} + +func (m *MsgLiquidateExternalKeeperRequest) Route() string { + return RouterKey +} + +func (m *MsgLiquidateExternalKeeperRequest) Type() string { + return TypeMsgLiquidateExternalRequest +} + +func (m *MsgLiquidateExternalKeeperRequest) ValidateBasic() error { + if m.AppId == 0 { + return errors.Wrap(ErrVaultIDInvalid, "app_id cannot be zero") + } + + return nil +} + +func (m *MsgLiquidateExternalKeeperRequest) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) +} + +func (m *MsgLiquidateExternalKeeperRequest) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(m.From) + if err != nil { + panic(err) + } + + return []sdk.AccAddress{from} +} diff --git a/x/liquidationsV2/types/tx.pb.go b/x/liquidationsV2/types/tx.pb.go index d8c1ea60d..b63e9f843 100644 --- a/x/liquidationsV2/types/tx.pb.go +++ b/x/liquidationsV2/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -181,11 +182,96 @@ func (m *MsgAppReserveFundsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAppReserveFundsResponse proto.InternalMessageInfo +type MsgLiquidateExternalKeeperRequest struct { + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty" yaml:"from"` + AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` + Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` + CollateralToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=collateral_token,json=collateralToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token" yaml:"collateral_token"` + DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"debt_token"` + FeeToBeCollected github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_to_be_collected" yaml:"fee_to_be_collected"` + BonusToBeGiven github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=bonus_to_be_given,json=bonusToBeGiven,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bonus_to_be_given" yaml:"bonus_to_be_given"` + AuctionType bool `protobuf:"varint,8,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` + CollateralAssetId uint64 `protobuf:"varint,9,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` + DebtAssetId uint64 `protobuf:"varint,10,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` + InitiatorType string `protobuf:"bytes,11,opt,name=initiator_type,json=initiatorType,proto3" json:"initiator_type,omitempty" yaml:"initiator_type"` +} + +func (m *MsgLiquidateExternalKeeperRequest) Reset() { *m = MsgLiquidateExternalKeeperRequest{} } +func (m *MsgLiquidateExternalKeeperRequest) String() string { return proto.CompactTextString(m) } +func (*MsgLiquidateExternalKeeperRequest) ProtoMessage() {} +func (*MsgLiquidateExternalKeeperRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_51c735c845851e88, []int{4} +} +func (m *MsgLiquidateExternalKeeperRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgLiquidateExternalKeeperRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgLiquidateExternalKeeperRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgLiquidateExternalKeeperRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgLiquidateExternalKeeperRequest.Merge(m, src) +} +func (m *MsgLiquidateExternalKeeperRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgLiquidateExternalKeeperRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgLiquidateExternalKeeperRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgLiquidateExternalKeeperRequest proto.InternalMessageInfo + +type MsgLiquidateExternalKeeperResponse struct { +} + +func (m *MsgLiquidateExternalKeeperResponse) Reset() { *m = MsgLiquidateExternalKeeperResponse{} } +func (m *MsgLiquidateExternalKeeperResponse) String() string { return proto.CompactTextString(m) } +func (*MsgLiquidateExternalKeeperResponse) ProtoMessage() {} +func (*MsgLiquidateExternalKeeperResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51c735c845851e88, []int{5} +} +func (m *MsgLiquidateExternalKeeperResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgLiquidateExternalKeeperResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgLiquidateExternalKeeperResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgLiquidateExternalKeeperResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgLiquidateExternalKeeperResponse.Merge(m, src) +} +func (m *MsgLiquidateExternalKeeperResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgLiquidateExternalKeeperResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgLiquidateExternalKeeperResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgLiquidateExternalKeeperResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgLiquidateInternalKeeperRequest)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateInternalKeeperRequest") proto.RegisterType((*MsgLiquidateInternalKeeperResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateInternalKeeperResponse") proto.RegisterType((*MsgAppReserveFundsRequest)(nil), "comdex.liquidationsV2.v1beta1.MsgAppReserveFundsRequest") proto.RegisterType((*MsgAppReserveFundsResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgAppReserveFundsResponse") + proto.RegisterType((*MsgLiquidateExternalKeeperRequest)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateExternalKeeperRequest") + proto.RegisterType((*MsgLiquidateExternalKeeperResponse)(nil), "comdex.liquidationsV2.v1beta1.MsgLiquidateExternalKeeperResponse") } func init() { @@ -193,41 +279,65 @@ func init() { } var fileDescriptor_51c735c845851e88 = []byte{ - // 536 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xb5, 0xd3, 0xb4, 0xa1, 0x5b, 0x95, 0x4a, 0x86, 0x43, 0x6a, 0x81, 0x5d, 0xb6, 0x08, 0xf5, - 0x82, 0xad, 0x84, 0x4b, 0xcb, 0x89, 0x04, 0xa9, 0x52, 0x45, 0x73, 0xc0,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 0x6f, 0xf3, 0xad, 0xdb, 0xd2, 0xfe, - 0x5a, 0x43, 0x6b, 0x3d, 0x11, 0x59, 0x5f, 0x4c, 0x05, 0xfb, 0x4b, 0x17, 0xad, 0x57, 0xde, 0xca, - 0x2d, 0xf4, 0xee, 0x5c, 0x15, 0xbb, 0xf3, 0x1f, 0x2f, 0xe8, 0x5a, 0xad, 0x4f, 0x26, 0xb2, 0x6e, - 0x5a, 0xb1, 0x0e, 0xef, 0x7e, 0xf9, 0xf6, 0xa9, 0xdb, 0x47, 0xff, 0xc0, 0xd4, 0xb5, 0x74, 0xcf, - 0x66, 0x3f, 0x1c, 0xe3, 0xb2, 0x70, 0x8c, 0x59, 0xe1, 0x98, 0x57, 0x85, 0x63, 0x7e, 0x2f, 0x1c, - 0xf3, 0xf3, 0xdc, 0x31, 0xae, 0xe6, 0x8e, 0xf1, 0x6d, 0xee, 0x18, 0x67, 0x87, 0x11, 0x95, 0x1f, - 0xb2, 0x41, 0x29, 0xe1, 0x6b, 0x99, 0xe7, 0x6c, 0x34, 0xa2, 0x43, 0x4a, 0xe2, 0xea, 0xee, 0xdf, - 0xf8, 0xfc, 0xe5, 0xfa, 0x8b, 0xc1, 0x86, 0xfa, 0x82, 0x2f, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, - 0x74, 0xde, 0x62, 0x41, 0x22, 0x04, 0x00, 0x00, + // 913 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x6f, 0x1b, 0xc5, + 0x1f, 0xf6, 0x3a, 0xce, 0x8b, 0xc7, 0x75, 0x5e, 0x36, 0xfd, 0xeb, 0xef, 0x58, 0xb0, 0x13, 0xa6, + 0x28, 0x44, 0x48, 0xdd, 0x55, 0xc2, 0xa5, 0x45, 0x1c, 0xf0, 0xb6, 0x04, 0x05, 0x1a, 0x50, 0x57, + 0x11, 0x87, 0x0a, 0xc9, 0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2, 0x11, 0x8b, 0xcd, 0x5f, + 0x0c, 0x69, 0x2b, 0xff, 0xe2, 0xba, 0xe6, 0xa7, 0xf6, 0xb5, 0x6f, 0x2d, 0xfb, 0xc6, 0x57, 0x4b, + 0xb3, 0xf5, 0x1f, 0x22, 0xa8, 0x5a, 0xcd, 0x9f, 0x0c, 0x60, 0x5e, 0xb5, 0x3e, 0xf3, 0xc1, 0xcd, + 0x91, 0xe7, 0xbf, 0x25, 0x9a, 0x0f, 0xdf, 0x82, 0xa9, 0x6b, 0x99, 0xd5, 0x6b, 0x5a, 0xde, 0x5b, + 0xe9, 0x35, 0xd7, 0xa2, 0x6f, 0xa5, 0xd7, 0xfc, 0xd9, 0xba, 0xcf, 0xce, 0xff, 0xb4, 0x4a, 0xaf, + 0x0a, 0xab, 0x74, 0x5e, 0x58, 0xc6, 0xeb, 0xc2, 0x32, 0xfe, 0x28, 0x2c, 0xe3, 0xe5, 0x85, 0x55, + 0x7a, 0x7d, 0x61, 0x95, 0x7e, 0xbd, 0xb0, 0x4a, 0xcf, 0x1e, 0x4c, 0xdd, 0x5a, 0x91, 0xee, 0x3e, + 0xed, 0x74, 0x48, 0x48, 0xfc, 0x44, 0x3f, 0x3b, 0x57, 0x3e, 0x68, 0xe4, 0x5d, 0x0e, 0x96, 0xe4, + 0x67, 0xc5, 0x47, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xc4, 0x0f, 0xdc, 0xf6, 0xf6, 0x08, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -244,6 +354,7 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { MsgLiquidateInternalKeeper(ctx context.Context, in *MsgLiquidateInternalKeeperRequest, opts ...grpc.CallOption) (*MsgLiquidateInternalKeeperResponse, error) MsgAppReserveFunds(ctx context.Context, in *MsgAppReserveFundsRequest, opts ...grpc.CallOption) (*MsgAppReserveFundsResponse, error) + MsgLiquidateExternalKeeper(ctx context.Context, in *MsgLiquidateExternalKeeperRequest, opts ...grpc.CallOption) (*MsgLiquidateExternalKeeperResponse, error) } type msgClient struct { @@ -272,10 +383,20 @@ func (c *msgClient) MsgAppReserveFunds(ctx context.Context, in *MsgAppReserveFun return out, nil } +func (c *msgClient) MsgLiquidateExternalKeeper(ctx context.Context, in *MsgLiquidateExternalKeeperRequest, opts ...grpc.CallOption) (*MsgLiquidateExternalKeeperResponse, error) { + out := new(MsgLiquidateExternalKeeperResponse) + err := c.cc.Invoke(ctx, "/comdex.liquidationsV2.v1beta1.Msg/MsgLiquidateExternalKeeper", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { MsgLiquidateInternalKeeper(context.Context, *MsgLiquidateInternalKeeperRequest) (*MsgLiquidateInternalKeeperResponse, error) MsgAppReserveFunds(context.Context, *MsgAppReserveFundsRequest) (*MsgAppReserveFundsResponse, error) + MsgLiquidateExternalKeeper(context.Context, *MsgLiquidateExternalKeeperRequest) (*MsgLiquidateExternalKeeperResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -288,6 +409,9 @@ func (*UnimplementedMsgServer) MsgLiquidateInternalKeeper(ctx context.Context, r func (*UnimplementedMsgServer) MsgAppReserveFunds(ctx context.Context, req *MsgAppReserveFundsRequest) (*MsgAppReserveFundsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MsgAppReserveFunds not implemented") } +func (*UnimplementedMsgServer) MsgLiquidateExternalKeeper(ctx context.Context, req *MsgLiquidateExternalKeeperRequest) (*MsgLiquidateExternalKeeperResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MsgLiquidateExternalKeeper not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -329,6 +453,24 @@ func _Msg_MsgAppReserveFunds_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Msg_MsgLiquidateExternalKeeper_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgLiquidateExternalKeeperRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MsgLiquidateExternalKeeper(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.liquidationsV2.v1beta1.Msg/MsgLiquidateExternalKeeper", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MsgLiquidateExternalKeeper(ctx, req.(*MsgLiquidateExternalKeeperRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.liquidationsV2.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -341,6 +483,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MsgAppReserveFunds", Handler: _Msg_MsgAppReserveFunds_Handler, }, + { + MethodName: "MsgLiquidateExternalKeeper", + Handler: _Msg_MsgLiquidateExternalKeeper_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/liquidationsV2/v1beta1/tx.proto", @@ -482,6 +628,138 @@ func (m *MsgAppReserveFundsResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *MsgLiquidateExternalKeeperRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgLiquidateExternalKeeperRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgLiquidateExternalKeeperRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.InitiatorType) > 0 { + i -= len(m.InitiatorType) + copy(dAtA[i:], m.InitiatorType) + i = encodeVarintTx(dAtA, i, uint64(len(m.InitiatorType))) + i-- + dAtA[i] = 0x5a + } + if m.DebtAssetId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.DebtAssetId)) + i-- + dAtA[i] = 0x50 + } + if m.CollateralAssetId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CollateralAssetId)) + i-- + dAtA[i] = 0x48 + } + if m.AuctionType { + i-- + if m.AuctionType { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + { + size := m.BonusToBeGiven.Size() + i -= size + if _, err := m.BonusToBeGiven.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size := m.FeeToBeCollected.Size() + i -= size + if _, err := m.FeeToBeCollected.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size, err := m.DebtToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size, err := m.CollateralToken.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if m.AppId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x10 + } + if len(m.From) > 0 { + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintTx(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgLiquidateExternalKeeperResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgLiquidateExternalKeeperResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgLiquidateExternalKeeperResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -551,6 +829,56 @@ func (m *MsgAppReserveFundsResponse) Size() (n int) { return n } +func (m *MsgLiquidateExternalKeeperRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.AppId != 0 { + n += 1 + sovTx(uint64(m.AppId)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.CollateralToken.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.DebtToken.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.FeeToBeCollected.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.BonusToBeGiven.Size() + n += 1 + l + sovTx(uint64(l)) + if m.AuctionType { + n += 2 + } + if m.CollateralAssetId != 0 { + n += 1 + sovTx(uint64(m.CollateralAssetId)) + } + if m.DebtAssetId != 0 { + n += 1 + sovTx(uint64(m.DebtAssetId)) + } + l = len(m.InitiatorType) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgLiquidateExternalKeeperResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -930,6 +1258,413 @@ func (m *MsgAppReserveFundsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgLiquidateExternalKeeperRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgLiquidateExternalKeeperRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgLiquidateExternalKeeperRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CollateralToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DebtToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeToBeCollected", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FeeToBeCollected.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BonusToBeGiven", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BonusToBeGiven.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionType", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AuctionType = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralAssetId", wireType) + } + m.CollateralAssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CollateralAssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtAssetId", wireType) + } + m.DebtAssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DebtAssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitiatorType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InitiatorType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgLiquidateExternalKeeperResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgLiquidateExternalKeeperResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgLiquidateExternalKeeperResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/vault/types/vault.pb.go b/x/vault/types/vault.pb.go index b23833d9f..5438430ab 100644 --- a/x/vault/types/vault.pb.go +++ b/x/vault/types/vault.pb.go @@ -28,7 +28,7 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -//app_vault_type_id will be the key for the KVStore for this value. +//app_vault_type_id will be the key for the KVStore for this value type Vault struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` AppId uint64 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty" yaml:"app_id"` From 9aa7512dfcdb9dae6f819d0a75d2c3aa2f27fd2b Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Tue, 6 Jun 2023 03:52:24 +0530 Subject: [PATCH 088/155] updating the PlaceEnglishAuctionBid Function - previous one also works --- proto/comdex/auctionsV2/v1beta1/auction.proto | 6 +- proto/comdex/auctionsV2/v1beta1/bid.proto | 5 + x/auctionsV2/keeper/bid.go | 226 ++++++++++++------ x/auctionsV2/keeper/msg_server.go | 2 +- x/auctionsV2/types/auction.pb.go | 169 +++++-------- x/auctionsV2/types/bid.pb.go | 161 ++++++++----- x/auctionsV2/types/errors.go | 1 + 7 files changed, 328 insertions(+), 242 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index 42bde961f..3837e20c9 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -49,11 +49,7 @@ message Auction{ repeated bidOwnerMapping bidding_ids = 5 [ (gogoproto.moretags) = "yaml:\"bidding_ids\"" ]; - string bid_factor = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"bid_factor\"" - ]; + // price indicator only for dutch auctions string collateral_token_auction_price = 7 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto index 2f14ff758..58c431df4 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -105,6 +105,11 @@ message AuctionParams{ uint64 min_usd_value_left = 5[ (gogoproto.moretags) = "yaml:\"min_usd_value_left\"" ]; + string bid_factor = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"bid_factor\"" + ]; } diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 31b01df54..665ad0f9a 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -216,6 +216,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if bid.Amount.Equal(sdk.ZeroInt()) { return bidId, types.ErrBidCannotBeZero } + bidderAddr, _ := sdk.AccAddressFromBech32(bidder) liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, auctionData.AppId) @@ -440,98 +441,181 @@ func (k Keeper) CreateUserBid(ctx sdk.Context, appID uint64, BidderAddress strin return bidding.BiddingId, nil } +// func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder string, bid sdk.Coin, auctionData types.Auction) error { +// if bid.Amount.Equal(sdk.ZeroInt()) { +// return types.ErrBidCannotBeZero +// } +// bidderAddr, _ := sdk.AccAddressFromBech32(bidder) +// //TODO: an identifier for surplus or debt auction +// if true { // for surplus auction +// if bid.Denom != auctionData.DebtToken.Denom { +// return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the debt token ", bid.Denom) +// } +// if auctionData.BiddingIds != nil { +// change := auctionData.BidFactor.MulInt(auctionData.DebtToken.Amount).Ceil().TruncateInt() +// minBidAmount := auctionData.DebtToken.Amount.Add(change) +// if bid.Amount.LT(minBidAmount) { +// return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be greater than or equal to %d ", minBidAmount) +// } +// } else { +// if bid.Amount.LTE(auctionData.DebtToken.Amount) { +// return auctiontypes.ErrorLowBidAmount +// } +// } +// err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctiontypes.ModuleName, sdk.NewCoins(bid)) +// if err != nil { +// return err +// } +// biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, bidder, auctionID, auctionData.CollateralToken, sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") +// if err != nil { +// return err +// } +// if auctionData.ActiveBiddingId != 0 { +// userBid, err := k.GetUserBid(ctx, auctionData.ActiveBiddingId) +// if err != nil { +// return err +// } +// addr, _ := sdk.AccAddressFromBech32(userBid.BidderAddress) +// err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, addr, sdk.NewCoins(auctionData.DebtToken)) +// if err != nil { +// return err +// } +// } + +// auctionData.DebtToken.Amount = bid.Amount +// auctionData.ActiveBiddingId = biddingId +// bidIDOwner := &auctiontypes.BidOwnerMapping{BidId: biddingId, BidOwner: bidder} +// auctionData.BiddingIds = append(auctionData.BiddingIds, bidIDOwner) + +// } else { // for debt auction +// if bid.Denom != auctionData.CollateralToken.Denom { +// return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the CollateralToken token ", bid.Denom) +// } +// if auctionData.BiddingIds != nil { +// change := auctionData.BidFactor.MulInt(auctionData.CollateralToken.Amount).Ceil().TruncateInt() +// maxBidAmount := auctionData.CollateralToken.Amount.Sub(change) +// if bid.Amount.GT(maxBidAmount) { +// return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be less than or equal to %d ", maxBidAmount.Uint64()) +// } +// } else { +// if bid.Amount.GT(auctionData.CollateralToken.Amount) { +// return auctiontypes.ErrorMaxBidAmount +// } +// } +// err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctiontypes.ModuleName, sdk.NewCoins(bid)) +// if err != nil { +// return err +// } +// biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, bid.Amount), auctionData.DebtToken, "dutch") +// if err != nil { +// return err +// } +// if auctionData.ActiveBiddingId != 0 { +// userBid, err := k.GetUserBid(ctx, auctionData.ActiveBiddingId) +// if err != nil { +// return err +// } +// addr, _ := sdk.AccAddressFromBech32(userBid.BidderAddress) +// err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, addr, sdk.NewCoins(auctionData.CollateralToken)) +// if err != nil { +// return err +// } + +// } +// auctionData.CollateralToken.Amount = bid.Amount +// auctionData.ActiveBiddingId = biddingId +// bidIDOwner := &auctiontypes.BidOwnerMapping{BidId: biddingId, BidOwner: bidder} +// auctionData.BiddingIds = append(auctionData.BiddingIds, bidIDOwner) + +// } +// err := k.SetAuction(ctx, auctionData) +// if err != nil { +// return err +// } + +// return nil +// } + func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder string, bid sdk.Coin, auctionData types.Auction) error { + auctionParams, _ := k.GetAuctionParams(ctx) if bid.Amount.Equal(sdk.ZeroInt()) { return types.ErrBidCannotBeZero } bidderAddr, _ := sdk.AccAddressFromBech32(bidder) - //TODO: an identifier for surplus or debt auction - if true { // for surplus auction - if bid.Denom != auctionData.DebtToken.Denom { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the debt token ", bid.Denom) - } - if auctionData.BiddingIds != nil { - change := auctionData.BidFactor.MulInt(auctionData.DebtToken.Amount).Ceil().TruncateInt() - minBidAmount := auctionData.DebtToken.Amount.Add(change) - if bid.Amount.LT(minBidAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be greater than or equal to %d ", minBidAmount) - } - } else { - if bid.Amount.LTE(auctionData.DebtToken.Amount) { - return auctiontypes.ErrorLowBidAmount - } - } - err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctiontypes.ModuleName, sdk.NewCoins(bid)) - if err != nil { - return err - } - biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, bidder, auctionID, auctionData.CollateralToken, sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") - if err != nil { - return err - } - if auctionData.ActiveBiddingId != 0 { - userBid, err := k.GetUserBid(ctx, auctionData.ActiveBiddingId) - if err != nil { - return err - } - addr, _ := sdk.AccAddressFromBech32(userBid.BidderAddress) - err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, addr, sdk.NewCoins(auctionData.DebtToken)) - if err != nil { - return err - } - } - auctionData.DebtToken.Amount = bid.Amount - auctionData.ActiveBiddingId = biddingId - bidIDOwner := &auctiontypes.BidOwnerMapping{BidId: biddingId, BidOwner: bidder} - auctionData.BiddingIds = append(auctionData.BiddingIds, bidIDOwner) + liquidationData, found := k.LiquidationsV2.GetLockedVault(ctx, auctionData.AppId, auctionData.LockedVaultId) + if !found { + return auctiontypes.ErrLiquidationNotFound + } + //TokenLastBid is used to get the last bid on the auction from the user + tokenLastBid := auctionData.DebtToken + //this is used to save the current collateral data. + tokenCollateralData := auctionData.CollateralToken + //bidFrom user is used to know how many token do we need to collect form the user + bidFromUser := bid + if liquidationData.InitiatorType == "debt" { + //In debt bid, the bid comes in form of collateral token , but gets converted interally for easy usecase + tokenLastBid = auctionData.CollateralToken + bidFromUser = auctionData.DebtToken + tokenCollateralData = bid + } + if bid.Denom != tokenLastBid.Denom { + return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid is not in correct denom ", bid.Denom) + } + if auctionData.BiddingIds != nil { - } else { // for debt auction - if bid.Denom != auctionData.CollateralToken.Denom { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the CollateralToken token ", bid.Denom) + change := auctionParams.BidFactor.MulInt(tokenLastBid.Amount).Ceil().TruncateInt() + bidAmount := tokenLastBid.Amount.Add(change) + if bid.Amount.LT(bidAmount) { + return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be less than or equal to %d ", bidAmount.Uint64()) } - if auctionData.BiddingIds != nil { - change := auctionData.BidFactor.MulInt(auctionData.CollateralToken.Amount).Ceil().TruncateInt() - maxBidAmount := auctionData.CollateralToken.Amount.Sub(change) - if bid.Amount.GT(maxBidAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be less than or equal to %d ", maxBidAmount.Uint64()) - } - } else { - if bid.Amount.GT(auctionData.CollateralToken.Amount) { - return auctiontypes.ErrorMaxBidAmount + if liquidationData.InitiatorType == "debt" { + bidAmount = tokenLastBid.Amount.Sub(change) + if bid.Amount.GT(bidAmount) { + return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be less than or equal to %d ", bidAmount.Uint64()) } } - err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctiontypes.ModuleName, sdk.NewCoins(bid)) + } else { + if liquidationData.InitiatorType != "debt" && bid.Amount.LT(tokenLastBid.Amount) { + return auctiontypes.ErrorLowBidAmount + } + if liquidationData.InitiatorType == "debt" && bid.Amount.GT(tokenLastBid.Amount) { + return auctiontypes.ErrorMaxBidAmount + } + } + err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctiontypes.ModuleName, sdk.NewCoins(bidFromUser)) + if err != nil { + return err + } + biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, tokenCollateralData, bidFromUser, "english") + if err != nil { + return err + } + if auctionData.ActiveBiddingId != 0 { + userBid, err := k.GetUserBid(ctx, auctionData.ActiveBiddingId) if err != nil { return err } - biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, bid.Amount), auctionData.DebtToken, "dutch") + addr, _ := sdk.AccAddressFromBech32(userBid.BidderAddress) + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, addr, sdk.NewCoins(auctionData.DebtToken)) if err != nil { return err } - if auctionData.ActiveBiddingId != 0 { - userBid, err := k.GetUserBid(ctx, auctionData.ActiveBiddingId) - if err != nil { - return err - } - addr, _ := sdk.AccAddressFromBech32(userBid.BidderAddress) - err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, addr, sdk.NewCoins(auctionData.CollateralToken)) - if err != nil { - return err - } - - } + } + if liquidationData.InitiatorType == "debt" { auctionData.CollateralToken.Amount = bid.Amount - auctionData.ActiveBiddingId = biddingId - bidIDOwner := &auctiontypes.BidOwnerMapping{BidId: biddingId, BidOwner: bidder} - auctionData.BiddingIds = append(auctionData.BiddingIds, bidIDOwner) - + } else { + auctionData.DebtToken.Amount = bid.Amount } - err := k.SetAuction(ctx, auctionData) + + auctionData.ActiveBiddingId = biddingId + bidIDOwner := &auctiontypes.BidOwnerMapping{BidId: biddingId, BidOwner: bidder} + auctionData.BiddingIds = append(auctionData.BiddingIds, bidIDOwner) + + err = k.SetAuction(ctx, auctionData) if err != nil { return err } - return nil } diff --git a/x/auctionsV2/keeper/msg_server.go b/x/auctionsV2/keeper/msg_server.go index cb56994a7..5e7e7c381 100644 --- a/x/auctionsV2/keeper/msg_server.go +++ b/x/auctionsV2/keeper/msg_server.go @@ -34,7 +34,7 @@ func (k msgServer) MsgPlaceMarketBid(goCtx context.Context, msg *types.MsgPlaceM //If true triggering Dutch Auction Bid Request if auctionData.AuctionType { - _, err = k.PlaceDutchAuctionBid(ctx, msg.AuctionId, bidder, msg.Amount, auctionData) + _, err = k.PlaceDutchAuctionBid(ctx, msg.AuctionId, bidder, msg.Amount, auctionData,false) if err != nil { return nil, err } diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index d7695cdef..a0199223a 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -96,7 +96,6 @@ type Auction struct { DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"inflow_token_target_amount"` ActiveBiddingId uint64 `protobuf:"varint,4,opt,name=active_bidding_id,json=activeBiddingId,proto3" json:"active_bidding_id,omitempty" yaml:"active_bidding_id"` BiddingIds []*BidOwnerMapping `protobuf:"bytes,5,rep,name=bidding_ids,json=biddingIds,proto3" json:"bidding_ids,omitempty" yaml:"bidding_ids"` - BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` // price indicator only for dutch auctions CollateralTokenAuctionPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=collateral_token_auction_price,json=collateralTokenAuctionPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_auction_price" yaml:"outflow_token_auction_price"` CollateralTokenOraclePrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=collateral_token_oracle_price,json=collateralTokenOraclePrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_oracle_price" yaml:"outflow_token_oracle_price"` @@ -291,68 +290,66 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 968 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x36, 0xe3, 0xf8, 0x47, 0x2b, 0xab, 0x8a, 0x18, 0x27, 0xa6, 0xe5, 0x5a, 0x54, 0xf6, 0x90, - 0x08, 0x05, 0x4c, 0x21, 0x69, 0x4e, 0x45, 0x2f, 0x66, 0x9a, 0x22, 0x2a, 0xda, 0xa4, 0x60, 0x85, - 0xa0, 0xe8, 0x85, 0x58, 0x72, 0x57, 0xf2, 0xc2, 0x14, 0x97, 0x15, 0x57, 0x4e, 0xfd, 0x08, 0xbd, - 0x14, 0x3e, 0x05, 0xe8, 0xb9, 0x2f, 0x93, 0x63, 0x8e, 0x45, 0x0f, 0x6c, 0x61, 0xbf, 0x01, 0x8f, - 0x3d, 0x15, 0xfb, 0x43, 0x91, 0x92, 0x5d, 0xa4, 0xea, 0x49, 0x9c, 0xd9, 0x99, 0x6f, 0xbe, 0x9d, - 0xfd, 0x76, 0x56, 0xe0, 0x51, 0xc8, 0x26, 0x98, 0xfc, 0xd4, 0x47, 0xb3, 0x90, 0x53, 0x16, 0xa7, - 0xaf, 0x9f, 0xf4, 0xcf, 0x1e, 0x07, 0x84, 0xa3, 0xc7, 0x85, 0xcb, 0x49, 0xa6, 0x8c, 0x33, 0x73, - 0x5f, 0x05, 0x3a, 0x65, 0xa0, 0xa3, 0x03, 0xdb, 0xbb, 0x63, 0x36, 0x66, 0x32, 0xaa, 0x2f, 0xbe, - 0x54, 0x42, 0xdb, 0x1e, 0x33, 0x36, 0x8e, 0x48, 0x5f, 0x5a, 0xc1, 0x6c, 0xd4, 0xe7, 0x74, 0x42, - 0x52, 0x8e, 0x26, 0x89, 0x0e, 0xe8, 0x84, 0x2c, 0x9d, 0xb0, 0xb4, 0x1f, 0xa0, 0x94, 0xcc, 0x8b, - 0x86, 0x8c, 0x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x97, 0x1d, 0xe3, 0xfd, 0x65, 0xc7, - 0xf8, 0xeb, 0xb2, 0x63, 0x5c, 0x5c, 0x75, 0xd6, 0xde, 0x5f, 0x75, 0xd6, 0x7e, 0xbf, 0xea, 0xac, - 0xfd, 0xf0, 0x74, 0x81, 0xac, 0x18, 0x9f, 0x47, 0x6c, 0x34, 0xa2, 0x21, 0x45, 0x91, 0xb6, 0xfb, - 0x0b, 0x7f, 0x83, 0x24, 0xfd, 0x60, 0x53, 0xaa, 0xe7, 0xd3, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x1f, 0x0a, 0x50, 0x35, 0x28, 0x09, 0x00, 0x00, + // 942 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0xdb, 0x36, + 0x18, 0x8e, 0x9a, 0xe6, 0xc3, 0xb4, 0x33, 0xd7, 0x6a, 0xda, 0x28, 0xce, 0x62, 0xb9, 0x3c, 0xb4, + 0xc6, 0x80, 0xc8, 0x68, 0xd7, 0xd3, 0xb0, 0x4b, 0xb4, 0x15, 0xa8, 0x87, 0xad, 0x1d, 0xb8, 0xa0, + 0x18, 0x76, 0x31, 0x28, 0x91, 0x76, 0x88, 0xc8, 0xa2, 0x66, 0xd1, 0xe9, 0xf2, 0x13, 0x76, 0x19, + 0x72, 0x1a, 0xb0, 0xf3, 0xfe, 0xc1, 0x7e, 0x45, 0x8f, 0x3d, 0x0e, 0x3b, 0x68, 0x43, 0xf2, 0x0f, + 0x74, 0xdc, 0x69, 0xe0, 0x87, 0x2c, 0xd9, 0xc9, 0x90, 0x65, 0xa7, 0x84, 0x2f, 0x9f, 0xf7, 0x79, + 0x1f, 0xbe, 0x7c, 0xf8, 0xca, 0xe0, 0x49, 0xc8, 0x27, 0x84, 0xfe, 0xd0, 0xc7, 0xb3, 0x50, 0x30, + 0x1e, 0xa7, 0x6f, 0x9e, 0xf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5e, 0x80, 0xe6, + 0xd2, 0x58, 0xb1, 0x1f, 0x80, 0xf5, 0x80, 0x91, 0xf9, 0x77, 0x03, 0xad, 0x05, 0x8c, 0x0c, 0x88, + 0xbd, 0x07, 0x6a, 0x32, 0xcc, 0x25, 0x54, 0x7d, 0x14, 0x6a, 0x68, 0xb3, 0x48, 0xf5, 0x5f, 0xbd, + 0xbb, 0xe8, 0x58, 0xef, 0x2f, 0x3a, 0xd6, 0x5f, 0x17, 0x1d, 0xeb, 0xfc, 0xb2, 0xb3, 0xf2, 0xfe, + 0xb2, 0xb3, 0xf2, 0xfb, 0x65, 0x67, 0xe5, 0xbb, 0xe7, 0x0b, 0x62, 0xe5, 0x68, 0x3b, 0xe0, 0xa3, + 0x11, 0x0b, 0x19, 0x8e, 0xcc, 0xba, 0xbf, 0xf0, 0x13, 0x45, 0xc9, 0x0f, 0xd6, 0x95, 0x7b, 0x3e, + 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x5d, 0xf0, 0x40, 0xc4, 0x08, 0x00, 0x00, } func (m *AuctionHistorical) Marshal() (dAtA []byte, err error) { @@ -517,16 +514,6 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x3a - { - size := m.BidFactor.Size() - i -= size - if _, err := m.BidFactor.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 if len(m.BiddingIds) > 0 { for iNdEx := len(m.BiddingIds) - 1; iNdEx >= 0; iNdEx-- { { @@ -662,8 +649,6 @@ func (m *Auction) Size() (n int) { n += 1 + l + sovAuction(uint64(l)) } } - l = m.BidFactor.Size() - n += 1 + l + sovAuction(uint64(l)) l = m.CollateralTokenAuctionPrice.Size() n += 1 + l + sovAuction(uint64(l)) l = m.CollateralTokenOraclePrice.Size() @@ -1024,40 +1009,6 @@ func (m *Auction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BidFactor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - 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 ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BidFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenAuctionPrice", wireType) diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index 588e5fecb..6cd3e47c6 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -212,6 +212,7 @@ type AuctionParams struct { WithdrawalFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=withdrawal_fee,json=withdrawalFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"withdrawal_fee" yaml:"withdrawal_fee"` ClosingFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=closing_fee,json=closingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"closing_fee" yaml:"closing_fee"` MinUsdValueLeft uint64 `protobuf:"varint,5,opt,name=min_usd_value_left,json=minUsdValueLeft,proto3" json:"min_usd_value_left,omitempty" yaml:"min_usd_value_left"` + BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` } func (m *AuctionParams) Reset() { *m = AuctionParams{} } @@ -325,63 +326,65 @@ func init() { } var fileDescriptor_6f6db8f3a6a396ec = []byte{ - // 893 bytes of a gzipped FileDescriptorProto + // 915 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcf, 0x6e, 0x1b, 0x45, - 0x18, 0xcf, 0xc6, 0x4e, 0x5a, 0x4f, 0xe4, 0x3a, 0xd9, 0x36, 0xa9, 0x13, 0x54, 0xaf, 0x99, 0x22, - 0xf0, 0xa5, 0xbb, 0x6a, 0xe8, 0x01, 0x21, 0x71, 0x88, 0xb1, 0x8a, 0x82, 0x4a, 0x81, 0x25, 0xcd, - 0x01, 0x09, 0xad, 0x66, 0x77, 0xc6, 0xee, 0xa8, 0xbb, 0x3b, 0xab, 0x9d, 0xd9, 0x86, 0x5e, 0x78, - 0x03, 0xa4, 0x1e, 0x78, 0x01, 0x9e, 0x80, 0x87, 0xe0, 0xd2, 0x63, 0x8f, 0x08, 0x89, 0x05, 0x25, - 0x3c, 0x81, 0x8f, 0x9c, 0xd0, 0xfc, 0xb1, 0x37, 0xeb, 0x04, 0x25, 0x16, 0x27, 0xcf, 0x7c, 0x7f, - 0x7e, 0xdf, 0x6f, 0xbe, 0xf9, 0xcd, 0xb7, 0x06, 0xf7, 0x23, 0x96, 0x60, 0xf2, 0xbd, 0x87, 0x8a, - 0x48, 0x50, 0x96, 0xf2, 0xe3, 0x7d, 0xef, 0xe5, 0xc3, 0x90, 0x08, 0xf4, 0xd0, 0x0b, 0x29, 0x76, - 0xb3, 0x9c, 0x09, 0x66, 0xef, 0xea, 0x20, 0xb7, 0x0a, 0x72, 0x4d, 0xd0, 0xde, 0x9d, 0x09, 0x9b, - 0x30, 0x15, 0xe5, 0xc9, 0x95, 0x4e, 0xd8, 0x73, 0x26, 0x8c, 0x4d, 0x62, 0xe2, 0xa9, 0x5d, 0x58, - 0x8c, 0x3d, 0x41, 0x13, 0xc2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8b, - 0x0a, 0xbf, 0x5a, 0xda, 0x9f, 0x99, 0x5e, 0xdf, 0xb9, 0x44, 0xda, 0xcb, 0xc9, 0x66, 0x41, 0xd3, - 0xf6, 0x0f, 0x00, 0x54, 0x62, 0xbe, 0x5a, 0xc5, 0x23, 0x43, 0xc4, 0x3c, 0xe3, 0x2a, 0x75, 0x29, - 0x16, 0xad, 0xb9, 0x78, 0x17, 0xa6, 0xcb, 0x5a, 0xbf, 0x71, 0xad, 0xe9, 0x22, 0xc0, 0x66, 0x96, - 0x93, 0x84, 0x16, 0x49, 0x80, 0x29, 0x8f, 0xd4, 0x0b, 0x5c, 0x57, 0x37, 0x70, 0x28, 0x09, 0xfe, - 0x5e, 0x3a, 0xef, 0x5f, 0x83, 0xcb, 0x88, 0x44, 0xd3, 0xd2, 0xb9, 0xab, 0x2b, 0x2d, 0xe2, 0x41, - 0xbf, 0x63, 0x4c, 0xa3, 0x99, 0xe5, 0xef, 0x06, 0x68, 0x1f, 0xe8, 0x59, 0xf5, 0x15, 0xca, 0x51, - 0xc2, 0xed, 0xef, 0x40, 0x77, 0x36, 0xc9, 0x70, 0x91, 0x23, 0xb5, 0xe0, 0x24, 0x62, 0x29, 0xe6, - 0x46, 0x61, 0xf7, 0xa7, 0xa5, 0xe3, 0xd4, 0x67, 0xde, 0x62, 0x24, 0xf4, 0x77, 0x8c, 0x6b, 0x64, - 0x3c, 0xdf, 0x68, 0x87, 0xfd, 0x35, 0x68, 0x72, 0x41, 0x32, 0x23, 0xae, 0x4f, 0x96, 0x3e, 0xda, - 0x86, 0x2e, 0x2c, 0x31, 0xa0, 0xaf, 0xa0, 0xec, 0x14, 0xdc, 0x3a, 0xa1, 0xe2, 0x39, 0xce, 0xd1, - 0x09, 0x8a, 0x83, 0x31, 0x21, 0x4a, 0x7c, 0x2d, 0xad, 0xb0, 0xa5, 0xc0, 0xb7, 0x35, 0x78, 0x1d, - 0x0d, 0xfa, 0xed, 0xca, 0xf0, 0x98, 0x10, 0x9b,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 0x41, 0x4c, 0x46, 0x42, + 0x4d, 0xc0, 0xc6, 0xe0, 0xc1, 0xa4, 0x74, 0x76, 0x74, 0xfe, 0xe5, 0x18, 0xe8, 0xb7, 0x13, 0x9a, + 0xbe, 0xe0, 0xf8, 0x58, 0x9a, 0x9e, 0x91, 0x91, 0xb0, 0x43, 0x25, 0xc9, 0x60, 0x84, 0x22, 0xc1, + 0x72, 0x23, 0xab, 0xa7, 0x0b, 0x33, 0xae, 0x04, 0x6c, 0x90, 0xb4, 0x80, 0x0f, 0xf4, 0xfa, 0x37, + 0x0b, 0x6c, 0xd5, 0x46, 0x15, 0x3f, 0x60, 0xf9, 0x0b, 0x4e, 0xf2, 0x2b, 0x46, 0x8b, 0x75, 0xc3, + 0xd1, 0x92, 0x81, 0xf6, 0xdc, 0x10, 0xeb, 0x2c, 0xf7, 0x56, 0xfa, 0xeb, 0x7b, 0x7d, 0xf7, 0x3f, + 0x3f, 0x1e, 0xdc, 0x1a, 0x89, 0x41, 0xd7, 0x3c, 0xef, 0xed, 0x2b, 0x67, 0x22, 0xf4, 0x5b, 0xb5, + 0x61, 0x38, 0x78, 0x7e, 0x7a, 0xd6, 0xb5, 0xde, 0x9d, 0x75, 0xad, 0xbf, 0xcf, 0xba, 0xd6, 0xdb, + 0xf3, 0xee, 0xd2, 0xbb, 0xf3, 0xee, 0xd2, 0xef, 0xe7, 0xdd, 0xa5, 0xef, 0x9e, 0xd4, 0xfa, 0x24, + 0x8b, 0x3f, 0x62, 0xa3, 0x11, 0x8d, 0x28, 0x8a, 0xcd, 0xde, 0xab, 0x7d, 0xf0, 0xa8, 0xce, 0x85, + 0x6b, 0xea, 0x6f, 0xe6, 0xe3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x8d, 0x6d, 0x8c, 0x12, + 0x09, 0x00, 0x00, } func (m *Bid) Marshal() (dAtA []byte, err error) { @@ -567,6 +570,16 @@ func (m *AuctionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.BidFactor.Size() + i -= size + if _, err := m.BidFactor.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 if m.MinUsdValueLeft != 0 { i = encodeVarintBid(dAtA, i, uint64(m.MinUsdValueLeft)) i-- @@ -744,6 +757,8 @@ func (m *AuctionParams) Size() (n int) { if m.MinUsdValueLeft != 0 { n += 1 + sovBid(uint64(m.MinUsdValueLeft)) } + l = m.BidFactor.Size() + n += 1 + l + sovBid(uint64(l)) return n } @@ -1488,6 +1503,40 @@ func (m *AuctionParams) Unmarshal(dAtA []byte) error { break } } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidFactor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BidFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipBid(dAtA[iNdEx:]) diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index 74899e252..5d168d1e0 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -15,4 +15,5 @@ var ( ErrBidCannotBeZero = sdkerrors.Register(ModuleName, 705, "Bid amount can't be Zero") ErrorLowBidAmount = sdkerrors.Register(ModuleName, 706, "bidding amount is lower than expected") ErrorMaxBidAmount = sdkerrors.Register(ModuleName, 707, "bidding amount is greater than maximum bidding amount") + ErrLiquidationNotFound=sdkerrors.Register(ModuleName, 708, "Liquidation data not found for the auction") ) From 82fb324cb303353aaeffb8532c06411e15b92e5d Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Wed, 7 Jun 2023 03:20:47 +0530 Subject: [PATCH 089/155] finalising auctionV2 & liquidationV2 --- proto/comdex/auctionsV2/v1beta1/bid.proto | 73 +- proto/comdex/auctionsV2/v1beta1/tx.proto | 18 +- proto/comdex/liquidationsV2/v1beta1/tx.proto | 25 +- x/auctionsV2/keeper/auctions.go | 20 +- x/auctionsV2/keeper/bid.go | 319 ++----- x/auctionsV2/keeper/msg_server.go | 2 +- x/auctionsV2/keeper/utils.go | 27 + x/auctionsV2/types/bid.pb.go | 934 +++++++++++++++---- x/auctionsV2/types/errors.go | 3 +- x/auctionsV2/types/keys.go | 12 +- x/auctionsV2/types/tx.pb.go | 175 ++-- x/liquidationsV2/expected/keeper.go | 2 + x/liquidationsV2/keeper/liquidate.go | 26 +- x/liquidationsV2/types/msg.go | 17 +- x/liquidationsV2/types/tx.pb.go | 290 ++---- 15 files changed, 1165 insertions(+), 778 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto index 58c431df4..18e0cb3a9 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -55,26 +55,31 @@ message LimitOrderBid{ (gogoproto.moretags) = "yaml:\"bidder\"" ]; - cosmos.base.v1beta1.Coin collateral_token = 3 [ + uint64 collateral_token_id = 3 [ + + (gogoproto.moretags) = "yaml:\"collateral_token_id\"" + ]; + string premium_discount = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"outflow_token\"", - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" + (gogoproto.moretags) = "yaml:\"premium_discount\"" ]; + uint64 debt_token_id = 5 [ + + (gogoproto.moretags) = "yaml:\"debt_token_id\"" +]; + - cosmos.base.v1beta1.Coin debt_token = 4 [ + cosmos.base.v1beta1.Coin debt_token = 6 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"debt_token\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - repeated uint64 bidding_id = 5 [ + repeated uint64 bidding_id = 7 [ (gogoproto.moretags) = "yaml:\"bidding_id\"" ]; - string premium_discount = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"premium_discount\"" - ]; + } @@ -110,6 +115,18 @@ message AuctionParams{ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"bid_factor\"" ]; + //For external apps + string liquidation_penalty = 7 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"liquidation_penalty\"" + ]; + string auction_bonus = 8 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"auction_bonus\"" + ]; + } @@ -118,12 +135,44 @@ message LimitOrderBidsForUser{ string bidder_address = 1 [ (gogoproto.moretags) = "yaml:\"bidder\"" ]; - repeated LimitOrderBid limit_order_bid = 2 [ + repeated LimitOrderUserKey limit_order_bid_key = 2 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"limit_order_bid\"" + (gogoproto.moretags) = "yaml:\"limit_order_bid_key\"" ]; } +message LimitOrderUserKey{ + uint64 debt_token_id = 1 [ + +(gogoproto.moretags) = "yaml:\"debt_token_id\""]; + + uint64 collateral_token_id = 2 [ + + (gogoproto.moretags) = "yaml:\"collateral_token_id\"" +]; +string premium_discount = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"premium_discount\"" +]; +uint64 limit_order_bidding_id = 4 [ + (gogoproto.moretags) = "yaml:\"limit_order_bidding_id\"" +]; + + + + +} + +message AuctionFeesCollectionFromLimitBidTx{ + uint64 asset_id=1 [ + (gogoproto.moretags) = "yaml:\"asset_id\""]; + string amount = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"amount\"" + ]; +} // Bidding Structs //1. Market Bid //2. ACBI LIMIT ORDER BIDS diff --git a/proto/comdex/auctionsV2/v1beta1/tx.proto b/proto/comdex/auctionsV2/v1beta1/tx.proto index 10b88ed60..58a03a5ce 100644 --- a/proto/comdex/auctionsV2/v1beta1/tx.proto +++ b/proto/comdex/auctionsV2/v1beta1/tx.proto @@ -23,7 +23,11 @@ message MsgPlaceMarketBidResponse{} message MsgDepositLimitBidRequest { uint64 collateral_token_id = 1; uint64 debt_token_id = 2; - string premium_discount = 3; + string premium_discount = 3 [ + (gogoproto.moretags) = "yaml:\"premium_discount\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + ]; string bidder = 4; cosmos.base.v1beta1.Coin amount = 5 [(gogoproto.nullable) = false]; } @@ -33,7 +37,11 @@ message MsgDepositLimitBidResponse{} message MsgCancelLimitBidRequest { uint64 collateral_token_id = 1; uint64 debt_token_id = 2; - string premium_discount = 3; + string premium_discount = 3 [ + (gogoproto.moretags) = "yaml:\"premium_discount\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + ]; string bidder = 4; } @@ -42,7 +50,11 @@ message MsgCancelLimitBidResponse{} message MsgWithdrawLimitBidRequest { uint64 collateral_token_id = 1; uint64 debt_token_id = 2; - string premium_discount = 3; + string premium_discount = 3 [ + (gogoproto.moretags) = "yaml:\"premium_discount\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + ]; string bidder = 4; cosmos.base.v1beta1.Coin amount = 5 [(gogoproto.nullable) = false]; } diff --git a/proto/comdex/liquidationsV2/v1beta1/tx.proto b/proto/comdex/liquidationsV2/v1beta1/tx.proto index 710ff0f41..a0006e648 100644 --- a/proto/comdex/liquidationsV2/v1beta1/tx.proto +++ b/proto/comdex/liquidationsV2/v1beta1/tx.proto @@ -65,30 +65,15 @@ message MsgLiquidateExternalKeeperRequest { (gogoproto.moretags) = "yaml:\"debt_token\"", (gogoproto.nullable) = false]; - string fee_to_be_collected = 6 [ - (gogoproto.customname) = "FeeToBeCollected", - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"fee_to_be_collected\""]; - - string bonus_to_be_given = 7 [ - (gogoproto.customname) = "BonusToBeGiven", - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"bonus_to_be_given\""]; - bool auction_type = 8 [ - (gogoproto.customname) = "AuctionType", - (gogoproto.moretags) = "yaml:\"auction_type\""]; - - uint64 collateral_asset_id = 9 [ + uint64 collateral_asset_id = 6 [ (gogoproto.moretags) = "yaml:\"collateral_asset_id\""]; - uint64 debt_asset_id = 10 [ + uint64 debt_asset_id = 7 [ (gogoproto.moretags) = "yaml:\"debt_asset_id\""]; - string initiator_type = 11 [ - (gogoproto.customname) = "InitiatorType", - (gogoproto.moretags) = "yaml:\"initiator_type\""]; + bool isDebtCmst=8[ + (gogoproto.moretags) = "yaml:\"debt_asset_id\""]; + } message MsgLiquidateExternalKeeperResponse{} diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index af820756c..0e3036116 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -375,6 +375,8 @@ func (k Keeper) RestartEnglishAuction(ctx sdk.Context, englishAuction types.Auct func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auction) error { + //check if there is any bid + //check for specific use cases //Send Collateral To the user //Delete Auction Data @@ -433,7 +435,7 @@ func (k Keeper) LimitOrderBid(ctx sdk.Context) error { if auction.CollateralTokenOraclePrice.GT(auction.CollateralTokenAuctionPrice) { premium := (auction.CollateralTokenOraclePrice.Sub(auction.CollateralTokenAuctionPrice)).Quo(auction.CollateralTokenOraclePrice) premiumPerc := premium.Mul(sdk.NewDecFromInt(sdk.NewInt(100))) - biddingData, found := k.GetUserLimitBidDataByPremium(ctx, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt().String()) + biddingData, found := k.GetUserLimitBidDataByPremium(ctx, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt()) if !found { return nil } @@ -445,26 +447,26 @@ func (k Keeper) LimitOrderBid(ctx sdk.Context) error { if individualBids.DebtToken.Amount.GTE(auction.DebtToken.Amount) { //User has more tokens than target debt, so their bid will close the auction ///Placing a user bid - biddingId, err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr, individualBids.DebtToken, auction, true) + biddingId, err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr.String(), individualBids.DebtToken, auction, true) if err != nil { return err } if individualBids.DebtToken.Amount.Equal(auction.DebtToken.Amount) { - k.DeleteUserLimitBidData(ctx, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt().String(), individualBids.BidderAddress) - k.AppendUserLimitBidDataForAddress(ctx, individualBids, false) + k.DeleteUserLimitBidData(ctx, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt(), individualBids.BidderAddress) + + k.UpdateUserLimitBidDataForAddress(ctx, individualBids, false) return nil } individualBids.DebtToken.Amount = individualBids.DebtToken.Amount.Sub(auction.DebtToken.Amount) individualBids.BiddingId = append(individualBids.BiddingId, biddingId) - k.SetUserLimitBidData(ctx, individualBids, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt().String()) - k.AppendUserLimitBidDataForAddress(ctx, individualBids, true) + k.SetUserLimitBidData(ctx, individualBids, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt()) } else { - _, err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr, individualBids.DebtToken, auction, true) + _, err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr.String(), individualBids.DebtToken, auction, true) if err != nil { return err } - k.DeleteUserLimitBidData(ctx, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt().String(), individualBids.BidderAddress) - k.AppendUserLimitBidDataForAddress(ctx, individualBids, false) + k.DeleteUserLimitBidData(ctx, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt(), individualBids.BidderAddress) + k.UpdateUserLimitBidDataForAddress(ctx, individualBids, false) } } diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 665ad0f9a..68263f3b4 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -11,206 +11,6 @@ import ( protobuftypes "github.com/gogo/protobuf/types" ) -// func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, bid sdk.Coin, auctionData types.Auction) error { -// //The bid is in debt token - This is different from the earliar auction model at comdex -// if bid.Amount.Equal(sdk.ZeroInt()) { -// return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid amount can't be Zero") -// } -// liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, auctionData.AppId) - -// if bid.Denom != auctionData.DebtToken.Denom { -// return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the debt token ", bid.Denom) -// } -// liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, auctionData.AppId, auctionData.LockedVaultId) -// //Price data of the token from market module -// debtToken, _ := k.market.GetTwa(ctx, auctionData.DebtAssetId) -// debtPrice := sdk.NewDecFromInt(sdk.NewInt(int64(debtToken.Twa))) -// //Price data of the token from market module -// collateralToken, _ := k.market.GetTwa(ctx, auctionData.CollateralAssetId) -// collateralPrice := sdk.NewDecFromInt(sdk.NewInt(int64(collateralToken.Twa))) - -// //only if debt token is CMST , we consider it as $1 -// if liquidationData.IsDebtCmst { -// debtPrice = sdk.NewDecFromInt(sdk.NewInt(int64(1000000))) - -// } -// isBidFinalBid := false -// //If user has sent a bigger bid than the target amount , -// if bid.Amount.GTE(auctionData.DebtToken.Amount) { -// bid.Amount = auctionData.DebtToken.Amount -// isBidFinalBid = true -// // bidPercent := 0 -// debtuDollar, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) -// //From auction bonus quantity , use the available quantity to calculate the collateral value -// _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, liquidationData.BonusToBeGiven, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) - -// //Checking if the auction bonus and the collateral to be given to user isnt more than available colalteral -// totalCollateralTokenQuanitity := collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus) -// if totalCollateralTokenQuanitity.LTE(auctionData.CollateralToken.Amount) { -// //If everything is correct - -// //Take Debt Token from user , -// if bid.Amount.GT(sdk.ZeroInt()) { -// err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidder, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) -// if err != nil { -// return err -// } -// } - -// //Send Collateral To bidder -// if bid.Amount.GT(sdk.ZeroInt()) { -// err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) -// if err != nil { -// return err -// } -// } - -// //Burn Debt Token, -// liquidationPenalty := sdk.NewCoin(auctionData.DebtToken.Denom, liquidationData.FeeToBeCollected) -// tokensToBurn := auctionData.DebtToken.Sub(liquidationPenalty) - -// if tokensToBurn.Amount.GT(sdk.ZeroInt()) { -// err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(tokensToBurn)) -// if err != nil { -// return err -// } -// } - -// //Send rest tokens to the user -// OwnerLeftOverCapital := auctionData.CollateralToken.Amount.Sub(totalCollateralTokenQuanitity) -// if bid.Amount.GT(sdk.ZeroInt()) { -// err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, OwnerLeftOverCapital))) -// if err != nil { -// return err -// } -// } -// //Add bid data to struct -// //Creating user bid struct -// bidding_id, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") -// if err != nil { -// return err -// } -// //Based on app type call perform specific function - external , internal and /or keeper incentive -// //See if this was keeper initiated transaction- then incentivisation will be in place based on the percentage -// //For apps that are external to comdex chain -// if liquidationData.InitiatorType == "external" { - -// //but if an app is external - will have to check the auction bonus , liquidation penalty , module account mechanism - -// } else if liquidationData.InitiatorType == "vault" { -// //Check if they are initiated through a keeper, if so they will be incentivised -// if liquidationData.IsInternalKeeper { - -// keeperIncentive := (liquidationWhitelistingAppData.KeeeperIncentive.Mul(sdk.NewDecFromInt(liquidationPenalty.Amount))).TruncateInt() -// if keeperIncentive.GT(sdk.ZeroInt()) { -// liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) -// err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.InternalKeeperAddress), sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) -// if err != nil { -// return err -// } - -// } -// } -// //Send Liquidation Penalty to the Collector Module -// if liquidationPenalty.Amount.GT(sdk.ZeroInt()) { -// err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(liquidationPenalty)) -// if err != nil { -// return err -// } -// } -// //Update Collector Data for CMST -// // Updating fees data in collector -// err = k.collector.SetNetFeeCollectedData(ctx, auctionData.AppId, auctionData.CollateralAssetId, liquidationPenalty.Amount) -// if err != nil { -// return err -// } -// //Updating mapping data of vault -// k.vault.UpdateTokenMintedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, tokensToBurn.Amount, false) -// k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, auctionData.CollateralToken.Amount, false) - -// } else if liquidationData.InitiatorType == "borrow" { -// //Check if they are initiated through a keeper, if so they will be incentivised - -// } - -// //Add bidder data in auction -// bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{bidding_id, string(bidder)} -// auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMapppingData) -// //Savinga auction data to auction historical -// auctionHistoricalData := auctionsV2types.AuctionHistorical{auctionID, &auctionData, &liquidationData} -// k.SetAuctionHistorical(ctx, auctionHistoricalData) -// //Close Auction -// k.DeleteAuction(ctx, auctionData) -// //Delete liquidation Data -// k.LiquidationsV2.DeleteLockedVault(ctx, liquidationData.LockedVaultId) - -// } else { -// //This means that there is less collateral available . -// //So we first try to compensate the difference through the liquidation penalty - -// //check the difference in collateral - -// //check if nullifing liquidation penalty helps -// //if yes - go for it - -// //else call the module account to give funds to compensate the user. - -// leftOverCollateral := auctionData.CollateralToken.Amount - -// _, debtTokenAgainstLeftOverCollateral, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice, leftOverCollateral.Sub(collateralTokenQuanitityForBonus), auctionData.DebtAssetId, debtPrice) - -// //Amount to call from reserve account for adjusting the auction target debt -// debtGettingLeft := auctionData.DebtToken.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, debtTokenAgainstLeftOverCollateral)) - -// //Calling reserve account for debt adjustment : debtGettingLeft - -// //Taking debtTokenAgainstLeftOverCollateral from user -// //Sending leftOverCollateral to the user -// //Burn Debt Token, -// //Creating user bid struct - -// //Based on app type call perform specific function - external , internal and /or keeper incentive -// //See if this was keeper initiated transaction- then incentivisation will be in place based on the percentage -// //For apps that are external to comdex chain - -// //Add bidder data in auction - -// } - -// } else { -// //if bid amount is less than the target bid - -// //Checking if bid isnt leaving dust amount less than allowed -for collateral & debt - -// //Calculating collateral token value from bid(debt) token value -// debtuDollar, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, collateralPrice) -// //From auction bonus quantity , use the available quantity to calculate the collateral value - -// //Checking bid.Amount -> to targetbid ratio -// //using that ratio data to calculate auction bonus to be given for the bid -// //first taking the debt percentage data -// //then calculating the collateral token data -// _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, liquidationData.BonusToBeGiven, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) - -// if collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus).LTE(auctionData.CollateralToken.Amount) { -// //If there is sufficient collalteral - -// } else { - -// //Not sure if this condition will arise in which partial bids also arent able to be fulfilled due to shortage of collateral token -// // Technically this case will also close the auction -// } - -// //Deducting auction bonus value from liquidation data also for next bid. -// } -// //Deducting the auction bonus - -// //Now checking if the bid is not the final bid, we will check the dust amount left by the bidder -// //if the dust check passes, it is good to go. -// //Dust check for debt token - -// return nil -// } - func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder string, bid sdk.Coin, auctionData types.Auction, isAutoBid bool) (bidId uint64, err error) { auctionParams, _ := k.GetAuctionParams(ctx) if bid.Amount.Equal(sdk.ZeroInt()) { @@ -650,7 +450,7 @@ func (k Keeper) GetLimitAuctionBidID(ctx sdk.Context) uint64 { return id.GetValue() } -func (k Keeper) SetUserLimitBidData(ctx sdk.Context, userLimitBidData types.LimitOrderBid, debtTokenID, collateralTokenID uint64, premium string) { +func (k Keeper) SetUserLimitBidData(ctx sdk.Context, userLimitBidData types.LimitOrderBid, debtTokenID, collateralTokenID uint64, premium sdk.Int) { var ( store = k.Store(ctx) key = types.UserLimitBidKey(debtTokenID, collateralTokenID, premium, userLimitBidData.BidderAddress) @@ -660,7 +460,7 @@ func (k Keeper) SetUserLimitBidData(ctx sdk.Context, userLimitBidData types.Limi store.Set(key, value) } -func (k Keeper) GetUserLimitBidData(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium, address string) (mappingData types.LimitOrderBid, found bool) { +func (k Keeper) GetUserLimitBidData(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium sdk.Int, address string) (mappingData types.LimitOrderBid, found bool) { var ( store = k.Store(ctx) key = types.UserLimitBidKey(debtTokenID, collateralTokenID, premium, address) @@ -675,7 +475,7 @@ func (k Keeper) GetUserLimitBidData(ctx sdk.Context, debtTokenID, collateralToke return mappingData, true } -func (k Keeper) DeleteUserLimitBidData(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium, address string) { +func (k Keeper) DeleteUserLimitBidData(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium sdk.Int, address string) { var ( store = k.Store(ctx) key = types.UserLimitBidKey(debtTokenID, collateralTokenID, premium, address) @@ -684,7 +484,7 @@ func (k Keeper) DeleteUserLimitBidData(ctx sdk.Context, debtTokenID, collateralT store.Delete(key) } -func (k Keeper) GetUserLimitBidDataByPremium(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium string) (biddingData []types.LimitOrderBid, found bool) { +func (k Keeper) GetUserLimitBidDataByPremium(ctx sdk.Context, debtTokenID, collateralTokenID uint64, premium sdk.Int) (biddingData []types.LimitOrderBid, found bool) { var ( store = k.Store(ctx) key = types.UserLimitBidKeyForPremium(debtTokenID, collateralTokenID, premium) @@ -710,72 +510,90 @@ func (k Keeper) GetUserLimitBidDataByPremium(ctx sdk.Context, debtTokenID, colla return biddingData, true } -func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount string, amount sdk.Coin) error { +func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount sdk.Int, amount sdk.Coin) error { id := k.GetLimitAuctionBidID(ctx) bidderAddr, err := sdk.AccAddressFromBech32(bidder) if err != nil { return nil } - premiumDiscount, err := sdk.NewDecFromStr(PremiumDiscount) - if err != nil { - return err - } - collateralAsset, found := k.asset.GetAsset(ctx, CollateralTokenId) + + _, found := k.asset.GetAsset(ctx, CollateralTokenId) if !found { return assettypes.ErrorAssetDoesNotExist } - collateralAssetToken := sdk.NewCoin(collateralAsset.Denom, sdk.NewInt(0)) userLimitBid, found := k.GetUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) if !found { userLimitBid = types.LimitOrderBid{ LimitOrderBiddingId: id + 1, BidderAddress: bidder, - CollateralToken: collateralAssetToken, // zero - DebtToken: amount, // user's balance + DebtToken: amount, // user's balance BiddingId: nil, - PremiumDiscount: premiumDiscount, + PremiumDiscount: PremiumDiscount, + CollateralTokenId: CollateralTokenId, + DebtTokenId: DebtTokenId, } + + k.UpdateUserLimitBidDataForAddress(ctx, userLimitBid, true) } else { userLimitBid.DebtToken = userLimitBid.DebtToken.Add(amount) } // send tokens from user to the auction module - err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, types.ModuleName, sdk.NewCoins(amount)) - if err != nil { - return err + if amount.Amount.GT(sdk.ZeroInt()) { + err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, types.ModuleName, sdk.NewCoins(amount)) + if err != nil { + return err + } } // Set ID and LimitBid Data k.SetLimitAuctionBidID(ctx, userLimitBid.LimitOrderBiddingId) k.SetUserLimitBidData(ctx, userLimitBid, DebtTokenId, CollateralTokenId, PremiumDiscount) - k.AppendUserLimitBidDataForAddress(ctx, userLimitBid, true) + return nil } -func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenId, CollateralTokenId uint64, PremiumDiscount string) error { +func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenId, CollateralTokenId uint64, PremiumDiscount sdk.Int) error { userLimitBid, found := k.GetUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) if !found { // return err not found + return types.ErrBidNotFound } + auctionParams, _ := k.GetAuctionParams(ctx) bidderAddr, err := sdk.AccAddressFromBech32(bidder) if err != nil { return err } // return all the tokens back to the user - err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, sdk.NewCoins(userLimitBid.DebtToken)) - if err != nil { - return err + if userLimitBid.DebtToken.Amount.GT(sdk.ZeroInt()) { + feesToBecollected := auctionParams.ClosingFee.Mul(sdk.NewDecFromInt(userLimitBid.DebtToken.Amount)).TruncateInt() + userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(feesToBecollected) + + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, sdk.NewCoins(userLimitBid.DebtToken)) + if err != nil { + return err + } + //updating fees in auction data + feeData, found := k.GetAuctionLimitBidFeeData(ctx, DebtTokenId) + if !found { + var feeData types.AuctionFeesCollectionFromLimitBidTx + feeData.AssetId = DebtTokenId + feeData.Amount = feesToBecollected + } else { + feeData.Amount = feeData.Amount.Add(feesToBecollected) + } + k.SetAuctionLimitBidFeeData(ctx, feeData) } // delete userLimitBid from KV store + k.UpdateUserLimitBidDataForAddress(ctx, userLimitBid, false) k.DeleteUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) - k.AppendUserLimitBidDataForAddress(ctx, userLimitBid, false) return nil } -func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount string, amount sdk.Coin) error { +func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount sdk.Int, amount sdk.Coin) error { userLimitBid, found := k.GetUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) if !found { // return err not found @@ -785,6 +603,7 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater if err != nil { return err } + auctionParams, _ := k.GetAuctionParams(ctx) if amount.Amount.Equal(userLimitBid.DebtToken.Amount) { err := k.CancelLimitAuctionBid(ctx, bidder, DebtTokenId, CollateralTokenId, PremiumDiscount) @@ -793,13 +612,31 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater } return nil } - err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, sdk.NewCoins(amount)) - if err != nil { - return err + + // return all the tokens back to the user + if userLimitBid.DebtToken.Amount.GT(sdk.ZeroInt()) { + feesToBecollected := auctionParams.WithdrawalFee.Mul(sdk.NewDecFromInt(amount.Amount)).TruncateInt() + userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(feesToBecollected) + + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, sdk.NewCoins(amount)) + if err != nil { + return err + } + //updating fees in auction data + feeData, found := k.GetAuctionLimitBidFeeData(ctx, DebtTokenId) + if !found { + var feeData types.AuctionFeesCollectionFromLimitBidTx + feeData.AssetId = DebtTokenId + feeData.Amount = feesToBecollected + } else { + feeData.Amount = feeData.Amount.Add(feesToBecollected) + } + k.SetAuctionLimitBidFeeData(ctx, feeData) } + + userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(amount.Amount) k.SetUserLimitBidData(ctx, userLimitBid, DebtTokenId, CollateralTokenId, PremiumDiscount) - k.AppendUserLimitBidDataForAddress(ctx, userLimitBid, true) return nil } @@ -820,26 +657,26 @@ func (k Keeper) SetUserLimitBidDataForAddress(ctx sdk.Context, userLimitBidData store.Set(key, value) } -func (k Keeper) AppendUserLimitBidDataForAddress(ctx sdk.Context, userLimitBid types.LimitOrderBid, inc bool) { - userLimitBidForAddress, found := k.GetUserLimitBidDataForAddress(ctx, userLimitBid.BidderAddress) - if inc { +func (k Keeper) UpdateUserLimitBidDataForAddress(ctx sdk.Context, userLimitBid types.LimitOrderBid, changeType bool) { + userLimitBidForAddress, found := k.GetUserLimitBidDataByAddress(ctx, userLimitBid.BidderAddress) + + if changeType { if !found { userLimitBidForAddress.BidderAddress = userLimitBid.BidderAddress - userLimitBidForAddress.LimitOrderBid = append(userLimitBidForAddress.LimitOrderBid, userLimitBid) - } else { - for _, individualLimitOrderBid := range userLimitBidForAddress.LimitOrderBid { - if individualLimitOrderBid.LimitOrderBiddingId == userLimitBid.LimitOrderBiddingId { - individualLimitOrderBid = userLimitBid - } - } + var userLimitBidSecondaryKey types.LimitOrderUserKey + userLimitBidSecondaryKey.CollateralTokenId = userLimitBid.CollateralTokenId + userLimitBidSecondaryKey.DebtTokenId = userLimitBid.DebtTokenId + userLimitBidSecondaryKey.PremiumDiscount = userLimitBid.PremiumDiscount + userLimitBidSecondaryKey.LimitOrderBiddingId = userLimitBid.LimitOrderBiddingId + userLimitBidForAddress.LimitOrderBidKey = append(userLimitBidForAddress.LimitOrderBidKey, userLimitBidSecondaryKey) } } else { if !found { userLimitBidForAddress.BidderAddress = userLimitBid.BidderAddress } else { - for index, individualLimitOrderBid := range userLimitBidForAddress.LimitOrderBid { + for index, individualLimitOrderBid := range userLimitBidForAddress.LimitOrderBidKey { if individualLimitOrderBid.LimitOrderBiddingId == userLimitBid.LimitOrderBiddingId { - userLimitBidForAddress.LimitOrderBid = append(userLimitBidForAddress.LimitOrderBid[:index], userLimitBidForAddress.LimitOrderBid[index+1:]...) + userLimitBidForAddress.LimitOrderBidKey = append(userLimitBidForAddress.LimitOrderBidKey[:index], userLimitBidForAddress.LimitOrderBidKey[index+1:]...) } } } @@ -848,7 +685,7 @@ func (k Keeper) AppendUserLimitBidDataForAddress(ctx sdk.Context, userLimitBid t k.SetUserLimitBidDataForAddress(ctx, userLimitBidForAddress) } -func (k Keeper) GetUserLimitBidDataForAddress(ctx sdk.Context, address string) (mappingData types.LimitOrderBidsForUser, found bool) { +func (k Keeper) GetUserLimitBidDataByAddress(ctx sdk.Context, address string) (mappingData types.LimitOrderBidsForUser, found bool) { var ( store = k.Store(ctx) key = types.UserLimitBidKeyForAddress(address) diff --git a/x/auctionsV2/keeper/msg_server.go b/x/auctionsV2/keeper/msg_server.go index 5e7e7c381..088650041 100644 --- a/x/auctionsV2/keeper/msg_server.go +++ b/x/auctionsV2/keeper/msg_server.go @@ -34,7 +34,7 @@ func (k msgServer) MsgPlaceMarketBid(goCtx context.Context, msg *types.MsgPlaceM //If true triggering Dutch Auction Bid Request if auctionData.AuctionType { - _, err = k.PlaceDutchAuctionBid(ctx, msg.AuctionId, bidder, msg.Amount, auctionData,false) + _, err = k.PlaceDutchAuctionBid(ctx, msg.AuctionId, bidder.String(), msg.Amount, auctionData, false) if err != nil { return nil, err } diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go index 39e2e1d52..b79ff4bb7 100644 --- a/x/auctionsV2/keeper/utils.go +++ b/x/auctionsV2/keeper/utils.go @@ -76,6 +76,33 @@ func (k Keeper) SetAuction(ctx sdk.Context, auction types.Auction) error { store.Set(key, value) return nil } + +func (k Keeper) SetAuctionLimitBidFeeData(ctx sdk.Context, feeData types.AuctionFeesCollectionFromLimitBidTx) error { + + var ( + store = k.Store(ctx) + key = types.AuctionLimitBidFeeKey(feeData.AssetId) + value = k.cdc.MustMarshal(&feeData) + ) + + store.Set(key, value) + return nil +} +func (k Keeper) GetAuctionLimitBidFeeData(ctx sdk.Context, assetId uint64) (feeData types.AuctionFeesCollectionFromLimitBidTx, found bool) { + var ( + store = k.Store(ctx) + key = types.AuctionLimitBidFeeKey(assetId) + value = store.Get(key) + ) + + if value == nil { + return feeData, false + } + + k.cdc.MustUnmarshal(value, &feeData) + return feeData, true +} + func (k Keeper) SetAuctionHistorical(ctx sdk.Context, auction types.AuctionHistorical) error { var ( diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index 6cd3e47c6..145869867 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -132,10 +132,11 @@ func (m *Bid) GetBidType() string { type LimitOrderBid struct { LimitOrderBiddingId uint64 `protobuf:"varint,1,opt,name=limit_order_bidding_id,json=limitOrderBiddingId,proto3" json:"limit_order_bidding_id,omitempty" yaml:"limit_order_bidding_id"` BidderAddress string `protobuf:"bytes,2,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` - CollateralToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=collateral_token,json=collateralToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token" yaml:"outflow_token"` - DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"debt_token"` - BiddingId []uint64 `protobuf:"varint,5,rep,packed,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` - PremiumDiscount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"premium_discount" yaml:"premium_discount"` + CollateralTokenId uint64 `protobuf:"varint,3,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty" yaml:"collateral_token_id"` + PremiumDiscount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"premium_discount" yaml:"premium_discount"` + DebtTokenId uint64 `protobuf:"varint,5,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty" yaml:"debt_token_id"` + DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,6,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"debt_token"` + BiddingId []uint64 `protobuf:"varint,7,rep,packed,name=bidding_id,json=biddingId,proto3" json:"bidding_id,omitempty" yaml:"bidding_id"` } func (m *LimitOrderBid) Reset() { *m = LimitOrderBid{} } @@ -185,11 +186,18 @@ func (m *LimitOrderBid) GetBidderAddress() string { return "" } -func (m *LimitOrderBid) GetCollateralToken() github_com_cosmos_cosmos_sdk_types.Coin { +func (m *LimitOrderBid) GetCollateralTokenId() uint64 { if m != nil { - return m.CollateralToken + return m.CollateralTokenId } - return github_com_cosmos_cosmos_sdk_types.Coin{} + return 0 +} + +func (m *LimitOrderBid) GetDebtTokenId() uint64 { + if m != nil { + return m.DebtTokenId + } + return 0 } func (m *LimitOrderBid) GetDebtToken() github_com_cosmos_cosmos_sdk_types.Coin { @@ -213,6 +221,9 @@ type AuctionParams struct { ClosingFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=closing_fee,json=closingFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"closing_fee" yaml:"closing_fee"` MinUsdValueLeft uint64 `protobuf:"varint,5,opt,name=min_usd_value_left,json=minUsdValueLeft,proto3" json:"min_usd_value_left,omitempty" yaml:"min_usd_value_left"` BidFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=bid_factor,json=bidFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bid_factor" yaml:"bid_factor"` + //For external apps + LiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=liquidation_penalty,json=liquidationPenalty,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_penalty" yaml:"liquidation_penalty"` + AuctionBonus github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=auction_bonus,json=auctionBonus,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"auction_bonus" yaml:"auction_bonus"` } func (m *AuctionParams) Reset() { *m = AuctionParams{} } @@ -263,8 +274,8 @@ func (m *AuctionParams) GetMinUsdValueLeft() uint64 { } type LimitOrderBidsForUser struct { - BidderAddress string `protobuf:"bytes,1,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` - LimitOrderBid []LimitOrderBid `protobuf:"bytes,2,rep,name=limit_order_bid,json=limitOrderBid,proto3" json:"limit_order_bid" yaml:"limit_order_bid"` + BidderAddress string `protobuf:"bytes,1,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" yaml:"bidder"` + LimitOrderBidKey []LimitOrderUserKey `protobuf:"bytes,2,rep,name=limit_order_bid_key,json=limitOrderBidKey,proto3" json:"limit_order_bid_key" yaml:"limit_order_bid_key"` } func (m *LimitOrderBidsForUser) Reset() { *m = LimitOrderBidsForUser{} } @@ -307,18 +318,126 @@ func (m *LimitOrderBidsForUser) GetBidderAddress() string { return "" } -func (m *LimitOrderBidsForUser) GetLimitOrderBid() []LimitOrderBid { +func (m *LimitOrderBidsForUser) GetLimitOrderBidKey() []LimitOrderUserKey { if m != nil { - return m.LimitOrderBid + return m.LimitOrderBidKey } return nil } +type LimitOrderUserKey struct { + DebtTokenId uint64 `protobuf:"varint,1,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty" yaml:"debt_token_id"` + CollateralTokenId uint64 `protobuf:"varint,2,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty" yaml:"collateral_token_id"` + PremiumDiscount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"premium_discount" yaml:"premium_discount"` + LimitOrderBiddingId uint64 `protobuf:"varint,4,opt,name=limit_order_bidding_id,json=limitOrderBiddingId,proto3" json:"limit_order_bidding_id,omitempty" yaml:"limit_order_bidding_id"` +} + +func (m *LimitOrderUserKey) Reset() { *m = LimitOrderUserKey{} } +func (m *LimitOrderUserKey) String() string { return proto.CompactTextString(m) } +func (*LimitOrderUserKey) ProtoMessage() {} +func (*LimitOrderUserKey) Descriptor() ([]byte, []int) { + return fileDescriptor_6f6db8f3a6a396ec, []int{4} +} +func (m *LimitOrderUserKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LimitOrderUserKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LimitOrderUserKey.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LimitOrderUserKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_LimitOrderUserKey.Merge(m, src) +} +func (m *LimitOrderUserKey) XXX_Size() int { + return m.Size() +} +func (m *LimitOrderUserKey) XXX_DiscardUnknown() { + xxx_messageInfo_LimitOrderUserKey.DiscardUnknown(m) +} + +var xxx_messageInfo_LimitOrderUserKey proto.InternalMessageInfo + +func (m *LimitOrderUserKey) GetDebtTokenId() uint64 { + if m != nil { + return m.DebtTokenId + } + return 0 +} + +func (m *LimitOrderUserKey) GetCollateralTokenId() uint64 { + if m != nil { + return m.CollateralTokenId + } + return 0 +} + +func (m *LimitOrderUserKey) GetLimitOrderBiddingId() uint64 { + if m != nil { + return m.LimitOrderBiddingId + } + return 0 +} + +type AuctionFeesCollectionFromLimitBidTx struct { + AssetId uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty" yaml:"asset_id"` + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount" yaml:"amount"` +} + +func (m *AuctionFeesCollectionFromLimitBidTx) Reset() { *m = AuctionFeesCollectionFromLimitBidTx{} } +func (m *AuctionFeesCollectionFromLimitBidTx) String() string { return proto.CompactTextString(m) } +func (*AuctionFeesCollectionFromLimitBidTx) ProtoMessage() {} +func (*AuctionFeesCollectionFromLimitBidTx) Descriptor() ([]byte, []int) { + return fileDescriptor_6f6db8f3a6a396ec, []int{5} +} +func (m *AuctionFeesCollectionFromLimitBidTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuctionFeesCollectionFromLimitBidTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuctionFeesCollectionFromLimitBidTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AuctionFeesCollectionFromLimitBidTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuctionFeesCollectionFromLimitBidTx.Merge(m, src) +} +func (m *AuctionFeesCollectionFromLimitBidTx) XXX_Size() int { + return m.Size() +} +func (m *AuctionFeesCollectionFromLimitBidTx) XXX_DiscardUnknown() { + xxx_messageInfo_AuctionFeesCollectionFromLimitBidTx.DiscardUnknown(m) +} + +var xxx_messageInfo_AuctionFeesCollectionFromLimitBidTx proto.InternalMessageInfo + +func (m *AuctionFeesCollectionFromLimitBidTx) GetAssetId() uint64 { + if m != nil { + return m.AssetId + } + return 0 +} + func init() { proto.RegisterType((*Bid)(nil), "comdex.auctionsV2.v1beta1.Bid") proto.RegisterType((*LimitOrderBid)(nil), "comdex.auctionsV2.v1beta1.LimitOrderBid") proto.RegisterType((*AuctionParams)(nil), "comdex.auctionsV2.v1beta1.AuctionParams") proto.RegisterType((*LimitOrderBidsForUser)(nil), "comdex.auctionsV2.v1beta1.LimitOrderBidsForUser") + proto.RegisterType((*LimitOrderUserKey)(nil), "comdex.auctionsV2.v1beta1.LimitOrderUserKey") + proto.RegisterType((*AuctionFeesCollectionFromLimitBidTx)(nil), "comdex.auctionsV2.v1beta1.AuctionFeesCollectionFromLimitBidTx") } func init() { @@ -326,65 +445,77 @@ func init() { } var fileDescriptor_6f6db8f3a6a396ec = []byte{ - // 915 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcf, 0x6e, 0x1b, 0x45, - 0x18, 0xcf, 0x26, 0x4e, 0x5a, 0x4f, 0xe4, 0x3a, 0xd9, 0x36, 0xa9, 0x13, 0x54, 0xaf, 0x99, 0x22, - 0xf0, 0xa5, 0xbb, 0x6a, 0xe8, 0x01, 0x21, 0x71, 0x88, 0x6b, 0x05, 0x05, 0x95, 0x02, 0x4b, 0x9a, - 0x03, 0x12, 0x5a, 0xcd, 0xee, 0x8c, 0xdd, 0x51, 0x77, 0x77, 0x56, 0x3b, 0xb3, 0x0d, 0xbd, 0xf0, - 0x06, 0x48, 0x3d, 0xf0, 0x02, 0x3c, 0x01, 0x0f, 0xc1, 0x25, 0xc7, 0x1e, 0x11, 0x12, 0x0b, 0x4a, - 0xde, 0xc0, 0x47, 0x4e, 0x68, 0xfe, 0xd8, 0x9b, 0x75, 0x82, 0x12, 0x8b, 0x93, 0x67, 0xbe, 0x3f, - 0xbf, 0xef, 0x37, 0xdf, 0xfc, 0xe6, 0xf3, 0x82, 0x87, 0x11, 0x4b, 0x30, 0xf9, 0xc1, 0x43, 0x45, - 0x24, 0x28, 0x4b, 0xf9, 0xf1, 0x9e, 0xf7, 0xfa, 0x71, 0x48, 0x04, 0x7a, 0xec, 0x85, 0x14, 0xbb, - 0x59, 0xce, 0x04, 0xb3, 0x77, 0x74, 0x90, 0x5b, 0x05, 0x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xbb, 0xf3, 0xee, 0xd2, 0xef, 0xe7, 0xdd, 0xa5, 0xef, 0x9e, 0xd4, 0xfa, 0x24, - 0x8b, 0x3f, 0x62, 0xa3, 0x11, 0x8d, 0x28, 0x8a, 0xcd, 0xde, 0xab, 0x7d, 0xf0, 0xa8, 0xce, 0x85, - 0x6b, 0xea, 0x6f, 0xe6, 0xe3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x8d, 0x6d, 0x8c, 0x12, - 0x09, 0x00, 0x00, + // 1117 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x41, 0x6f, 0xe3, 0x44, + 0x14, 0xae, 0xdb, 0xb4, 0xdd, 0x4c, 0xc9, 0xb6, 0x71, 0xdb, 0xdd, 0xb4, 0x68, 0xe3, 0x32, 0x45, + 0xd0, 0x03, 0xeb, 0x68, 0xcb, 0x1e, 0x10, 0x02, 0xa1, 0xba, 0x55, 0x50, 0xd8, 0x52, 0x16, 0xd3, + 0x2d, 0x12, 0x12, 0xb2, 0x6c, 0xcf, 0x24, 0x3b, 0xaa, 0xed, 0x09, 0x9e, 0xf1, 0x76, 0x73, 0x00, + 0xfe, 0xc2, 0x1e, 0xf8, 0x03, 0xfc, 0x01, 0xb8, 0xf0, 0x23, 0xf6, 0xb8, 0xe2, 0x84, 0x40, 0x32, + 0xa8, 0xfd, 0x01, 0x48, 0x39, 0x72, 0x42, 0x9e, 0x99, 0xc4, 0x71, 0xd2, 0x42, 0xa3, 0x85, 0x53, + 0x66, 0xde, 0x7b, 0xf3, 0xbd, 0xe7, 0x37, 0xdf, 0x7c, 0x33, 0x01, 0xdb, 0x3e, 0x0d, 0x11, 0x7e, + 0xda, 0x70, 0x13, 0x9f, 0x13, 0x1a, 0xb1, 0x93, 0xdd, 0xc6, 0x93, 0x7b, 0x1e, 0xe6, 0xee, 0xbd, + 0x86, 0x47, 0x90, 0x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xbd, 0x19, 0xbc, 0x5d, 0xe4, 0x1b, 0xce, 0x56, 0x70, 0xd6, 0xd1, 0xf3, 0xf3, + 0xba, 0xf6, 0xe2, 0xbc, 0xae, 0xfd, 0x71, 0x5e, 0xd7, 0x9e, 0x5d, 0xd4, 0x67, 0x5e, 0x5c, 0xd4, + 0x67, 0x7e, 0xb9, 0xa8, 0xcf, 0x7c, 0x71, 0xbf, 0x00, 0x9d, 0x51, 0xf5, 0x2e, 0x6d, 0xb7, 0x89, + 0x4f, 0xdc, 0x40, 0xcd, 0x1b, 0x85, 0x3f, 0x03, 0x22, 0x99, 0xb7, 0x20, 0x9e, 0x60, 0x6f, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0xff, 0x24, 0x38, 0x09, 0x3e, 0x2e, 0x0c, 0x00, 0x00, } func (m *Bid) Marshal() (dAtA []byte, err error) { @@ -487,16 +618,6 @@ func (m *LimitOrderBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size := m.PremiumDiscount.Size() - i -= size - if _, err := m.PremiumDiscount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBid(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 if len(m.BiddingId) > 0 { dAtA5 := make([]byte, len(m.BiddingId)*10) var j4 int @@ -513,7 +634,7 @@ func (m *LimitOrderBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], dAtA5[:j4]) i = encodeVarintBid(dAtA, i, uint64(j4)) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x3a } { size, err := m.DebtToken.MarshalToSizedBuffer(dAtA[:i]) @@ -524,17 +645,27 @@ func (m *LimitOrderBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBid(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x32 + if m.DebtTokenId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.DebtTokenId)) + i-- + dAtA[i] = 0x28 + } { - size, err := m.CollateralToken.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { + size := m.PremiumDiscount.Size() + i -= size + if _, err := m.PremiumDiscount.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size i = encodeVarintBid(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 + if m.CollateralTokenId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.CollateralTokenId)) + i-- + dAtA[i] = 0x18 + } if len(m.BidderAddress) > 0 { i -= len(m.BidderAddress) copy(dAtA[i:], m.BidderAddress) @@ -570,6 +701,26 @@ func (m *AuctionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.AuctionBonus.Size() + i -= size + if _, err := m.AuctionBonus.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size := m.LiquidationPenalty.Size() + i -= size + if _, err := m.LiquidationPenalty.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a { size := m.BidFactor.Size() i -= size @@ -643,10 +794,10 @@ func (m *LimitOrderBidsForUser) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.LimitOrderBid) > 0 { - for iNdEx := len(m.LimitOrderBid) - 1; iNdEx >= 0; iNdEx-- { + if len(m.LimitOrderBidKey) > 0 { + for iNdEx := len(m.LimitOrderBidKey) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.LimitOrderBid[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.LimitOrderBidKey[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -667,6 +818,92 @@ func (m *LimitOrderBidsForUser) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *LimitOrderUserKey) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LimitOrderUserKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LimitOrderUserKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LimitOrderBiddingId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.LimitOrderBiddingId)) + i-- + dAtA[i] = 0x20 + } + { + size := m.PremiumDiscount.Size() + i -= size + if _, err := m.PremiumDiscount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.CollateralTokenId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.CollateralTokenId)) + i-- + dAtA[i] = 0x10 + } + if m.DebtTokenId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.DebtTokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AuctionFeesCollectionFromLimitBidTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AuctionFeesCollectionFromLimitBidTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuctionFeesCollectionFromLimitBidTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.AssetId != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.AssetId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintBid(dAtA []byte, offset int, v uint64) int { offset -= sovBid(v) base := offset @@ -723,8 +960,14 @@ func (m *LimitOrderBid) Size() (n int) { if l > 0 { n += 1 + l + sovBid(uint64(l)) } - l = m.CollateralToken.Size() + if m.CollateralTokenId != 0 { + n += 1 + sovBid(uint64(m.CollateralTokenId)) + } + l = m.PremiumDiscount.Size() n += 1 + l + sovBid(uint64(l)) + if m.DebtTokenId != 0 { + n += 1 + sovBid(uint64(m.DebtTokenId)) + } l = m.DebtToken.Size() n += 1 + l + sovBid(uint64(l)) if len(m.BiddingId) > 0 { @@ -734,8 +977,6 @@ func (m *LimitOrderBid) Size() (n int) { } n += 1 + sovBid(uint64(l)) + l } - l = m.PremiumDiscount.Size() - n += 1 + l + sovBid(uint64(l)) return n } @@ -759,6 +1000,10 @@ func (m *AuctionParams) Size() (n int) { } l = m.BidFactor.Size() n += 1 + l + sovBid(uint64(l)) + l = m.LiquidationPenalty.Size() + n += 1 + l + sovBid(uint64(l)) + l = m.AuctionBonus.Size() + n += 1 + l + sovBid(uint64(l)) return n } @@ -772,8 +1017,8 @@ func (m *LimitOrderBidsForUser) Size() (n int) { if l > 0 { n += 1 + l + sovBid(uint64(l)) } - if len(m.LimitOrderBid) > 0 { - for _, e := range m.LimitOrderBid { + if len(m.LimitOrderBidKey) > 0 { + for _, e := range m.LimitOrderBidKey { l = e.Size() n += 1 + l + sovBid(uint64(l)) } @@ -781,6 +1026,40 @@ func (m *LimitOrderBidsForUser) Size() (n int) { return n } +func (m *LimitOrderUserKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DebtTokenId != 0 { + n += 1 + sovBid(uint64(m.DebtTokenId)) + } + if m.CollateralTokenId != 0 { + n += 1 + sovBid(uint64(m.CollateralTokenId)) + } + l = m.PremiumDiscount.Size() + n += 1 + l + sovBid(uint64(l)) + if m.LimitOrderBiddingId != 0 { + n += 1 + sovBid(uint64(m.LimitOrderBiddingId)) + } + return n +} + +func (m *AuctionFeesCollectionFromLimitBidTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AssetId != 0 { + n += 1 + sovBid(uint64(m.AssetId)) + } + l = m.Amount.Size() + n += 1 + l + sovBid(uint64(l)) + return n +} + func sovBid(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1138,10 +1417,10 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { m.BidderAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CollateralToken", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenId", wireType) } - var msglen int + m.CollateralTokenId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBid @@ -1151,30 +1430,16 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.CollateralTokenId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthBid - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBid - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CollateralToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DebtToken", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PremiumDiscount", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowBid @@ -1184,40 +1449,93 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthBid } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthBid } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.DebtToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.PremiumDiscount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBid - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenId", wireType) + } + m.DebtTokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DebtTokenId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtToken", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBid + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DebtToken.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break } } m.BiddingId = append(m.BiddingId, v) @@ -1279,40 +1597,6 @@ func (m *LimitOrderBid) Unmarshal(dAtA []byte) error { } else { return fmt.Errorf("proto: wrong wireType = %d for field BiddingId", wireType) } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PremiumDiscount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBid - } - 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 ErrInvalidLengthBid - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBid - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PremiumDiscount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipBid(dAtA[iNdEx:]) @@ -1537,6 +1821,74 @@ func (m *AuctionParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidationPenalty", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LiquidationPenalty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionBonus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AuctionBonus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipBid(dAtA[iNdEx:]) @@ -1621,7 +1973,7 @@ func (m *LimitOrderBidsForUser) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderBid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderBidKey", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1648,8 +2000,252 @@ func (m *LimitOrderBidsForUser) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.LimitOrderBid = append(m.LimitOrderBid, LimitOrderBid{}) - if err := m.LimitOrderBid[len(m.LimitOrderBid)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.LimitOrderBidKey = append(m.LimitOrderBidKey, LimitOrderUserKey{}) + if err := m.LimitOrderBidKey[len(m.LimitOrderBidKey)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBid(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBid + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LimitOrderUserKey) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LimitOrderUserKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LimitOrderUserKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenId", wireType) + } + m.DebtTokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DebtTokenId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenId", wireType) + } + m.CollateralTokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CollateralTokenId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PremiumDiscount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PremiumDiscount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderBiddingId", wireType) + } + m.LimitOrderBiddingId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LimitOrderBiddingId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipBid(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBid + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AuctionFeesCollectionFromLimitBidTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AuctionFeesCollectionFromLimitBidTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuctionFeesCollectionFromLimitBidTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + m.AssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + 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 ErrInvalidLengthBid + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index 5d168d1e0..e382d60db 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -15,5 +15,6 @@ var ( ErrBidCannotBeZero = sdkerrors.Register(ModuleName, 705, "Bid amount can't be Zero") ErrorLowBidAmount = sdkerrors.Register(ModuleName, 706, "bidding amount is lower than expected") ErrorMaxBidAmount = sdkerrors.Register(ModuleName, 707, "bidding amount is greater than maximum bidding amount") - ErrLiquidationNotFound=sdkerrors.Register(ModuleName, 708, "Liquidation data not found for the auction") + ErrLiquidationNotFound = sdkerrors.Register(ModuleName, 708, "Liquidation data not found for the auction") + ErrBidNotFound = sdkerrors.Register(ModuleName, 709, "There exists no active bid for the user with given params") ) diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index 3e16ccb2c..4cce649b0 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -35,11 +35,15 @@ var ( AuctionHistoricalKeyPrefix = []byte{0x07} UserLimitBidMappingKeyPrefix = []byte{0x08} UserLimitBidMappingKeyForAddressPrefix = []byte{0x09} + AuctionLimitBidFeeKeyPrefix = []byte{0x10} ) func AuctionKey(auctionID uint64) []byte { return append(append(AuctionKeyPrefix, sdk.Uint64ToBigEndian(auctionID)...)) } +func AuctionLimitBidFeeKey(assetID uint64) []byte { + return append(append(AuctionLimitBidFeeKeyPrefix, sdk.Uint64ToBigEndian(assetID)...)) +} func AuctionHistoricalKey(auctionID uint64) []byte { return append(append(AuctionHistoricalKeyPrefix, sdk.Uint64ToBigEndian(auctionID)...)) } @@ -48,12 +52,12 @@ func UserBidKey(userBidId uint64) []byte { return append(append(UserBidKeyPrefix, sdk.Uint64ToBigEndian(userBidId)...)) } -func UserLimitBidKey(debtTokenID, collateralTokenID uint64, premium, address string) []byte { - return append(append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), premium...), address...) +func UserLimitBidKey(debtTokenID, collateralTokenID uint64, premium sdk.Int, address string) []byte { + return append(append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), sdk.Uint64ToBigEndian((premium.Uint64()))...), address...) } -func UserLimitBidKeyForPremium(debtTokenID, collateralTokenID uint64, premium string) []byte { - return append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), premium...) +func UserLimitBidKeyForPremium(debtTokenID, collateralTokenID uint64, premium sdk.Int) []byte { + return append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), sdk.Uint64ToBigEndian((premium.Uint64()))...) } func UserLimitBidKeyForAddress(address string) []byte { diff --git a/x/auctionsV2/types/tx.pb.go b/x/auctionsV2/types/tx.pb.go index 330975d1b..206ec8877 100644 --- a/x/auctionsV2/types/tx.pb.go +++ b/x/auctionsV2/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -105,11 +106,11 @@ func (m *MsgPlaceMarketBidResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgPlaceMarketBidResponse proto.InternalMessageInfo type MsgDepositLimitBidRequest struct { - CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` - DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` - PremiumDiscount string `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3" json:"premium_discount,omitempty"` - Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` - Amount types.Coin `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount"` + CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` + DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` + PremiumDiscount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"premium_discount" yaml:"premium_discount"` + Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` + Amount types.Coin `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount"` } func (m *MsgDepositLimitBidRequest) Reset() { *m = MsgDepositLimitBidRequest{} } @@ -182,10 +183,10 @@ func (m *MsgDepositLimitBidResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDepositLimitBidResponse proto.InternalMessageInfo type MsgCancelLimitBidRequest struct { - CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` - DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` - PremiumDiscount string `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3" json:"premium_discount,omitempty"` - Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` + CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` + DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` + PremiumDiscount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"premium_discount" yaml:"premium_discount"` + Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` } func (m *MsgCancelLimitBidRequest) Reset() { *m = MsgCancelLimitBidRequest{} } @@ -258,11 +259,11 @@ func (m *MsgCancelLimitBidResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCancelLimitBidResponse proto.InternalMessageInfo type MsgWithdrawLimitBidRequest struct { - CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` - DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` - PremiumDiscount string `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3" json:"premium_discount,omitempty"` - Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` - Amount types.Coin `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount"` + CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` + DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` + PremiumDiscount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=premium_discount,json=premiumDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"premium_discount" yaml:"premium_discount"` + Bidder string `protobuf:"bytes,4,opt,name=bidder,proto3" json:"bidder,omitempty"` + Amount types.Coin `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount"` } func (m *MsgWithdrawLimitBidRequest) Reset() { *m = MsgWithdrawLimitBidRequest{} } @@ -350,40 +351,43 @@ func init() { } var fileDescriptor_2c216a24ef98c1b4 = []byte{ - // 523 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x55, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0x8e, 0xb7, 0x32, 0xa9, 0x9e, 0x10, 0xcc, 0x43, 0xa8, 0xcd, 0x58, 0xa8, 0x72, 0x2a, 0x07, - 0x12, 0xad, 0x1b, 0x70, 0xef, 0x76, 0x99, 0x44, 0x25, 0x14, 0xa1, 0x21, 0x71, 0xa9, 0x1c, 0xdb, - 0xcb, 0xac, 0x25, 0x71, 0x88, 0x1d, 0x18, 0x17, 0x24, 0x24, 0x4e, 0x9c, 0xf6, 0x33, 0xb8, 0xf2, - 0x2f, 0x7a, 0xdc, 0x91, 0x13, 0x82, 0xf6, 0x08, 0x3f, 0x02, 0x25, 0xf6, 0xd6, 0x8e, 0xa5, 0xaa, - 0x7a, 0x84, 0x5b, 0xfc, 0xde, 0xf7, 0x9e, 0xbf, 0xf7, 0xbd, 0xf7, 0x62, 0xe8, 0x12, 0x91, 0x50, - 0x76, 0xe6, 0xe3, 0x82, 0x28, 0x2e, 0x52, 0x79, 0xd4, 0xf3, 0xdf, 0xee, 0x84, 0x4c, 0xe1, 0x1d, - 0x5f, 0x9d, 0x79, 0x59, 0x2e, 0x94, 0x40, 0x6d, 0x8d, 0xf1, 0xa6, 0x18, 0xcf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x63, 0x71, 0x7c, 0xcc, 0x09, 0xc7, 0xb1, 0x39, - 0xfb, 0xd7, 0xde, 0x16, 0xf5, 0x3e, 0x63, 0x32, 0x5c, 0xab, 0x9e, 0x81, 0xdd, 0x3f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0xae, 0xb8, 0xda, 0xe7, 0x7d, 0x06, 0x00, 0x00, + // 568 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0x93, 0xae, 0x54, 0xaa, 0x27, 0x04, 0xf3, 0x10, 0xb4, 0x19, 0x4b, 0xab, 0x1c, 0x50, + 0x2f, 0x73, 0xb4, 0x6e, 0x80, 0xc4, 0xb1, 0xdb, 0xa5, 0x12, 0x95, 0x50, 0x85, 0x86, 0xc4, 0xa5, + 0x72, 0x62, 0xaf, 0xb3, 0x9a, 0xc4, 0x25, 0x76, 0x61, 0xbb, 0x20, 0x21, 0x71, 0xe2, 0xb4, 0x8f, + 0xc1, 0x27, 0x80, 0xaf, 0xd0, 0xe3, 0x8e, 0x88, 0x43, 0x05, 0xed, 0x37, 0xe0, 0xcc, 0x01, 0x25, + 0xf6, 0xd6, 0x76, 0x4b, 0x55, 0x7a, 0x86, 0x53, 0x9b, 0xf7, 0xfe, 0xcf, 0xf9, 0xfb, 0x97, 0xf7, + 0x6c, 0xe0, 0xf8, 0x3c, 0x24, 0xf4, 0xd4, 0xc5, 0x03, 0x5f, 0x32, 0x1e, 0x89, 0xa3, 0xba, 0xfb, + 0x76, 0xd7, 0xa3, 0x12, 0xef, 0xba, 0xf2, 0x14, 0xf5, 0x63, 0x2e, 0x39, 0x2c, 0x2b, 0x0d, 0x9a, + 0x6a, 0x90, 0xd6, 0x58, 0xf7, 0xba, 0xbc, 0xcb, 0x53, 0x95, 0x9b, 0xfc, 0x53, 0x05, 0x96, 0xed, + 0x73, 0x11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, 0xe6, 0xc5, + 0xd8, 0x36, 0x7f, 0x8c, 0x6d, 0xf3, 0x7c, 0x62, 0x1b, 0x17, 0x13, 0xdb, 0xf8, 0x36, 0xb1, 0x8d, + 0xd7, 0xfb, 0x73, 0x8d, 0x9f, 0xbc, 0x63, 0x87, 0x1f, 0x1f, 0x33, 0x9f, 0xe1, 0x40, 0x3f, 0xbb, + 0x73, 0x97, 0x67, 0x3a, 0x0a, 0x5e, 0x21, 0xbd, 0xe7, 0xf6, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, + 0xba, 0xe5, 0xa9, 0x6c, 0x5e, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -679,13 +683,16 @@ func (m *MsgDepositLimitBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, erro i-- dAtA[i] = 0x22 } - if len(m.PremiumDiscount) > 0 { - i -= len(m.PremiumDiscount) - copy(dAtA[i:], m.PremiumDiscount) - i = encodeVarintTx(dAtA, i, uint64(len(m.PremiumDiscount))) - i-- - dAtA[i] = 0x1a + { + size := m.PremiumDiscount.Size() + i -= size + if _, err := m.PremiumDiscount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a if m.DebtTokenId != 0 { i = encodeVarintTx(dAtA, i, uint64(m.DebtTokenId)) i-- @@ -749,13 +756,16 @@ func (m *MsgCancelLimitBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error i-- dAtA[i] = 0x22 } - if len(m.PremiumDiscount) > 0 { - i -= len(m.PremiumDiscount) - copy(dAtA[i:], m.PremiumDiscount) - i = encodeVarintTx(dAtA, i, uint64(len(m.PremiumDiscount))) - i-- - dAtA[i] = 0x1a + { + size := m.PremiumDiscount.Size() + i -= size + if _, err := m.PremiumDiscount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a if m.DebtTokenId != 0 { i = encodeVarintTx(dAtA, i, uint64(m.DebtTokenId)) i-- @@ -829,13 +839,16 @@ func (m *MsgWithdrawLimitBidRequest) MarshalToSizedBuffer(dAtA []byte) (int, err i-- dAtA[i] = 0x22 } - if len(m.PremiumDiscount) > 0 { - i -= len(m.PremiumDiscount) - copy(dAtA[i:], m.PremiumDiscount) - i = encodeVarintTx(dAtA, i, uint64(len(m.PremiumDiscount))) - i-- - dAtA[i] = 0x1a + { + size := m.PremiumDiscount.Size() + i -= size + if _, err := m.PremiumDiscount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a if m.DebtTokenId != 0 { i = encodeVarintTx(dAtA, i, uint64(m.DebtTokenId)) i-- @@ -922,10 +935,8 @@ func (m *MsgDepositLimitBidRequest) Size() (n int) { if m.DebtTokenId != 0 { n += 1 + sovTx(uint64(m.DebtTokenId)) } - l = len(m.PremiumDiscount) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } + l = m.PremiumDiscount.Size() + n += 1 + l + sovTx(uint64(l)) l = len(m.Bidder) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -956,10 +967,8 @@ func (m *MsgCancelLimitBidRequest) Size() (n int) { if m.DebtTokenId != 0 { n += 1 + sovTx(uint64(m.DebtTokenId)) } - l = len(m.PremiumDiscount) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } + l = m.PremiumDiscount.Size() + n += 1 + l + sovTx(uint64(l)) l = len(m.Bidder) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -988,10 +997,8 @@ func (m *MsgWithdrawLimitBidRequest) Size() (n int) { if m.DebtTokenId != 0 { n += 1 + sovTx(uint64(m.DebtTokenId)) } - l = len(m.PremiumDiscount) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } + l = m.PremiumDiscount.Size() + n += 1 + l + sovTx(uint64(l)) l = len(m.Bidder) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -1297,7 +1304,9 @@ func (m *MsgDepositLimitBidRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PremiumDiscount = string(dAtA[iNdEx:postIndex]) + if err := m.PremiumDiscount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 4: if wireType != 2 { @@ -1532,7 +1541,9 @@ func (m *MsgCancelLimitBidRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PremiumDiscount = string(dAtA[iNdEx:postIndex]) + if err := m.PremiumDiscount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 4: if wireType != 2 { @@ -1734,7 +1745,9 @@ func (m *MsgWithdrawLimitBidRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PremiumDiscount = string(dAtA[iNdEx:postIndex]) + if err := m.PremiumDiscount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 4: if wireType != 2 { diff --git a/x/liquidationsV2/expected/keeper.go b/x/liquidationsV2/expected/keeper.go index 4a0a02a2b..9204d7e63 100644 --- a/x/liquidationsV2/expected/keeper.go +++ b/x/liquidationsV2/expected/keeper.go @@ -6,6 +6,7 @@ import ( esmtypes "github.com/comdex-official/comdex/x/esm/types" lendtypes "github.com/comdex-official/comdex/x/lend/types" liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" + auctiontypes "github.com/comdex-official/comdex/x/auctionsV2/types" markettypes "github.com/comdex-official/comdex/x/market/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" "github.com/comdex-official/comdex/x/vault/types" @@ -97,6 +98,7 @@ type RewardsKeeper interface { type AuctionsV2Keeper interface { AuctionActivator(ctx sdk.Context, lockedVault liquidationtypes.LockedVault) error + GetAuctionParams(ctx sdk.Context) (auctionParams auctiontypes.AuctionParams, found bool) } type CollectorKeeper interface { diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 9eda11395..96607b03c 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + assettypes "github.com/comdex-official/comdex/x/asset/types" lendtypes "github.com/comdex-official/comdex/x/lend/types" @@ -10,6 +11,7 @@ import ( auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" "github.com/comdex-official/comdex/x/liquidationsV2/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" + vaulttypes "github.com/comdex-official/comdex/x/vault/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -59,7 +61,7 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context, offsetCounterId uint64) error { for _, vault := range newVaults { _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { - err := k.LiquidateIndividualVault(ctx, vault.Id) + err := k.LiquidateIndividualVault(ctx, vault.Id, "", false) if err != nil { return fmt.Errorf(err.Error()) @@ -78,7 +80,7 @@ func (k Keeper) LiquidateVaults(ctx sdk.Context, offsetCounterId uint64) error { } -func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error { +func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64, liquidator string, isInternalkeeper bool) error { vault, found := k.vault.GetVault(ctx, vaultID) if !found { @@ -139,7 +141,13 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64) error } - err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), collateralizationRatio, vault.AppId, false, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "vault", whitelistingData.IsDutchActivated, isCMST, pair.AssetIn, pair.AssetOut) + if vault.AmountIn.GT(sdk.ZeroInt()) { + err := k.bank.SendCoinsFromModuleToModule(ctx, vaulttypes.ModuleName, auctionsV2types.ModuleName, sdk.NewCoins(k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn))) + if err != nil { + return fmt.Errorf("Error , not enough token in vault to transfer %d", vault.AmountIn) + } + } + err = k.CreateLockedVault(ctx, vault.Id, vault.ExtendedPairVaultID, vault.Owner, k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), k.ReturnCoin(ctx, pair.AssetIn, vault.AmountIn), k.ReturnCoin(ctx, pair.AssetOut, totalOut), collateralizationRatio, vault.AppId, isInternalkeeper, liquidator, "", feesToBeCollected, auctionBonusToBeGiven, "vault", whitelistingData.IsDutchActivated, isCMST, pair.AssetIn, pair.AssetOut) if err != nil { return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for Vault %d", vault.Id) } @@ -361,7 +369,7 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsse func (k Keeper) MsgLiquidate(ctx sdk.Context, liquidator string, liqType, id uint64) error { if liqType == 0 { - err := k.LiquidateIndividualVault(ctx, id) + err := k.LiquidateIndividualVault(ctx, id, liquidator, true) if err != nil { return err } @@ -586,10 +594,11 @@ func (k Keeper) GetAppReserveFundsTxData(ctx sdk.Context, appId uint64) (appRese return appReserveFundsTxData, true } -func (k Keeper) MsgLiquidateExternal(ctx sdk.Context, from string, appID uint64, owner string, collateralToken, debtToken sdk.Coin, liquidationFee, auctionBonus sdk.Dec, auctionType bool, collateralAssetId, debtAssetId uint64, initiatorType string) error { +func (k Keeper) MsgLiquidateExternal(ctx sdk.Context, from string, appID uint64, owner string, collateralToken, debtToken sdk.Coin, collateralAssetId, debtAssetId uint64, isDebtCmst bool) error { // check if the assets exists // check if reserve funds are added for the debt or not // send tokens from the liquidator's address to the auction module + auctionParams, _ := k.auctionsV2.GetAuctionParams(ctx) _, found := k.asset.GetAsset(ctx, collateralAssetId) if !found { @@ -605,16 +614,17 @@ func (k Keeper) MsgLiquidateExternal(ctx sdk.Context, from string, appID uint64, return fmt.Errorf("reserve funds not added for debt asset id") } - feeToBeCollected := sdk.NewDecFromInt(debtToken.Amount).Mul(liquidationFee).TruncateInt() + feeToBeCollected := sdk.NewDecFromInt(debtToken.Amount).Mul(auctionParams.LiquidationPenalty).TruncateInt() + feetoken := sdk.NewCoin(debtToken.Denom, feeToBeCollected) //Calculating auction bonus to be given - bonusToBeGiven := sdk.NewDecFromInt(debtToken.Amount).Mul(auctionBonus).TruncateInt() + bonusToBeGiven := sdk.NewDecFromInt(debtToken.Amount).Mul(auctionParams.AuctionBonus).TruncateInt() addr, err := sdk.AccAddressFromBech32(from) err = k.bank.SendCoinsFromAccountToModule(ctx, addr, auctionsV2types.ModuleName, sdk.NewCoins(collateralToken)) if err != nil { return err } - err = k.CreateLockedVault(ctx, 0, 0, owner, collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, false, "", from, feeToBeCollected, bonusToBeGiven, initiatorType, auctionType, false, collateralAssetId, debtAssetId) + err = k.CreateLockedVault(ctx, 0, 0, owner, collateralToken, debtToken, collateralToken, debtToken.Add(feetoken), sdk.ZeroDec(), appID, false, "", from, feeToBeCollected, bonusToBeGiven, "external", true, isDebtCmst, collateralAssetId, debtAssetId) if err != nil { return fmt.Errorf("error Creating Locked Vaults in Liquidation, liquidate_vaults.go for External liquidation ") } diff --git a/x/liquidationsV2/types/msg.go b/x/liquidationsV2/types/msg.go index d79514b85..5ec54ca2c 100644 --- a/x/liquidationsV2/types/msg.go +++ b/x/liquidationsV2/types/msg.go @@ -91,20 +91,17 @@ func NewMsgLiquidateExternalKeeperRequest( feeToBeCollected, bonusToBeGiven sdk.Dec, auctionType bool, collateralAssetId, debtAssetId uint64, - initiatorType string, + isDebtCmst bool, ) *MsgLiquidateExternalKeeperRequest { return &MsgLiquidateExternalKeeperRequest{ - From: from.String(), - AppId: appId, - Owner: owner, - CollateralToken: collateralToken, - DebtToken: debtToken, - FeeToBeCollected: feeToBeCollected, - BonusToBeGiven: bonusToBeGiven, - AuctionType: auctionType, + From: from.String(), + AppId: appId, + Owner: owner, + CollateralToken: collateralToken, + DebtToken: debtToken, CollateralAssetId: collateralAssetId, DebtAssetId: debtAssetId, - InitiatorType: initiatorType, + IsDebtCmst: isDebtCmst, } } diff --git a/x/liquidationsV2/types/tx.pb.go b/x/liquidationsV2/types/tx.pb.go index b63e9f843..f5667aa8c 100644 --- a/x/liquidationsV2/types/tx.pb.go +++ b/x/liquidationsV2/types/tx.pb.go @@ -188,12 +188,9 @@ type MsgLiquidateExternalKeeperRequest struct { Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` CollateralToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,4,opt,name=collateral_token,json=collateralToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"collateral_token" yaml:"collateral_token"` DebtToken github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=debt_token,json=debtToken,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"debt_token" yaml:"debt_token"` - FeeToBeCollected github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=fee_to_be_collected,json=feeToBeCollected,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee_to_be_collected" yaml:"fee_to_be_collected"` - BonusToBeGiven github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=bonus_to_be_given,json=bonusToBeGiven,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bonus_to_be_given" yaml:"bonus_to_be_given"` - AuctionType bool `protobuf:"varint,8,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty" yaml:"auction_type"` - CollateralAssetId uint64 `protobuf:"varint,9,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` - DebtAssetId uint64 `protobuf:"varint,10,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` - InitiatorType string `protobuf:"bytes,11,opt,name=initiator_type,json=initiatorType,proto3" json:"initiator_type,omitempty" yaml:"initiator_type"` + CollateralAssetId uint64 `protobuf:"varint,6,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` + DebtAssetId uint64 `protobuf:"varint,7,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` + IsDebtCmst bool `protobuf:"varint,8,opt,name=isDebtCmst,proto3" json:"isDebtCmst,omitempty" yaml:"debt_asset_id"` } func (m *MsgLiquidateExternalKeeperRequest) Reset() { *m = MsgLiquidateExternalKeeperRequest{} } @@ -279,65 +276,55 @@ func init() { } var fileDescriptor_51c735c845851e88 = []byte{ - // 913 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x6f, 0x1b, 0xc5, - 0x1f, 0xf6, 0x3a, 0xce, 0x8b, 0xc7, 0x75, 0x5e, 0x36, 0xfd, 0xeb, 0xef, 0x58, 0xb0, 0x13, 0xa6, - 0x28, 0x44, 0x48, 0xdd, 0x55, 0xc2, 0xa5, 0x45, 0x1c, 0xf0, 0xb6, 0x04, 0x05, 0x1a, 0x50, 0x57, - 0x11, 0x87, 0x0a, 0xc9, 0xec, 0xcb, 0x78, 0x19, 0x75, 0xbd, 0xb3, 0xf6, 0x8c, 0x43, 0x72, 0xe1, - 0x5a, 0x71, 0xa2, 0x5f, 0x81, 0x5b, 0x3f, 0x4a, 0x8e, 0x3d, 0x02, 0x87, 0x15, 0x6c, 0xbe, 0x81, - 0x0f, 0x1c, 0x38, 0xa1, 0x79, 0x71, 0xf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e, 0xf3, 0xc1, 0xcd, - 0x91, 0xe7, 0xbf, 0x25, 0x9a, 0x0f, 0xdf, 0x82, 0xa9, 0x6b, 0x99, 0xd5, 0x6b, 0x5a, 0xde, 0x5b, - 0xe9, 0x35, 0xd7, 0xa2, 0x6f, 0xa5, 0xd7, 0xfc, 0xd9, 0xba, 0xcf, 0xce, 0xff, 0xb4, 0x4a, 0xaf, - 0x0a, 0xab, 0x74, 0x5e, 0x58, 0xc6, 0xeb, 0xc2, 0x32, 0xfe, 0x28, 0x2c, 0xe3, 0xe5, 0x85, 0x55, - 0x7a, 0x7d, 0x61, 0x95, 0x7e, 0xbd, 0xb0, 0x4a, 0xcf, 0x1e, 0x4c, 0xdd, 0x5a, 0x91, 0xee, 0x3e, - 0xed, 0x74, 0x48, 0x48, 0xfc, 0x44, 0x3f, 0x3b, 0x57, 0x3e, 0x68, 0xe4, 0x5d, 0x0e, 0x96, 0xe4, - 0x67, 0xc5, 0x47, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xc4, 0x0f, 0xdc, 0xf6, 0xf6, 0x08, 0x00, - 0x00, + // 758 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x53, 0xd3, 0x4e, + 0x18, 0x6e, 0x4a, 0x4b, 0xe9, 0xf2, 0xe3, 0x87, 0x04, 0x66, 0x2c, 0x1d, 0x4d, 0x30, 0x38, 0xca, + 0x85, 0x64, 0xc0, 0x0b, 0x38, 0x1e, 0x6c, 0x41, 0x66, 0x50, 0xd0, 0x31, 0xc3, 0x78, 0xe0, 0xd2, + 0xd9, 0x36, 0xdb, 0xb8, 0x43, 0x92, 0x4d, 0xbb, 0x5b, 0xa4, 0x17, 0xaf, 0x8e, 0x37, 0xbe, 0x82, + 0x37, 0x3e, 0x0a, 0x47, 0x8e, 0x7a, 0xc9, 0x68, 0xf9, 0x06, 0x3d, 0x78, 0xf0,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0x04, 0x98, 0xd8, 0xa7, 0xae, 0xfa, 0x45, 0x11, 0x6d, 0xfd, 0x87, 0xa9, 0x57, 0x9f, 0x9b, + 0x63, 0x5f, 0x4d, 0xf3, 0xda, 0xa7, 0x2d, 0x5f, 0xf8, 0x87, 0x08, 0x32, 0x57, 0xf5, 0xb3, 0x02, + 0xd4, 0xab, 0xa3, 0xa7, 0x6e, 0x5c, 0x1f, 0x79, 0xf4, 0x2b, 0x95, 0xdf, 0xbc, 0x05, 0x33, 0xce, + 0x65, 0xd8, 0xaf, 0x41, 0x7b, 0x6f, 0xe4, 0xd7, 0xc8, 0x27, 0xe2, 0x46, 0x7e, 0x8d, 0xae, 0x6d, + 0xf1, 0xf0, 0xfc, 0x87, 0x96, 0x38, 0x6b, 0x69, 0x89, 0xf3, 0x96, 0xa6, 0x5c, 0xb4, 0x34, 0xe5, + 0x7b, 0x4b, 0x53, 0x4e, 0x2f, 0xb5, 0xc4, 0xc5, 0xa5, 0x96, 0xf8, 0x7a, 0xa9, 0x25, 0x0e, 0x37, + 0x06, 0xe6, 0x83, 0x5f, 0xb7, 0x4a, 0xaa, 0x55, 0x5c, 0xc1, 0xd0, 0x8b, 0xd7, 0xd6, 0x95, 0x0f, + 0xaa, 0x98, 0x9a, 0xf2, 0xa4, 0xf8, 0xac, 0x3d, 0xf9, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xc4, 0x67, + 0x88, 0x07, 0x76, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -648,26 +635,9 @@ func (m *MsgLiquidateExternalKeeperRequest) MarshalToSizedBuffer(dAtA []byte) (i _ = i var l int _ = l - if len(m.InitiatorType) > 0 { - i -= len(m.InitiatorType) - copy(dAtA[i:], m.InitiatorType) - i = encodeVarintTx(dAtA, i, uint64(len(m.InitiatorType))) + if m.IsDebtCmst { i-- - dAtA[i] = 0x5a - } - if m.DebtAssetId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.DebtAssetId)) - i-- - dAtA[i] = 0x50 - } - if m.CollateralAssetId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.CollateralAssetId)) - i-- - dAtA[i] = 0x48 - } - if m.AuctionType { - i-- - if m.AuctionType { + if m.IsDebtCmst { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -675,26 +645,16 @@ func (m *MsgLiquidateExternalKeeperRequest) MarshalToSizedBuffer(dAtA []byte) (i i-- dAtA[i] = 0x40 } - { - size := m.BonusToBeGiven.Size() - i -= size - if _, err := m.BonusToBeGiven.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) + if m.DebtAssetId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.DebtAssetId)) + i-- + dAtA[i] = 0x38 } - i-- - dAtA[i] = 0x3a - { - size := m.FeeToBeCollected.Size() - i -= size - if _, err := m.FeeToBeCollected.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) + if m.CollateralAssetId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CollateralAssetId)) + i-- + dAtA[i] = 0x30 } - i-- - dAtA[i] = 0x32 { size, err := m.DebtToken.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -850,22 +810,14 @@ func (m *MsgLiquidateExternalKeeperRequest) Size() (n int) { n += 1 + l + sovTx(uint64(l)) l = m.DebtToken.Size() n += 1 + l + sovTx(uint64(l)) - l = m.FeeToBeCollected.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.BonusToBeGiven.Size() - n += 1 + l + sovTx(uint64(l)) - if m.AuctionType { - n += 2 - } if m.CollateralAssetId != 0 { n += 1 + sovTx(uint64(m.CollateralAssetId)) } if m.DebtAssetId != 0 { n += 1 + sovTx(uint64(m.DebtAssetId)) } - l = len(m.InitiatorType) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.IsDebtCmst { + n += 2 } return n } @@ -1437,94 +1389,6 @@ func (m *MsgLiquidateExternalKeeperRequest) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeeToBeCollected", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.FeeToBeCollected.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BonusToBeGiven", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BonusToBeGiven.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionType", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AuctionType = bool(v != 0) - case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CollateralAssetId", wireType) } @@ -1543,7 +1407,7 @@ func (m *MsgLiquidateExternalKeeperRequest) Unmarshal(dAtA []byte) error { break } } - case 10: + case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field DebtAssetId", wireType) } @@ -1562,11 +1426,11 @@ func (m *MsgLiquidateExternalKeeperRequest) Unmarshal(dAtA []byte) error { break } } - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitiatorType", wireType) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsDebtCmst", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1576,24 +1440,12 @@ func (m *MsgLiquidateExternalKeeperRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InitiatorType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex + m.IsDebtCmst = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From a6a51119325876221e8519f8d890ad4576dfb219 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 7 Jun 2023 19:59:17 +0530 Subject: [PATCH 090/155] minor refactor --- x/auctionsV2/keeper/auctions.go | 9 +++- x/auctionsV2/types/keys.go | 4 +- x/liquidationsV2/keeper/liquidate.go | 69 ++++++++++++++++----------- x/liquidationsV2/keeper/msg_server.go | 2 +- 4 files changed, 52 insertions(+), 32 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 0e3036116..d1fdb6df3 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -16,7 +16,6 @@ func (k Keeper) AuctionActivator(ctx sdk.Context, liquidationData liquidationtyp //Dutch Auction Model Followed for auction type true if liquidationData.AuctionType { - //Trigger Dutch Auction err := k.DutchAuctionActivator(ctx, liquidationData) if err != nil { @@ -380,6 +379,14 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio //Send Collateral To the user //Delete Auction Data + // First check if the auction initiator type is surplus or debt + liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, englishAuction.AppId, englishAuction.LockedVaultId) + if liquidationData.InitiatorType == types.SurplusAuctionInitiator { + + } else if liquidationData.InitiatorType == types.DebtAuctionInitiator { + + } + return nil } diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index 4cce649b0..a334c693c 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -18,7 +18,9 @@ const ( QuerierRoute = ModuleName // MemStoreKey defines the in-memory store key - MemStoreKey = "mem_newauc" + MemStoreKey = "mem_newauc" + SurplusAuctionInitiator = "surplus" + DebtAuctionInitiator = "debt" ) var ( diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 96607b03c..d0d75ec4f 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - assettypes "github.com/comdex-official/comdex/x/asset/types" lendtypes "github.com/comdex-official/comdex/x/lend/types" @@ -353,13 +352,14 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsse } borrow.IsLiquidated = true k.lend.SetBorrow(ctx, borrow) + pair, _ := k.lend.GetLendPair(ctx, borrow.PairID) //Calculating Liquidation Fees feesToBeCollected := sdk.NewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationPenalty).TruncateInt() //Calculating auction bonus to be given auctionBonusToBeGiven := sdk.NewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationBonus).TruncateInt() - err := k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false) + err := k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false, pair.AssetIn, pair.AssetOut) if err != nil { return err } @@ -418,7 +418,7 @@ func (k Keeper) WhitelistLiquidation(ctx sdk.Context, msg types.LiquidationWhite func (k Keeper) LiquidateForSurplusAndDebt(ctx sdk.Context) error { auctionMapData, _ := k.collector.GetAllAuctionMappingForApp(ctx) for _, data := range auctionMapData { - err := k.CheckNetFeesCollectedStatsForSurplusAndDebt(ctx, data.AppId, data.AssetId) + err := k.CheckStatsForSurplusAndDebt(ctx, data.AppId, data.AssetId) if err != nil { return err } @@ -427,59 +427,70 @@ func (k Keeper) LiquidateForSurplusAndDebt(ctx sdk.Context) error { return nil } -func (k Keeper) CheckNetFeesCollectedStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint64) error { +func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint64) error { collector, found := k.collector.GetCollectorLookupTable(ctx, appID, assetID) if !found { return nil } - // coin denomination will be of 2 type: Auctioned Asset the asset which is being sold; i.e. Collateral Token - // Asset required to bid on Collateral Asset; i.e. Debt Token - // traverse this to access appId , collector asset id , debt threshold + // coin denomination will be of 2 type: Auctioned Asset the asset which is being sold; i.e. Collateral Token // CMST + // Asset required to bid on Collateral Asset; i.e. Debt Token // HARBOR netFeeCollectedData, found := k.collector.GetNetFeeCollectedData(ctx, appID, assetID) if !found { return nil } + + collateralAssetID := collector.CollectorAssetId //cmst + debtAssetID := collector.SecondaryAssetId //harbor + // for debt Auction if netFeeCollectedData.NetFeesCollected.LTE(collector.DebtThreshold.Sub(collector.LotSize)) { - collateralAssetID := collector.CollectorAssetId - debtAssetID := collector.SecondaryAssetId // net = 200 debtThreshold = 500 , lotSize = 100 - collateralToken, debtToken := k.getDebtSellTokenAmount(ctx, collateralAssetID, debtAssetID, collector.LotSize, collector.DebtLotSize) - err := k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, true, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "", false, true, collateralAssetID, collateralAssetID) + collateralToken, debtToken := k.DebtTokenAmount(ctx, collateralAssetID, debtAssetID, collector.LotSize, collector.DebtLotSize) + err := k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, true, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "debt", false, true, collateralAssetID, collateralAssetID) if err != nil { return err } - return nil } - //// for surplus auction - //if netFeeCollectedData.NetFeesCollected.GTE(collector.SurplusThreshold.Add(collector.LotSize)) { - // collateralAssetID := collector.SecondaryAssetId - // debtAssetID := collector.CollectorAssetId - // - // // net = 900 surplusThreshold = 500 , lotSize = 100 - // amount := collector.LotSize - // debtToken, collateralToken := k.getSurplusBuyTokenAmount(ctx, collateralAssetID, debtAssetID, amount) - // - // _, err := k.collector.GetAmountFromCollector(ctx, appID, assetID, sellToken.Amount) - // if err != nil { - // return err - // } - //} + // for surplus auction + if netFeeCollectedData.NetFeesCollected.GTE(collector.SurplusThreshold.Add(collector.LotSize)) { + // net = 900 surplusThreshold = 500 , lotSize = 100 + amount := collector.LotSize + collateralToken, debtToken := k.SurplusTokenAmount(ctx, collateralAssetID, debtAssetID, amount) + + // check to see if we have amount in collector + _, err := k.collector.GetAmountFromCollector(ctx, appID, assetID, collateralToken.Amount) + if err != nil { + return err + } + err = k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, true, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "surplus", false, true, collateralAssetID, collateralAssetID) + if err != nil { + return err + } + } return nil } -func (k Keeper) getDebtSellTokenAmount(ctx sdk.Context, AssetInID, AssetOutID uint64, lotSize, debtLotSize sdk.Int) (collateralToken, debtToken sdk.Coin) { - collateralAsset, found1 := k.asset.GetAsset(ctx, AssetOutID) - debtAsset, found2 := k.asset.GetAsset(ctx, AssetInID) +func (k Keeper) DebtTokenAmount(ctx sdk.Context, CollateralAssetId, DebtAssetID uint64, lotSize, debtLotSize sdk.Int) (collateralToken, debtToken sdk.Coin) { + collateralAsset, found1 := k.asset.GetAsset(ctx, CollateralAssetId) + debtAsset, found2 := k.asset.GetAsset(ctx, DebtAssetID) if !found1 || !found2 { return sdk.Coin{}, sdk.Coin{} } return sdk.NewCoin(collateralAsset.Denom, debtLotSize), sdk.NewCoin(debtAsset.Denom, lotSize) } +func (k Keeper) SurplusTokenAmount(ctx sdk.Context, CollateralAssetId, DebtAssetID uint64, lotSize sdk.Int) (collateralToken, debtToken sdk.Coin) { + collateralAsset, found1 := k.asset.GetAsset(ctx, CollateralAssetId) + debtAsset, found2 := k.asset.GetAsset(ctx, DebtAssetID) + if !found1 || !found2 { + return sdk.Coin{}, sdk.Coin{} + } + return sdk.NewCoin(collateralAsset.Denom, lotSize), sdk.NewCoin(debtAsset.Denom, sdk.ZeroInt()) +} + func (k Keeper) MsgAppReserveFundsFn(ctx sdk.Context, from string, appId, assetId uint64, tokenQuantity sdk.Coin) error { appReserveFunds, found := k.GetAppReserveFunds(ctx, appId, assetId) if !found { diff --git a/x/liquidationsV2/keeper/msg_server.go b/x/liquidationsV2/keeper/msg_server.go index e264be949..893a4fc44 100644 --- a/x/liquidationsV2/keeper/msg_server.go +++ b/x/liquidationsV2/keeper/msg_server.go @@ -45,7 +45,7 @@ func (m msgServer) MsgAppReserveFunds(c context.Context, req *types.MsgAppReserv func (m msgServer) MsgLiquidateExternalKeeper(c context.Context, req *types.MsgLiquidateExternalKeeperRequest) (*types.MsgLiquidateExternalKeeperResponse, error) { ctx := sdk.UnwrapSDKContext(c) - if err := m.keeper.MsgLiquidateExternal(ctx, req.From, req.AppId, req.Owner, req.CollateralToken, req.DebtToken, req.FeeToBeCollected, req.BonusToBeGiven, req.AuctionType, req.CollateralAssetId, req.DebtAssetId, req.InitiatorType); err != nil { + if err := m.keeper.MsgLiquidateExternal(ctx, req.From, req.AppId, req.Owner, req.CollateralToken, req.DebtToken, req.CollateralAssetId, req.DebtAssetId, req.IsDebtCmst); err != nil { return nil, err } return &types.MsgLiquidateExternalKeeperResponse{}, nil From bce5ceb6ea53e704c9d26b0150352cdaa60a0ea7 Mon Sep 17 00:00:00 2001 From: Pratik Date: Thu, 8 Jun 2023 23:12:07 +0530 Subject: [PATCH 091/155] close english auction updated --- x/auctionsV2/keeper/auctions.go | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index d1fdb6df3..16617c71b 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,6 +1,7 @@ package keeper import ( + auctiontypes "github.com/comdex-official/comdex/x/auction/types" "time" utils "github.com/comdex-official/comdex/types" @@ -381,10 +382,39 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio // First check if the auction initiator type is surplus or debt liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, englishAuction.AppId, englishAuction.LockedVaultId) + bidding, err := k.GetUserBid(ctx, englishAuction.ActiveBiddingId) + if err != nil { + return err + } + bidder, err := sdk.AccAddressFromBech32(bidding.BidderAddress) + if err != nil { + panic(err) + } + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, bidder, sdk.NewCoins(englishAuction.CollateralToken)) + if err != nil { + return err + } + err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctiontypes.ModuleName, collectortypes.ModuleName, sdk.NewCoins(englishAuction.DebtToken)) + if err != nil { + return err + } + if liquidationData.InitiatorType == types.SurplusAuctionInitiator { + err = k.collector.SetNetFeeCollectedData(ctx, englishAuction.AppId, englishAuction.CollateralAssetId, englishAuction.CollateralToken.Amount) + if err != nil { + return auctiontypes.ErrorUnableToSetNetFees + } } else if liquidationData.InitiatorType == types.DebtAuctionInitiator { - + err = k.collector.SetNetFeeCollectedData(ctx, englishAuction.AppId, englishAuction.DebtAssetId, englishAuction.DebtToken.Amount) + if err != nil { + return auctiontypes.ErrorUnableToSetNetFees + } + } + + err = k.DeleteAuction(ctx, englishAuction) + if err != nil { + return err } return nil From 743949365881c2f5d75a2cfa6e322b85ce659253 Mon Sep 17 00:00:00 2001 From: Rohit Rasjurya Prasad <42783861+rajrohit10@users.noreply.github.com> Date: Fri, 9 Jun 2023 01:51:38 +0530 Subject: [PATCH 092/155] resolving esm bugs in auctionV2 --- x/auctionsV2/keeper/auctions.go | 37 ++++++--- x/auctionsV2/keeper/bid.go | 114 +++------------------------ x/liquidationsV2/keeper/liquidate.go | 9 ++- x/vault/keeper/vault.go | 11 +++ 4 files changed, 58 insertions(+), 113 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 16617c71b..35a9b628d 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,9 +1,10 @@ package keeper import ( - auctiontypes "github.com/comdex-official/comdex/x/auction/types" "time" + auctiontypes "github.com/comdex-official/comdex/x/auction/types" + utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/auctionsV2/types" @@ -390,26 +391,40 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio if err != nil { panic(err) } - err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, bidder, sdk.NewCoins(englishAuction.CollateralToken)) - if err != nil { - return err - } - err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctiontypes.ModuleName, collectortypes.ModuleName, sdk.NewCoins(englishAuction.DebtToken)) - if err != nil { - return err - } + // err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, bidder, sdk.NewCoins(englishAuction.CollateralToken)) + // if err != nil { + // return err + // } + // err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctiontypes.ModuleName, collectortypes.ModuleName, sdk.NewCoins(englishAuction.DebtToken)) + // if err != nil { + // return err + // } if liquidationData.InitiatorType == types.SurplusAuctionInitiator { + //Take collateral from collector + //send collateral to user + // send harbor to token mint to burn + //set net fees data err = k.collector.SetNetFeeCollectedData(ctx, englishAuction.AppId, englishAuction.CollateralAssetId, englishAuction.CollateralToken.Amount) if err != nil { return auctiontypes.ErrorUnableToSetNetFees } } else if liquidationData.InitiatorType == types.DebtAuctionInitiator { + //Mint required collateral token from tokenmint + //send newly minted token((collateral)) to the user + // send debt to collector to get added + //set net fees data err = k.collector.SetNetFeeCollectedData(ctx, englishAuction.AppId, englishAuction.DebtAssetId, englishAuction.DebtToken.Amount) if err != nil { return auctiontypes.ErrorUnableToSetNetFees } + } else { + //External auction + //TODO: + //1. Add external English auction activator + //2. Add Close auction functionality to send the debt token to the initiator + } err = k.DeleteAuction(ctx, englishAuction) @@ -455,6 +470,10 @@ func (k Keeper) TriggerEsm(ctx sdk.Context, auctionData types.Auction, liquidati return err } //Opening vault + + //TODO + //check if a vault exists + //if yes update params of the current vault k.vault.CreateNewVault(ctx, liquidationData.Owner, auctionData.AppId, liquidationData.ExtendedPairId, auctionData.CollateralToken.Amount, auctionData.DebtToken.Amount) k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, collateralAuctioned, false) diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 68263f3b4..71847da3c 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -82,13 +82,18 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s } //Burn Debt Token, liquidationPenalty := sdk.NewCoin(auctionData.DebtToken.Denom, liquidationData.FeeToBeCollected) - tokensToBurn := liquidationData.TargetDebt.Sub(liquidationPenalty) - if tokensToBurn.Amount.GT(sdk.ZeroInt()) { - err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(tokensToBurn)) - if err != nil { - return bidId, err + var tokensToBurn sdk.Coin + if liquidationData.InitiatorType != "external" { + tokensToBurn = liquidationData.TargetDebt.Sub(liquidationPenalty) + if tokensToBurn.Amount.GT(sdk.ZeroInt()) { + err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(tokensToBurn)) + if err != nil { + return bidId, err + } } + } + //Send rest tokens to the user OwnerLeftOverCapital := auctionData.CollateralToken.Amount.Sub(totalCollateralTokenQuanitity) if OwnerLeftOverCapital.GT(sdk.ZeroInt()) { @@ -108,6 +113,8 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //For apps that are external to comdex chain if liquidationData.InitiatorType == "external" { + //Send Liquidation penalty to the comdex protocol -- create a kv store like SetAuctionLimitBidFeeData with name SetAuctionExternalFeeData + //Send debt to the initiator address of the auction //but if an app is external - will have to check the auction bonus , liquidation penalty , module account mechanism } else if liquidationData.InitiatorType == "vault" { @@ -141,6 +148,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, liquidationData.CollateralToken.Amount, false) } else if liquidationData.InitiatorType == "borrow" { //Check if they are initiated through a keeper, if so they will be incentivised + //TODO } //Add bidder data in auction bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{biddingId, string(bidder)} @@ -241,101 +249,6 @@ func (k Keeper) CreateUserBid(ctx sdk.Context, appID uint64, BidderAddress strin return bidding.BiddingId, nil } -// func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder string, bid sdk.Coin, auctionData types.Auction) error { -// if bid.Amount.Equal(sdk.ZeroInt()) { -// return types.ErrBidCannotBeZero -// } -// bidderAddr, _ := sdk.AccAddressFromBech32(bidder) -// //TODO: an identifier for surplus or debt auction -// if true { // for surplus auction -// if bid.Denom != auctionData.DebtToken.Denom { -// return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the debt token ", bid.Denom) -// } -// if auctionData.BiddingIds != nil { -// change := auctionData.BidFactor.MulInt(auctionData.DebtToken.Amount).Ceil().TruncateInt() -// minBidAmount := auctionData.DebtToken.Amount.Add(change) -// if bid.Amount.LT(minBidAmount) { -// return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be greater than or equal to %d ", minBidAmount) -// } -// } else { -// if bid.Amount.LTE(auctionData.DebtToken.Amount) { -// return auctiontypes.ErrorLowBidAmount -// } -// } -// err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctiontypes.ModuleName, sdk.NewCoins(bid)) -// if err != nil { -// return err -// } -// biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, bidder, auctionID, auctionData.CollateralToken, sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") -// if err != nil { -// return err -// } -// if auctionData.ActiveBiddingId != 0 { -// userBid, err := k.GetUserBid(ctx, auctionData.ActiveBiddingId) -// if err != nil { -// return err -// } -// addr, _ := sdk.AccAddressFromBech32(userBid.BidderAddress) -// err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, addr, sdk.NewCoins(auctionData.DebtToken)) -// if err != nil { -// return err -// } -// } - -// auctionData.DebtToken.Amount = bid.Amount -// auctionData.ActiveBiddingId = biddingId -// bidIDOwner := &auctiontypes.BidOwnerMapping{BidId: biddingId, BidOwner: bidder} -// auctionData.BiddingIds = append(auctionData.BiddingIds, bidIDOwner) - -// } else { // for debt auction -// if bid.Denom != auctionData.CollateralToken.Denom { -// return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the CollateralToken token ", bid.Denom) -// } -// if auctionData.BiddingIds != nil { -// change := auctionData.BidFactor.MulInt(auctionData.CollateralToken.Amount).Ceil().TruncateInt() -// maxBidAmount := auctionData.CollateralToken.Amount.Sub(change) -// if bid.Amount.GT(maxBidAmount) { -// return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be less than or equal to %d ", maxBidAmount.Uint64()) -// } -// } else { -// if bid.Amount.GT(auctionData.CollateralToken.Amount) { -// return auctiontypes.ErrorMaxBidAmount -// } -// } -// err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctiontypes.ModuleName, sdk.NewCoins(bid)) -// if err != nil { -// return err -// } -// biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, string(bidder), auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, bid.Amount), auctionData.DebtToken, "dutch") -// if err != nil { -// return err -// } -// if auctionData.ActiveBiddingId != 0 { -// userBid, err := k.GetUserBid(ctx, auctionData.ActiveBiddingId) -// if err != nil { -// return err -// } -// addr, _ := sdk.AccAddressFromBech32(userBid.BidderAddress) -// err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, addr, sdk.NewCoins(auctionData.CollateralToken)) -// if err != nil { -// return err -// } - -// } -// auctionData.CollateralToken.Amount = bid.Amount -// auctionData.ActiveBiddingId = biddingId -// bidIDOwner := &auctiontypes.BidOwnerMapping{BidId: biddingId, BidOwner: bidder} -// auctionData.BiddingIds = append(auctionData.BiddingIds, bidIDOwner) - -// } -// err := k.SetAuction(ctx, auctionData) -// if err != nil { -// return err -// } - -// return nil -// } - func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder string, bid sdk.Coin, auctionData types.Auction) error { auctionParams, _ := k.GetAuctionParams(ctx) if bid.Amount.Equal(sdk.ZeroInt()) { @@ -634,7 +547,6 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater k.SetAuctionLimitBidFeeData(ctx, feeData) } - userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(amount.Amount) k.SetUserLimitBidData(ctx, userLimitBid, DebtTokenId, CollateralTokenId, PremiumDiscount) return nil diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index d0d75ec4f..825cc74bd 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -440,6 +440,7 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint return nil } + //surplus condition collateralAssetID := collector.CollectorAssetId //cmst debtAssetID := collector.SecondaryAssetId //harbor @@ -447,7 +448,7 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint if netFeeCollectedData.NetFeesCollected.LTE(collector.DebtThreshold.Sub(collector.LotSize)) { // net = 200 debtThreshold = 500 , lotSize = 100 collateralToken, debtToken := k.DebtTokenAmount(ctx, collateralAssetID, debtAssetID, collector.LotSize, collector.DebtLotSize) - err := k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, true, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "debt", false, true, collateralAssetID, collateralAssetID) + err := k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, false, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "debt", false, true, collateralAssetID, collateralAssetID) if err != nil { return err } @@ -464,7 +465,7 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint if err != nil { return err } - err = k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, true, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "surplus", false, true, collateralAssetID, collateralAssetID) + err = k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, false, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "surplus", false, false, collateralAssetID, collateralAssetID) if err != nil { return err } @@ -472,7 +473,9 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint return nil } - +// Surplus ``` | Debt` +//--Collateral cmst harbor +//debt harbor cmst func (k Keeper) DebtTokenAmount(ctx sdk.Context, CollateralAssetId, DebtAssetID uint64, lotSize, debtLotSize sdk.Int) (collateralToken, debtToken sdk.Coin) { collateralAsset, found1 := k.asset.GetAsset(ctx, CollateralAssetId) debtAsset, found2 := k.asset.GetAsset(ctx, DebtAssetID) diff --git a/x/vault/keeper/vault.go b/x/vault/keeper/vault.go index 0a966864e..cdf8b8ef7 100644 --- a/x/vault/keeper/vault.go +++ b/x/vault/keeper/vault.go @@ -574,6 +574,17 @@ func (k Keeper) GetStableMintVaults(ctx sdk.Context) (stableVaults []types.Stabl func (k Keeper) CreateNewVault(ctx sdk.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdk.Int, AmountOut sdk.Int) error { appMapping, _ := k.asset.GetApp(ctx, AppID) extendedPairVault, _ := k.asset.GetPairsVault(ctx, ExtendedPairVaultID) + //checking if vault exists + userData, userExists := k.GetUserAppExtendedPairMappingData(ctx, From, AppID, ExtendedPairVaultID) + if userExists { + + vaultData, _ := k.GetVault(ctx, userData.VaultId) + vaultData.AmountIn = vaultData.AmountIn.Add(AmountIn) + vaultData.AmountOut = vaultData.AmountOut.Add(AmountOut) + k.SetVault(ctx, vaultData) + + return nil + } zeroVal := sdk.ZeroInt() oldID := k.GetIDForVault(ctx) From f9767cc0f53dbbed77aed1c1bd86fe872736297c Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 9 Jun 2023 17:32:11 +0530 Subject: [PATCH 093/155] updating close borrow logic --- x/auctionsV2/expected/keeper.go | 16 +++-- x/auctionsV2/keeper/auctions.go | 54 ++++++++++++---- x/auctionsV2/keeper/bid.go | 80 +++++++++++++++++++----- x/auctionsV2/keeper/keeper.go | 3 + x/auctionsV2/keeper/utils.go | 26 ++++++++ x/auctionsV2/types/keys.go | 5 ++ x/liquidationsV2/keeper/liquidate.go | 93 ++++++++++++++++++++++++++-- 7 files changed, 235 insertions(+), 42 deletions(-) diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go index 03b620be2..99af4c580 100644 --- a/x/auctionsV2/expected/keeper.go +++ b/x/auctionsV2/expected/keeper.go @@ -2,6 +2,7 @@ package expected import ( assettypes "github.com/comdex-official/comdex/x/asset/types" + auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" esmtypes "github.com/comdex-official/comdex/x/esm/types" liquidationsV2types "github.com/comdex-official/comdex/x/liquidationsV2/types" markettypes "github.com/comdex-official/comdex/x/market/types" @@ -15,6 +16,7 @@ type LiquidationsV2Keeper interface { GetLockedVault(ctx sdk.Context, appID, id uint64) (lockedVault liquidationsV2types.LockedVault, found bool) DeleteLockedVault(ctx sdk.Context, id uint64) WithdrawAppReserveFundsFn(ctx sdk.Context, appId, assetId uint64, tokenQuantity sdk.Coin) + MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData liquidationsV2types.LockedVault, auctionData auctionsV2types.Auction) error } type MarketKeeper interface { @@ -56,14 +58,10 @@ type VaultKeeper interface { CreateNewVault(ctx sdk.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdk.Int, AmountOut sdk.Int) } type CollectorKeeper interface { - // GetAppidToAssetCollectorMapping(ctx sdk.Context, appID, assetID uint64) (appAssetCollectorData types.AppToAssetIdCollectorMapping, found bool) - // UpdateCollector(ctx sdk.Context, appID, assetID uint64, CollectedStabilityFee, CollectedClosingFee, CollectedOpeningFee, LiquidationRewardsCollected sdk.Int) error - // // SetCollectorLookupTable(ctx sdk.Context, records ...types.CollectorLookupTable) error - // GetCollectorLookupTable(ctx sdk.Context, appID, assetID uint64) (collectorLookup types.CollectorLookupTableData, found bool) - // GetAuctionMappingForApp(ctx sdk.Context, appID, assetID uint64) (collectorAuctionLookupTable types.AppAssetIdToAuctionLookupTable, found bool) - // GetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64) (netFeeData types.AppAssetIdToFeeCollectedData, found bool) - // GetAmountFromCollector(ctx sdk.Context, appID, assetID uint64, amount sdk.Int) (sdk.Int, error) SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdk.Int) error - // SetAuctionMappingForApp(ctx sdk.Context, records types.AppAssetIdToAuctionLookupTable) error - // GetAllAuctionMappingForApp(ctx sdk.Context) (collectorAuctionLookupTable []types.AppAssetIdToAuctionLookupTable, found bool) +} + +type TokenMintKeeper interface { + MintNewTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, address string, amount sdk.Int) error + BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, amount sdk.Int) error } diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 35a9b628d..fb52bf153 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -391,20 +391,27 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio if err != nil { panic(err) } - // err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, bidder, sdk.NewCoins(englishAuction.CollateralToken)) - // if err != nil { - // return err - // } - // err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctiontypes.ModuleName, collectortypes.ModuleName, sdk.NewCoins(englishAuction.DebtToken)) - // if err != nil { - // return err - // } if liquidationData.InitiatorType == types.SurplusAuctionInitiator { - //Take collateral from collector - //send collateral to user + // Take collateral from collector + // send collateral to user // send harbor to token mint to burn - //set net fees data + // set net fees data + err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, collectortypes.ModuleName, auctionsV2types.ModuleName, sdk.NewCoins(englishAuction.CollateralToken)) + if err != nil { + return err + } + + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(englishAuction.CollateralToken)) + if err != nil { + return err + } + + err = k.tokenMint.BurnTokensForApp(ctx, englishAuction.AppId, englishAuction.DebtAssetId, englishAuction.DebtToken.Amount) + if err != nil { + return err + } + err = k.collector.SetNetFeeCollectedData(ctx, englishAuction.AppId, englishAuction.CollateralAssetId, englishAuction.CollateralToken.Amount) if err != nil { return auctiontypes.ErrorUnableToSetNetFees @@ -415,6 +422,16 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio //send newly minted token((collateral)) to the user // send debt to collector to get added //set net fees data + err = k.tokenMint.MintNewTokensForApp(ctx, englishAuction.AppId, englishAuction.CollateralAssetId, bidding.BidderAddress, englishAuction.CollateralToken.Amount) + if err != nil { + return err + } + + err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(englishAuction.DebtToken)) + if err != nil { + return err + } + err = k.collector.SetNetFeeCollectedData(ctx, englishAuction.AppId, englishAuction.DebtAssetId, englishAuction.DebtToken.Amount) if err != nil { return auctiontypes.ErrorUnableToSetNetFees @@ -424,7 +441,18 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio //TODO: //1. Add external English auction activator //2. Add Close auction functionality to send the debt token to the initiator - + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(englishAuction.CollateralToken)) + if err != nil { + return err + } + externalInitiator, err := sdk.AccAddressFromBech32(liquidationData.ExternalKeeperAddress) + if err != nil { + return err + } + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, externalInitiator, sdk.NewCoins(englishAuction.DebtToken)) + if err != nil { + return err + } } err = k.DeleteAuction(ctx, englishAuction) @@ -472,7 +500,7 @@ func (k Keeper) TriggerEsm(ctx sdk.Context, auctionData types.Auction, liquidati //Opening vault //TODO - //check if a vault exists + //check if a vault exists //if yes update params of the current vault k.vault.CreateNewVault(ctx, liquidationData.Owner, auctionData.AppId, liquidationData.ExtendedPairId, auctionData.CollateralToken.Amount, auctionData.DebtToken.Amount) k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, collateralAuctioned, false) diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 71847da3c..1bffa9c4d 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -115,6 +115,39 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if liquidationData.InitiatorType == "external" { //Send Liquidation penalty to the comdex protocol -- create a kv store like SetAuctionLimitBidFeeData with name SetAuctionExternalFeeData //Send debt to the initiator address of the auction + finalDebtToInitiator := liquidationData.DebtToken.Sub(liquidationPenalty) + keeperIncentive := (liquidationWhitelistingAppData.KeeeperIncentive.Mul(sdk.NewDecFromInt(liquidationPenalty.Amount))).TruncateInt() + if keeperIncentive.GT(sdk.ZeroInt()) { + liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.InternalKeeperAddress), sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) + if err != nil { + return bidId, err + } + } + + // updating feeData for external initiator + feeData, found := k.GetAuctionLimitBidFeeDataExternal(ctx, auctionData.DebtAssetId) + if !found { + feeData.AssetId = auctionData.DebtAssetId + feeData.Amount = liquidationPenalty.Amount + } else { + feeData.Amount = feeData.Amount.Add(liquidationPenalty.Amount) + } + err = k.SetAuctionLimitBidFeeDataExternal(ctx, feeData) + if err != nil { + return 0, err + } + + // sending collected debt to the initiator + externalInitiator, err := sdk.AccAddressFromBech32(liquidationData.ExternalKeeperAddress) + if err != nil { + return 0, err + } + + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, externalInitiator, sdk.NewCoins(finalDebtToInitiator)) + if err != nil { + return 0, err + } //but if an app is external - will have to check the auction bonus , liquidation penalty , module account mechanism } else if liquidationData.InitiatorType == "vault" { @@ -148,13 +181,22 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, liquidationData.CollateralToken.Amount, false) } else if liquidationData.InitiatorType == "borrow" { //Check if they are initiated through a keeper, if so they will be incentivised - //TODO + //TODO: + // send money back to the debt pool (assetOut pool) + // liquidation penalty to the reserve and interest to the pool + // send token to the bidder + // if cross pool borrow, settle the transit asset to it's native pool + // close the borrow and update the stats + err = k.LiquidationsV2.MsgCloseDutchAuctionForBorrow(ctx, liquidationData, auctionData) + if err != nil { + return 0, err + } } //Add bidder data in auction - bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{biddingId, string(bidder)} - auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMapppingData) - //Savinga auction data to auction historical - auctionHistoricalData := auctionsV2types.AuctionHistorical{auctionID, &auctionData, &liquidationData} + bidOwnerMappingData := auctionsV2types.BidOwnerMapping{BidId: biddingId, BidOwner: bidder} + auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMappingData) + //Saving auction data to auction historical + auctionHistoricalData := auctionsV2types.AuctionHistorical{AuctionId: auctionID, AuctionHistorical: &auctionData, LockedVault: &liquidationData} err = k.SetAuctionHistorical(ctx, auctionHistoricalData) if err != nil { return 0, err @@ -170,7 +212,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s } else { //if bid amount is less than the target bid //Calculating collateral token value from bid(debt) token value - _, collateralTokenQuanitity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + _, collateralTokenQuantity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) debtLeft := bid.Amount.Sub(bid.Amount) debtuDollar, _ := k.CalcDollarValueForToken(ctx, auctionData.DebtAssetId, debtPrice, debtLeft) if !(debtuDollar).GT(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.MinUsdValueLeft))) { @@ -188,8 +230,8 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //using that ratio data to calculate auction bonus to be given for the bid //first taking the debt percentage data //then calculating the collateral token data - _, collateralTokenQuanitityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, expectedBonusShareForCurrentBid, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) - totalCollateralTokenQuanitity := collateralTokenQuanitity.Add(collateralTokenQuanitityForBonus) + _, collateralTokenQuantityForBonus, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, expectedBonusShareForCurrentBid, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) + totalCollateralTokenQuantity := collateralTokenQuantity.Add(collateralTokenQuantityForBonus) if !isAutoBid { if bid.Amount.GT(sdk.ZeroInt()) { err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, bidderAddr, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount))) @@ -199,22 +241,22 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s } } //Send Collateral To bidder - if totalCollateralTokenQuanitity.GT(sdk.ZeroInt()) { - err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidderAddr, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity))) + if totalCollateralTokenQuantity.GT(sdk.ZeroInt()) { + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidderAddr, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuantity))) if err != nil { return bidId, err } } - biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, bidder, auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuanitity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") + biddingId, err := k.CreateUserBid(ctx, auctionData.AppId, bidder, auctionID, sdk.NewCoin(auctionData.CollateralToken.Denom, totalCollateralTokenQuantity), sdk.NewCoin(auctionData.DebtToken.Denom, bid.Amount), "dutch") if err != nil { return bidId, err } //Add bidder data in auction - bidOwnerMapppingData := auctionsV2types.BidOwnerMapping{biddingId, string(bidder)} - auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMapppingData) + bidOwnerMappingData := auctionsV2types.BidOwnerMapping{BidId: biddingId, BidOwner: string(bidder)} + auctionData.BiddingIds = append(auctionData.BiddingIds, &bidOwnerMappingData) //Reduce Auction collateral and debt value - auctionData.CollateralToken.Amount = auctionData.CollateralToken.Amount.Sub(totalCollateralTokenQuanitity) + auctionData.CollateralToken.Amount = auctionData.CollateralToken.Amount.Sub(totalCollateralTokenQuantity) auctionData.DebtToken.Amount = auctionData.DebtToken.Amount.Sub(bid.Amount) auctionData.BonusAmount = auctionData.BonusAmount.Sub(expectedBonusShareForCurrentBid) //Set Auction @@ -496,7 +538,10 @@ func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenI } else { feeData.Amount = feeData.Amount.Add(feesToBecollected) } - k.SetAuctionLimitBidFeeData(ctx, feeData) + err := k.SetAuctionLimitBidFeeData(ctx, feeData) + if err != nil { + return err + } } // delete userLimitBid from KV store @@ -544,7 +589,10 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater } else { feeData.Amount = feeData.Amount.Add(feesToBecollected) } - k.SetAuctionLimitBidFeeData(ctx, feeData) + err := k.SetAuctionLimitBidFeeData(ctx, feeData) + if err != nil { + return err + } } userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(amount.Amount) diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index 213039ae3..dddb97927 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -25,6 +25,7 @@ type ( esm expected.EsmKeeper vault expected.VaultKeeper collector expected.CollectorKeeper + tokenMint expected.TokenMintKeeper } ) @@ -45,6 +46,7 @@ func NewKeeper( esm expected.EsmKeeper, vaultKeeper expected.VaultKeeper, collector expected.CollectorKeeper, + tokenMintKeeper expected.TokenMintKeeper, ) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { @@ -63,6 +65,7 @@ func NewKeeper( esm: esm, vault: vaultKeeper, collector: collector, + tokenMint: tokenMintKeeper, } } diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go index b79ff4bb7..2f272771c 100644 --- a/x/auctionsV2/keeper/utils.go +++ b/x/auctionsV2/keeper/utils.go @@ -271,3 +271,29 @@ func (k Keeper) GetUserBids(ctx sdk.Context) (userBids []types.Bid) { return userBids } + +func (k Keeper) SetAuctionLimitBidFeeDataExternal(ctx sdk.Context, feeData types.AuctionFeesCollectionFromLimitBidTx) error { + + var ( + store = k.Store(ctx) + key = types.ExternalAuctionLimitBidFeeKey(feeData.AssetId) + value = k.cdc.MustMarshal(&feeData) + ) + + store.Set(key, value) + return nil +} +func (k Keeper) GetAuctionLimitBidFeeDataExternal(ctx sdk.Context, assetId uint64) (feeData types.AuctionFeesCollectionFromLimitBidTx, found bool) { + var ( + store = k.Store(ctx) + key = types.ExternalAuctionLimitBidFeeKey(assetId) + value = store.Get(key) + ) + + if value == nil { + return feeData, false + } + + k.cdc.MustUnmarshal(value, &feeData) + return feeData, true +} diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index a334c693c..9ee590df7 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -38,6 +38,7 @@ var ( UserLimitBidMappingKeyPrefix = []byte{0x08} UserLimitBidMappingKeyForAddressPrefix = []byte{0x09} AuctionLimitBidFeeKeyPrefix = []byte{0x10} + ExternalAuctionLimitBidFeeKeyPrefix = []byte{0x11} ) func AuctionKey(auctionID uint64) []byte { @@ -65,3 +66,7 @@ func UserLimitBidKeyForPremium(debtTokenID, collateralTokenID uint64, premium sd func UserLimitBidKeyForAddress(address string) []byte { return append(UserLimitBidMappingKeyForAddressPrefix, address...) } + +func ExternalAuctionLimitBidFeeKey(assetID uint64) []byte { + return append(append(ExternalAuctionLimitBidFeeKeyPrefix, sdk.Uint64ToBigEndian(assetID)...)) +} diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 825cc74bd..803e39756 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -342,6 +342,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro } } } + k.lend.UpdateBorrowStats(ctx, lendPair, borrowPos.IsStableBorrow, borrowPos.AmountOut.Amount, false) return nil } @@ -440,7 +441,7 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint return nil } - //surplus condition + //surplus condition collateralAssetID := collector.CollectorAssetId //cmst debtAssetID := collector.SecondaryAssetId //harbor @@ -473,9 +474,11 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint return nil } -// Surplus ``` | Debt` -//--Collateral cmst harbor -//debt harbor cmst + +// Surplus ``` | Debt` +// +// --Collateral cmst harbor +// debt harbor cmst func (k Keeper) DebtTokenAmount(ctx sdk.Context, CollateralAssetId, DebtAssetID uint64, lotSize, debtLotSize sdk.Int) (collateralToken, debtToken sdk.Coin) { collateralAsset, found1 := k.asset.GetAsset(ctx, CollateralAssetId) debtAsset, found2 := k.asset.GetAsset(ctx, DebtAssetID) @@ -645,3 +648,85 @@ func (k Keeper) MsgLiquidateExternal(ctx sdk.Context, from string, appID uint64, return nil } + +func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData types.LockedVault, auctionData auctionsV2types.Auction) error { + //TODO: + // send money back to the debt pool (assetOut pool) + // liquidation penalty to the reserve and interest to the pool + // send token to the bidder + // if cross pool borrow, settle the transit asset to it's native pool + // close the borrow and update the stats + + borrowPos, _ := k.lend.GetBorrow(ctx, liquidationData.OriginalVaultId) + pair, _ := k.lend.GetLendPair(ctx, borrowPos.PairID) + pool, _ := k.lend.GetPool(ctx, pair.AssetOutPoolID) + poolAssetLBMappingData, _ := k.lend.GetAssetStatsByPoolIDAndAssetID(ctx, pair.AssetOutPoolID, pair.AssetOut) + amountToPool := auctionData.DebtToken // subtract liquidation penalty and interest after sending all the collateral to pool + assetOutStats, _ := k.lend.GetAssetRatesParams(ctx, pair.AssetOut) + cAsset, _ := k.asset.GetAsset(ctx, assetOutStats.CAssetID) + + // sending tokens debt tokens to the pool + err := k.bank.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, pool.ModuleName, sdk.NewCoins(amountToPool)) + if err != nil { + return err + } + + reservePoolRecords, found := k.lend.GetBorrowInterestTracker(ctx, liquidationData.OriginalVaultId) + if !found { + reservePoolRecords = lendtypes.BorrowInterestTracker{ + BorrowingId: liquidationData.OriginalVaultId, + ReservePoolInterest: sdk.ZeroDec(), + } + } + + // calculating amount sent to be reserve pool and the debt pool + // after recovering interest some part of the interest goes into the reserve pool + // and for the remaining quantity equivalent number of cToken is minted to be given to the lenders upon calculate interest and rewards + amtToReservePool := reservePoolRecords.ReservePoolInterest + if amtToReservePool.TruncateInt().GT(sdk.ZeroInt()) { + amount := sdk.NewCoin(auctionData.DebtToken.Denom, amtToReservePool.TruncateInt()) + err = k.lend.UpdateReserveBalances(ctx, pair.AssetOut, pool.ModuleName, amount, true) + if err != nil { + return err + } + + allReserveStats, found := k.lend.GetAllReserveStatsByAssetID(ctx, pair.AssetOut) + if !found { + allReserveStats = lendtypes.AllReserveStats{ + AssetID: pair.AssetOut, + AmountOutFromReserveToLenders: sdk.ZeroInt(), + AmountOutFromReserveForAuction: sdk.ZeroInt(), + AmountInFromLiqPenalty: sdk.ZeroInt(), + AmountInFromRepayments: sdk.ZeroInt(), + TotalAmountOutToLenders: sdk.ZeroInt(), + } + } + allReserveStats.AmountInFromRepayments = allReserveStats.AmountInFromRepayments.Add(amount.Amount) + k.lend.SetAllReserveStatsByAssetID(ctx, allReserveStats) + } + // amount minted in the debt pool + amtToMint := (borrowPos.InterestAccumulated.Sub(amtToReservePool)).TruncateInt() + if amtToMint.GT(sdk.ZeroInt()) { + err = k.bank.MintCoins(ctx, pool.ModuleName, sdk.NewCoins(sdk.NewCoin(cAsset.Denom, amtToMint))) + if err != nil { + return err + } + poolAssetLBMappingData.TotalInterestAccumulated = poolAssetLBMappingData.TotalInterestAccumulated.Add(amtToMint) + k.lend.SetAssetStatsByPoolIDAndAssetID(ctx, poolAssetLBMappingData) + } + // if borrow position is having bridged asset then return to the initial pool + if borrowPos.BridgedAssetAmount.Amount.GT(sdk.NewInt(0)) { + lend, _ := k.lend.GetLend(ctx, borrowPos.LendingID) + assetInPool, _ := k.lend.GetPool(ctx, lend.PoolID) + err = k.bank.SendCoinsFromModuleToModule(ctx, pool.ModuleName, assetInPool.ModuleName, sdk.NewCoins(borrowPos.BridgedAssetAmount)) + if err != nil { + return err + } + } + + k.lend.DeleteIDFromAssetStatsMapping(ctx, pair.AssetOutPoolID, pair.AssetOut, liquidationData.OriginalVaultId, false) + k.lend.DeleteBorrowIDFromUserMapping(ctx, liquidationData.Owner, borrowPos.LendingID, liquidationData.OriginalVaultId) + k.lend.DeleteBorrow(ctx, liquidationData.OriginalVaultId) + k.lend.DeleteBorrowInterestTracker(ctx, liquidationData.OriginalVaultId) + return nil +} From e6c99938a04a458640210031ef1445f0f5f22b92 Mon Sep 17 00:00:00 2001 From: Chandragupta Singh Date: Sun, 11 Jun 2023 02:25:57 +0530 Subject: [PATCH 094/155] auction fix --- app/app.go | 29 ++++++++++++++++++++++------- x/auctionsV2/expected/keeper.go | 6 +++--- x/auctionsV2/keeper/auctions.go | 5 ++++- x/auctionsV2/keeper/bid.go | 8 +++++--- x/liquidationsV2/expected/keeper.go | 2 +- 5 files changed, 35 insertions(+), 15 deletions(-) diff --git a/app/app.go b/app/app.go index 10bfa5cd4..996a2ec3d 100644 --- a/app/app.go +++ b/app/app.go @@ -773,18 +773,33 @@ func New( ) app.NewliqKeeper = newliqkeeper.NewKeeper( app.cdc, - app.keys[lendtypes.StoreKey], - app.keys[lendtypes.StoreKey], - app.GetSubspace(lendtypes.ModuleName), + app.keys[newliqtypes.StoreKey], + app.keys[newliqtypes.MemStoreKey], + app.GetSubspace(newliqtypes.ModuleName), + app.AccountKeeper, app.BankKeeper, + app.AssetKeeper, + app.VaultKeeper, + app.MarketKeeper, + app.EsmKeeper, + app.Rewardskeeper, + app.LendKeeper, + app.NewaucKeeper, + app.CollectorKeeper, ) app.NewaucKeeper = newauckeeper.NewKeeper( app.cdc, - app.keys[lendtypes.StoreKey], - app.keys[lendtypes.StoreKey], - app.GetSubspace(lendtypes.ModuleName), + app.keys[newauctypes.StoreKey], + app.keys[newauctypes.MemStoreKey], + app.GetSubspace(newauctypes.ModuleName), + app.NewliqKeeper, app.BankKeeper, + app.MarketKeeper, + app.AssetKeeper, + app.EsmKeeper, + app.VaultKeeper, + app.CollectorKeeper, ) wasmDir := filepath.Join(homePath, "wasm") wasmConfig, err := wasm.ReadWasmConfig(appOptions) @@ -915,7 +930,7 @@ func New( liquidity.NewAppModule(app.cdc, app.LiquidityKeeper, app.AccountKeeper, app.BankKeeper, app.AssetKeeper), rewards.NewAppModule(app.cdc, app.Rewardskeeper, app.AccountKeeper, app.BankKeeper), liquidationsV2.NewAppModule(app.cdc, app.NewliqKeeper, app.AccountKeeper, app.BankKeeper), - auctionsV2.NewAppModule(app.cdc, app.NewaucKeeper, app.AccountKeeper, app.BankKeeper), + auctionsV2.NewAppModule(app.cdc, app.NewaucKeeper, app.BankKeeper), ibcratelimitmodule.NewAppModule(*app.RateLimitingICS4Wrapper), ibchooks.NewAppModule(app.AccountKeeper), packetforward.NewAppModule(app.PacketForwardKeeper), diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go index 03b620be2..90eb06a13 100644 --- a/x/auctionsV2/expected/keeper.go +++ b/x/auctionsV2/expected/keeper.go @@ -13,8 +13,8 @@ import ( type LiquidationsV2Keeper interface { GetLiquidationWhiteListing(ctx sdk.Context, appId uint64) (liquidationWhiteListing liquidationsV2types.LiquidationWhiteListing, found bool) GetLockedVault(ctx sdk.Context, appID, id uint64) (lockedVault liquidationsV2types.LockedVault, found bool) - DeleteLockedVault(ctx sdk.Context, id uint64) - WithdrawAppReserveFundsFn(ctx sdk.Context, appId, assetId uint64, tokenQuantity sdk.Coin) + DeleteLockedVault(ctx sdk.Context, appID, id uint64) + WithdrawAppReserveFundsFn(ctx sdk.Context, appId, assetId uint64, tokenQuantity sdk.Coin) error } type MarketKeeper interface { @@ -53,7 +53,7 @@ type VaultKeeper interface { GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdk.Dec, amt1 sdk.Int, id2 uint64, rate2 sdk.Dec) (sdk.Dec, sdk.Int, error) UpdateTokenMintedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) UpdateCollateralLockedAmountLockerMapping(ctx sdk.Context, appMappingID uint64, extendedPairID uint64, amount sdk.Int, changeType bool) - CreateNewVault(ctx sdk.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdk.Int, AmountOut sdk.Int) + CreateNewVault(ctx sdk.Context, From string, AppID uint64, ExtendedPairVaultID uint64, AmountIn sdk.Int, AmountOut sdk.Int) error } type CollectorKeeper interface { // GetAppidToAssetCollectorMapping(ctx sdk.Context, appID, assetID uint64) (appAssetCollectorData types.AppToAssetIdCollectorMapping, found bool) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 0e3036116..0968570fd 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -418,7 +418,10 @@ func (k Keeper) TriggerEsm(ctx sdk.Context, auctionData types.Auction, liquidati return err } //Opening vault - k.vault.CreateNewVault(ctx, liquidationData.Owner, auctionData.AppId, liquidationData.ExtendedPairId, auctionData.CollateralToken.Amount, auctionData.DebtToken.Amount) + err = k.vault.CreateNewVault(ctx, liquidationData.Owner, auctionData.AppId, liquidationData.ExtendedPairId, auctionData.CollateralToken.Amount, auctionData.DebtToken.Amount) + if err != nil { + return err + } k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, collateralAuctioned, false) return nil diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 68263f3b4..f49181914 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -59,7 +59,10 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s debtGettingLeft := auctionData.DebtToken.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, debtTokenAgainstLeftOverCollateral)) //Calling reserve account for debt adjustment : debtGettingLeft //Updating the protocol was in loss stuct - k.LiquidationsV2.WithdrawAppReserveFundsFn(ctx, auctionData.AppId, auctionData.DebtAssetId, debtGettingLeft) + err := k.LiquidationsV2.WithdrawAppReserveFundsFn(ctx, auctionData.AppId, auctionData.DebtAssetId, debtGettingLeft) + if err != nil { + return bidId, err + } } //Take Debt Token from user , @@ -157,7 +160,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s return 0, err } //Delete liquidation Data - k.LiquidationsV2.DeleteLockedVault(ctx, liquidationData.LockedVaultId) + k.LiquidationsV2.DeleteLockedVault(ctx, auctionData.AppId, liquidationData.LockedVaultId) bidId = biddingId } else { //if bid amount is less than the target bid @@ -634,7 +637,6 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater k.SetAuctionLimitBidFeeData(ctx, feeData) } - userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(amount.Amount) k.SetUserLimitBidData(ctx, userLimitBid, DebtTokenId, CollateralTokenId, PremiumDiscount) return nil diff --git a/x/liquidationsV2/expected/keeper.go b/x/liquidationsV2/expected/keeper.go index 9204d7e63..40b296a30 100644 --- a/x/liquidationsV2/expected/keeper.go +++ b/x/liquidationsV2/expected/keeper.go @@ -69,7 +69,7 @@ type LendKeeper interface { VerifyCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset, liquidationThreshold sdk.Dec) error CalculateCollateralizationRatio(ctx sdk.Context, amountIn sdk.Int, assetIn assettypes.Asset, amountOut sdk.Int, assetOut assettypes.Asset) (sdk.Dec, error) GetLend(ctx sdk.Context, id uint64) (lend lendtypes.LendAsset, found bool) - CreteNewBorrow(ctx sdk.Context, liqBorrow liquidationtypes.LockedVault) + // CreteNewBorrow(ctx sdk.Context, liqBorrow liquidationtypes.LockedVault) GetPool(ctx sdk.Context, id uint64) (pool lendtypes.Pool, found bool) GetAssetStatsByPoolIDAndAssetID(ctx sdk.Context, assetID, poolID uint64) (AssetStats lendtypes.PoolAssetLBMapping, found bool) From aad530f9d8f9128311041e340e975c6a14b8e2f6 Mon Sep 17 00:00:00 2001 From: Pratik Date: Sun, 11 Jun 2023 15:29:00 +0530 Subject: [PATCH 095/155] refactoring app.go --- app/app.go | 1 + 1 file changed, 1 insertion(+) diff --git a/app/app.go b/app/app.go index 996a2ec3d..b5420cf62 100644 --- a/app/app.go +++ b/app/app.go @@ -800,6 +800,7 @@ func New( app.EsmKeeper, app.VaultKeeper, app.CollectorKeeper, + app.TokenmintKeeper, ) wasmDir := filepath.Join(homePath, "wasm") wasmConfig, err := wasm.ReadWasmConfig(appOptions) From f55a1ba125ef0b2e2cbbf53dc6918bd0c25096f5 Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 12 Jun 2023 17:56:23 +0530 Subject: [PATCH 096/155] updating directory str v1beta1 -> v2 --- .../v1beta1 => auctions/v2}/auction.proto | 4 +- .../v1beta1 => auctions/v2}/bid.proto | 4 +- .../v1beta1 => auctions/v2}/genesis.proto | 6 +- .../v1beta1 => auctions/v2}/gov.proto | 6 +- .../v1beta1 => auctions/v2}/params.proto | 4 +- .../v1beta1 => auctions/v2}/query.proto | 6 +- .../v1beta1 => auctions/v2}/tx.proto | 4 +- testutil/keeper/auctionsV2.go | 4 +- x/auctionsV2/client/cli/query.go | 2 +- x/auctionsV2/client/cli/tx.go | 2 +- x/auctionsV2/keeper/auctions_test.go | 1 + x/auctionsV2/keeper/grpc_query.go | 10 ++ x/auctionsV2/keeper/keeper_test.go | 81 +++++++++ x/auctionsV2/types/auction.pb.go | 131 ++++++++------- x/auctionsV2/types/bid.pb.go | 158 +++++++++--------- x/auctionsV2/types/codec.go | 8 +- x/auctionsV2/types/errors.go | 2 +- x/auctionsV2/types/genesis.pb.go | 26 +-- x/auctionsV2/types/gov.pb.go | 38 ++--- x/auctionsV2/types/keys.go | 2 +- x/auctionsV2/types/params.pb.go | 22 +-- x/auctionsV2/types/query.pb.go | 56 +++---- x/auctionsV2/types/query.pb.gw.go | 2 +- x/auctionsV2/types/tx.pb.go | 113 +++++++------ x/liquidationsV2/keeper/grpc_query.go | 10 ++ x/liquidationsV2/keeper/keeper_test.go | 52 ++++++ 26 files changed, 454 insertions(+), 300 deletions(-) rename proto/comdex/{auctionsV2/v1beta1 => auctions/v2}/auction.proto (98%) rename proto/comdex/{auctionsV2/v1beta1 => auctions/v2}/bid.proto (99%) rename proto/comdex/{auctionsV2/v1beta1 => auctions/v2}/genesis.proto (66%) rename proto/comdex/{auctionsV2/v1beta1 => auctions/v2}/gov.proto (79%) rename proto/comdex/{auctionsV2/v1beta1 => auctions/v2}/params.proto (79%) rename proto/comdex/{auctionsV2/v1beta1 => auctions/v2}/query.proto (83%) rename proto/comdex/{auctionsV2/v1beta1 => auctions/v2}/tx.proto (97%) create mode 100644 x/auctionsV2/keeper/auctions_test.go create mode 100644 x/auctionsV2/keeper/keeper_test.go create mode 100644 x/liquidationsV2/keeper/keeper_test.go diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctions/v2/auction.proto similarity index 98% rename from proto/comdex/auctionsV2/v1beta1/auction.proto rename to proto/comdex/auctions/v2/auction.proto index 3837e20c9..51245d79f 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctions/v2/auction.proto @@ -1,12 +1,12 @@ syntax = "proto3"; -package comdex.auctionsV2.v1beta1; +package comdex.auctions.v2; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; import "comdex/liquidationsV2/v1beta1/liquidate.proto"; -option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; +option go_package = "github.com/comdex-official/comdex/x/auctions/types"; message AuctionHistorical{ uint64 auction_id = 1 [ diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctions/v2/bid.proto similarity index 99% rename from proto/comdex/auctionsV2/v1beta1/bid.proto rename to proto/comdex/auctions/v2/bid.proto index 18e0cb3a9..910397e85 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctions/v2/bid.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package comdex.auctionsV2.v1beta1; +package comdex.auctions.v2; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; +option go_package = "github.com/comdex-official/comdex/x/auctions/types"; message Bid{ uint64 bidding_id = 1 [ diff --git a/proto/comdex/auctionsV2/v1beta1/genesis.proto b/proto/comdex/auctions/v2/genesis.proto similarity index 66% rename from proto/comdex/auctionsV2/v1beta1/genesis.proto rename to proto/comdex/auctions/v2/genesis.proto index 96d9ec396..68bd46684 100644 --- a/proto/comdex/auctionsV2/v1beta1/genesis.proto +++ b/proto/comdex/auctions/v2/genesis.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package comdex.auctionsV2.v1beta1; +package comdex.auctions.v2; import "gogoproto/gogo.proto"; -import "comdex/auctionsV2/v1beta1/params.proto"; +import "comdex/auctions/v1beta1/params.proto"; -option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; +option go_package = "github.com/comdex-official/comdex/x/auctions/types"; message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; diff --git a/proto/comdex/auctionsV2/v1beta1/gov.proto b/proto/comdex/auctions/v2/gov.proto similarity index 79% rename from proto/comdex/auctionsV2/v1beta1/gov.proto rename to proto/comdex/auctions/v2/gov.proto index fc2ca179c..7672d9eeb 100644 --- a/proto/comdex/auctionsV2/v1beta1/gov.proto +++ b/proto/comdex/auctions/v2/gov.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package comdex.auctionsV2.v1beta1; +package comdex.auctions.v2; import "gogoproto/gogo.proto"; -import "comdex/auctionsV2/v1beta1/bid.proto"; +import "comdex/auctions/v1beta1/bid.proto"; -option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; +option go_package = "github.com/comdex-official/comdex/x/auctions/types"; message DutchAutoBidParamsProposal { string title = 1 [(gogoproto.moretags) = "yaml:\"title\""]; diff --git a/proto/comdex/auctionsV2/v1beta1/params.proto b/proto/comdex/auctions/v2/params.proto similarity index 79% rename from proto/comdex/auctionsV2/v1beta1/params.proto rename to proto/comdex/auctions/v2/params.proto index 675db1b85..b51778639 100644 --- a/proto/comdex/auctionsV2/v1beta1/params.proto +++ b/proto/comdex/auctions/v2/params.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package comdex.auctionsV2.v1beta1; +package comdex.auctions.v2; import "gogoproto/gogo.proto"; -option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; +option go_package = "github.com/comdex-official/comdex/x/auctions/types"; message Params { option (gogoproto.goproto_stringer) = false; diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctions/v2/query.proto similarity index 83% rename from proto/comdex/auctionsV2/v1beta1/query.proto rename to proto/comdex/auctions/v2/query.proto index 79ce69c2a..145564053 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctions/v2/query.proto @@ -1,12 +1,12 @@ syntax = "proto3"; -package comdex.auctionsV2.v1beta1; +package comdex.auctions.v2; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -import "comdex/auctionsV2/v1beta1/params.proto"; +import "comdex/auctions/v1beta1/params.proto"; -option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; +option go_package = "github.com/comdex-official/comdex/x/auctions/types"; service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { diff --git a/proto/comdex/auctionsV2/v1beta1/tx.proto b/proto/comdex/auctions/v2/tx.proto similarity index 97% rename from proto/comdex/auctionsV2/v1beta1/tx.proto rename to proto/comdex/auctions/v2/tx.proto index 58a03a5ce..82997953d 100644 --- a/proto/comdex/auctionsV2/v1beta1/tx.proto +++ b/proto/comdex/auctions/v2/tx.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package comdex.auctionsV2.v1beta1; +package comdex.auctions.v2; -option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; +option go_package = "github.com/comdex-official/comdex/x/auctions/types"; import "gogoproto/gogo.proto"; diff --git a/testutil/keeper/auctionsV2.go b/testutil/keeper/auctionsV2.go index 084ad00f0..f72ebb663 100644 --- a/testutil/keeper/auctionsV2.go +++ b/testutil/keeper/auctionsV2.go @@ -3,8 +3,8 @@ package keeper //import ( // "testing" // -// "github.com/comdex-official/comdex/x/auctionsV2/keeper" -// "github.com/comdex-official/comdex/x/auctionsV2/types" +// "github.com/comdex-official/comdex/x/auctions/keeper" +// "github.com/comdex-official/comdex/x/auctions/types" // "github.com/cosmos/cosmos-sdk/codec" // codectypes "github.com/cosmos/cosmos-sdk/codec/types" // "github.com/cosmos/cosmos-sdk/store" diff --git a/x/auctionsV2/client/cli/query.go b/x/auctionsV2/client/cli/query.go index 3168f6d39..f17801d9a 100644 --- a/x/auctionsV2/client/cli/query.go +++ b/x/auctionsV2/client/cli/query.go @@ -14,7 +14,7 @@ import ( ) func GetQueryCmd(queryRoute string) *cobra.Command { - // Group auctionsV2 queries under a subcommand + // Group auctions queries under a subcommand cmd := &cobra.Command{ Use: types.ModuleName, Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), diff --git a/x/auctionsV2/client/cli/tx.go b/x/auctionsV2/client/cli/tx.go index a110f8946..683e0b086 100644 --- a/x/auctionsV2/client/cli/tx.go +++ b/x/auctionsV2/client/cli/tx.go @@ -27,7 +27,7 @@ const ( // GetTxCmd returns the transaction commands for this module func GetTxCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "auctionsV2", + Use: "auctions", Short: "AuctionsV2 module sub-commands", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, diff --git a/x/auctionsV2/keeper/auctions_test.go b/x/auctionsV2/keeper/auctions_test.go new file mode 100644 index 000000000..942926490 --- /dev/null +++ b/x/auctionsV2/keeper/auctions_test.go @@ -0,0 +1 @@ +package keeper_test diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index 2a7953c0c..616ebf181 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -5,3 +5,13 @@ import ( ) var _ types.QueryServer = Keeper{} + +type QueryServer struct { + Keeper +} + +func NewQueryServer(k Keeper) types.QueryServer { + return &QueryServer{ + Keeper: k, + } +} diff --git a/x/auctionsV2/keeper/keeper_test.go b/x/auctionsV2/keeper/keeper_test.go new file mode 100644 index 000000000..25bc2200e --- /dev/null +++ b/x/auctionsV2/keeper/keeper_test.go @@ -0,0 +1,81 @@ +package keeper_test + +import ( + chain "github.com/comdex-official/comdex/app" + assetKeeper "github.com/comdex-official/comdex/x/asset/keeper" + "github.com/comdex-official/comdex/x/auctionsV2/keeper" + auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" + collectKeeper "github.com/comdex-official/comdex/x/collector/keeper" + lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" + liquidationKeeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper" + liquidationTypes "github.com/comdex-official/comdex/x/liquidationsV2/types" + marketKeeper "github.com/comdex-official/comdex/x/market/keeper" + tokenmintKeeper "github.com/comdex-official/comdex/x/tokenmint/keeper" + vaultKeeper "github.com/comdex-official/comdex/x/vault/keeper" + vaultTypes "github.com/comdex-official/comdex/x/vault/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/suite" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "testing" +) + +type KeeperTestSuite struct { + suite.Suite + + app *chain.App + ctx sdk.Context + vaultKeeper vaultKeeper.Keeper + assetKeeper assetKeeper.Keeper + liquidationKeeper liquidationKeeper.Keeper + tokenmintKeeper tokenmintKeeper.Keeper + marketKeeper marketKeeper.Keeper + collectorKeeper collectKeeper.Keeper + liquidationQuerier liquidationKeeper.QueryServer + vaultQuerier vaultKeeper.QueryServer + liquidationMsgServer liquidationTypes.MsgServer + vaultMsgServer vaultTypes.MsgServer + keeper keeper.Keeper + auctionMsgServer auctionsV2types.MsgServer + lendKeeper lendkeeper.Keeper + lendQuerier lendkeeper.QueryServer +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +func (s *KeeperTestSuite) SetupTest() { + s.app = chain.Setup(false) + s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.vaultKeeper = s.app.VaultKeeper + s.liquidationKeeper = s.app.NewliqKeeper + s.assetKeeper = s.app.AssetKeeper + s.collectorKeeper = s.app.CollectorKeeper + s.liquidationQuerier = liquidationKeeper.QueryServer{Keeper: s.liquidationKeeper} + s.liquidationMsgServer = liquidationKeeper.NewMsgServerImpl(s.liquidationKeeper) + s.vaultMsgServer = vaultKeeper.NewMsgServer(s.vaultKeeper) + s.vaultQuerier = vaultKeeper.QueryServer{Keeper: s.vaultKeeper} + s.marketKeeper = s.app.MarketKeeper + s.keeper = s.app.NewaucKeeper + s.auctionMsgServer = keeper.NewMsgServerImpl(s.keeper) + s.tokenmintKeeper = s.app.TokenmintKeeper + s.lendKeeper = s.app.LendKeeper + s.lendQuerier = lendkeeper.QueryServer{Keeper: s.lendKeeper} +} + +func (s *KeeperTestSuite) getBalance(addr string, denom string) (coin sdk.Coin, err error) { + addr1, err := sdk.AccAddressFromBech32(addr) + if err != nil { + return coin, err + } + return s.app.BankKeeper.GetBalance(s.ctx, addr1, denom), nil +} + +func (s *KeeperTestSuite) fundAddr(addr sdk.AccAddress, amt sdk.Coin) { + amt1 := sdk.NewCoins(amt) + s.T().Helper() + err := s.app.BankKeeper.MintCoins(s.ctx, liquidationTypes.ModuleName, amt1) + s.Require().NoError(err) + err = s.app.BankKeeper.SendCoinsFromModuleToAccount(s.ctx, liquidationTypes.ModuleName, addr, amt1) + s.Require().NoError(err) +} diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index a0199223a..32cbf4fef 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctionsV2/v1beta1/auction.proto +// source: comdex/auctions/v1beta1/auction.proto package types @@ -280,76 +280,77 @@ func (m *BidOwnerMapping) GetBidOwner() string { } func init() { - proto.RegisterType((*AuctionHistorical)(nil), "comdex.auctionsV2.v1beta1.AuctionHistorical") - proto.RegisterType((*Auction)(nil), "comdex.auctionsV2.v1beta1.Auction") - proto.RegisterType((*BidOwnerMapping)(nil), "comdex.auctionsV2.v1beta1.bidOwnerMapping") + proto.RegisterType((*AuctionHistorical)(nil), "comdex.auctions.v2.AuctionHistorical") + proto.RegisterType((*Auction)(nil), "comdex.auctions.v2.Auction") + proto.RegisterType((*BidOwnerMapping)(nil), "comdex.auctions.v2.bidOwnerMapping") } func init() { - proto.RegisterFile("comdex/auctionsV2/v1beta1/auction.proto", fileDescriptor_8ee47f5a405fa8ba) + proto.RegisterFile("comdex/auctions/v1beta1/auction.proto", fileDescriptor_8ee47f5a405fa8ba) } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 942 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0xdb, 0x36, - 0x18, 0x8e, 0x9a, 0xe6, 0xc3, 0xb4, 0x33, 0xd7, 0x6a, 0xda, 0x28, 0xce, 0x62, 0xb9, 0x3c, 0xb4, - 0xc6, 0x80, 0xc8, 0x68, 0xd7, 0xd3, 0xb0, 0x4b, 0xb4, 0x15, 0xa8, 0x87, 0xad, 0x1d, 0xb8, 0xa0, - 0x18, 0x76, 0x31, 0x28, 0x91, 0x76, 0x88, 0xc8, 0xa2, 0x66, 0xd1, 0xe9, 0xf2, 0x13, 0x76, 0x19, - 0x72, 0x1a, 0xb0, 0xf3, 0xfe, 0xc1, 0x7e, 0x45, 0x8f, 0x3d, 0x0e, 0x3b, 0x68, 0x43, 0xf2, 0x0f, - 0x74, 0xdc, 0x69, 0xe0, 0x87, 0x2c, 0xd9, 0xc9, 0x90, 0x65, 0xa7, 0x84, 0x2f, 0x9f, 0xf7, 0x79, - 0x1f, 0xbe, 0x7c, 0xf8, 0xca, 0xe0, 0x49, 0xc8, 0x27, 0x84, 0xfe, 0xd0, 0xc7, 0x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0x5c, 0x10, 0xd5, 0xd5, 0xf2, 0x50, 0xaf, 0x5e, 0x80, 0xe6, - 0xd2, 0x58, 0xb1, 0x1f, 0x80, 0xf5, 0x80, 0x91, 0xf9, 0x77, 0x03, 0xad, 0x05, 0x8c, 0x0c, 0x88, - 0xbd, 0x07, 0x6a, 0x32, 0xcc, 0x25, 0x54, 0x7d, 0x14, 0x6a, 0x68, 0xb3, 0x48, 0xf5, 0x5f, 0xbd, - 0xbb, 0xe8, 0x58, 0xef, 0x2f, 0x3a, 0xd6, 0x5f, 0x17, 0x1d, 0xeb, 0xfc, 0xb2, 0xb3, 0xf2, 0xfe, - 0xb2, 0xb3, 0xf2, 0xfb, 0x65, 0x67, 0xe5, 0xbb, 0xe7, 0x0b, 0x62, 0xe5, 0x68, 0x3b, 0xe0, 0xa3, - 0x11, 0x0b, 0x19, 0x8e, 0xcc, 0xba, 0xbf, 0xf0, 0x13, 0x45, 0xc9, 0x0f, 0xd6, 0x95, 0x7b, 0x3e, - 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x5d, 0xf0, 0x40, 0xc4, 0x08, 0x00, 0x00, + // 947 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x96, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0xc7, 0xcd, 0x38, 0xfe, 0xd0, 0xca, 0xae, 0x22, 0xc6, 0x89, 0x19, 0xb9, 0x16, 0x95, 0x2d, + 0x90, 0x08, 0x05, 0x4c, 0x21, 0x6e, 0x4e, 0x45, 0x2f, 0x66, 0x1b, 0x20, 0x2a, 0xda, 0xa4, 0xd8, + 0x1a, 0x41, 0x51, 0x14, 0x10, 0x96, 0xdc, 0x95, 0xbc, 0x30, 0xc5, 0x65, 0xc5, 0x95, 0x53, 0x3f, + 0x42, 0x2f, 0x85, 0x4f, 0x05, 0x0a, 0xf4, 0x0d, 0xfa, 0x22, 0x39, 0xe6, 0x58, 0xf4, 0xc0, 0x16, + 0xf6, 0x1b, 0xf0, 0xd8, 0x53, 0xb1, 0x1f, 0x14, 0x29, 0xc9, 0x40, 0xea, 0x9c, 0xec, 0x9d, 0x9d, + 0xf9, 0xcf, 0x6f, 0x67, 0x67, 0x87, 0x02, 0x8f, 0x43, 0x3e, 0x26, 0xf4, 0xa7, 0x1e, 0x9e, 0x86, + 0x82, 0xf1, 0x38, 0x7d, 0x75, 0xd8, 0x3b, 0x7b, 0x12, 0x50, 0x81, 0x9f, 0x14, 0x26, 0x2f, 0x99, + 0x70, 0xc1, 0x6d, 0x5b, 0x3b, 0x7a, 0x85, 0xa3, 0x77, 0x76, 0xd8, 0xda, 0x19, 0xf1, 0x11, 0x57, + 0xdb, 0x3d, 0xf9, 0x9f, 0xf6, 0x6c, 0xb9, 0x23, 0xce, 0x47, 0x11, 0xed, 0xa9, 0x55, 0x30, 0x1d, + 0xf6, 0x04, 0x1b, 0xd3, 0x54, 0xe0, 0x71, 0x62, 0x1c, 0xda, 0x21, 0x4f, 0xc7, 0x3c, 0xed, 0x05, + 0x38, 0xa5, 0xb3, 0x6c, 0x21, 0x67, 0x26, 0x55, 0xeb, 0xc0, 0x30, 0x45, 0xec, 0xc7, 0x29, 0x23, + 0x78, 0x91, 0xab, 0x30, 0x53, 0xed, 0x0e, 0x7f, 0xbf, 0x05, 0x9a, 0x47, 0x9a, 0xea, 0x39, 0x4b, + 0x05, 0x9f, 0xb0, 0x10, 0x47, 0xf6, 0x53, 0x00, 0x0c, 0xea, 0x80, 0x11, 0xc7, 0xea, 0x58, 0xdd, + 0xdb, 0xfe, 0xbd, 0x3c, 0x73, 0x9b, 0xe7, 0x78, 0x1c, 0x7d, 0x0a, 0xcb, 0x3d, 0x88, 0x6a, 0x66, + 0xd1, 0x27, 0x36, 0x03, 0x76, 0xb1, 0x73, 0x32, 0xd3, 0x72, 0x6e, 0x75, 0xac, 0x6e, 0xfd, 0x70, + 0xcf, 0x5b, 0x2e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xe9, 0x8e, 0x52, 0x72, 0xf2, 0xcc, 0xdd, 0xd1, 0x4a, 0x73, 0xdb, + 0x10, 0xd5, 0xe5, 0xba, 0x88, 0x3e, 0x01, 0x5b, 0x01, 0x8f, 0xa7, 0xa9, 0x19, 0x52, 0x4e, 0x53, + 0x35, 0xdd, 0xb3, 0x1b, 0x34, 0x5d, 0x3f, 0x16, 0xe5, 0xb9, 0xab, 0x5a, 0x10, 0xd5, 0xd5, 0xf2, + 0x48, 0xaf, 0x9e, 0x81, 0xc6, 0xc2, 0x58, 0xb1, 0xef, 0x81, 0xf5, 0x80, 0x91, 0xd9, 0x07, 0x03, + 0xad, 0x05, 0x8c, 0xf4, 0x89, 0xbd, 0x07, 0x6a, 0xd2, 0xcc, 0xa5, 0xab, 0xfa, 0x1a, 0xd4, 0xd0, + 0x66, 0x11, 0xea, 0xbf, 0x78, 0x73, 0xd9, 0xb6, 0xde, 0x5e, 0xb6, 0xad, 0x7f, 0x2e, 0xdb, 0xd6, + 0xc5, 0x55, 0x7b, 0xe5, 0xed, 0x55, 0x7b, 0xe5, 0xcf, 0xab, 0xf6, 0xca, 0xf7, 0x4f, 0xe7, 0x60, + 0xe5, 0x4c, 0x3b, 0xe0, 0xc3, 0x21, 0x0b, 0x19, 0x8e, 0xcc, 0xba, 0x37, 0xf7, 0x6b, 0x44, 0xe1, + 0x07, 0xeb, 0xaa, 0x7b, 0x3e, 0xf9, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x4f, 0x74, 0xce, 0x12, 0xaf, + 0x08, 0x00, 0x00, } func (m *AuctionHistorical) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index 145869867..b42ffef02 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctionsV2/v1beta1/bid.proto +// source: comdex/auctions/v1beta1/bid.proto package types @@ -432,90 +432,90 @@ func (m *AuctionFeesCollectionFromLimitBidTx) GetAssetId() uint64 { } func init() { - proto.RegisterType((*Bid)(nil), "comdex.auctionsV2.v1beta1.Bid") - proto.RegisterType((*LimitOrderBid)(nil), "comdex.auctionsV2.v1beta1.LimitOrderBid") - proto.RegisterType((*AuctionParams)(nil), "comdex.auctionsV2.v1beta1.AuctionParams") - proto.RegisterType((*LimitOrderBidsForUser)(nil), "comdex.auctionsV2.v1beta1.LimitOrderBidsForUser") - proto.RegisterType((*LimitOrderUserKey)(nil), "comdex.auctionsV2.v1beta1.LimitOrderUserKey") - proto.RegisterType((*AuctionFeesCollectionFromLimitBidTx)(nil), "comdex.auctionsV2.v1beta1.AuctionFeesCollectionFromLimitBidTx") + proto.RegisterType((*Bid)(nil), "comdex.auctions.v2.Bid") + proto.RegisterType((*LimitOrderBid)(nil), "comdex.auctions.v2.LimitOrderBid") + proto.RegisterType((*AuctionParams)(nil), "comdex.auctions.v2.AuctionParams") + proto.RegisterType((*LimitOrderBidsForUser)(nil), "comdex.auctions.v2.LimitOrderBidsForUser") + proto.RegisterType((*LimitOrderUserKey)(nil), "comdex.auctions.v2.LimitOrderUserKey") + proto.RegisterType((*AuctionFeesCollectionFromLimitBidTx)(nil), "comdex.auctions.v2.AuctionFeesCollectionFromLimitBidTx") } func init() { - proto.RegisterFile("comdex/auctionsV2/v1beta1/bid.proto", fileDescriptor_6f6db8f3a6a396ec) + proto.RegisterFile("comdex/auctions/v1beta1/bid.proto", fileDescriptor_6f6db8f3a6a396ec) } var fileDescriptor_6f6db8f3a6a396ec = []byte{ - // 1117 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x41, 0x6f, 0xe3, 0x44, - 0x14, 0xae, 0xdb, 0xb4, 0xdd, 0x4c, 0xc9, 0xb6, 0x71, 0xdb, 0xdd, 0xb4, 0x68, 0xe3, 0x32,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x92, 0x6f, 0x15, 0x8e, 0xa1, 0x5d, 0x91, 0x83, 0x3d, 0x19, 0xa7, 0x87, 0xa0, 0x3a, 0xd8, - 0xc4, 0x21, 0x47, 0x6a, 0x0b, 0xe2, 0x7b, 0x36, 0x4d, 0xc9, 0x22, 0x73, 0xc0, 0x22, 0xf3, 0x78, - 0x10, 0x61, 0xbd, 0xae, 0x3e, 0xa8, 0x56, 0xe4, 0xc1, 0x10, 0x02, 0x3e, 0xfb, 0xdd, 0xd0, 0xec, - 0x15, 0x65, 0x1f, 0xae, 0xd3, 0x77, 0xc0, 0x82, 0xdb, 0xed, 0x66, 0xac, 0x58, 0x14, 0xac, 0x18, - 0x29, 0x50, 0xda, 0xa1, 0x3d, 0xef, 0x76, 0xbb, 0x2d, 0xa4, 0x9b, 0xe0, 0x86, 0x47, 0x90, 0x93, - 0x7d, 0x75, 0xed, 0x86, 0xf8, 0x98, 0xd5, 0x7e, 0x6a, 0x2c, 0x0f, 0xf3, 0x09, 0x0f, 0xb4, 0x17, - 0x3d, 0x82, 0x8e, 0xb3, 0xd1, 0x6f, 0x25, 0x50, 0x39, 0x24, 0x21, 0xe1, 0x9f, 0xc4, 0x08, 0xc7, - 0x19, 0x77, 0x4f, 0xc0, 0xad, 0x20, 0x33, 0x38, 0x34, 0xb3, 0x38, 0x13, 0x3c, 0x7e, 0xad, 0x9f, - 0x1a, 0x77, 0x24, 0xde, 0xe5, 0x71, 0xd0, 0x5e, 0x0d, 0x46, 0x11, 0x15, 0xbb, 0x27, 0x9b, 0x3d, - 0x7b, 0xcd, 0x66, 0x1f, 0x81, 0xd5, 0x09, 0x82, 0x13, 0x24, 0xc8, 0x5d, 0xb2, 0xea, 0x39, 0x3f, - 0x2e, 0x09, 0x82, 0x76, 0x75, 0x8c, 0x91, 0x2d, 0xa4, 0x73, 0xb0, 0xd2, 0x8d, 0x71, 0x48, 0x92, - 0xd0, 0x41, 0x84, 0xf9, 0x43, 0x2e, 0x96, 0xad, 0x56, 0xb6,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00, 0x00, + // 1118 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xdf, 0x6e, 0x1b, 0xc5, + 0x17, 0xce, 0x26, 0x6e, 0x52, 0x4f, 0x7e, 0x6e, 0xe2, 0x49, 0xd2, 0xba, 0xf9, 0xa9, 0xde, 0x30, + 0xe1, 0x4f, 0x6e, 0xba, 0x56, 0x43, 0x2f, 0x10, 0x02, 0xa1, 0x6c, 0xa2, 0x20, 0xd3, 0x10, 0xca, + 0x92, 0x06, 0x09, 0x09, 0xad, 0x76, 0x77, 0xc6, 0xee, 0x28, 0xbb, 0x3b, 0x66, 0x67, 0x9c, 0xc4, + 0x17, 0xf0, 0x0c, 0xbd, 0xe0, 0x05, 0x78, 0x01, 0xb8, 0xe1, 0x21, 0x2a, 0x71, 0xd3, 0x4b, 0x04, + 0xd2, 0x82, 0x92, 0x07, 0x40, 0xf2, 0x25, 0x57, 0x68, 0x67, 0xc6, 0x5e, 0xaf, 0x9d, 0x42, 0xac, + 0xc2, 0xd5, 0xce, 0x9c, 0x73, 0xe6, 0x3b, 0x67, 0x67, 0xbe, 0xf9, 0xe6, 0x80, 0xcd, 0x80, 0x45, + 0x98, 0x9c, 0x37, 0xbc, 0x6e, 0x20, 0x28, 0x8b, 0xf9, 0xf1, 0x76, 0xe3, 0xf4, 0x81, 0x4f, 0x84, + 0xf7, 0xa0, 0xe1, 0x53, 0x6c, 0x75, 0x12, 0x26, 0x18, 0x84, 0x2a, 0xc8, 0x1a, 0x04, 0x59, 0xa7, + 0xdb, 0xeb, 0xab, 0x6d, 0xd6, 0x66, 0xd2, 0xdd, 0xc8, 0x46, 0x2a, 0x72, 0xdd, 0x6c, 0x33, 0xd6, + 0x0e, 0x49, 0x43, 0xce, 0xfc, 0x6e, 0xab, 0x21, 0x68, 0x44, 0xb8, 0xf0, 0xa2, 0x8e, 0x0e, 0xa8, + 0x07, 0x8c, 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 0xa1, 0x60, 0x0c, 0x6e, 0x9d, 0x51, 0xf1, 0x14, 0x27, 0xde, 0x99, 0x17, 0xba, 0x2d, 0x42, + 0x24, 0xf1, 0xca, 0xf6, 0x87, 0x53, 0x83, 0xaf, 0x29, 0xf0, 0x22, 0x1a, 0x72, 0x2a, 0xb9, 0x61, + 0x9f, 0x10, 0x48, 0xc0, 0x62, 0x10, 0x32, 0x9e, 0xed, 0x66, 0x96, 0x4c, 0x11, 0x73, 0x6f, 0xea, + 0x64, 0x50, 0xdf, 0x89, 0x1c, 0x0a, 0x39, 0x40, 0xcf, 0xb2, 0x34, 0x1f, 0x01, 0x18, 0xd1, 0xd8, + 0xed, 0x72, 0xec, 0x9e, 0x7a, 0x61, 0x97, 0xb8, 0x21, 0x69, 0x09, 0xcd, 0xc9, 0x7b, 0xfd, 0xd4, + 0xbc, 0xab, 0xd6, 0x4f, 0xc6, 0x20, 0x67, 0x29, 0xa2, 0xf1, 0x13, 0x8e, 0x8f, 0x33, 0xd3, 0x01, + 0x69, 0x09, 0xe8, 0x4b, 0x72, 0xb8, 0x2d, 0x2f, 0x10, 0x2c, 0x91, 0xe4, 0x2c, 0xdb, 0xbb, 0x53, + 0x57, 0x9c, 0x53, 0x49, 0x23, 0x29, 0x2a, 0xed, 0xcb, 0x31, 0xfc, 0x1a, 0xac, 0x84, 0xf4, 0xab, + 0x2e, 0xc5, 0x8a, 0x09, 0x1d, 0x12, 0x7b, 0xa1, 0xe8, 0x49, 0x3d, 0x2c, 0xdb, 0x07, 0x53, 0x27, + 0x5b, 0x1f, 0x28, 0xd8, 0x04, 0x24, 0x72, 0xe0, 0x88, 0xf5, 0xb1, 0x32, 0xc2, 0x13, 0x50, 0x19, + 0xb0, 0xd1, 0x67, 0x71, 0x97, 0x6b, 0x71, 0xdd, 0x9f, 0x3a, 0xf1, 0x6a, 0x91, 0xda, 0x12, 0x0c, + 0x39, 0xff, 0xd3, 0x73, 0x5b, 0x4e, 0x7f, 0x32, 0xc0, 0x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xac, 0xd5, + 0xa2, 0x01, 0xf5, 0x42, 0x3d, 0x6f, 0x14, 0xda, 0x7f, 0x99, 0xcc, 0x9f, 0x97, 0xbd, 0xd7, 0xdb, + 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x32, 0xbc, 0x83, 0x0f, 0x20, 0x0c, 0x00, 0x00, } func (m *Bid) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/codec.go b/x/auctionsV2/types/codec.go index 2dcc7cab7..34ca95c8a 100644 --- a/x/auctionsV2/types/codec.go +++ b/x/auctionsV2/types/codec.go @@ -9,10 +9,10 @@ import ( ) func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgPlaceMarketBidRequest{}, "comdex/auctionsV2/MsgPlaceMarketBidRequest", nil) - cdc.RegisterConcrete(&MsgDepositLimitBidRequest{}, "comdex/auctionsV2/MsgPlaceLimitBidRequest", nil) - cdc.RegisterConcrete(&MsgCancelLimitBidRequest{}, "comdex/auctionsV2/MsgCancelLimitBidRequest", nil) - cdc.RegisterConcrete(&MsgWithdrawLimitBidRequest{}, "comdex/auctionsV2/MsgWithdrawLimitBidRequest", nil) + cdc.RegisterConcrete(&MsgPlaceMarketBidRequest{}, "comdex/auctions/MsgPlaceMarketBidRequest", nil) + cdc.RegisterConcrete(&MsgDepositLimitBidRequest{}, "comdex/auctions/MsgPlaceLimitBidRequest", nil) + cdc.RegisterConcrete(&MsgCancelLimitBidRequest{}, "comdex/auctions/MsgCancelLimitBidRequest", nil) + cdc.RegisterConcrete(&MsgWithdrawLimitBidRequest{}, "comdex/auctions/MsgWithdrawLimitBidRequest", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index e382d60db..0f9b664da 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -6,7 +6,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -// x/auctionsV2 module sentinel errors +// x/auctions module sentinel errors var ( ErrDutchAuctionDisabled = sdkerrors.Register(ModuleName, 701, "Dutch auction not enabled for the app") ErrEnglishAuctionDisabled = sdkerrors.Register(ModuleName, 702, "English auction not enabled for the app") diff --git a/x/auctionsV2/types/genesis.pb.go b/x/auctionsV2/types/genesis.pb.go index 70e86b595..1df795b52 100644 --- a/x/auctionsV2/types/genesis.pb.go +++ b/x/auctionsV2/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctionsV2/v1beta1/genesis.proto +// source: comdex/auctions/v1beta1/genesis.proto package types @@ -68,11 +68,11 @@ func (m *GenesisState) GetParams() Params { } func init() { - proto.RegisterType((*GenesisState)(nil), "comdex.auctionsV2.v1beta1.GenesisState") + proto.RegisterType((*GenesisState)(nil), "comdex.auctions.v2.GenesisState") } func init() { - proto.RegisterFile("comdex/auctionsV2/v1beta1/genesis.proto", fileDescriptor_eebc68c04739f45f) + proto.RegisterFile("comdex/auctions/v1beta1/genesis.proto", fileDescriptor_eebc68c04739f45f) } var fileDescriptor_eebc68c04739f45f = []byte{ @@ -80,16 +80,16 @@ var fileDescriptor_eebc68c04739f45f = []byte{ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4f, 0xce, 0xcf, 0x4d, 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x84, 0x28, 0xd4, 0x43, 0x28, 0xd4, 0x83, 0x2a, 0x94, 0x12, 0x49, - 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0xa4, 0xd4, 0x70, 0x9b, 0x5c, 0x90, - 0x58, 0x94, 0x98, 0x0b, 0x35, 0x58, 0xc9, 0x9f, 0x8b, 0xc7, 0x1d, 0x62, 0x53, 0x70, 0x49, 0x62, - 0x49, 0xaa, 0x90, 0x3d, 0x17, 0x1b, 0x44, 0x5e, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x51, - 0x0f, 0xa7, 0xcd, 0x7a, 0x01, 0x60, 0x85, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xb5, - 0x39, 0xf9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, - 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x49, 0x7a, 0x66, - 0x49, 0x46, 0x69, 0x12, 0xc8, 0x40, 0x7d, 0x88, 0xa1, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, - 0x89, 0x39, 0x50, 0xbe, 0x3e, 0x8a, 0x7b, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xee, - 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xff, 0x32, 0x82, 0x5d, 0x2b, 0x01, 0x00, 0x00, + 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0x28, 0xd4, 0x83, 0x29, 0xd4, 0x2b, 0x33, 0x92, 0x12, 0x49, + 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xeb, 0x83, 0x58, 0x10, 0x95, 0x52, 0x6a, 0xb8, 0x8d, 0x2c, 0x48, + 0x2c, 0x4a, 0xcc, 0x85, 0x9a, 0xa8, 0xe4, 0xc1, 0xc5, 0xe3, 0x0e, 0xb1, 0x22, 0xb8, 0x24, 0xb1, + 0x24, 0x55, 0xc8, 0x82, 0x8b, 0x0d, 0x22, 0x2f, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa5, + 0x87, 0x69, 0xa5, 0x5e, 0x00, 0x58, 0x85, 0x13, 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0xf5, + 0x4e, 0x7e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, + 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x92, 0x9e, 0x59, + 0x92, 0x51, 0x9a, 0x04, 0x32, 0x49, 0x1f, 0x62, 0x9a, 0x6e, 0x7e, 0x5a, 0x5a, 0x66, 0x72, 0x66, + 0x62, 0x0e, 0x94, 0xaf, 0x8f, 0xe2, 0xd0, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x03, + 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x59, 0x33, 0xba, 0xd7, 0x1d, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/gov.pb.go b/x/auctionsV2/types/gov.pb.go index febe11e3e..67194795e 100644 --- a/x/auctionsV2/types/gov.pb.go +++ b/x/auctionsV2/types/gov.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctionsV2/v1beta1/gov.proto +// source: comdex/auctions/v1beta1/gov.proto package types @@ -84,33 +84,33 @@ func (m *DutchAutoBidParamsProposal) GetAuctionParams() AuctionParams { } func init() { - proto.RegisterType((*DutchAutoBidParamsProposal)(nil), "comdex.auctionsV2.v1beta1.DutchAutoBidParamsProposal") + proto.RegisterType((*DutchAutoBidParamsProposal)(nil), "comdex.auctions.v2.DutchAutoBidParamsProposal") } func init() { - proto.RegisterFile("comdex/auctionsV2/v1beta1/gov.proto", fileDescriptor_11f3d7c5f2a28b27) + proto.RegisterFile("comdex/auctions/v1beta1/gov.proto", fileDescriptor_11f3d7c5f2a28b27) } var fileDescriptor_11f3d7c5f2a28b27 = []byte{ - // 286 bytes of a gzipped FileDescriptorProto + // 285 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0xcf, 0x4d, 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0xcf, 0x2f, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0x92, 0x84, 0x28, 0xd2, 0x43, 0x28, 0xd2, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, - 0xab, 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0xa4, 0xf0, 0x98, 0x9a, 0x94, 0x99, 0x02, 0x51, 0xa4, 0x74, - 0x85, 0x91, 0x4b, 0xca, 0xa5, 0xb4, 0x24, 0x39, 0xc3, 0xb1, 0xb4, 0x24, 0xdf, 0x29, 0x33, 0x25, - 0x20, 0xb1, 0x28, 0x31, 0xb7, 0x38, 0xa0, 0x28, 0xbf, 0x20, 0xbf, 0x38, 0x31, 0x47, 0x48, 0x8d, - 0x8b, 0xb5, 0x24, 0xb3, 0x24, 0x27, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, 0x49, 0xe0, 0xd3, - 0x3d, 0x79, 0x9e, 0xca, 0xc4, 0xdc, 0x1c, 0x2b, 0x25, 0xb0, 0xb0, 0x52, 0x10, 0x44, 0x5a, 0xc8, - 0x82, 0x8b, 0x3b, 0x25, 0xb5, 0x38, 0xb9, 0x28, 0xb3, 0x00, 0x64, 0x95, 0x04, 0x13, 0x58, 0xb5, - 0xd8, 0xa7, 0x7b, 0xf2, 0x42, 0x10, 0xd5, 0x48, 0x92, 0x4a, 0x41, 0xc8, 0x4a, 0x85, 0x42, 0xb8, - 0x78, 0xa1, 0x0e, 0x84, 0x58, 0x2d, 0xc1, 0xac, 0xc0, 0xa8, 0xc1, 0x6d, 0xa4, 0xa1, 0x87, 0xd3, - 0xbb, 0x7a, 0x8e, 0xc8, 0xea, 0x9d, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x42, 0x35, 0xc4, 0xc9, - 0xef, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, - 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x4c, 0xd2, 0x33, 0x4b, 0x32, - 0x4a, 0x93, 0x40, 0xc6, 0xeb, 0x43, 0xac, 0xd0, 0xcd, 0x4f, 0x4b, 0xcb, 0x4c, 0xce, 0x4c, 0xcc, - 0x81, 0xf2, 0xf5, 0x51, 0x82, 0xac, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0x5a, 0xc6, - 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x96, 0x81, 0x80, 0x98, 0xaa, 0x01, 0x00, 0x00, + 0x12, 0x82, 0x28, 0xd2, 0x83, 0x29, 0xd2, 0x2b, 0x33, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, + 0x4b, 0xeb, 0x83, 0x58, 0x10, 0x95, 0x52, 0x78, 0x8c, 0x4b, 0xca, 0x4c, 0x81, 0x28, 0x52, 0x3a, + 0xcb, 0xc8, 0x25, 0xe5, 0x52, 0x5a, 0x92, 0x9c, 0xe1, 0x58, 0x5a, 0x92, 0xef, 0x94, 0x99, 0x12, + 0x90, 0x58, 0x94, 0x98, 0x5b, 0x1c, 0x50, 0x94, 0x5f, 0x90, 0x5f, 0x9c, 0x98, 0x23, 0xa4, 0xc6, + 0xc5, 0x5a, 0x92, 0x59, 0x92, 0x93, 0x2a, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0xf0, 0xe9, + 0x9e, 0x3c, 0x4f, 0x65, 0x62, 0x6e, 0x8e, 0x95, 0x12, 0x58, 0x58, 0x29, 0x08, 0x22, 0x2d, 0x64, + 0xc1, 0xc5, 0x9d, 0x92, 0x5a, 0x9c, 0x5c, 0x94, 0x59, 0x00, 0xb2, 0x4a, 0x82, 0x09, 0xac, 0x5a, + 0xec, 0xd3, 0x3d, 0x79, 0x21, 0x88, 0x6a, 0x24, 0x49, 0xa5, 0x20, 0x64, 0xa5, 0x42, 0xbe, 0x5c, + 0xbc, 0x50, 0x07, 0x42, 0xac, 0x96, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x36, 0x52, 0xd4, 0xc3, 0xf4, + 0xa7, 0x9e, 0x23, 0xb2, 0x42, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0x50, 0x75, 0x3b, 0xf9, + 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, + 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x49, 0x7a, 0x66, 0x49, 0x46, + 0x69, 0x12, 0xc8, 0x5c, 0x7d, 0x88, 0xd9, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, + 0x50, 0xbe, 0x3e, 0x4a, 0x58, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x83, 0xc9, 0x18, + 0x10, 0x00, 0x00, 0xff, 0xff, 0x13, 0x4e, 0x3c, 0x09, 0x9c, 0x01, 0x00, 0x00, } func (m *DutchAutoBidParamsProposal) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index 9ee590df7..2e74387a3 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -6,7 +6,7 @@ import ( const ( // ModuleName defines the module name - ModuleName = "auctionsV2" + ModuleName = "auctions" // StoreKey defines the primary module store key StoreKey = ModuleName diff --git a/x/auctionsV2/types/params.pb.go b/x/auctionsV2/types/params.pb.go index 64e5f8ff0..891a36165 100644 --- a/x/auctionsV2/types/params.pb.go +++ b/x/auctionsV2/types/params.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctionsV2/v1beta1/params.proto +// source: comdex/auctions/v1beta1/params.proto package types @@ -59,11 +59,11 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo func init() { - proto.RegisterType((*Params)(nil), "comdex.auctionsV2.v1beta1.Params") + proto.RegisterType((*Params)(nil), "comdex.auctions.v2.Params") } func init() { - proto.RegisterFile("comdex/auctionsV2/v1beta1/params.proto", fileDescriptor_5122d8002bd05fc0) + proto.RegisterFile("comdex/auctions/v1beta1/params.proto", fileDescriptor_5122d8002bd05fc0) } var fileDescriptor_5122d8002bd05fc0 = []byte{ @@ -71,14 +71,14 @@ var fileDescriptor_5122d8002bd05fc0 = []byte{ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4b, 0xce, 0xcf, 0x4d, 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, - 0x2f, 0xc9, 0x17, 0x92, 0x84, 0xa8, 0xd3, 0x43, 0xa8, 0xd3, 0x83, 0xaa, 0x93, 0x12, 0x49, 0xcf, - 0x4f, 0xcf, 0x07, 0xab, 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0x94, 0xf8, 0xb8, 0xd8, 0x02, 0xc0, 0x06, - 0x58, 0xb1, 0xcc, 0x58, 0x20, 0xcf, 0xe0, 0xe4, 0x77, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, - 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, - 0x72, 0x0c, 0x51, 0x26, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x10, - 0x5b, 0x74, 0xf3, 0xd3, 0xd2, 0x32, 0x93, 0x33, 0x13, 0x73, 0xa0, 0x7c, 0x7d, 0x14, 0xf7, 0x95, - 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xad, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x8d, - 0x26, 0xbe, 0x52, 0xc1, 0x00, 0x00, 0x00, + 0x2f, 0xc9, 0x17, 0x12, 0x82, 0xa8, 0xd3, 0x83, 0xa9, 0xd3, 0x2b, 0x33, 0x92, 0x12, 0x49, 0xcf, + 0x4f, 0xcf, 0x07, 0x4b, 0xeb, 0x83, 0x58, 0x10, 0x95, 0x4a, 0x7c, 0x5c, 0x6c, 0x01, 0x60, 0x9d, + 0x56, 0x2c, 0x33, 0x16, 0xc8, 0x33, 0x38, 0xf9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, + 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, + 0x1c, 0x43, 0x94, 0x49, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xc4, + 0x78, 0xdd, 0xfc, 0xb4, 0xb4, 0xcc, 0xe4, 0xcc, 0xc4, 0x1c, 0x28, 0x5f, 0x1f, 0xc5, 0x61, 0x25, + 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x6b, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x69, + 0x89, 0xe6, 0x27, 0xba, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index 8ecdcde08..b4849c93d 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctionsV2/v1beta1/query.proto +// source: comdex/auctions/v1beta1/query.proto package types @@ -111,36 +111,36 @@ func (m *QueryParamsResponse) GetParams() Params { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "comdex.auctions.v2.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "comdex.auctions.v2.QueryParamsResponse") } func init() { - proto.RegisterFile("comdex/auctionsV2/v1beta1/query.proto", fileDescriptor_5270c3f1c79728ac) + proto.RegisterFile("comdex/auctions/v1beta1/query.proto", fileDescriptor_5270c3f1c79728ac) } var fileDescriptor_5270c3f1c79728ac = []byte{ // 316 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xb1, 0x4a, 0x73, 0x31, - 0x14, 0xc7, 0x6f, 0x3e, 0x3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 0x83, 0x34, 0xa8, 0x9d, 0xff, 0xd3, 0xb7, - 0x9d, 0xa4, 0x1b, 0xb5, 0xf6, 0x33, 0x4a, 0xd7, 0x7c, 0x30, 0x7e, 0x42, 0x69, 0x25, 0x20, 0xb8, - 0xf9, 0x4b, 0xca, 0xcf, 0xd9, 0x6a, 0xf4, 0xaf, 0x78, 0x18, 0xba, 0xde, 0xbc, 0x7f, 0xf9, 0x78, - 0xfc, 0x77, 0x80, 0x1b, 0x2c, 0x78, 0x4d, 0xe8, 0xf7, 0x55, 0xae, 0xf8, 0x20, 0xde, 0x99, 0x16, - 0xb7, 0xbc, 0xc8, 0xe3, 0x5a, 0x3a, 0x67, 0xd3, 0x39, 0x41, 0xb3, 0x39, 0x41, 0xef, 0x73, 0x82, - 0x1e, 0x16, 0x24, 0x99, 0x2d, 0x48, 0xf2, 0xba, 0x20, 0xc9, 0xe5, 0x89, 0x54, 0xee, 0xba, 0xc8, - 0x96, 0xed, 0xcb, 0xa2, 0x56, 0xf6, 0xed, 0x26, 0x46, 0xd8, 0xac, 0xe2, 0xf7, 0x7c, 0xfc, 0x19, - 0x00, 0x00, 0xff, 0xff, 0x32, 0xff, 0x8b, 0xae, 0x33, 0x02, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0xbf, 0x4e, 0xf3, 0x30, + 0x14, 0xc5, 0xe3, 0x4f, 0x1f, 0x1d, 0xcc, 0x66, 0x3a, 0xa0, 0x08, 0x19, 0x54, 0xa9, 0x2d, 0x42, + 0x6a, 0xac, 0x06, 0x06, 0xe6, 0x3e, 0x00, 0x7f, 0x3a, 0x30, 0xb0, 0x39, 0xc1, 0x35, 0x96, 0x5a, + 0x5f, 0xb7, 0x76, 0x0a, 0x5d, 0x99, 0x18, 0x11, 0xbc, 0x54, 0xc7, 0x4a, 0x2c, 0x4c, 0x08, 0x35, + 0x3c, 0x08, 0x4a, 0x1c, 0x90, 0x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55, 0x7c, 0x58, 0xfd, 0x33, 0x2d, + 0xee, 0x78, 0x96, 0x56, 0x0d, 0xf4, 0xce, 0xe6, 0x4b, 0x8a, 0x16, 0x4b, 0x8a, 0x3e, 0x96, 0x14, + 0x3d, 0xe5, 0x34, 0x58, 0xe4, 0x34, 0x78, 0xcb, 0x69, 0x70, 0x7d, 0x22, 0x95, 0xbb, 0xcd, 0x92, + 0xe2, 0xee, 0x26, 0xab, 0x95, 0x6a, 0xdd, 0xcc, 0x08, 0x9b, 0xd4, 0xca, 0x4a, 0x8f, 0xbf, 0x02, + 0x00, 0x00, 0xff, 0xff, 0xae, 0x22, 0x79, 0x02, 0x17, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -168,7 +168,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/comdex.auctions.v2.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -202,7 +202,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/comdex.auctionsV2.v1beta1.Query/Params", + FullMethod: "/comdex.auctions.v2.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -211,7 +211,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.auctionsV2.v1beta1.Query", + ServiceName: "comdex.auctions.v2.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -220,7 +220,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "comdex/auctionsV2/v1beta1/query.proto", + Metadata: "comdex/auctions/v1beta1/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/query.pb.gw.go b/x/auctionsV2/types/query.pb.gw.go index 86a8e63fa..c2426ab56 100644 --- a/x/auctionsV2/types/query.pb.gw.go +++ b/x/auctionsV2/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: comdex/auctionsV2/v1beta1/query.proto +// source: comdex/auctions/v1beta1/query.proto /* Package types is a reverse proxy. diff --git a/x/auctionsV2/types/tx.pb.go b/x/auctionsV2/types/tx.pb.go index 206ec8877..84b34efe6 100644 --- a/x/auctionsV2/types/tx.pb.go +++ b/x/auctionsV2/types/tx.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctionsV2/v1beta1/tx.proto +// source: comdex/auctions/v1beta1/tx.proto package types @@ -336,58 +336,57 @@ func (m *MsgWithdrawLimitBidResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgWithdrawLimitBidResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgPlaceMarketBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceMarketBidRequest") - proto.RegisterType((*MsgPlaceMarketBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceMarketBidResponse") - proto.RegisterType((*MsgDepositLimitBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgDepositLimitBidRequest") - proto.RegisterType((*MsgDepositLimitBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgDepositLimitBidResponse") - proto.RegisterType((*MsgCancelLimitBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgCancelLimitBidRequest") - proto.RegisterType((*MsgCancelLimitBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgCancelLimitBidResponse") - proto.RegisterType((*MsgWithdrawLimitBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgWithdrawLimitBidRequest") - proto.RegisterType((*MsgWithdrawLimitBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgWithdrawLimitBidResponse") + proto.RegisterType((*MsgPlaceMarketBidRequest)(nil), "comdex.auctions.v2.MsgPlaceMarketBidRequest") + proto.RegisterType((*MsgPlaceMarketBidResponse)(nil), "comdex.auctions.v2.MsgPlaceMarketBidResponse") + proto.RegisterType((*MsgDepositLimitBidRequest)(nil), "comdex.auctions.v2.MsgDepositLimitBidRequest") + proto.RegisterType((*MsgDepositLimitBidResponse)(nil), "comdex.auctions.v2.MsgDepositLimitBidResponse") + proto.RegisterType((*MsgCancelLimitBidRequest)(nil), "comdex.auctions.v2.MsgCancelLimitBidRequest") + proto.RegisterType((*MsgCancelLimitBidResponse)(nil), "comdex.auctions.v2.MsgCancelLimitBidResponse") + proto.RegisterType((*MsgWithdrawLimitBidRequest)(nil), "comdex.auctions.v2.MsgWithdrawLimitBidRequest") + proto.RegisterType((*MsgWithdrawLimitBidResponse)(nil), "comdex.auctions.v2.MsgWithdrawLimitBidResponse") } func init() { - proto.RegisterFile("comdex/auctionsV2/v1beta1/tx.proto", fileDescriptor_2c216a24ef98c1b4) + proto.RegisterFile("comdex/auctions/v1beta1/tx.proto", fileDescriptor_2c216a24ef98c1b4) } var fileDescriptor_2c216a24ef98c1b4 = []byte{ - // 568 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0xc7, 0x93, 0xae, 0x54, 0xaa, 0x27, 0x04, 0xf3, 0x10, 0xb4, 0x19, 0x4b, 0xab, 0x1c, 0x50, - 0x2f, 0x73, 0xb4, 0x6e, 0x80, 0xc4, 0xb1, 0xdb, 0xa5, 0x12, 0x95, 0x50, 0x85, 0x86, 0xc4, 0xa5, - 0x72, 0x62, 0xaf, 0xb3, 0x9a, 0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0x95, 0x09, 0x4e, 0x81, 0xad, 0x9f, 0xe7, 0xc1, 0x5a, 0x4b, 0x74, 0xe1, 0x7b, 0xb0, 0x71, - 0x63, 0xe0, 0xe1, 0x1e, 0x5a, 0x78, 0xc8, 0xa1, 0x45, 0x47, 0x95, 0xb5, 0xbf, 0x5a, 0x91, 0xf2, - 0x01, 0x3f, 0x98, 0x00, 0xde, 0x9c, 0x0d, 0xb8, 0x64, 0xb1, 0xec, 0x23, 0xc8, 0x7a, 0xbc, 0x62, - 0x95, 0xf6, 0xa0, 0x18, 0xcc, 0x77, 0xe0, 0x32, 0x06, 0x99, 0xd3, 0xba, 0x8c, 0x41, 0x76, 0x93, - 0xc3, 0x8f, 0x26, 0xd8, 0xcc, 0xf8, 0x56, 0x70, 0xc9, 0x76, 0x16, 0x0c, 0x85, 0xf5, 0x64, 0xd5, - 0x32, 0x65, 0xa3, 0x71, 0x34, 0xfc, 0x69, 0x1b, 0x9f, 0xc7, 0xb6, 0x31, 0x1c, 0xdb, 0xe6, 0xc5, - 0xd8, 0x36, 0x7f, 0x8c, 0x6d, 0xf3, 0x7c, 0x62, 0x1b, 0x17, 0x13, 0xdb, 0xf8, 0x36, 0xb1, 0x8d, - 0xd7, 0xfb, 0x73, 0x8d, 0x9f, 0xbc, 0x63, 0x87, 0x1f, 0x1f, 0x33, 0x9f, 0xe1, 0x40, 0x3f, 0xbb, - 0x73, 0x97, 0x67, 0x3a, 0x0a, 0x5e, 0x21, 0xbd, 0xe7, 0xf6, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, - 0xba, 0xe5, 0xa9, 0x6c, 0x5e, 0x07, 0x00, 0x00, + // 560 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0xb5, 0x93, 0x10, 0x29, 0x5b, 0x21, 0xe8, 0x16, 0x41, 0xea, 0x52, 0x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0x4e, 0xaf, 0xb4, 0xf9, 0x5a, 0x4a, 0xa5, + 0x7b, 0xcb, 0xe4, 0x29, 0x89, 0xf0, 0x87, 0x5b, 0xcf, 0x6d, 0xec, 0xb9, 0x7d, 0xb0, 0x97, 0x2b, + 0x5c, 0x26, 0x6c, 0xe7, 0x5b, 0x19, 0x94, 0xfb, 0x62, 0x04, 0x43, 0xb0, 0xbd, 0x76, 0xe1, 0xe1, + 0x53, 0xb4, 0xbe, 0xdd, 0x50, 0xd1, 0x8e, 0x32, 0xda, 0x1b, 0xa2, 0xb3, 0xce, 0x50, 0x00, 0xb8, + 0x7e, 0x19, 0x60, 0x51, 0x91, 0xfc, 0x65, 0x63, 0xa0, 0x4d, 0xe1, 0xaa, 0x69, 0x36, 0xe6, 0xaa, + 0xc9, 0x0a, 0xc7, 0xcc, 0xbd, 0x89, 0x85, 0x63, 0xe6, 0x3b, 0x17, 0x4e, 0xc0, 0x4e, 0x8e, 0xfe, + 0xb0, 0x88, 0x78, 0x81, 0xc3, 0x0d, 0x7b, 0x63, 0x7c, 0xd6, 0xb7, 0x7b, 0x3c, 0xfd, 0x65, 0x6a, + 0x9f, 0xe7, 0xa6, 0x36, 0x9d, 0x9b, 0xfa, 0xc5, 0xdc, 0xd4, 0x7f, 0xce, 0x4d, 0xfd, 0xd3, 0xc2, + 0xd4, 0x2e, 0x16, 0xa6, 0xf6, 0x7d, 0x61, 0x6a, 0xef, 0x9e, 0xaf, 0xd8, 0x37, 0x29, 0xde, 0xe6, + 0x27, 0x27, 0xcc, 0x65, 0xd8, 0x53, 0x67, 0x7b, 0xe5, 0xed, 0x4b, 0x0d, 0xed, 0x54, 0xd3, 0xd7, + 0xea, 0xd9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x32, 0x35, 0xb7, 0x83, 0x1d, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -418,7 +417,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) MsgPlaceMarketBid(ctx context.Context, in *MsgPlaceMarketBidRequest, opts ...grpc.CallOption) (*MsgPlaceMarketBidResponse, error) { out := new(MsgPlaceMarketBidResponse) - err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgPlaceMarketBid", in, out, opts...) + err := c.cc.Invoke(ctx, "/comdex.auctions.v2.Msg/MsgPlaceMarketBid", in, out, opts...) if err != nil { return nil, err } @@ -427,7 +426,7 @@ func (c *msgClient) MsgPlaceMarketBid(ctx context.Context, in *MsgPlaceMarketBid func (c *msgClient) MsgDepositLimitBid(ctx context.Context, in *MsgDepositLimitBidRequest, opts ...grpc.CallOption) (*MsgDepositLimitBidResponse, error) { out := new(MsgDepositLimitBidResponse) - err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgDepositLimitBid", in, out, opts...) + err := c.cc.Invoke(ctx, "/comdex.auctions.v2.Msg/MsgDepositLimitBid", in, out, opts...) if err != nil { return nil, err } @@ -436,7 +435,7 @@ func (c *msgClient) MsgDepositLimitBid(ctx context.Context, in *MsgDepositLimitB func (c *msgClient) MsgCancelLimitBid(ctx context.Context, in *MsgCancelLimitBidRequest, opts ...grpc.CallOption) (*MsgCancelLimitBidResponse, error) { out := new(MsgCancelLimitBidResponse) - err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgCancelLimitBid", in, out, opts...) + err := c.cc.Invoke(ctx, "/comdex.auctions.v2.Msg/MsgCancelLimitBid", in, out, opts...) if err != nil { return nil, err } @@ -445,7 +444,7 @@ func (c *msgClient) MsgCancelLimitBid(ctx context.Context, in *MsgCancelLimitBid func (c *msgClient) MsgWithdrawLimitBid(ctx context.Context, in *MsgWithdrawLimitBidRequest, opts ...grpc.CallOption) (*MsgWithdrawLimitBidResponse, error) { out := new(MsgWithdrawLimitBidResponse) - err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgWithdrawLimitBid", in, out, opts...) + err := c.cc.Invoke(ctx, "/comdex.auctions.v2.Msg/MsgWithdrawLimitBid", in, out, opts...) if err != nil { return nil, err } @@ -491,7 +490,7 @@ func _Msg_MsgPlaceMarketBid_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgPlaceMarketBid", + FullMethod: "/comdex.auctions.v2.Msg/MsgPlaceMarketBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).MsgPlaceMarketBid(ctx, req.(*MsgPlaceMarketBidRequest)) @@ -509,7 +508,7 @@ func _Msg_MsgDepositLimitBid_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgDepositLimitBid", + FullMethod: "/comdex.auctions.v2.Msg/MsgDepositLimitBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).MsgDepositLimitBid(ctx, req.(*MsgDepositLimitBidRequest)) @@ -527,7 +526,7 @@ func _Msg_MsgCancelLimitBid_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgCancelLimitBid", + FullMethod: "/comdex.auctions.v2.Msg/MsgCancelLimitBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).MsgCancelLimitBid(ctx, req.(*MsgCancelLimitBidRequest)) @@ -545,7 +544,7 @@ func _Msg_MsgWithdrawLimitBid_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgWithdrawLimitBid", + FullMethod: "/comdex.auctions.v2.Msg/MsgWithdrawLimitBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).MsgWithdrawLimitBid(ctx, req.(*MsgWithdrawLimitBidRequest)) @@ -554,7 +553,7 @@ func _Msg_MsgWithdrawLimitBid_Handler(srv interface{}, ctx context.Context, dec } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.auctionsV2.v1beta1.Msg", + ServiceName: "comdex.auctions.v2.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -575,7 +574,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "comdex/auctionsV2/v1beta1/tx.proto", + Metadata: "comdex/auctions/v1beta1/tx.proto", } func (m *MsgPlaceMarketBidRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/liquidationsV2/keeper/grpc_query.go b/x/liquidationsV2/keeper/grpc_query.go index c67891845..aad735ed6 100644 --- a/x/liquidationsV2/keeper/grpc_query.go +++ b/x/liquidationsV2/keeper/grpc_query.go @@ -5,3 +5,13 @@ import ( ) var _ types.QueryServer = Keeper{} + +type QueryServer struct { + Keeper +} + +func NewQueryServer(k Keeper) types.QueryServer { + return &QueryServer{ + Keeper: k, + } +} diff --git a/x/liquidationsV2/keeper/keeper_test.go b/x/liquidationsV2/keeper/keeper_test.go new file mode 100644 index 000000000..d98c7bd8e --- /dev/null +++ b/x/liquidationsV2/keeper/keeper_test.go @@ -0,0 +1,52 @@ +package keeper_test + +import ( + chain "github.com/comdex-official/comdex/app" + assetKeeper "github.com/comdex-official/comdex/x/asset/keeper" + lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" + liquidationKeeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper" + "github.com/comdex-official/comdex/x/liquidationsV2/types" + marketKeeper "github.com/comdex-official/comdex/x/market/keeper" + vaultKeeper "github.com/comdex-official/comdex/x/vault/keeper" + vaultTypes "github.com/comdex-official/comdex/x/vault/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/suite" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "testing" +) + +type KeeperTestSuite struct { + suite.Suite + + app *chain.App + ctx sdk.Context + vaultKeeper vaultKeeper.Keeper + assetKeeper assetKeeper.Keeper + liquidationKeeper liquidationKeeper.Keeper + marketKeeper marketKeeper.Keeper + querier liquidationKeeper.QueryServer + vaultQuerier vaultKeeper.QueryServer + msgServer types.MsgServer + vaultMsgServer vaultTypes.MsgServer + lendKeeper lendkeeper.Keeper + lendQuerier lendkeeper.QueryServer +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +func (s *KeeperTestSuite) SetupTest() { + s.app = chain.Setup(false) + s.ctx = s.app.BaseApp.NewContext(false, tmproto.Header{}) + s.vaultKeeper = s.app.VaultKeeper + s.liquidationKeeper = s.app.NewliqKeeper + s.assetKeeper = s.app.AssetKeeper + s.querier = liquidationKeeper.QueryServer{Keeper: s.liquidationKeeper} + s.msgServer = liquidationKeeper.NewMsgServerImpl(s.liquidationKeeper) + s.vaultMsgServer = vaultKeeper.NewMsgServer(s.vaultKeeper) + s.vaultQuerier = vaultKeeper.QueryServer{Keeper: s.vaultKeeper} + s.marketKeeper = s.app.MarketKeeper + s.lendKeeper = s.app.LendKeeper + s.lendQuerier = lendkeeper.QueryServer{Keeper: s.lendKeeper} +} From b7104588e06b6ebb7595c4dc6494ab2f1ed0c942 Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 16 Jun 2023 13:33:17 +0530 Subject: [PATCH 097/155] liquidationsV2 and auctionsV2 queries added --- proto/comdex/auctions/v2/query.proto | 22 - .../v2 => auctionsV2/v1beta1}/auction.proto | 4 +- .../v2 => auctionsV2/v1beta1}/bid.proto | 4 +- .../v2 => auctionsV2/v1beta1}/genesis.proto | 6 +- .../v2 => auctionsV2/v1beta1}/gov.proto | 6 +- .../v2 => auctionsV2/v1beta1}/params.proto | 4 +- proto/comdex/auctionsV2/v1beta1/query.proto | 88 + .../v2 => auctionsV2/v1beta1}/tx.proto | 5 +- .../liquidationsV2/v1beta1/liquidate.proto | 21 +- .../comdex/liquidationsV2/v1beta1/query.proto | 106 +- x/auctionsV2/client/cli/query.go | 82 +- x/auctionsV2/keeper/grpc_query.go | 147 +- x/auctionsV2/keeper/keeper.go | 6 - x/auctionsV2/module.go | 8 +- x/auctionsV2/types/auction.pb.go | 131 +- x/auctionsV2/types/bid.pb.go | 158 +- x/auctionsV2/types/errors.go | 1 + x/auctionsV2/types/genesis.pb.go | 26 +- x/auctionsV2/types/gov.pb.go | 38 +- x/auctionsV2/types/params.pb.go | 22 +- x/auctionsV2/types/query.pb.go | 2009 +++++++++++- x/auctionsV2/types/query.pb.gw.go | 452 ++- x/auctionsV2/types/tx.pb.go | 113 +- x/liquidationsV2/client/cli/query.go | 214 +- x/liquidationsV2/keeper/grpc_query.go | 164 +- x/liquidationsV2/module.go | 2 +- x/liquidationsV2/types/keys.go | 1 + x/liquidationsV2/types/liquidate.pb.go | 238 +- x/liquidationsV2/types/query.pb.go | 2847 ++++++++++++++++- x/liquidationsV2/types/query.pb.gw.go | 574 ++++ 30 files changed, 6828 insertions(+), 671 deletions(-) delete mode 100644 proto/comdex/auctions/v2/query.proto rename proto/comdex/{auctions/v2 => auctionsV2/v1beta1}/auction.proto (98%) rename proto/comdex/{auctions/v2 => auctionsV2/v1beta1}/bid.proto (99%) rename proto/comdex/{auctions/v2 => auctionsV2/v1beta1}/genesis.proto (66%) rename proto/comdex/{auctions/v2 => auctionsV2/v1beta1}/gov.proto (79%) rename proto/comdex/{auctions/v2 => auctionsV2/v1beta1}/params.proto (79%) create mode 100644 proto/comdex/auctionsV2/v1beta1/query.proto rename proto/comdex/{auctions/v2 => auctionsV2/v1beta1}/tx.proto (97%) diff --git a/proto/comdex/auctions/v2/query.proto b/proto/comdex/auctions/v2/query.proto deleted file mode 100644 index 145564053..000000000 --- a/proto/comdex/auctions/v2/query.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; -package comdex.auctions.v2; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "comdex/auctions/v1beta1/params.proto"; - -option go_package = "github.com/comdex-official/comdex/x/auctions/types"; - -service Query { - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/comdex-official/comdex/newauc/params"; - } -} - -message QueryParamsRequest {} - -message QueryParamsResponse { - Params params = 1 [(gogoproto.nullable) = false]; -} - diff --git a/proto/comdex/auctions/v2/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto similarity index 98% rename from proto/comdex/auctions/v2/auction.proto rename to proto/comdex/auctionsV2/v1beta1/auction.proto index 51245d79f..3837e20c9 100644 --- a/proto/comdex/auctions/v2/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -1,12 +1,12 @@ syntax = "proto3"; -package comdex.auctions.v2; +package comdex.auctionsV2.v1beta1; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; import "comdex/liquidationsV2/v1beta1/liquidate.proto"; -option go_package = "github.com/comdex-official/comdex/x/auctions/types"; +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; message AuctionHistorical{ uint64 auction_id = 1 [ diff --git a/proto/comdex/auctions/v2/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto similarity index 99% rename from proto/comdex/auctions/v2/bid.proto rename to proto/comdex/auctionsV2/v1beta1/bid.proto index 910397e85..18e0cb3a9 100644 --- a/proto/comdex/auctions/v2/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package comdex.auctions.v2; +package comdex.auctionsV2.v1beta1; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/comdex-official/comdex/x/auctions/types"; +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; message Bid{ uint64 bidding_id = 1 [ diff --git a/proto/comdex/auctions/v2/genesis.proto b/proto/comdex/auctionsV2/v1beta1/genesis.proto similarity index 66% rename from proto/comdex/auctions/v2/genesis.proto rename to proto/comdex/auctionsV2/v1beta1/genesis.proto index 68bd46684..96d9ec396 100644 --- a/proto/comdex/auctions/v2/genesis.proto +++ b/proto/comdex/auctionsV2/v1beta1/genesis.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package comdex.auctions.v2; +package comdex.auctionsV2.v1beta1; import "gogoproto/gogo.proto"; -import "comdex/auctions/v1beta1/params.proto"; +import "comdex/auctionsV2/v1beta1/params.proto"; -option go_package = "github.com/comdex-official/comdex/x/auctions/types"; +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; diff --git a/proto/comdex/auctions/v2/gov.proto b/proto/comdex/auctionsV2/v1beta1/gov.proto similarity index 79% rename from proto/comdex/auctions/v2/gov.proto rename to proto/comdex/auctionsV2/v1beta1/gov.proto index 7672d9eeb..fc2ca179c 100644 --- a/proto/comdex/auctions/v2/gov.proto +++ b/proto/comdex/auctionsV2/v1beta1/gov.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package comdex.auctions.v2; +package comdex.auctionsV2.v1beta1; import "gogoproto/gogo.proto"; -import "comdex/auctions/v1beta1/bid.proto"; +import "comdex/auctionsV2/v1beta1/bid.proto"; -option go_package = "github.com/comdex-official/comdex/x/auctions/types"; +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; message DutchAutoBidParamsProposal { string title = 1 [(gogoproto.moretags) = "yaml:\"title\""]; diff --git a/proto/comdex/auctions/v2/params.proto b/proto/comdex/auctionsV2/v1beta1/params.proto similarity index 79% rename from proto/comdex/auctions/v2/params.proto rename to proto/comdex/auctionsV2/v1beta1/params.proto index b51778639..675db1b85 100644 --- a/proto/comdex/auctions/v2/params.proto +++ b/proto/comdex/auctionsV2/v1beta1/params.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package comdex.auctions.v2; +package comdex.auctionsV2.v1beta1; import "gogoproto/gogo.proto"; -option go_package = "github.com/comdex-official/comdex/x/auctions/types"; +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; message Params { option (gogoproto.goproto_stringer) = false; diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto new file mode 100644 index 000000000..f341b741f --- /dev/null +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -0,0 +1,88 @@ +syntax = "proto3"; +package comdex.auctionsV2.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "comdex/auctionsV2/v1beta1/params.proto"; +import "comdex/auctionsV2/v1beta1/auction.proto"; +import "comdex/auctionsV2/v1beta1/bid.proto"; + +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; + +message QueryParamsRequest {} + +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false]; +} + +message QueryAuctionRequest { + uint64 auction_id = 1; + bool history = 2; +} + +message QueryAuctionResponse { + Auction auction = 1 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"auction\""]; +} + +message QueryAuctionsRequest { + bool history = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryAuctionsResponse { + repeated Auction auctions = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"auctions\"" + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryBidsRequest { + string bidder = 1; + bool history = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryBidsResponse { + string bidder = 1 [ + (gogoproto.moretags) = "yaml:\"bidder\"" + ]; + repeated Bid bids = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"bids\"" + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 3 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryAuctionParamsRequest {} + +message QueryAuctionParamsResponse { + AuctionParams auction_params = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"auction_params\"" + ]; +} + +service Query { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/comdex/auctions/v2/params"; + } + rpc Auction(QueryAuctionRequest) returns (QueryAuctionResponse) { + option (google.api.http).get = "/comdex/auctions/v2/auction/{auction_id}/{history}"; + } + rpc Auctions(QueryAuctionsRequest) returns (QueryAuctionsResponse) { + option (google.api.http).get = "/comdex/auctions/v2/auctions/{history}"; + } + rpc Bids(QueryBidsRequest) returns (QueryBidsResponse) { + option (google.api.http).get = "/comdex/auctions/v2/bids/{bidder}/{history}"; + } + rpc AuctionParams(QueryAuctionParamsRequest) returns (QueryAuctionParamsResponse) { + option (google.api.http).get = "/comdex/auctions/v2/auction_params"; + } +} \ No newline at end of file diff --git a/proto/comdex/auctions/v2/tx.proto b/proto/comdex/auctionsV2/v1beta1/tx.proto similarity index 97% rename from proto/comdex/auctions/v2/tx.proto rename to proto/comdex/auctionsV2/v1beta1/tx.proto index 82997953d..cf9539dae 100644 --- a/proto/comdex/auctions/v2/tx.proto +++ b/proto/comdex/auctionsV2/v1beta1/tx.proto @@ -1,8 +1,7 @@ syntax = "proto3"; -package comdex.auctions.v2; +package comdex.auctionsV2.v1beta1; - -option go_package = "github.com/comdex-official/comdex/x/auctions/types"; +option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; import "gogoproto/gogo.proto"; diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index 67a9e8338..27223f71d 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -23,32 +23,33 @@ message LiquidationWhiteListing { //bool param //true - comdex apps //false external apps - bool initiator = 6 [ + bool initiator = 2 [ (gogoproto.customname) = "Initiator", (gogoproto.moretags) = "yaml:\"initiator\""]; //Sets of Params for Dutch Auction - bool is_dutch_activated = 7 [ + bool is_dutch_activated = 3 [ (gogoproto.customname) = "IsDutchActivated", (gogoproto.moretags) = "yaml:\"is_dutch_activated\""]; - DutchAuctionParam dutch_auction_param = 8[ + DutchAuctionParam dutch_auction_param = 4[ (gogoproto.customname) = "DutchAuctionParam", (gogoproto.moretags) = "yaml:\"dutch_auction_param\""]; //Sets of Params for English Auction - bool is_english_activated = 9 [ + bool is_english_activated = 5 [ (gogoproto.customname) = "IsEnglishActivated", (gogoproto.moretags) = "yaml:\"is_english_activated\""]; - EnglishAuctionParam english_auction_param = 10[ + EnglishAuctionParam english_auction_param = 6[ (gogoproto.customname) = "EnglishAuctionParam", (gogoproto.moretags) = "yaml:\"english_auction_param\""]; //One thing to keep in mind that somehow it should not happen that a void is created where something at level 2 gets triggerred and it has no data saved a level 1 for lookup and it fails . - string keeeper_incentive = 11 [ + string keeeper_incentive = 7 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"keeper_incentive\"" ]; } + message AppReserveFunds{ uint64 app_id = 1 [ (gogoproto.customname) = "AppId", @@ -62,6 +63,7 @@ message AppReserveFunds{ (gogoproto.nullable) = false ]; } + message AppReserveFundsTxData{ uint64 app_id = 1 [ (gogoproto.customname) = "AppId", @@ -72,8 +74,8 @@ message AppReserveFundsTxData{ (gogoproto.moretags) = "yaml:\"asset_tx_data\"", (gogoproto.nullable) = false ]; - } + message AssetTxData{ uint64 asset_id = 1 [ (gogoproto.customname) = "AssetId", @@ -107,6 +109,7 @@ message DutchAuctionParam{ ]; } + message EnglishAuctionParam{ string decrement_factor = 1 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", @@ -116,8 +119,6 @@ message EnglishAuctionParam{ } - - message LiquidationOffsetHolder { uint64 app_id = 1 [ (gogoproto.customname) = "AppId", @@ -126,13 +127,11 @@ message LiquidationOffsetHolder { uint64 current_offset = 2; } - //Internal keepers are bots run by people to liquidate positions of comdex apps //They run tx function to liquidate the positions //External keeper function allows external projects to use comdex auction- //market to liquidate their positions and take part in auctions. - message LockedVault { uint64 id = 1 [ diff --git a/proto/comdex/liquidationsV2/v1beta1/query.proto b/proto/comdex/liquidationsV2/v1beta1/query.proto index c29c11f68..c0031f214 100644 --- a/proto/comdex/liquidationsV2/v1beta1/query.proto +++ b/proto/comdex/liquidationsV2/v1beta1/query.proto @@ -5,18 +5,112 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "comdex/liquidationsV2/v1beta1/params.proto"; +import "comdex/liquidationsV2/v1beta1/liquidate.proto"; option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; -service Query { - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/comdex-official/comdex/liquidationsV2/params"; - } -} - message QueryParamsRequest {} message QueryParamsResponse { Params params = 1 [(gogoproto.nullable) = false]; } +message QueryLockedVaultRequest { + uint64 app_id = 1; + uint64 id = 2; +} + +message QueryLockedVaultResponse { + LockedVault locked_vault = 1 + [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"locked_vault\"" ]; +} + +message QueryLockedVaultsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1 + [ (gogoproto.moretags) = "yaml:\"pagination\"" ]; +} + +message QueryLockedVaultsResponse { + repeated LockedVault locked_vaults = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"locked_vaults\"" + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2 + [ (gogoproto.moretags) = "yaml:\"pagination\"" ]; +} + +message QueryLiquidationWhiteListingRequest { + uint64 app_id = 1; +} + +message QueryLiquidationWhiteListingResponse { + LiquidationWhiteListing liquidation_whiteListing = 1 [ + (gogoproto.moretags) = "yaml:\"liquidation_whiteListing\"", + (gogoproto.nullable) = false + ]; +} + +message QueryLiquidationWhiteListingsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1 + [ (gogoproto.moretags) = "yaml:\"pagination\"" ]; +} + +message QueryLiquidationWhiteListingsResponse { + repeated LiquidationWhiteListing liquidation_whiteListings = 1 [ + (gogoproto.moretags) = "yaml:\"liquidation_whiteListings\"", + (gogoproto.nullable) = false + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2 + [ (gogoproto.moretags) = "yaml:\"pagination\"" ]; +} + +message QueryLockedVaultsHistoryRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1 + [ (gogoproto.moretags) = "yaml:\"pagination\"" ]; +} + +message QueryLockedVaultsHistoryResponse { + repeated LockedVault locked_vaults_history = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"locked_vaults_history\"" + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2 + [ (gogoproto.moretags) = "yaml:\"pagination\"" ]; +} + + +message QueryAppReserveFundsTxDataRequest { + uint64 app_id = 1; +} + +message QueryAppReserveFundsTxDataResponse { + AppReserveFundsTxData app_reserve_funds_tx_data = 1 [ + (gogoproto.moretags) = "yaml:\"app_reserve_funds_tx_data\"", + (gogoproto.nullable) = false + ]; +} + + +service Query { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/comdex-official/comdex/liquidationsV2/params"; + } + rpc QueryLockedVault(QueryLockedVaultRequest) returns (QueryLockedVaultResponse) { + option (google.api.http).get = "/comdex/liquidationsV2/v1beta1/locked_vault/{app_id}/{id}"; + } + rpc QueryLockedVaults(QueryLockedVaultsRequest) returns (QueryLockedVaultsResponse) { + option (google.api.http).get = "/comdex/liquidationsV2/v1beta1/locked_vaults"; + } + rpc QueryLiquidationWhiteListing(QueryLiquidationWhiteListingRequest) returns (QueryLiquidationWhiteListingResponse) { + option (google.api.http).get = "/comdex/liquidationsV2/v1beta1/liquidation_whiteListing/{app_id}"; + } + rpc QueryLiquidationWhiteListings(QueryLiquidationWhiteListingsRequest) returns (QueryLiquidationWhiteListingsResponse) { + option (google.api.http).get = "/comdex/liquidationsV2/v1beta1/liquidation_whiteListings"; + } + rpc QueryLockedVaultsHistory(QueryLockedVaultsHistoryRequest) returns (QueryLockedVaultsHistoryResponse) { + option (google.api.http).get = "/comdex/liquidationsV2/v1beta1/locked_vaults_history"; + } + rpc QueryAppReserveFundsTxData(QueryAppReserveFundsTxDataRequest) returns (QueryAppReserveFundsTxDataResponse) { + option (google.api.http).get = "/comdex/liquidationsV2/v1beta1/app_reserve_funds_tx_data/{app_id}"; + } +} diff --git a/x/auctionsV2/client/cli/query.go b/x/auctionsV2/client/cli/query.go index f17801d9a..fd3fec3c8 100644 --- a/x/auctionsV2/client/cli/query.go +++ b/x/auctionsV2/client/cli/query.go @@ -1,7 +1,11 @@ package cli import ( + "context" "fmt" + "github.com/cosmos/cosmos-sdk/client/flags" + "strconv" + // "strings" "github.com/spf13/cobra" @@ -23,7 +27,83 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand() + cmd.AddCommand( + queryAuction(), + queryAuctions(), + ) + + return cmd +} +func queryAuction() *cobra.Command { + cmd := &cobra.Command{ + Use: "auction [auction id] [history]", + Short: "Query auction", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + auctionID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + history, err := strconv.ParseBool(args[1]) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.Auction( + context.Background(), + &types.QueryAuctionRequest{ + AuctionId: auctionID, + History: history, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +func queryAuctions() *cobra.Command { + cmd := &cobra.Command{ + Use: "auctions [history]", + Short: "Query all auctions", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + history, err := strconv.ParseBool(args[0]) + if err != nil { + return err + } + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.Auctions( + context.Background(), + &types.QueryAuctionsRequest{ + History: history, + Pagination: pagination, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "auctions") return cmd } diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index 616ebf181..4150c81f4 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -1,10 +1,16 @@ package keeper import ( + "context" "github.com/comdex-official/comdex/x/auctionsV2/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) -var _ types.QueryServer = Keeper{} +var _ types.QueryServer = QueryServer{} type QueryServer struct { Keeper @@ -15,3 +21,142 @@ func NewQueryServer(k Keeper) types.QueryServer { Keeper: k, } } + +func (q QueryServer) Auction(c context.Context, req *types.QueryAuctionRequest) (res *types.QueryAuctionResponse, err error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + ctx = sdk.UnwrapSDKContext(c) + item types.Auction + ) + if req.History { + auctionHistorical, _ := q.GetAuctionHistorical(ctx, req.AuctionId) + item = *auctionHistorical.AuctionHistorical + } else { + item, err = q.GetAuction(ctx, req.AuctionId) + } + if err != nil { + return nil, err + } + + return &types.QueryAuctionResponse{ + Auction: item, + }, nil +} + +func (q QueryServer) Auctions(c context.Context, req *types.QueryAuctionsRequest) (*types.QueryAuctionsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + items []types.Auction + ctx = sdk.UnwrapSDKContext(c) + key []byte + ) + if req.History { + key = types.AuctionHistoricalKeyPrefix + } else { + key = types.AuctionKeyPrefix + } + pagination, err := query.FilteredPaginate( + prefix.NewStore(q.Store(ctx), key), + req.Pagination, + func(_, value []byte, accumulate bool) (bool, error) { + var item types.Auction + if err := q.cdc.Unmarshal(value, &item); err != nil { + return false, err + } + + if accumulate { + items = append(items, item) + } + + return true, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAuctionsResponse{ + Auctions: items, + Pagination: pagination, + }, nil +} + +func (q QueryServer) Bids(c context.Context, req *types.QueryBidsRequest) (*types.QueryBidsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + ctx = sdk.UnwrapSDKContext(c) + key []byte + items []types.Bid + ) + if req.History { + //TODO: add historical key + //key = types.HistoryUserAuctionTypeKey(req.Bidder, req.AppId, types.DutchString) + } else { + key = types.UserBidKeyPrefix + + } + + pagination, err := query.FilteredPaginate( + prefix.NewStore(q.Store(ctx), key), + req.Pagination, + func(_, value []byte, accumulate bool) (bool, error) { + var item types.Bid + if err := q.cdc.Unmarshal(value, &item); err != nil { + return false, err + } + + if accumulate { + items = append(items, item) + } + + return true, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryBidsResponse{ + Bidder: req.Bidder, + Bids: items, + Pagination: pagination, + }, nil +} + +func (q QueryServer) AuctionParams(c context.Context, req *types.QueryAuctionParamsRequest) (*types.QueryAuctionParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + ctx = sdk.UnwrapSDKContext(c) + item types.AuctionParams + ) + + item, found := q.GetAuctionParams(ctx) + if !found { + return nil, types.ErrAuctionParamsNotFound + } + + return &types.QueryAuctionParamsResponse{ + AuctionParams: item, + }, nil +} + +func (q QueryServer) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + return &types.QueryParamsResponse{Params: q.GetParams(ctx)}, nil +} diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index dddb97927..1d0476695 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -1,7 +1,6 @@ package keeper import ( - "context" "fmt" "github.com/comdex-official/comdex/x/auctionsV2/expected" @@ -29,11 +28,6 @@ type ( } ) -func (k Keeper) Params(ctx context.Context, request *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - //TODO implement me - panic("implement me") -} - func NewKeeper( cdc codec.BinaryCodec, storeKey, diff --git a/x/auctionsV2/module.go b/x/auctionsV2/module.go index 3b4dfa760..fa7911fc7 100644 --- a/x/auctionsV2/module.go +++ b/x/auctionsV2/module.go @@ -12,8 +12,8 @@ import ( abci "github.com/tendermint/tendermint/abci/types" "github.com/comdex-official/comdex/x/auctionsV2/client/cli" - "github.com/comdex-official/comdex/x/auctionsV2/keeper" "github.com/comdex-official/comdex/x/auctionsV2/expected" + "github.com/comdex-official/comdex/x/auctionsV2/keeper" "github.com/comdex-official/comdex/x/auctionsV2/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -95,8 +95,8 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { type AppModule struct { AppModuleBasic - keeper keeper.Keeper - bankKeeper expected.BankKeeper + keeper keeper.Keeper + bankKeeper expected.BankKeeper } func NewAppModule( @@ -132,7 +132,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServer(am.keeper)) } // RegisterInvariants registers the capability module's invariants. diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index 32cbf4fef..a0199223a 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctions/v1beta1/auction.proto +// source: comdex/auctionsV2/v1beta1/auction.proto package types @@ -280,77 +280,76 @@ func (m *BidOwnerMapping) GetBidOwner() string { } func init() { - proto.RegisterType((*AuctionHistorical)(nil), "comdex.auctions.v2.AuctionHistorical") - proto.RegisterType((*Auction)(nil), "comdex.auctions.v2.Auction") - proto.RegisterType((*BidOwnerMapping)(nil), "comdex.auctions.v2.bidOwnerMapping") + proto.RegisterType((*AuctionHistorical)(nil), "comdex.auctionsV2.v1beta1.AuctionHistorical") + proto.RegisterType((*Auction)(nil), "comdex.auctionsV2.v1beta1.Auction") + proto.RegisterType((*BidOwnerMapping)(nil), "comdex.auctionsV2.v1beta1.bidOwnerMapping") } func init() { - proto.RegisterFile("comdex/auctions/v1beta1/auction.proto", fileDescriptor_8ee47f5a405fa8ba) + proto.RegisterFile("comdex/auctionsV2/v1beta1/auction.proto", fileDescriptor_8ee47f5a405fa8ba) } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 947 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x96, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0xc7, 0xcd, 0x38, 0xfe, 0xd0, 0xca, 0xae, 0x22, 0xc6, 0x89, 0x19, 0xb9, 0x16, 0x95, 0x2d, - 0x90, 0x08, 0x05, 0x4c, 0x21, 0x6e, 0x4e, 0x45, 0x2f, 0x66, 0x1b, 0x20, 0x2a, 0xda, 0xa4, 0xd8, - 0x1a, 0x41, 0x51, 0x14, 0x10, 0x96, 0xdc, 0x95, 0xbc, 0x30, 0xc5, 0x65, 0xc5, 0x95, 0x53, 0x3f, - 0x42, 0x2f, 0x85, 0x4f, 0x05, 0x0a, 0xf4, 0x0d, 0xfa, 0x22, 0x39, 0xe6, 0x58, 0xf4, 0xc0, 0x16, - 0xf6, 0x1b, 0xf0, 0xd8, 0x53, 0xb1, 0x1f, 0x14, 0x29, 0xc9, 0x40, 0xea, 0x9c, 0xec, 0x9d, 0x9d, - 0xf9, 0xcf, 0x6f, 0x67, 0x67, 0x87, 0x02, 0x8f, 0x43, 0x3e, 0x26, 0xf4, 0xa7, 0x1e, 0x9e, 0x86, - 0x82, 0xf1, 0x38, 0x7d, 0x75, 0xd8, 0x3b, 0x7b, 0x12, 0x50, 0x81, 0x9f, 0x14, 0x26, 0x2f, 0x99, - 0x70, 0xc1, 0x6d, 0x5b, 0x3b, 0x7a, 0x85, 0xa3, 0x77, 0x76, 0xd8, 0xda, 0x19, 0xf1, 0x11, 0x57, - 0xdb, 0x3d, 0xf9, 0x9f, 0xf6, 0x6c, 0xb9, 0x23, 0xce, 0x47, 0x11, 0xed, 0xa9, 0x55, 0x30, 0x1d, - 0xf6, 0x04, 0x1b, 0xd3, 0x54, 0xe0, 0x71, 0x62, 0x1c, 0xda, 0x21, 0x4f, 0xc7, 0x3c, 0xed, 0x05, - 0x38, 0xa5, 0xb3, 0x6c, 0x21, 0x67, 0x26, 0x55, 0xeb, 0xc0, 0x30, 0x45, 0xec, 0xc7, 0x29, 0x23, - 0x78, 0x91, 0xab, 0x30, 0x53, 0xed, 0x0e, 0x7f, 0xbf, 0x05, 0x9a, 0x47, 0x9a, 0xea, 0x39, 0x4b, - 0x05, 0x9f, 0xb0, 0x10, 0x47, 0xf6, 0x53, 0x00, 0x0c, 0xea, 0x80, 0x11, 0xc7, 0xea, 0x58, 0xdd, - 0xdb, 0xfe, 0xbd, 0x3c, 0x73, 0x9b, 0xe7, 0x78, 0x1c, 0x7d, 0x0a, 0xcb, 0x3d, 0x88, 0x6a, 0x66, - 0xd1, 0x27, 0x36, 0x03, 0x76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xd4, 0x2c, 0xad, 0x47, 0xd2, 0xd8, 0x27, 0xf6, 0x67, - 0x60, 0x5b, 0x75, 0xd0, 0x4c, 0xe9, 0x8e, 0x52, 0x72, 0xf2, 0xcc, 0xdd, 0xd1, 0x4a, 0x73, 0xdb, - 0x10, 0xd5, 0xe5, 0xba, 0x88, 0x3e, 0x01, 0x5b, 0x01, 0x8f, 0xa7, 0xa9, 0x19, 0x52, 0x4e, 0x53, - 0x35, 0xdd, 0xb3, 0x1b, 0x34, 0x5d, 0x3f, 0x16, 0xe5, 0xb9, 0xab, 0x5a, 0x10, 0xd5, 0xd5, 0xf2, - 0x48, 0xaf, 0x9e, 0x81, 0xc6, 0xc2, 0x58, 0xb1, 0xef, 0x81, 0xf5, 0x80, 0x91, 0xd9, 0x07, 0x03, - 0xad, 0x05, 0x8c, 0xf4, 0x89, 0xbd, 0x07, 0x6a, 0xd2, 0xcc, 0xa5, 0xab, 0xfa, 0x1a, 0xd4, 0xd0, - 0x66, 0x11, 0xea, 0xbf, 0x78, 0x73, 0xd9, 0xb6, 0xde, 0x5e, 0xb6, 0xad, 0x7f, 0x2e, 0xdb, 0xd6, - 0xc5, 0x55, 0x7b, 0xe5, 0xed, 0x55, 0x7b, 0xe5, 0xcf, 0xab, 0xf6, 0xca, 0xf7, 0x4f, 0xe7, 0x60, - 0xe5, 0x4c, 0x3b, 0xe0, 0xc3, 0x21, 0x0b, 0x19, 0x8e, 0xcc, 0xba, 0x37, 0xf7, 0x6b, 0x44, 0xe1, - 0x07, 0xeb, 0xaa, 0x7b, 0x3e, 0xf9, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x4f, 0x74, 0xce, 0x12, 0xaf, - 0x08, 0x00, 0x00, + // 942 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0xdb, 0x36, + 0x18, 0x8e, 0x9a, 0xe6, 0xc3, 0xb4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 0x00, 0xff, 0xff, 0xd5, 0x5d, 0xf0, 0x40, 0xc4, 0x08, 0x00, 0x00, } func (m *AuctionHistorical) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/bid.pb.go b/x/auctionsV2/types/bid.pb.go index b42ffef02..145869867 100644 --- a/x/auctionsV2/types/bid.pb.go +++ b/x/auctionsV2/types/bid.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctions/v1beta1/bid.proto +// source: comdex/auctionsV2/v1beta1/bid.proto package types @@ -432,90 +432,90 @@ func (m *AuctionFeesCollectionFromLimitBidTx) GetAssetId() uint64 { } func init() { - proto.RegisterType((*Bid)(nil), "comdex.auctions.v2.Bid") - proto.RegisterType((*LimitOrderBid)(nil), "comdex.auctions.v2.LimitOrderBid") - proto.RegisterType((*AuctionParams)(nil), "comdex.auctions.v2.AuctionParams") - proto.RegisterType((*LimitOrderBidsForUser)(nil), "comdex.auctions.v2.LimitOrderBidsForUser") - proto.RegisterType((*LimitOrderUserKey)(nil), "comdex.auctions.v2.LimitOrderUserKey") - proto.RegisterType((*AuctionFeesCollectionFromLimitBidTx)(nil), "comdex.auctions.v2.AuctionFeesCollectionFromLimitBidTx") + proto.RegisterType((*Bid)(nil), "comdex.auctionsV2.v1beta1.Bid") + proto.RegisterType((*LimitOrderBid)(nil), "comdex.auctionsV2.v1beta1.LimitOrderBid") + proto.RegisterType((*AuctionParams)(nil), "comdex.auctionsV2.v1beta1.AuctionParams") + proto.RegisterType((*LimitOrderBidsForUser)(nil), "comdex.auctionsV2.v1beta1.LimitOrderBidsForUser") + proto.RegisterType((*LimitOrderUserKey)(nil), "comdex.auctionsV2.v1beta1.LimitOrderUserKey") + proto.RegisterType((*AuctionFeesCollectionFromLimitBidTx)(nil), "comdex.auctionsV2.v1beta1.AuctionFeesCollectionFromLimitBidTx") } func init() { - proto.RegisterFile("comdex/auctions/v1beta1/bid.proto", fileDescriptor_6f6db8f3a6a396ec) + proto.RegisterFile("comdex/auctionsV2/v1beta1/bid.proto", fileDescriptor_6f6db8f3a6a396ec) } var fileDescriptor_6f6db8f3a6a396ec = []byte{ - // 1118 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xdf, 0x6e, 0x1b, 0xc5, - 0x17, 0xce, 0x26, 0x6e, 0x52, 0x4f, 0x7e, 0x6e, 0xe2, 0x49, 0xd2, 0xba, 0xf9, 0xa9, 0xde, 0x30, - 0xe1, 0x4f, 0x6e, 0xba, 0x56, 0x43, 0x2f, 0x10, 0x02, 0xa1, 0x6c, 0xa2, 0x20, 0xd3, 0x10, 0xca, - 0x92, 0x06, 0x09, 0x09, 0xad, 0x76, 0x77, 0xc6, 0xee, 0x28, 0xbb, 0x3b, 0x66, 0x67, 0x9c, 0xc4, - 0x17, 0xf0, 0x0c, 0xbd, 0xe0, 0x05, 0x78, 0x01, 0xb8, 0xe1, 0x21, 0x2a, 0x71, 0xd3, 0x4b, 0x04, - 0xd2, 0x82, 0x92, 0x07, 0x40, 0xf2, 0x25, 0x57, 0x68, 0x67, 0xc6, 0x5e, 0xaf, 0x9d, 0x42, 0xac, - 0xc2, 0xd5, 0xce, 0x9c, 0x73, 0xe6, 0x3b, 0x67, 0x67, 0xbe, 0xf9, 0xe6, 0x80, 0xcd, 0x80, 0x45, - 0x98, 0x9c, 0x37, 0xbc, 0x6e, 0x20, 0x28, 0x8b, 0xf9, 0xf1, 0x76, 0xe3, 0xf4, 0x81, 0x4f, 0x84, - 0xf7, 0xa0, 0xe1, 0x53, 0x6c, 0x75, 0x12, 0x26, 0x18, 0x84, 0x2a, 0xc8, 0x1a, 0x04, 0x59, 0xa7, - 0xdb, 0xeb, 0xab, 0x6d, 0xd6, 0x66, 0xd2, 0xdd, 0xc8, 0x46, 0x2a, 0x72, 0xdd, 0x6c, 0x33, 0xd6, - 0x0e, 0x49, 0x43, 0xce, 0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0xf7, 0xa7, 0x38, 0xce, 0x3d, 0x12, 0xf4, 0x53, 0x73, 0x51, 0x25, 0xce, 0x30, 0x90, - 0x23, 0xa1, 0x60, 0x0c, 0x6e, 0x9d, 0x51, 0xf1, 0x14, 0x27, 0xde, 0x99, 0x17, 0xba, 0x2d, 0x42, - 0x24, 0xf1, 0xca, 0xf6, 0x87, 0x53, 0x83, 0xaf, 0x29, 0xf0, 0x22, 0x1a, 0x72, 0x2a, 0xb9, 0x61, - 0x9f, 0x10, 0x48, 0xc0, 0x62, 0x10, 0x32, 0x9e, 0xed, 0x66, 0x96, 0x4c, 0x11, 0x73, 0x6f, 0xea, - 0x64, 0x50, 0xdf, 0x89, 0x1c, 0x0a, 0x39, 0x40, 0xcf, 0xb2, 0x34, 0x1f, 0x01, 0x18, 0xd1, 0xd8, - 0xed, 0x72, 0xec, 0x9e, 0x7a, 0x61, 0x97, 0xb8, 0x21, 0x69, 0x09, 0xcd, 0xc9, 0x7b, 0xfd, 0xd4, - 0xbc, 0xab, 0xd6, 0x4f, 0xc6, 0x20, 0x67, 0x29, 0xa2, 0xf1, 0x13, 0x8e, 0x8f, 0x33, 0xd3, 0x01, - 0x69, 0x09, 0xe8, 0x4b, 0x72, 0xb8, 0x2d, 0x2f, 0x10, 0x2c, 0x91, 0xe4, 0x2c, 0xdb, 0xbb, 0x53, - 0x57, 0x9c, 0x53, 0x49, 0x23, 0x29, 0x2a, 0xed, 0xcb, 0x31, 0xfc, 0x1a, 0xac, 0x84, 0xf4, 0xab, - 0x2e, 0xc5, 0x8a, 0x09, 0x1d, 0x12, 0x7b, 0xa1, 0xe8, 0x49, 0x3d, 0x2c, 0xdb, 0x07, 0x53, 0x27, - 0x5b, 0x1f, 0x28, 0xd8, 0x04, 0x24, 0x72, 0xe0, 0x88, 0xf5, 0xb1, 0x32, 0xc2, 0x13, 0x50, 0x19, - 0xb0, 0xd1, 0x67, 0x71, 0x97, 0x6b, 0x71, 0xdd, 0x9f, 0x3a, 0xf1, 0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, 0x9f, 0xf9, 0xf9, 0xb2, 0x3e, 0xf3, 0xc5, 0xc3, 0x02, 0x74, 0xc6, 0xd1, 0xfb, 0xac, 0xd5, - 0xa2, 0x01, 0xf5, 0x42, 0x3d, 0x6f, 0x14, 0xda, 0x7f, 0x99, 0xcc, 0x9f, 0x97, 0xbd, 0xd7, 0xdb, - 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x32, 0xbc, 0x83, 0x0f, 0x20, 0x0c, 0x00, 0x00, + // 1117 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x41, 0x6f, 0xe3, 0x44, + 0x14, 0xae, 0xdb, 0xb4, 0xdd, 0x4c, 0xc9, 0xb6, 0x71, 0xdb, 0xdd, 0xb4, 0x68, 0xe3, 0x32, 0x45, + 0xd0, 0x03, 0xeb, 0x68, 0xcb, 0x1e, 0x10, 0x02, 0xa1, 0xba, 0x55, 0x50, 0xd8, 0x52, 0x16, 0xd3, + 0x2d, 0x12, 0x12, 0xb2, 0x6c, 0xcf, 0x24, 0x3b, 0xaa, 0xed, 0x09, 0x9e, 0xf1, 0x76, 0x73, 0x00, + 0xfe, 0xc2, 0x1e, 0xf8, 0x03, 0xfc, 0x01, 0xb8, 0xf0, 0x23, 0xf6, 0xb8, 0xe2, 0x84, 0x40, 0x32, + 0xa8, 0xfd, 0x01, 0x48, 0x39, 0x72, 0x42, 0x9e, 0x99, 0xc4, 0x71, 0xd2, 0x42, 0xa3, 0x85, 0x53, + 0x66, 0xde, 0x7b, 0xf3, 0xbd, 0xe7, 0x37, 0xdf, 0x7c, 0x33, 0x01, 0xdb, 0x3e, 0x0d, 0x11, 0x7e, + 0xda, 0x70, 0x13, 0x9f, 0x13, 0x1a, 0xb1, 0x93, 0xdd, 0xc6, 0x93, 0x7b, 0x1e, 0xe6, 0xee, 0xbd, + 0x86, 0x47, 0x90, 0xd9, 0x8d, 0x29,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, 0x5d, 0xe4, 0x1b, 0xce, 0x56, 0x70, 0xd6, 0xd1, 0xf3, 0xf3, + 0xba, 0xf6, 0xe2, 0xbc, 0xae, 0xfd, 0x71, 0x5e, 0xd7, 0x9e, 0x5d, 0xd4, 0x67, 0x5e, 0x5c, 0xd4, + 0x67, 0x7e, 0xb9, 0xa8, 0xcf, 0x7c, 0x71, 0xbf, 0x00, 0x9d, 0x51, 0xf5, 0x2e, 0x6d, 0xb7, 0x89, + 0x4f, 0xdc, 0x40, 0xcd, 0x1b, 0x85, 0x3f, 0x03, 0x22, 0x99, 0xb7, 0x20, 0x9e, 0x60, 0x6f, 0xff, + 0x1d, 0x00, 0x00, 0xff, 0xff, 0x24, 0x38, 0x09, 0x3e, 0x2e, 0x0c, 0x00, 0x00, } func (m *Bid) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index 0f9b664da..6fe694764 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -17,4 +17,5 @@ var ( ErrorMaxBidAmount = sdkerrors.Register(ModuleName, 707, "bidding amount is greater than maximum bidding amount") ErrLiquidationNotFound = sdkerrors.Register(ModuleName, 708, "Liquidation data not found for the auction") ErrBidNotFound = sdkerrors.Register(ModuleName, 709, "There exists no active bid for the user with given params") + ErrAuctionParamsNotFound = sdkerrors.Register(ModuleName, 710, "There exists no auction params") ) diff --git a/x/auctionsV2/types/genesis.pb.go b/x/auctionsV2/types/genesis.pb.go index 1df795b52..70e86b595 100644 --- a/x/auctionsV2/types/genesis.pb.go +++ b/x/auctionsV2/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctions/v1beta1/genesis.proto +// source: comdex/auctionsV2/v1beta1/genesis.proto package types @@ -68,11 +68,11 @@ func (m *GenesisState) GetParams() Params { } func init() { - proto.RegisterType((*GenesisState)(nil), "comdex.auctions.v2.GenesisState") + proto.RegisterType((*GenesisState)(nil), "comdex.auctionsV2.v1beta1.GenesisState") } func init() { - proto.RegisterFile("comdex/auctions/v1beta1/genesis.proto", fileDescriptor_eebc68c04739f45f) + proto.RegisterFile("comdex/auctionsV2/v1beta1/genesis.proto", fileDescriptor_eebc68c04739f45f) } var fileDescriptor_eebc68c04739f45f = []byte{ @@ -80,16 +80,16 @@ var fileDescriptor_eebc68c04739f45f = []byte{ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4f, 0xce, 0xcf, 0x4d, 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0x28, 0xd4, 0x83, 0x29, 0xd4, 0x2b, 0x33, 0x92, 0x12, 0x49, - 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xeb, 0x83, 0x58, 0x10, 0x95, 0x52, 0x6a, 0xb8, 0x8d, 0x2c, 0x48, - 0x2c, 0x4a, 0xcc, 0x85, 0x9a, 0xa8, 0xe4, 0xc1, 0xc5, 0xe3, 0x0e, 0xb1, 0x22, 0xb8, 0x24, 0xb1, - 0x24, 0x55, 0xc8, 0x82, 0x8b, 0x0d, 0x22, 0x2f, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa5, - 0x87, 0x69, 0xa5, 0x5e, 0x00, 0x58, 0x85, 0x13, 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0xf5, - 0x4e, 0x7e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, - 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x92, 0x9e, 0x59, - 0x92, 0x51, 0x9a, 0x04, 0x32, 0x49, 0x1f, 0x62, 0x9a, 0x6e, 0x7e, 0x5a, 0x5a, 0x66, 0x72, 0x66, - 0x62, 0x0e, 0x94, 0xaf, 0x8f, 0xe2, 0xd0, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x03, - 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x59, 0x33, 0xba, 0xd7, 0x1d, 0x01, 0x00, 0x00, + 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x84, 0x28, 0xd4, 0x43, 0x28, 0xd4, 0x83, 0x2a, 0x94, 0x12, 0x49, + 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0xa4, 0xd4, 0x70, 0x9b, 0x5c, 0x90, + 0x58, 0x94, 0x98, 0x0b, 0x35, 0x58, 0xc9, 0x9f, 0x8b, 0xc7, 0x1d, 0x62, 0x53, 0x70, 0x49, 0x62, + 0x49, 0xaa, 0x90, 0x3d, 0x17, 0x1b, 0x44, 0x5e, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x51, + 0x0f, 0xa7, 0xcd, 0x7a, 0x01, 0x60, 0x85, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xb5, + 0x39, 0xf9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, + 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x49, 0x7a, 0x66, + 0x49, 0x46, 0x69, 0x12, 0xc8, 0x40, 0x7d, 0x88, 0xa1, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, + 0x89, 0x39, 0x50, 0xbe, 0x3e, 0x8a, 0x7b, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xee, + 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xff, 0x32, 0x82, 0x5d, 0x2b, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/gov.pb.go b/x/auctionsV2/types/gov.pb.go index 67194795e..febe11e3e 100644 --- a/x/auctionsV2/types/gov.pb.go +++ b/x/auctionsV2/types/gov.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctions/v1beta1/gov.proto +// source: comdex/auctionsV2/v1beta1/gov.proto package types @@ -84,33 +84,33 @@ func (m *DutchAutoBidParamsProposal) GetAuctionParams() AuctionParams { } func init() { - proto.RegisterType((*DutchAutoBidParamsProposal)(nil), "comdex.auctions.v2.DutchAutoBidParamsProposal") + proto.RegisterType((*DutchAutoBidParamsProposal)(nil), "comdex.auctionsV2.v1beta1.DutchAutoBidParamsProposal") } func init() { - proto.RegisterFile("comdex/auctions/v1beta1/gov.proto", fileDescriptor_11f3d7c5f2a28b27) + proto.RegisterFile("comdex/auctionsV2/v1beta1/gov.proto", fileDescriptor_11f3d7c5f2a28b27) } var fileDescriptor_11f3d7c5f2a28b27 = []byte{ - // 285 bytes of a gzipped FileDescriptorProto + // 286 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0xcf, 0x4d, 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0xcf, 0x2f, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0x12, 0x82, 0x28, 0xd2, 0x83, 0x29, 0xd2, 0x2b, 0x33, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, - 0x4b, 0xeb, 0x83, 0x58, 0x10, 0x95, 0x52, 0x78, 0x8c, 0x4b, 0xca, 0x4c, 0x81, 0x28, 0x52, 0x3a, - 0xcb, 0xc8, 0x25, 0xe5, 0x52, 0x5a, 0x92, 0x9c, 0xe1, 0x58, 0x5a, 0x92, 0xef, 0x94, 0x99, 0x12, - 0x90, 0x58, 0x94, 0x98, 0x5b, 0x1c, 0x50, 0x94, 0x5f, 0x90, 0x5f, 0x9c, 0x98, 0x23, 0xa4, 0xc6, - 0xc5, 0x5a, 0x92, 0x59, 0x92, 0x93, 0x2a, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0xf0, 0xe9, - 0x9e, 0x3c, 0x4f, 0x65, 0x62, 0x6e, 0x8e, 0x95, 0x12, 0x58, 0x58, 0x29, 0x08, 0x22, 0x2d, 0x64, - 0xc1, 0xc5, 0x9d, 0x92, 0x5a, 0x9c, 0x5c, 0x94, 0x59, 0x00, 0xb2, 0x4a, 0x82, 0x09, 0xac, 0x5a, - 0xec, 0xd3, 0x3d, 0x79, 0x21, 0x88, 0x6a, 0x24, 0x49, 0xa5, 0x20, 0x64, 0xa5, 0x42, 0xbe, 0x5c, - 0xbc, 0x50, 0x07, 0x42, 0xac, 0x96, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x36, 0x52, 0xd4, 0xc3, 0xf4, - 0xa7, 0x9e, 0x23, 0xb2, 0x42, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0x50, 0x75, 0x3b, 0xf9, - 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, - 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x49, 0x7a, 0x66, 0x49, 0x46, - 0x69, 0x12, 0xc8, 0x5c, 0x7d, 0x88, 0xd9, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, - 0x50, 0xbe, 0x3e, 0x4a, 0x58, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x83, 0xc9, 0x18, - 0x10, 0x00, 0x00, 0xff, 0xff, 0x13, 0x4e, 0x3c, 0x09, 0x9c, 0x01, 0x00, 0x00, + 0x92, 0x84, 0x28, 0xd2, 0x43, 0x28, 0xd2, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, + 0xab, 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0xa4, 0xf0, 0x98, 0x9a, 0x94, 0x99, 0x02, 0x51, 0xa4, 0x74, + 0x85, 0x91, 0x4b, 0xca, 0xa5, 0xb4, 0x24, 0x39, 0xc3, 0xb1, 0xb4, 0x24, 0xdf, 0x29, 0x33, 0x25, + 0x20, 0xb1, 0x28, 0x31, 0xb7, 0x38, 0xa0, 0x28, 0xbf, 0x20, 0xbf, 0x38, 0x31, 0x47, 0x48, 0x8d, + 0x8b, 0xb5, 0x24, 0xb3, 0x24, 0x27, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, 0x49, 0xe0, 0xd3, + 0x3d, 0x79, 0x9e, 0xca, 0xc4, 0xdc, 0x1c, 0x2b, 0x25, 0xb0, 0xb0, 0x52, 0x10, 0x44, 0x5a, 0xc8, + 0x82, 0x8b, 0x3b, 0x25, 0xb5, 0x38, 0xb9, 0x28, 0xb3, 0x00, 0x64, 0x95, 0x04, 0x13, 0x58, 0xb5, + 0xd8, 0xa7, 0x7b, 0xf2, 0x42, 0x10, 0xd5, 0x48, 0x92, 0x4a, 0x41, 0xc8, 0x4a, 0x85, 0x42, 0xb8, + 0x78, 0xa1, 0x0e, 0x84, 0x58, 0x2d, 0xc1, 0xac, 0xc0, 0xa8, 0xc1, 0x6d, 0xa4, 0xa1, 0x87, 0xd3, + 0xbb, 0x7a, 0x8e, 0xc8, 0xea, 0x9d, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x42, 0x35, 0xc4, 0xc9, + 0xef, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, + 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x4c, 0xd2, 0x33, 0x4b, 0x32, + 0x4a, 0x93, 0x40, 0xc6, 0xeb, 0x43, 0xac, 0xd0, 0xcd, 0x4f, 0x4b, 0xcb, 0x4c, 0xce, 0x4c, 0xcc, + 0x81, 0xf2, 0xf5, 0x51, 0x82, 0xac, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0x5a, 0xc6, + 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x96, 0x81, 0x80, 0x98, 0xaa, 0x01, 0x00, 0x00, } func (m *DutchAutoBidParamsProposal) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/params.pb.go b/x/auctionsV2/types/params.pb.go index 891a36165..64e5f8ff0 100644 --- a/x/auctionsV2/types/params.pb.go +++ b/x/auctionsV2/types/params.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctions/v1beta1/params.proto +// source: comdex/auctionsV2/v1beta1/params.proto package types @@ -59,11 +59,11 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo func init() { - proto.RegisterType((*Params)(nil), "comdex.auctions.v2.Params") + proto.RegisterType((*Params)(nil), "comdex.auctionsV2.v1beta1.Params") } func init() { - proto.RegisterFile("comdex/auctions/v1beta1/params.proto", fileDescriptor_5122d8002bd05fc0) + proto.RegisterFile("comdex/auctionsV2/v1beta1/params.proto", fileDescriptor_5122d8002bd05fc0) } var fileDescriptor_5122d8002bd05fc0 = []byte{ @@ -71,14 +71,14 @@ var fileDescriptor_5122d8002bd05fc0 = []byte{ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4b, 0xce, 0xcf, 0x4d, 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, - 0x2f, 0xc9, 0x17, 0x12, 0x82, 0xa8, 0xd3, 0x83, 0xa9, 0xd3, 0x2b, 0x33, 0x92, 0x12, 0x49, 0xcf, - 0x4f, 0xcf, 0x07, 0x4b, 0xeb, 0x83, 0x58, 0x10, 0x95, 0x4a, 0x7c, 0x5c, 0x6c, 0x01, 0x60, 0x9d, - 0x56, 0x2c, 0x33, 0x16, 0xc8, 0x33, 0x38, 0xf9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, - 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, - 0x1c, 0x43, 0x94, 0x49, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xc4, - 0x78, 0xdd, 0xfc, 0xb4, 0xb4, 0xcc, 0xe4, 0xcc, 0xc4, 0x1c, 0x28, 0x5f, 0x1f, 0xc5, 0x61, 0x25, - 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x6b, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x69, - 0x89, 0xe6, 0x27, 0xba, 0x00, 0x00, 0x00, + 0x2f, 0xc9, 0x17, 0x92, 0x84, 0xa8, 0xd3, 0x43, 0xa8, 0xd3, 0x83, 0xaa, 0x93, 0x12, 0x49, 0xcf, + 0x4f, 0xcf, 0x07, 0xab, 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0x94, 0xf8, 0xb8, 0xd8, 0x02, 0xc0, 0x06, + 0x58, 0xb1, 0xcc, 0x58, 0x20, 0xcf, 0xe0, 0xe4, 0x77, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, + 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, + 0x72, 0x0c, 0x51, 0x26, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x10, + 0x5b, 0x74, 0xf3, 0xd3, 0xd2, 0x32, 0x93, 0x33, 0x13, 0x73, 0xa0, 0x7c, 0x7d, 0x14, 0xf7, 0x95, + 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xad, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x8d, + 0x26, 0xbe, 0x52, 0xc1, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index b4849c93d..8be5d21ab 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -1,12 +1,12 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctions/v1beta1/query.proto +// source: comdex/auctionsV2/v1beta1/query.proto package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/query" + query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -110,37 +110,474 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } +type QueryAuctionRequest struct { + AuctionId uint64 `protobuf:"varint,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + History bool `protobuf:"varint,2,opt,name=history,proto3" json:"history,omitempty"` +} + +func (m *QueryAuctionRequest) Reset() { *m = QueryAuctionRequest{} } +func (m *QueryAuctionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAuctionRequest) ProtoMessage() {} +func (*QueryAuctionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{2} +} +func (m *QueryAuctionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAuctionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAuctionRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAuctionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAuctionRequest.Merge(m, src) +} +func (m *QueryAuctionRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAuctionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAuctionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAuctionRequest proto.InternalMessageInfo + +func (m *QueryAuctionRequest) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + +func (m *QueryAuctionRequest) GetHistory() bool { + if m != nil { + return m.History + } + return false +} + +type QueryAuctionResponse struct { + Auction Auction `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction" yaml:"auction"` +} + +func (m *QueryAuctionResponse) Reset() { *m = QueryAuctionResponse{} } +func (m *QueryAuctionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAuctionResponse) ProtoMessage() {} +func (*QueryAuctionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{3} +} +func (m *QueryAuctionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAuctionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAuctionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAuctionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAuctionResponse.Merge(m, src) +} +func (m *QueryAuctionResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAuctionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAuctionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAuctionResponse proto.InternalMessageInfo + +func (m *QueryAuctionResponse) GetAuction() Auction { + if m != nil { + return m.Auction + } + return Auction{} +} + +type QueryAuctionsRequest struct { + History bool `protobuf:"varint,1,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAuctionsRequest) Reset() { *m = QueryAuctionsRequest{} } +func (m *QueryAuctionsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAuctionsRequest) ProtoMessage() {} +func (*QueryAuctionsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{4} +} +func (m *QueryAuctionsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAuctionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAuctionsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAuctionsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAuctionsRequest.Merge(m, src) +} +func (m *QueryAuctionsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAuctionsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAuctionsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAuctionsRequest proto.InternalMessageInfo + +func (m *QueryAuctionsRequest) GetHistory() bool { + if m != nil { + return m.History + } + return false +} + +func (m *QueryAuctionsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAuctionsResponse struct { + Auctions []Auction `protobuf:"bytes,1,rep,name=auctions,proto3" json:"auctions" yaml:"auctions"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAuctionsResponse) Reset() { *m = QueryAuctionsResponse{} } +func (m *QueryAuctionsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAuctionsResponse) ProtoMessage() {} +func (*QueryAuctionsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{5} +} +func (m *QueryAuctionsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAuctionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAuctionsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAuctionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAuctionsResponse.Merge(m, src) +} +func (m *QueryAuctionsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAuctionsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAuctionsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAuctionsResponse proto.InternalMessageInfo + +func (m *QueryAuctionsResponse) GetAuctions() []Auction { + if m != nil { + return m.Auctions + } + return nil +} + +func (m *QueryAuctionsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryBidsRequest struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + History bool `protobuf:"varint,2,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryBidsRequest) Reset() { *m = QueryBidsRequest{} } +func (m *QueryBidsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBidsRequest) ProtoMessage() {} +func (*QueryBidsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{6} +} +func (m *QueryBidsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBidsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBidsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBidsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBidsRequest.Merge(m, src) +} +func (m *QueryBidsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBidsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBidsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBidsRequest proto.InternalMessageInfo + +func (m *QueryBidsRequest) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *QueryBidsRequest) GetHistory() bool { + if m != nil { + return m.History + } + return false +} + +func (m *QueryBidsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryBidsResponse struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` + Bids []Bid `protobuf:"bytes,2,rep,name=bids,proto3" json:"bids" yaml:"bids"` + Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryBidsResponse) Reset() { *m = QueryBidsResponse{} } +func (m *QueryBidsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBidsResponse) ProtoMessage() {} +func (*QueryBidsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{7} +} +func (m *QueryBidsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBidsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBidsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBidsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBidsResponse.Merge(m, src) +} +func (m *QueryBidsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBidsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBidsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBidsResponse proto.InternalMessageInfo + +func (m *QueryBidsResponse) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *QueryBidsResponse) GetBids() []Bid { + if m != nil { + return m.Bids + } + return nil +} + +func (m *QueryBidsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAuctionParamsRequest struct { +} + +func (m *QueryAuctionParamsRequest) Reset() { *m = QueryAuctionParamsRequest{} } +func (m *QueryAuctionParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAuctionParamsRequest) ProtoMessage() {} +func (*QueryAuctionParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{8} +} +func (m *QueryAuctionParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAuctionParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAuctionParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAuctionParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAuctionParamsRequest.Merge(m, src) +} +func (m *QueryAuctionParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAuctionParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAuctionParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAuctionParamsRequest proto.InternalMessageInfo + +type QueryAuctionParamsResponse struct { + AuctionParams AuctionParams `protobuf:"bytes,1,opt,name=auction_params,json=auctionParams,proto3" json:"auction_params" yaml:"auction_params"` +} + +func (m *QueryAuctionParamsResponse) Reset() { *m = QueryAuctionParamsResponse{} } +func (m *QueryAuctionParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAuctionParamsResponse) ProtoMessage() {} +func (*QueryAuctionParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{9} +} +func (m *QueryAuctionParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAuctionParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAuctionParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAuctionParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAuctionParamsResponse.Merge(m, src) +} +func (m *QueryAuctionParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAuctionParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAuctionParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAuctionParamsResponse proto.InternalMessageInfo + +func (m *QueryAuctionParamsResponse) GetAuctionParams() AuctionParams { + if m != nil { + return m.AuctionParams + } + return AuctionParams{} +} + func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "comdex.auctions.v2.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "comdex.auctions.v2.QueryParamsResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryAuctionRequest)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionRequest") + proto.RegisterType((*QueryAuctionResponse)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionResponse") + proto.RegisterType((*QueryAuctionsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionsRequest") + proto.RegisterType((*QueryAuctionsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionsResponse") + proto.RegisterType((*QueryBidsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryBidsRequest") + proto.RegisterType((*QueryBidsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryBidsResponse") + proto.RegisterType((*QueryAuctionParamsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionParamsRequest") + proto.RegisterType((*QueryAuctionParamsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionParamsResponse") } func init() { - proto.RegisterFile("comdex/auctions/v1beta1/query.proto", fileDescriptor_5270c3f1c79728ac) + proto.RegisterFile("comdex/auctionsV2/v1beta1/query.proto", fileDescriptor_5270c3f1c79728ac) } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 316 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0xbf, 0x4e, 0xf3, 0x30, - 0x14, 0xc5, 0xe3, 0x4f, 0x1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0x5e, 0xd3, 0xfb, 0x3f, 0x7f, - 0xdf, 0x0f, 0xfa, 0x15, 0x1f, 0x3f, 0x23, 0xbc, 0x55, 0x3a, 0x92, 0x47, 0x84, 0x6b, 0x1e, 0x21, - 0xad, 0xdf, 0xe4, 0xeb, 0x69, 0xc2, 0xf6, 0x9f, 0x9c, 0xcf, 0xd7, 0xe8, 0x3c, 0xbc, 0x7e, 0xbe, - 0xfc, 0x6b, 0x93, 0x26, 0xf3, 0x82, 0x0e, 0x0c, 0x06, 0x2a, 0x55, 0x7c, 0x58, 0xfd, 0x33, 0x2d, - 0xee, 0x78, 0x96, 0x56, 0x0d, 0xf4, 0xce, 0xe6, 0x4b, 0x8a, 0x16, 0x4b, 0x8a, 0x3e, 0x96, 0x14, - 0x3d, 0xe5, 0x34, 0x58, 0xe4, 0x34, 0x78, 0xcb, 0x69, 0x70, 0x7d, 0x22, 0x95, 0xbb, 0xcd, 0x92, - 0xe2, 0xee, 0x26, 0xab, 0x95, 0x6a, 0xdd, 0xcc, 0x08, 0x9b, 0xd4, 0xca, 0x4a, 0x8f, 0xbf, 0x02, - 0x00, 0x00, 0xff, 0xff, 0xae, 0x22, 0x79, 0x02, 0x17, 0x02, 0x00, 0x00, + // 777 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcf, 0x4f, 0x13, 0x4d, + 0x18, 0xc7, 0x3b, 0xd0, 0xb7, 0xc0, 0x10, 0x78, 0x5f, 0x86, 0x1f, 0x6f, 0x59, 0x61, 0x8b, 0xa3, + 0x42, 0x05, 0xd9, 0x95, 0x82, 0x17, 0x2e, 0xc6, 0xbd, 0x18, 0x2f, 0x44, 0x37, 0x06, 0x13, 0x13, + 0x35, 0xbb, 0xdd, 0x65, 0xd9, 0xa4, 0xed, 0x94, 0xee, 0x96, 0xd8, 0x10, 0x2e, 0x5e, 0x35, 0xd1, + 0xc4, 0xc4, 0x9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0, 0xb3, 0x7a, 0xd4, 0x9e, 0xb7, 0xc7, 0xea, 0x11, 0x3c, 0x9a, 0x63, 0xf2, 0x11, + 0xe1, 0xd1, 0x70, 0x94, 0x90, 0xa4, 0x27, 0xb7, 0xa2, 0xbb, 0x9d, 0x7c, 0x03, 0xb0, 0x2a, 0x9c, + 0x35, 0x4f, 0x96, 0xfb, 0xb0, 0x7a, 0x11, 0xbe, 0x0f, 0x08, 0xa7, 0x83, 0x17, 0x47, 0xd6, 0x06, + 0x1d, 0x15, 0x99, 0x1e, 0xd2, 0xad, 0x64, 0x62, 0x60, 0xda, 0xe4, 0x4c, 0xeb, 0x64, 0xad, 0x1b, + 0x53, 0xf0, 0xe4, 0xd4, 0x23, 0xf1, 0x86, 0xa3, 0xc1, 0x7d, 0x45, 0x78, 0x22, 0xd6, 0xb9, 0x64, + 0x2b, 0x61, 0x18, 0xf1, 0xee, 0xbb, 0xf3, 0x97, 0xbb, 0x80, 0x79, 0x95, 0x33, 0x5f, 0x27, 0xb4, + 0x4f, 0x8e, 0xf0, 0x68, 0xb4, 0x9d, 0x93, 0x33, 0x19, 0x9d, 0x9e, 0xc9, 0xe8, 0xc7, 0x99, 0x8c, + 0xde, 0x9d, 0xcb, 0xa9, 0xd3, 0x73, 0x39, 0xf5, 0xfd, 0x5c, 0x4e, 0x3d, 0xdd, 0x72, 0x5c, 0x7f, + 0xbf, 0x6e, 0x06, 0x08, 0xe0, 0xb3, 0xce, 0xf6, 0xf6, 0xdc, 0xa2, 0x6b, 0x94, 0x42, 0xdf, 0xd8, + 0xbf, 0x09, 0xbf, 0x51, 0xb5, 0x3d, 0x33, 0xc3, 0xff, 0x48, 0x6c, 0xfe, 0x0e, 0x00, 0x00, 0xff, + 0xff, 0x10, 0xb1, 0x6f, 0x33, 0x62, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -156,6 +593,10 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + Auction(ctx context.Context, in *QueryAuctionRequest, opts ...grpc.CallOption) (*QueryAuctionResponse, error) + Auctions(ctx context.Context, in *QueryAuctionsRequest, opts ...grpc.CallOption) (*QueryAuctionsResponse, error) + Bids(ctx context.Context, in *QueryBidsRequest, opts ...grpc.CallOption) (*QueryBidsResponse, error) + AuctionParams(ctx context.Context, in *QueryAuctionParamsRequest, opts ...grpc.CallOption) (*QueryAuctionParamsResponse, error) } type queryClient struct { @@ -168,7 +609,43 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/comdex.auctions.v2.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Auction(ctx context.Context, in *QueryAuctionRequest, opts ...grpc.CallOption) (*QueryAuctionResponse, error) { + out := new(QueryAuctionResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/Auction", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Auctions(ctx context.Context, in *QueryAuctionsRequest, opts ...grpc.CallOption) (*QueryAuctionsResponse, error) { + out := new(QueryAuctionsResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/Auctions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Bids(ctx context.Context, in *QueryBidsRequest, opts ...grpc.CallOption) (*QueryBidsResponse, error) { + out := new(QueryBidsResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/Bids", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AuctionParams(ctx context.Context, in *QueryAuctionParamsRequest, opts ...grpc.CallOption) (*QueryAuctionParamsResponse, error) { + out := new(QueryAuctionParamsResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/AuctionParams", in, out, opts...) if err != nil { return nil, err } @@ -178,6 +655,10 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . // QueryServer is the server API for Query service. type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + Auction(context.Context, *QueryAuctionRequest) (*QueryAuctionResponse, error) + Auctions(context.Context, *QueryAuctionsRequest) (*QueryAuctionsResponse, error) + Bids(context.Context, *QueryBidsRequest) (*QueryBidsResponse, error) + AuctionParams(context.Context, *QueryAuctionParamsRequest) (*QueryAuctionParamsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -187,8 +668,20 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { +func (*UnimplementedQueryServer) Auction(ctx context.Context, req *QueryAuctionRequest) (*QueryAuctionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Auction not implemented") +} +func (*UnimplementedQueryServer) Auctions(ctx context.Context, req *QueryAuctionsRequest) (*QueryAuctionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Auctions not implemented") +} +func (*UnimplementedQueryServer) Bids(ctx context.Context, req *QueryBidsRequest) (*QueryBidsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Bids not implemented") +} +func (*UnimplementedQueryServer) AuctionParams(ctx context.Context, req *QueryAuctionParamsRequest) (*QueryAuctionParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AuctionParams not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } @@ -202,7 +695,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/comdex.auctions.v2.Query/Params", + FullMethod: "/comdex.auctionsV2.v1beta1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -210,17 +703,105 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_Auction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAuctionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Auction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Query/Auction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Auction(ctx, req.(*QueryAuctionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Auctions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAuctionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Auctions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Query/Auctions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Auctions(ctx, req.(*QueryAuctionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Bids_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBidsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Bids(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Query/Bids", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Bids(ctx, req.(*QueryBidsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AuctionParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAuctionParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AuctionParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Query/AuctionParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AuctionParams(ctx, req.(*QueryAuctionParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.auctions.v2.Query", + ServiceName: "comdex.auctionsV2.v1beta1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Params", Handler: _Query_Params_Handler, }, + { + MethodName: "Auction", + Handler: _Query_Auction_Handler, + }, + { + MethodName: "Auctions", + Handler: _Query_Auctions_Handler, + }, + { + MethodName: "Bids", + Handler: _Query_Bids_Handler, + }, + { + MethodName: "AuctionParams", + Handler: _Query_AuctionParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "comdex/auctions/v1beta1/query.proto", + Metadata: "comdex/auctionsV2/v1beta1/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { @@ -271,52 +852,1326 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { if err != nil { return 0, err } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAuctionRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAuctionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAuctionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.AuctionId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAuctionResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAuctionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAuctionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Auction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryAuctionsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAuctionsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAuctionsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAuctionsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAuctionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Auctions) > 0 { + for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryBidsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBidsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBidsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBidsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBidsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBidsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Bids) > 0 { + for iNdEx := len(m.Bids) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Bids[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAuctionParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAuctionParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAuctionParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryAuctionParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAuctionParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAuctionParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.AuctionParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAuctionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovQuery(uint64(m.AuctionId)) + } + if m.History { + n += 2 + } + return n +} + +func (m *QueryAuctionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Auction.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAuctionsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAuctionsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Auctions) > 0 { + for _, e := range m.Auctions { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBidsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBidsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Bids) > 0 { + for _, e := range m.Bids { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAuctionParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryAuctionParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.AuctionParams.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAuctionRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAuctionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAuctionResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAuctionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Auction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAuctionsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAuctionsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAuctionsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAuctionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Auctions = append(m.Auctions, Auction{}) + if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBidsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBidsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBidsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ + if iNdEx > l { + return io.ErrUnexpectedEOF } - dAtA[offset] = uint8(v) - return base + return nil } -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryBidsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBidsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBidsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bids", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bids = append(m.Bids, Bid{}) + if err := m.Bids[len(m.Bids)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } - var l int - _ = l - return n -} -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 + if iNdEx > l { + return io.ErrUnexpectedEOF } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return nil } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAuctionParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -339,10 +2194,10 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAuctionParamsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAuctionParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -366,7 +2221,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAuctionParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -389,15 +2244,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAuctionParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAuctionParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AuctionParams", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -424,7 +2279,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AuctionParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/auctionsV2/types/query.pb.gw.go b/x/auctionsV2/types/query.pb.gw.go index c2426ab56..a2b7d9e6a 100644 --- a/x/auctionsV2/types/query.pb.gw.go +++ b/x/auctionsV2/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: comdex/auctions/v1beta1/query.proto +// source: comdex/auctionsV2/v1beta1/query.proto /* Package types is a reverse proxy. @@ -51,6 +51,266 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } +func request_Query_Auction_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAuctionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["auction_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") + } + + protoReq.AuctionId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + msg, err := client.Auction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Auction_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAuctionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["auction_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_id") + } + + protoReq.AuctionId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_id", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + msg, err := server.Auction(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Auctions_0 = &utilities.DoubleArray{Encoding: map[string]int{"history": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Auctions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAuctionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Auctions_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Auctions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Auctions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAuctionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Auctions_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Auctions(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Bids_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "history": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_Query_Bids_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBidsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Bids_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Bids(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Bids_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBidsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Bids_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Bids(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_AuctionParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAuctionParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.AuctionParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AuctionParams_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAuctionParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.AuctionParams(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -80,6 +340,98 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_Auction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Auction_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Auction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Auctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Auctions_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Auctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Bids_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Bids_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Bids_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AuctionParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AuctionParams_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AuctionParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -141,13 +493,109 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Auction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Auction_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Auction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Auctions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Auctions_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Auctions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Bids_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Bids_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Bids_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AuctionParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AuctionParams_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AuctionParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex-official", "comdex", "newauc", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "auctions", "v2", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Auction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auctions", "v2", "auction", "auction_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Auctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 1, 0, 4, 1, 5, 3}, []string{"comdex", "auctions", "v2", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Bids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auctions", "v2", "bids", "bidder", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AuctionParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "auctions", "v2", "auction_params"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Auction_0 = runtime.ForwardResponseMessage + + forward_Query_Auctions_0 = runtime.ForwardResponseMessage + + forward_Query_Bids_0 = runtime.ForwardResponseMessage + + forward_Query_AuctionParams_0 = runtime.ForwardResponseMessage ) diff --git a/x/auctionsV2/types/tx.pb.go b/x/auctionsV2/types/tx.pb.go index 84b34efe6..206ec8877 100644 --- a/x/auctionsV2/types/tx.pb.go +++ b/x/auctionsV2/types/tx.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/auctions/v1beta1/tx.proto +// source: comdex/auctionsV2/v1beta1/tx.proto package types @@ -336,57 +336,58 @@ func (m *MsgWithdrawLimitBidResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgWithdrawLimitBidResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgPlaceMarketBidRequest)(nil), "comdex.auctions.v2.MsgPlaceMarketBidRequest") - proto.RegisterType((*MsgPlaceMarketBidResponse)(nil), "comdex.auctions.v2.MsgPlaceMarketBidResponse") - proto.RegisterType((*MsgDepositLimitBidRequest)(nil), "comdex.auctions.v2.MsgDepositLimitBidRequest") - proto.RegisterType((*MsgDepositLimitBidResponse)(nil), "comdex.auctions.v2.MsgDepositLimitBidResponse") - proto.RegisterType((*MsgCancelLimitBidRequest)(nil), "comdex.auctions.v2.MsgCancelLimitBidRequest") - proto.RegisterType((*MsgCancelLimitBidResponse)(nil), "comdex.auctions.v2.MsgCancelLimitBidResponse") - proto.RegisterType((*MsgWithdrawLimitBidRequest)(nil), "comdex.auctions.v2.MsgWithdrawLimitBidRequest") - proto.RegisterType((*MsgWithdrawLimitBidResponse)(nil), "comdex.auctions.v2.MsgWithdrawLimitBidResponse") + proto.RegisterType((*MsgPlaceMarketBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceMarketBidRequest") + proto.RegisterType((*MsgPlaceMarketBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgPlaceMarketBidResponse") + proto.RegisterType((*MsgDepositLimitBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgDepositLimitBidRequest") + proto.RegisterType((*MsgDepositLimitBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgDepositLimitBidResponse") + proto.RegisterType((*MsgCancelLimitBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgCancelLimitBidRequest") + proto.RegisterType((*MsgCancelLimitBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgCancelLimitBidResponse") + proto.RegisterType((*MsgWithdrawLimitBidRequest)(nil), "comdex.auctionsV2.v1beta1.MsgWithdrawLimitBidRequest") + proto.RegisterType((*MsgWithdrawLimitBidResponse)(nil), "comdex.auctionsV2.v1beta1.MsgWithdrawLimitBidResponse") } func init() { - proto.RegisterFile("comdex/auctions/v1beta1/tx.proto", fileDescriptor_2c216a24ef98c1b4) + proto.RegisterFile("comdex/auctionsV2/v1beta1/tx.proto", fileDescriptor_2c216a24ef98c1b4) } var fileDescriptor_2c216a24ef98c1b4 = []byte{ - // 560 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xb5, 0x93, 0x10, 0x29, 0x5b, 0x21, 0xe8, 0x16, 0x41, 0xea, 0x52, 0x27, 0xf2, 0x01, 0xe5, - 0x40, 0xd6, 0x6a, 0x40, 0x42, 0xe2, 0x98, 0xf6, 0x12, 0x89, 0x48, 0x28, 0x42, 0x45, 0xe2, 0x12, - 0xad, 0xbd, 0xdb, 0x74, 0x15, 0xdb, 0x6b, 0xbc, 0xeb, 0xd0, 0xfe, 0x02, 0x27, 0x3e, 0x83, 0x2f, - 0x80, 0x5f, 0xc8, 0xb1, 0x27, 0x84, 0x38, 0x44, 0x90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dd, 0x50, 0xd1, 0x8e, 0x32, 0xda, 0x1b, 0xa2, 0xb3, 0xce, 0x50, 0x00, 0xb8, - 0x7e, 0x19, 0x60, 0x51, 0x91, 0xfc, 0x65, 0x63, 0xa0, 0x4d, 0xe1, 0xaa, 0x69, 0x36, 0xe6, 0xaa, - 0xc9, 0x0a, 0xc7, 0xcc, 0xbd, 0x89, 0x85, 0x63, 0xe6, 0x3b, 0x17, 0x4e, 0xc0, 0x4e, 0x8e, 0xfe, - 0xb0, 0x88, 0x78, 0x81, 0xc3, 0x0d, 0x7b, 0x63, 0x7c, 0xd6, 0xb7, 0x7b, 0x3c, 0xfd, 0x65, 0x6a, - 0x9f, 0xe7, 0xa6, 0x36, 0x9d, 0x9b, 0xfa, 0xc5, 0xdc, 0xd4, 0x7f, 0xce, 0x4d, 0xfd, 0xd3, 0xc2, - 0xd4, 0x2e, 0x16, 0xa6, 0xf6, 0x7d, 0x61, 0x6a, 0xef, 0x9e, 0xaf, 0xd8, 0x37, 0x29, 0xde, 0xe6, - 0x27, 0x27, 0xcc, 0x65, 0xd8, 0x53, 0x67, 0x7b, 0xe5, 0xed, 0x4b, 0x0d, 0xed, 0x54, 0xd3, 0xd7, - 0xea, 0xd9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x32, 0x35, 0xb7, 0x83, 0x1d, 0x07, 0x00, 0x00, + // 568 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0x93, 0xae, 0x54, 0xaa, 0x27, 0x04, 0xf3, 0x10, 0xb4, 0x19, 0x4b, 0xab, 0x1c, 0x50, + 0x2f, 0x73, 0xb4, 0x6e, 0x80, 0xc4, 0xb1, 0xdb, 0xa5, 0x12, 0x95, 0x50, 0x85, 0x86, 0xc4, 0xa5, + 0x72, 0x62, 0xaf, 0xb3, 0x9a, 0xc4, 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0x09, 0x4e, 0x81, 0xad, 0x9f, 0xe7, 0xc1, 0x5a, 0x4b, 0x74, 0xe1, 0x7b, 0xb0, 0x71, + 0x63, 0xe0, 0xe1, 0x1e, 0x5a, 0x78, 0xc8, 0xa1, 0x45, 0x47, 0x95, 0xb5, 0xbf, 0x5a, 0x91, 0xf2, + 0x01, 0x3f, 0x98, 0x00, 0xde, 0x9c, 0x0d, 0xb8, 0x64, 0xb1, 0xec, 0x23, 0xc8, 0x7a, 0xbc, 0x62, + 0x95, 0xf6, 0xa0, 0x18, 0xcc, 0x77, 0xe0, 0x32, 0x06, 0x99, 0xd3, 0xba, 0x8c, 0x41, 0x76, 0x93, + 0xc3, 0x8f, 0x26, 0xd8, 0xcc, 0xf8, 0x56, 0x70, 0xc9, 0x76, 0x16, 0x0c, 0x85, 0xf5, 0x64, 0xd5, + 0x32, 0x65, 0xa3, 0x71, 0x34, 0xfc, 0x69, 0x1b, 0x9f, 0xc7, 0xb6, 0x31, 0x1c, 0xdb, 0xe6, 0xc5, + 0xd8, 0x36, 0x7f, 0x8c, 0x6d, 0xf3, 0x7c, 0x62, 0x1b, 0x17, 0x13, 0xdb, 0xf8, 0x36, 0xb1, 0x8d, + 0xd7, 0xfb, 0x73, 0x8d, 0x9f, 0xbc, 0x63, 0x87, 0x1f, 0x1f, 0x33, 0x9f, 0xe1, 0x40, 0x3f, 0xbb, + 0x73, 0x97, 0x67, 0x3a, 0x0a, 0x5e, 0x21, 0xbd, 0xe7, 0xf6, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, + 0xba, 0xe5, 0xa9, 0x6c, 0x5e, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -417,7 +418,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) MsgPlaceMarketBid(ctx context.Context, in *MsgPlaceMarketBidRequest, opts ...grpc.CallOption) (*MsgPlaceMarketBidResponse, error) { out := new(MsgPlaceMarketBidResponse) - err := c.cc.Invoke(ctx, "/comdex.auctions.v2.Msg/MsgPlaceMarketBid", in, out, opts...) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgPlaceMarketBid", in, out, opts...) if err != nil { return nil, err } @@ -426,7 +427,7 @@ func (c *msgClient) MsgPlaceMarketBid(ctx context.Context, in *MsgPlaceMarketBid func (c *msgClient) MsgDepositLimitBid(ctx context.Context, in *MsgDepositLimitBidRequest, opts ...grpc.CallOption) (*MsgDepositLimitBidResponse, error) { out := new(MsgDepositLimitBidResponse) - err := c.cc.Invoke(ctx, "/comdex.auctions.v2.Msg/MsgDepositLimitBid", in, out, opts...) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgDepositLimitBid", in, out, opts...) if err != nil { return nil, err } @@ -435,7 +436,7 @@ func (c *msgClient) MsgDepositLimitBid(ctx context.Context, in *MsgDepositLimitB func (c *msgClient) MsgCancelLimitBid(ctx context.Context, in *MsgCancelLimitBidRequest, opts ...grpc.CallOption) (*MsgCancelLimitBidResponse, error) { out := new(MsgCancelLimitBidResponse) - err := c.cc.Invoke(ctx, "/comdex.auctions.v2.Msg/MsgCancelLimitBid", in, out, opts...) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgCancelLimitBid", in, out, opts...) if err != nil { return nil, err } @@ -444,7 +445,7 @@ func (c *msgClient) MsgCancelLimitBid(ctx context.Context, in *MsgCancelLimitBid func (c *msgClient) MsgWithdrawLimitBid(ctx context.Context, in *MsgWithdrawLimitBidRequest, opts ...grpc.CallOption) (*MsgWithdrawLimitBidResponse, error) { out := new(MsgWithdrawLimitBidResponse) - err := c.cc.Invoke(ctx, "/comdex.auctions.v2.Msg/MsgWithdrawLimitBid", in, out, opts...) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Msg/MsgWithdrawLimitBid", in, out, opts...) if err != nil { return nil, err } @@ -490,7 +491,7 @@ func _Msg_MsgPlaceMarketBid_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/comdex.auctions.v2.Msg/MsgPlaceMarketBid", + FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgPlaceMarketBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).MsgPlaceMarketBid(ctx, req.(*MsgPlaceMarketBidRequest)) @@ -508,7 +509,7 @@ func _Msg_MsgDepositLimitBid_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/comdex.auctions.v2.Msg/MsgDepositLimitBid", + FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgDepositLimitBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).MsgDepositLimitBid(ctx, req.(*MsgDepositLimitBidRequest)) @@ -526,7 +527,7 @@ func _Msg_MsgCancelLimitBid_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/comdex.auctions.v2.Msg/MsgCancelLimitBid", + FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgCancelLimitBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).MsgCancelLimitBid(ctx, req.(*MsgCancelLimitBidRequest)) @@ -544,7 +545,7 @@ func _Msg_MsgWithdrawLimitBid_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/comdex.auctions.v2.Msg/MsgWithdrawLimitBid", + FullMethod: "/comdex.auctionsV2.v1beta1.Msg/MsgWithdrawLimitBid", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).MsgWithdrawLimitBid(ctx, req.(*MsgWithdrawLimitBidRequest)) @@ -553,7 +554,7 @@ func _Msg_MsgWithdrawLimitBid_Handler(srv interface{}, ctx context.Context, dec } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.auctions.v2.Msg", + ServiceName: "comdex.auctionsV2.v1beta1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -574,7 +575,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "comdex/auctions/v1beta1/tx.proto", + Metadata: "comdex/auctionsV2/v1beta1/tx.proto", } func (m *MsgPlaceMarketBidRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/liquidationsV2/client/cli/query.go b/x/liquidationsV2/client/cli/query.go index 56e41ca63..544ae89c2 100644 --- a/x/liquidationsV2/client/cli/query.go +++ b/x/liquidationsV2/client/cli/query.go @@ -1,7 +1,11 @@ package cli import ( + "context" "fmt" + "github.com/cosmos/cosmos-sdk/client/flags" + "strconv" + // "strings" "github.com/spf13/cobra" @@ -24,8 +28,214 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand(CmdQueryParams()) - // this line is used by starport scaffolding # 1 + cmd.AddCommand( + CmdQueryParams(), + queryLockedVault(), + queryLockedVaults(), + queryLiquidationWhitelisting(), + queryLiquidationWhitelistings(), + queryLockedVaultsHistory(), + queryAppReserveFundsTxData(), + ) + + return cmd +} + +func queryLockedVault() *cobra.Command { + cmd := &cobra.Command{ + Use: "locked-vault [app-id] [id]", + Short: "Query locked-vault", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + appID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + id, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.QueryLockedVault( + context.Background(), + &types.QueryLockedVaultRequest{ + AppId: appID, + Id: id, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func queryLockedVaults() *cobra.Command { + cmd := &cobra.Command{ + Use: "locked-vaults", + Short: "Query locked-vaults", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.QueryLockedVaults( + context.Background(), + &types.QueryLockedVaultsRequest{ + Pagination: pagination, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "locked-vaults") + + return cmd +} + +func queryLiquidationWhitelisting() *cobra.Command { + cmd := &cobra.Command{ + Use: "liquidation-whitelisting [app-id]", + Short: "Query liquidation-whitelisting", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + appID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.QueryLiquidationWhiteListing( + context.Background(), + &types.QueryLiquidationWhiteListingRequest{ + AppId: appID, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func queryLiquidationWhitelistings() *cobra.Command { + cmd := &cobra.Command{ + Use: "liquidation-whitelistings", + Short: "Query liquidation-whitelistings", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.QueryLiquidationWhiteListings( + context.Background(), + &types.QueryLiquidationWhiteListingsRequest{ + Pagination: pagination, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "liquidation-whitelistings") + + return cmd +} + +func queryLockedVaultsHistory() *cobra.Command { + cmd := &cobra.Command{ + Use: "locked-vaults-history", + Short: "Query locked-vaults history", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.QueryLockedVaultsHistory( + context.Background(), + &types.QueryLockedVaultsHistoryRequest{ + Pagination: pagination, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "locked-vaults-history") + + return cmd +} + +func queryAppReserveFundsTxData() *cobra.Command { + cmd := &cobra.Command{ + Use: "app-reserve-funds [app-id]", + Short: "Query app-reserve-funds", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + appID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.QueryAppReserveFundsTxData( + context.Background(), + &types.QueryAppReserveFundsTxDataRequest{ + AppId: appID, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) return cmd } diff --git a/x/liquidationsV2/keeper/grpc_query.go b/x/liquidationsV2/keeper/grpc_query.go index aad735ed6..539da32f8 100644 --- a/x/liquidationsV2/keeper/grpc_query.go +++ b/x/liquidationsV2/keeper/grpc_query.go @@ -1,10 +1,16 @@ package keeper import ( + "context" "github.com/comdex-official/comdex/x/liquidationsV2/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) -var _ types.QueryServer = Keeper{} +var _ types.QueryServer = QueryServer{} type QueryServer struct { Keeper @@ -15,3 +21,159 @@ func NewQueryServer(k Keeper) types.QueryServer { Keeper: k, } } + +func (q QueryServer) QueryLockedVault(c context.Context, req *types.QueryLockedVaultRequest) (*types.QueryLockedVaultResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + ctx := sdk.UnwrapSDKContext(c) + item, found := q.GetLockedVault(ctx, req.AppId, req.Id) + if !found { + return nil, status.Errorf(codes.NotFound, "locked-vault does not exist for id %d", req.Id) + } + + return &types.QueryLockedVaultResponse{ + LockedVault: item, + }, nil +} + +func (q QueryServer) QueryLockedVaults(c context.Context, req *types.QueryLockedVaultsRequest) (*types.QueryLockedVaultsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + items []types.LockedVault + ctx = sdk.UnwrapSDKContext(c) + ) + + pagination, err := query.FilteredPaginate( + prefix.NewStore(q.Store(ctx), types.LockedVaultKeyPrefix), + req.Pagination, + func(_, value []byte, accumulate bool) (bool, error) { + var item types.LockedVault + if err := q.cdc.Unmarshal(value, &item); err != nil { + return false, err + } + + if accumulate { + items = append(items, item) + } + + return true, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryLockedVaultsResponse{ + LockedVaults: items, + Pagination: pagination, + }, nil +} + +func (q QueryServer) QueryLiquidationWhiteListing(c context.Context, req *types.QueryLiquidationWhiteListingRequest) (*types.QueryLiquidationWhiteListingResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + ctx := sdk.UnwrapSDKContext(c) + item, found := q.GetLiquidationWhiteListing(ctx, req.AppId) + if !found { + return nil, status.Errorf(codes.NotFound, "Liquidation WhiteListing does not exist for app_id %d", req.AppId) + } + + return &types.QueryLiquidationWhiteListingResponse{ + LiquidationWhiteListing: item, + }, nil +} + +func (q QueryServer) QueryLiquidationWhiteListings(c context.Context, req *types.QueryLiquidationWhiteListingsRequest) (*types.QueryLiquidationWhiteListingsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + items []types.LiquidationWhiteListing + ctx = sdk.UnwrapSDKContext(c) + ) + + pagination, err := query.FilteredPaginate( + prefix.NewStore(q.Store(ctx), types.LiquidationWhiteListingKeyPrefix), + req.Pagination, + func(_, value []byte, accumulate bool) (bool, error) { + var item types.LiquidationWhiteListing + if err := q.cdc.Unmarshal(value, &item); err != nil { + return false, err + } + + if accumulate { + items = append(items, item) + } + + return true, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryLiquidationWhiteListingsResponse{ + LiquidationWhiteListings: items, + Pagination: pagination, + }, nil +} + +func (q QueryServer) QueryLockedVaultsHistory(c context.Context, req *types.QueryLockedVaultsHistoryRequest) (*types.QueryLockedVaultsHistoryResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + items []types.LockedVault + ctx = sdk.UnwrapSDKContext(c) + ) + + pagination, err := query.FilteredPaginate( + prefix.NewStore(q.Store(ctx), types.LockedVaultDataKeyHistory), + req.Pagination, + func(_, value []byte, accumulate bool) (bool, error) { + var item types.LockedVault + if err := q.cdc.Unmarshal(value, &item); err != nil { + return false, err + } + + if accumulate { + items = append(items, item) + } + + return true, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryLockedVaultsHistoryResponse{ + LockedVaultsHistory: items, + Pagination: pagination, + }, nil +} + +func (q QueryServer) QueryAppReserveFundsTxData(c context.Context, req *types.QueryAppReserveFundsTxDataRequest) (*types.QueryAppReserveFundsTxDataResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + ctx := sdk.UnwrapSDKContext(c) + item, found := q.GetAppReserveFundsTxData(ctx, req.AppId) + if !found { + return nil, status.Errorf(codes.NotFound, "AppReserveFunds Tx Data does not exist for app_id %d", req.AppId) + } + + return &types.QueryAppReserveFundsTxDataResponse{ + AppReserveFundsTxData: item, + }, nil +} diff --git a/x/liquidationsV2/module.go b/x/liquidationsV2/module.go index 7b6a193c6..9f88ca2c1 100644 --- a/x/liquidationsV2/module.go +++ b/x/liquidationsV2/module.go @@ -134,7 +134,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServer(am.keeper)) } // RegisterInvariants registers the capability module's invariants. diff --git a/x/liquidationsV2/types/keys.go b/x/liquidationsV2/types/keys.go index b2cc957de..2315fa7eb 100644 --- a/x/liquidationsV2/types/keys.go +++ b/x/liquidationsV2/types/keys.go @@ -30,6 +30,7 @@ var ( LiquidationWhiteListingKeyPrefix = []byte{0x05} AppReserveFundsKeyPrefix = []byte{0x06} AppReserveFundsTxDataKeyPrefix = []byte{0x07} + LockedVaultDataKeyHistory = []byte{0x08} ) // LengthPrefixString returns length-prefixed bytes representation diff --git a/x/liquidationsV2/types/liquidate.pb.go b/x/liquidationsV2/types/liquidate.pb.go index 3161ba275..d4681b501 100644 --- a/x/liquidationsV2/types/liquidate.pb.go +++ b/x/liquidationsV2/types/liquidate.pb.go @@ -37,14 +37,14 @@ type LiquidationWhiteListing struct { //bool param //true - comdex apps //false external apps - Initiator bool `protobuf:"varint,6,opt,name=initiator,proto3" json:"initiator,omitempty" yaml:"initiator"` + Initiator bool `protobuf:"varint,2,opt,name=initiator,proto3" json:"initiator,omitempty" yaml:"initiator"` //Sets of Params for Dutch Auction - IsDutchActivated bool `protobuf:"varint,7,opt,name=is_dutch_activated,json=isDutchActivated,proto3" json:"is_dutch_activated,omitempty" yaml:"is_dutch_activated"` - DutchAuctionParam *DutchAuctionParam `protobuf:"bytes,8,opt,name=dutch_auction_param,json=dutchAuctionParam,proto3" json:"dutch_auction_param,omitempty" yaml:"dutch_auction_param"` + IsDutchActivated bool `protobuf:"varint,3,opt,name=is_dutch_activated,json=isDutchActivated,proto3" json:"is_dutch_activated,omitempty" yaml:"is_dutch_activated"` + DutchAuctionParam *DutchAuctionParam `protobuf:"bytes,4,opt,name=dutch_auction_param,json=dutchAuctionParam,proto3" json:"dutch_auction_param,omitempty" yaml:"dutch_auction_param"` //Sets of Params for English Auction - IsEnglishActivated bool `protobuf:"varint,9,opt,name=is_english_activated,json=isEnglishActivated,proto3" json:"is_english_activated,omitempty" yaml:"is_english_activated"` - EnglishAuctionParam *EnglishAuctionParam `protobuf:"bytes,10,opt,name=english_auction_param,json=englishAuctionParam,proto3" json:"english_auction_param,omitempty" yaml:"english_auction_param"` - KeeeperIncentive github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=keeeper_incentive,json=keeeperIncentive,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"keeeper_incentive" yaml:"keeper_incentive"` + IsEnglishActivated bool `protobuf:"varint,5,opt,name=is_english_activated,json=isEnglishActivated,proto3" json:"is_english_activated,omitempty" yaml:"is_english_activated"` + EnglishAuctionParam *EnglishAuctionParam `protobuf:"bytes,6,opt,name=english_auction_param,json=englishAuctionParam,proto3" json:"english_auction_param,omitempty" yaml:"english_auction_param"` + KeeeperIncentive github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=keeeper_incentive,json=keeeperIncentive,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"keeeper_incentive" yaml:"keeper_incentive"` } func (m *LiquidationWhiteListing) Reset() { *m = LiquidationWhiteListing{} } @@ -388,107 +388,107 @@ func init() { } var fileDescriptor_631048b9d11253bf = []byte{ - // 1599 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0x52, 0xd6, 0x07, 0x87, 0xa2, 0x44, 0x8e, 0x44, 0x8b, 0x56, 0x6d, 0xae,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0x85, 0x31, - 0x7d, 0x24, 0x63, 0x5a, 0x11, 0xee, 0xec, 0x27, 0x4e, 0xa8, 0x8e, 0xf7, 0x42, 0x9e, 0xa9, 0x02, - 0xbc, 0x6e, 0x4e, 0x26, 0x81, 0xff, 0x55, 0x40, 0x8e, 0x22, 0xb7, 0x8d, 0xa9, 0xc1, 0xce, 0x40, - 0x76, 0x83, 0x17, 0x38, 0x77, 0x28, 0x9d, 0x83, 0xf2, 0xa5, 0x8a, 0xb1, 0x53, 0x39, 0x04, 0x04, - 0xf0, 0x00, 0x37, 0x29, 0xfc, 0x50, 0x01, 0xa5, 0x44, 0x27, 0x60, 0x44, 0xd3, 0x0c, 0x6f, 0xff, - 0x72, 0xbb, 0x1b, 0x55, 0x31, 0xef, 0x54, 0xc3, 0x79, 0xa7, 0x7a, 0x1c, 0x6a, 0x88, 0x87, 0x2b, - 0xf0, 0xd5, 0xb5, 0x44, 0x41, 0x8c, 0xa4, 0x71, 0x23, 0x3a, 0x91, 0x5e, 0x7b, 0xf6, 0x8d, 0xaa, - 0xe8, 0x6b, 0x9d, 0x09, 0x48, 0xf8, 0x0f, 0x3e, 0x91, 0x10, 0x9b, 0x62, 0x97, 0x55, 0x21, 0xd1, - 0x48, 0x96, 0x97, 0x78, 0x5b, 0x7e, 0x5b, 0x4c, 0x24, 0x0d, 0x29, 0xfc, 0x33, 0x97, 0x0d, 0x7d, - 0xb5, 0x1c, 0x35, 0xe5, 0x0c, 0x17, 0xc3, 0xf8, 0x40, 0x92, 0xd6, 0x86, 0x1e, 0x58, 0x1f, 0x21, - 0x37, 0x90, 0x65, 0xb9, 0xd8, 0xf3, 0xca, 0x79, 0x9e, 0xdd, 0xbf, 0x0b, 0x7c, 0xb5, 0x94, 0x06, - 0xed, 0x09, 0x85, 0x38, 0x33, 0x5e, 0xc1, 0xa0, 0xe9, 0x25, 0x32, 0x09, 0xc8, 0x8c, 0xb2, 0xb2, - 0x35, 0xc9, 0xe8, 0x4a, 0x6c, 0xf4,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 0x89, 0x7a, 0x18, - 0x35, 0xe1, 0x25, 0xd1, 0x3f, 0xc4, 0xe7, 0x37, 0x41, 0x49, 0xd3, 0x8b, 0xf1, 0xaa, 0x6c, 0xd5, - 0xe1, 0xef, 0x41, 0x9e, 0x5b, 0x8a, 0x98, 0x2e, 0x73, 0xa6, 0x72, 0x3c, 0x17, 0xa4, 0xc4, 0x9a, - 0x9e, 0x63, 0xdf, 0x12, 0x5d, 0x7f, 0xf2, 0xfc, 0xbb, 0xca, 0xcc, 0x27, 0x41, 0x65, 0xe6, 0x79, - 0x50, 0x51, 0x5e, 0x04, 0x15, 0xe5, 0xdb, 0xa0, 0xa2, 0x3c, 0x7b, 0x59, 0x99, 0x79, 0xf1, 0xb2, - 0x32, 0xf3, 0xd5, 0xcb, 0xca, 0xcc, 0x93, 0x5f, 0xa7, 0x0e, 0x9f, 0x4d, 0x2a, 0xdb, 0x4e, 0xab, - 0x45, 0x4c, 0x82, 0x3a, 0xf2, 0xbb, 0x36, 0xf6, 0x07, 0x1e, 0x9e, 0x12, 0xcd, 0x79, 0x5e, 0xa2, - 0xee, 0xfc, 0x10, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x02, 0x97, 0xb4, 0x06, 0x12, 0x00, 0x00, + // 1598 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4b, 0x6f, 0x1b, 0x47, + 0x12, 0xd6, 0x50, 0xd6, 0x83, 0x4d, 0x51, 0x22, 0x5b, 0xa2, 0x35, 0xd6, 0xda, 0x1c, 0xed, 0x00, + 0xf6, 0x0a, 0x36, 0x44, 0x5a, 0x32, 0x16, 0xfb, 0x04, 0x76, 0x45, 0x49, 0xb6, 0xb9, 0x2b, 0xc4, + 0xf6, 0x40, 0x70, 0x00, 0x23, 0xc9, 0x64, 0x38, 0xd3, 0xa4, 0x1a, 0x22, 0x67, 0xe8, 0x99, 0xa6, + 0x42,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, 0x8f, 0x9e, 0xfe, 0x52, 0x9e, 0xfa, 0x2a, 0x28, 0x4f, 0x3d, 0x0d, 0xca, + 0xd2, 0xb3, 0xa0, 0x2c, 0xfd, 0x1c, 0x94, 0xa5, 0x27, 0xcf, 0xcb, 0x53, 0xcf, 0x9e, 0x97, 0xa7, + 0x7e, 0x78, 0x5e, 0x9e, 0x7a, 0xf4, 0xf7, 0xd4, 0xe1, 0xd3, 0x49, 0x65, 0xd3, 0x69, 0x36, 0xb1, + 0x89, 0x8d, 0xb6, 0xf8, 0xae, 0x8e, 0xfc, 0x81, 0x87, 0xa5, 0x44, 0x63, 0x96, 0x95, 0xa8, 0x5b, + 0xbf, 0x05, 0x00, 0x00, 0xff, 0xff, 0x04, 0xfb, 0x8c, 0x7b, 0x06, 0x12, 0x00, 0x00, } func (m *LiquidationWhiteListing) Marshal() (dAtA []byte, err error) { @@ -520,7 +520,7 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintLiquidate(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x5a + dAtA[i] = 0x3a if m.EnglishAuctionParam != nil { { size, err := m.EnglishAuctionParam.MarshalToSizedBuffer(dAtA[:i]) @@ -531,7 +531,7 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintLiquidate(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x52 + dAtA[i] = 0x32 } if m.IsEnglishActivated { i-- @@ -541,7 +541,7 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0 } i-- - dAtA[i] = 0x48 + dAtA[i] = 0x28 } if m.DutchAuctionParam != nil { { @@ -553,7 +553,7 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintLiquidate(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x42 + dAtA[i] = 0x22 } if m.IsDutchActivated { i-- @@ -563,7 +563,7 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0 } i-- - dAtA[i] = 0x38 + dAtA[i] = 0x18 } if m.Initiator { i-- @@ -573,7 +573,7 @@ func (m *LiquidationWhiteListing) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0 } i-- - dAtA[i] = 0x30 + dAtA[i] = 0x10 } if m.AppId != 0 { i = encodeVarintLiquidate(dAtA, i, uint64(m.AppId)) @@ -1293,7 +1293,7 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { break } } - case 6: + case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Initiator", wireType) } @@ -1313,7 +1313,7 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { } } m.Initiator = bool(v != 0) - case 7: + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field IsDutchActivated", wireType) } @@ -1333,7 +1333,7 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { } } m.IsDutchActivated = bool(v != 0) - case 8: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DutchAuctionParam", wireType) } @@ -1369,7 +1369,7 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 9: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field IsEnglishActivated", wireType) } @@ -1389,7 +1389,7 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { } } m.IsEnglishActivated = bool(v != 0) - case 10: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EnglishAuctionParam", wireType) } @@ -1425,7 +1425,7 @@ func (m *LiquidationWhiteListing) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 11: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field KeeeperIncentive", wireType) } diff --git a/x/liquidationsV2/types/query.pb.go b/x/liquidationsV2/types/query.pb.go index 5a09810b6..7e9adfb2f 100644 --- a/x/liquidationsV2/types/query.pb.go +++ b/x/liquidationsV2/types/query.pb.go @@ -6,7 +6,7 @@ package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/query" + query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -110,213 +110,2723 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "comdex.liquidationsV2.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "comdex.liquidationsV2.v1beta1.QueryParamsResponse") +type QueryLockedVaultRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` } -func init() { - proto.RegisterFile("comdex/liquidationsV2/v1beta1/query.proto", fileDescriptor_5ed3babcdef7f922) +func (m *QueryLockedVaultRequest) Reset() { *m = QueryLockedVaultRequest{} } +func (m *QueryLockedVaultRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLockedVaultRequest) ProtoMessage() {} +func (*QueryLockedVaultRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ed3babcdef7f922, []int{2} } - -var fileDescriptor_5ed3babcdef7f922 = []byte{ - // 314 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4c, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0xcf, 0xc9, 0x2c, 0x2c, 0xcd, 0x4c, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, - 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x2c, 0x4d,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d, 0x21, 0x5d, 0x7d, 0x88, 0x5e, 0xdd, 0xfc, 0xb4, 0xb4, 0xcc, 0xe4, 0xcc, - 0xc4, 0x1c, 0x7d, 0xec, 0x41, 0x06, 0x71, 0xb2, 0x53, 0xd0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, - 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, - 0x1e, 0xcb, 0x31, 0x44, 0x59, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0x81, 0x9c, 0x82, 0xcb, 0x48, - 0x0c, 0x43, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xe1, 0x6f, 0x0c, 0x08, 0x00, 0x00, - 0xff, 0xff, 0x7f, 0xc8, 0xf5, 0x9a, 0x57, 0x02, 0x00, 0x00, +func (m *QueryLockedVaultRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLockedVaultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLockedVaultRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLockedVaultRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLockedVaultRequest.Merge(m, src) +} +func (m *QueryLockedVaultRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLockedVaultRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLockedVaultRequest.DiscardUnknown(m) } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn +var xxx_messageInfo_QueryLockedVaultRequest proto.InternalMessageInfo -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +func (m *QueryLockedVaultRequest) GetAppId() uint64 { + if m != nil { + return m.AppId + } + return 0 +} -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +func (m *QueryLockedVaultRequest) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 } -type queryClient struct { - cc grpc1.ClientConn +type QueryLockedVaultResponse struct { + LockedVault LockedVault `protobuf:"bytes,1,opt,name=locked_vault,json=lockedVault,proto3" json:"locked_vault" yaml:"locked_vault"` } -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} +func (m *QueryLockedVaultResponse) Reset() { *m = QueryLockedVaultResponse{} } +func (m *QueryLockedVaultResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLockedVaultResponse) ProtoMessage() {} +func (*QueryLockedVaultResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ed3babcdef7f922, []int{3} +} +func (m *QueryLockedVaultResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLockedVaultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLockedVaultResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLockedVaultResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLockedVaultResponse.Merge(m, src) +} +func (m *QueryLockedVaultResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLockedVaultResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLockedVaultResponse.DiscardUnknown(m) } -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/comdex.liquidationsV2.v1beta1.Query/Params", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QueryLockedVaultResponse proto.InternalMessageInfo + +func (m *QueryLockedVaultResponse) GetLockedVault() LockedVault { + if m != nil { + return m.LockedVault } - return out, nil + return LockedVault{} } -// QueryServer is the server API for Query service. -type QueryServer interface { - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +type QueryLockedVaultsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` } -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { +func (m *QueryLockedVaultsRequest) Reset() { *m = QueryLockedVaultsRequest{} } +func (m *QueryLockedVaultsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLockedVaultsRequest) ProtoMessage() {} +func (*QueryLockedVaultsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ed3babcdef7f922, []int{4} +} +func (m *QueryLockedVaultsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLockedVaultsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLockedVaultsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLockedVaultsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLockedVaultsRequest.Merge(m, src) +} +func (m *QueryLockedVaultsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLockedVaultsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLockedVaultsRequest.DiscardUnknown(m) } -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +var xxx_messageInfo_QueryLockedVaultsRequest proto.InternalMessageInfo + +func (m *QueryLockedVaultsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil } -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) +type QueryLockedVaultsResponse struct { + LockedVaults []LockedVault `protobuf:"bytes,1,rep,name=locked_vaults,json=lockedVaults,proto3" json:"locked_vaults" yaml:"locked_vaults"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` } -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err +func (m *QueryLockedVaultsResponse) Reset() { *m = QueryLockedVaultsResponse{} } +func (m *QueryLockedVaultsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLockedVaultsResponse) ProtoMessage() {} +func (*QueryLockedVaultsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ed3babcdef7f922, []int{5} +} +func (m *QueryLockedVaultsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLockedVaultsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLockedVaultsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) +} +func (m *QueryLockedVaultsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLockedVaultsResponse.Merge(m, src) +} +func (m *QueryLockedVaultsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLockedVaultsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLockedVaultsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLockedVaultsResponse proto.InternalMessageInfo + +func (m *QueryLockedVaultsResponse) GetLockedVaults() []LockedVault { + if m != nil { + return m.LockedVaults } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.liquidationsV2.v1beta1.Query/Params", + return nil +} + +func (m *QueryLockedVaultsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + return nil +} + +type QueryLiquidationWhiteListingRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` +} + +func (m *QueryLiquidationWhiteListingRequest) Reset() { *m = QueryLiquidationWhiteListingRequest{} } +func (m *QueryLiquidationWhiteListingRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLiquidationWhiteListingRequest) ProtoMessage() {} +func (*QueryLiquidationWhiteListingRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ed3babcdef7f922, []int{6} +} +func (m *QueryLiquidationWhiteListingRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLiquidationWhiteListingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLiquidationWhiteListingRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *QueryLiquidationWhiteListingRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLiquidationWhiteListingRequest.Merge(m, src) +} +func (m *QueryLiquidationWhiteListingRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLiquidationWhiteListingRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLiquidationWhiteListingRequest.DiscardUnknown(m) } -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.liquidationsV2.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "comdex/liquidationsV2/v1beta1/query.proto", +var xxx_messageInfo_QueryLiquidationWhiteListingRequest proto.InternalMessageInfo + +func (m *QueryLiquidationWhiteListingRequest) GetAppId() uint64 { + if m != nil { + return m.AppId + } + return 0 } -func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +type QueryLiquidationWhiteListingResponse struct { + LiquidationWhiteListing LiquidationWhiteListing `protobuf:"bytes,1,opt,name=liquidation_whiteListing,json=liquidationWhiteListing,proto3" json:"liquidation_whiteListing" yaml:"liquidation_whiteListing"` +} + +func (m *QueryLiquidationWhiteListingResponse) Reset() { *m = QueryLiquidationWhiteListingResponse{} } +func (m *QueryLiquidationWhiteListingResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLiquidationWhiteListingResponse) ProtoMessage() {} +func (*QueryLiquidationWhiteListingResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ed3babcdef7f922, []int{7} +} +func (m *QueryLiquidationWhiteListingResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLiquidationWhiteListingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLiquidationWhiteListingResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return dAtA[:n], nil +} +func (m *QueryLiquidationWhiteListingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLiquidationWhiteListingResponse.Merge(m, src) +} +func (m *QueryLiquidationWhiteListingResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLiquidationWhiteListingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLiquidationWhiteListingResponse.DiscardUnknown(m) } -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +var xxx_messageInfo_QueryLiquidationWhiteListingResponse proto.InternalMessageInfo + +func (m *QueryLiquidationWhiteListingResponse) GetLiquidationWhiteListing() LiquidationWhiteListing { + if m != nil { + return m.LiquidationWhiteListing + } + return LiquidationWhiteListing{} } -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +type QueryLiquidationWhiteListingsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` } -func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryLiquidationWhiteListingsRequest) Reset() { *m = QueryLiquidationWhiteListingsRequest{} } +func (m *QueryLiquidationWhiteListingsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLiquidationWhiteListingsRequest) ProtoMessage() {} +func (*QueryLiquidationWhiteListingsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ed3babcdef7f922, []int{8} +} +func (m *QueryLiquidationWhiteListingsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLiquidationWhiteListingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLiquidationWhiteListingsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return dAtA[:n], nil +} +func (m *QueryLiquidationWhiteListingsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLiquidationWhiteListingsRequest.Merge(m, src) +} +func (m *QueryLiquidationWhiteListingsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLiquidationWhiteListingsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLiquidationWhiteListingsRequest.DiscardUnknown(m) } -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +var xxx_messageInfo_QueryLiquidationWhiteListingsRequest proto.InternalMessageInfo + +func (m *QueryLiquidationWhiteListingsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil } -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) +type QueryLiquidationWhiteListingsResponse struct { + LiquidationWhiteListings []LiquidationWhiteListing `protobuf:"bytes,1,rep,name=liquidation_whiteListings,json=liquidationWhiteListings,proto3" json:"liquidation_whiteListings" yaml:"liquidation_whiteListings"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryLiquidationWhiteListingsResponse) Reset() { *m = QueryLiquidationWhiteListingsResponse{} } +func (m *QueryLiquidationWhiteListingsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLiquidationWhiteListingsResponse) ProtoMessage() {} +func (*QueryLiquidationWhiteListingsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ed3babcdef7f922, []int{9} +} +func (m *QueryLiquidationWhiteListingsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLiquidationWhiteListingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLiquidationWhiteListingsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) if err != nil { - return 0, err + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLiquidationWhiteListingsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLiquidationWhiteListingsResponse.Merge(m, src) +} +func (m *QueryLiquidationWhiteListingsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLiquidationWhiteListingsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLiquidationWhiteListingsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLiquidationWhiteListingsResponse proto.InternalMessageInfo + +func (m *QueryLiquidationWhiteListingsResponse) GetLiquidationWhiteListings() []LiquidationWhiteListing { + if m != nil { + return m.LiquidationWhiteListings + } + return nil +} + +func (m *QueryLiquidationWhiteListingsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryLockedVaultsHistoryRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryLockedVaultsHistoryRequest) Reset() { *m = QueryLockedVaultsHistoryRequest{} } +func (m *QueryLockedVaultsHistoryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLockedVaultsHistoryRequest) ProtoMessage() {} +func (*QueryLockedVaultsHistoryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ed3babcdef7f922, []int{10} +} +func (m *QueryLockedVaultsHistoryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLockedVaultsHistoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLockedVaultsHistoryRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLockedVaultsHistoryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLockedVaultsHistoryRequest.Merge(m, src) +} +func (m *QueryLockedVaultsHistoryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLockedVaultsHistoryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLockedVaultsHistoryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLockedVaultsHistoryRequest proto.InternalMessageInfo + +func (m *QueryLockedVaultsHistoryRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryLockedVaultsHistoryResponse struct { + LockedVaultsHistory []LockedVault `protobuf:"bytes,1,rep,name=locked_vaults_history,json=lockedVaultsHistory,proto3" json:"locked_vaults_history" yaml:"locked_vaults_history"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryLockedVaultsHistoryResponse) Reset() { *m = QueryLockedVaultsHistoryResponse{} } +func (m *QueryLockedVaultsHistoryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLockedVaultsHistoryResponse) ProtoMessage() {} +func (*QueryLockedVaultsHistoryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ed3babcdef7f922, []int{11} +} +func (m *QueryLockedVaultsHistoryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLockedVaultsHistoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLockedVaultsHistoryResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLockedVaultsHistoryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLockedVaultsHistoryResponse.Merge(m, src) +} +func (m *QueryLockedVaultsHistoryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLockedVaultsHistoryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLockedVaultsHistoryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLockedVaultsHistoryResponse proto.InternalMessageInfo + +func (m *QueryLockedVaultsHistoryResponse) GetLockedVaultsHistory() []LockedVault { + if m != nil { + return m.LockedVaultsHistory + } + return nil +} + +func (m *QueryLockedVaultsHistoryResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAppReserveFundsTxDataRequest struct { + AppId uint64 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` +} + +func (m *QueryAppReserveFundsTxDataRequest) Reset() { *m = QueryAppReserveFundsTxDataRequest{} } +func (m *QueryAppReserveFundsTxDataRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAppReserveFundsTxDataRequest) ProtoMessage() {} +func (*QueryAppReserveFundsTxDataRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5ed3babcdef7f922, []int{12} +} +func (m *QueryAppReserveFundsTxDataRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAppReserveFundsTxDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAppReserveFundsTxDataRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAppReserveFundsTxDataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAppReserveFundsTxDataRequest.Merge(m, src) +} +func (m *QueryAppReserveFundsTxDataRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAppReserveFundsTxDataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAppReserveFundsTxDataRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAppReserveFundsTxDataRequest proto.InternalMessageInfo + +func (m *QueryAppReserveFundsTxDataRequest) GetAppId() uint64 { + if m != nil { + return m.AppId + } + return 0 +} + +type QueryAppReserveFundsTxDataResponse struct { + AppReserveFundsTxData AppReserveFundsTxData `protobuf:"bytes,1,opt,name=app_reserve_funds_tx_data,json=appReserveFundsTxData,proto3" json:"app_reserve_funds_tx_data" yaml:"app_reserve_funds_tx_data"` +} + +func (m *QueryAppReserveFundsTxDataResponse) Reset() { *m = QueryAppReserveFundsTxDataResponse{} } +func (m *QueryAppReserveFundsTxDataResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAppReserveFundsTxDataResponse) ProtoMessage() {} +func (*QueryAppReserveFundsTxDataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5ed3babcdef7f922, []int{13} +} +func (m *QueryAppReserveFundsTxDataResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAppReserveFundsTxDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAppReserveFundsTxDataResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAppReserveFundsTxDataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAppReserveFundsTxDataResponse.Merge(m, src) +} +func (m *QueryAppReserveFundsTxDataResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAppReserveFundsTxDataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAppReserveFundsTxDataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAppReserveFundsTxDataResponse proto.InternalMessageInfo + +func (m *QueryAppReserveFundsTxDataResponse) GetAppReserveFundsTxData() AppReserveFundsTxData { + if m != nil { + return m.AppReserveFundsTxData + } + return AppReserveFundsTxData{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "comdex.liquidationsV2.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "comdex.liquidationsV2.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryLockedVaultRequest)(nil), "comdex.liquidationsV2.v1beta1.QueryLockedVaultRequest") + proto.RegisterType((*QueryLockedVaultResponse)(nil), "comdex.liquidationsV2.v1beta1.QueryLockedVaultResponse") + proto.RegisterType((*QueryLockedVaultsRequest)(nil), "comdex.liquidationsV2.v1beta1.QueryLockedVaultsRequest") + proto.RegisterType((*QueryLockedVaultsResponse)(nil), "comdex.liquidationsV2.v1beta1.QueryLockedVaultsResponse") + proto.RegisterType((*QueryLiquidationWhiteListingRequest)(nil), "comdex.liquidationsV2.v1beta1.QueryLiquidationWhiteListingRequest") + proto.RegisterType((*QueryLiquidationWhiteListingResponse)(nil), "comdex.liquidationsV2.v1beta1.QueryLiquidationWhiteListingResponse") + proto.RegisterType((*QueryLiquidationWhiteListingsRequest)(nil), "comdex.liquidationsV2.v1beta1.QueryLiquidationWhiteListingsRequest") + proto.RegisterType((*QueryLiquidationWhiteListingsResponse)(nil), "comdex.liquidationsV2.v1beta1.QueryLiquidationWhiteListingsResponse") + proto.RegisterType((*QueryLockedVaultsHistoryRequest)(nil), "comdex.liquidationsV2.v1beta1.QueryLockedVaultsHistoryRequest") + proto.RegisterType((*QueryLockedVaultsHistoryResponse)(nil), "comdex.liquidationsV2.v1beta1.QueryLockedVaultsHistoryResponse") + proto.RegisterType((*QueryAppReserveFundsTxDataRequest)(nil), "comdex.liquidationsV2.v1beta1.QueryAppReserveFundsTxDataRequest") + proto.RegisterType((*QueryAppReserveFundsTxDataResponse)(nil), "comdex.liquidationsV2.v1beta1.QueryAppReserveFundsTxDataResponse") +} + +func init() { + proto.RegisterFile("comdex/liquidationsV2/v1beta1/query.proto", fileDescriptor_5ed3babcdef7f922) +} + +var fileDescriptor_5ed3babcdef7f922 = []byte{ + // 954 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x98, 0x36, 0x87, 0x49, 0x41, 0x74, 0x92, 0xa8, 0xce, 0x92, 0xda, 0x61, 0x68, 0x69, + 0xa9, 0xc8, 0xae, 0x12, 0x42, 0x08, 0xa1, 0x02, 0xdb, 0xa9, 0x50, 0x2b, 0xf5, 0x00, 0x2b, 0x54, + 0xa4, 0x4a, 0x60, 0x8d, 0xb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b, 0x50, 0xea, + 0xdd, 0xad, 0xed, 0x4c, 0x85, 0xa1, 0xf4, 0xdd, 0x14, 0xfa, 0x6a, 0xa8, 0x62, 0x8c, 0xf7, 0x08, + 0x3e, 0x7d, 0x5d, 0x0c, 0xfa, 0x86, 0xfe, 0x05, 0xf0, 0x62, 0xea, 0x2d, 0x87, 0xa6, 0x21, 0x3c, + 0x68, 0xe5, 0x8d, 0xe9, 0x40, 0x94, 0xec, 0x8a, 0x90, 0xbd, 0x8d, 0xb6, 0x26, 0x94, 0xcd, 0xd1, + 0x1f, 0x31, 0x2f, 0xea, 0xc1, 0x62, 0x7e, 0x33, 0xef, 0xbc, 0x8d, 0xde, 0x71, 0xda, 0x5b, 0x13, + 0xe7, 0x2b, 0x7d, 0xd7, 0x85, 0xbe, 0x4d, 0xb4, 0x91, 0x67, 0x6c, 0xfb, 0xb7, 0x4d, 0xd0, 0x4a, + 0x2d, 0x79, 0x77, 0xa3, 0xca, 0x38, 0xec, 0xd2, 0xee, 0x0c, 0xad, 0x3a, 0x05, 0x82, 0x52, 0x78, + 0x4b, 0x28, 0xdc, 0x41, 0xd5, 0x0c, 0x85, 0x89, 0x7b, 0x7f, 0x30, 0xb9, 0x35, 0xf3, 0xc1, 0x71, + 0x09, 0x3c, 0x3c, 0x2e, 0x81, 0x3f, 0x8f, 0x4b, 0xe0, 0xeb, 0x93, 0xd2, 0xcc, 0xc3, 0x93, 0xd2, + 0xcc, 0xef, 0x27, 0xa5, 0x99, 0xbb, 0x5b, 0x36, 0xf3, 0xf7, 0xba, 0x8d, 0x80, 0x6d, 0xd2, 0x22, + 0x8e, 0x14, 0xf6, 0x7b, 0x1e, 0xe5, 0x8d, 0x59, 0xf1, 0x5b, 0xf1, 0x95, 0xff, 0x03, 0x00, 0x00, + 0xff, 0xff, 0xea, 0xcc, 0xc6, 0x36, 0x32, 0x0f, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + QueryLockedVault(ctx context.Context, in *QueryLockedVaultRequest, opts ...grpc.CallOption) (*QueryLockedVaultResponse, error) + QueryLockedVaults(ctx context.Context, in *QueryLockedVaultsRequest, opts ...grpc.CallOption) (*QueryLockedVaultsResponse, error) + QueryLiquidationWhiteListing(ctx context.Context, in *QueryLiquidationWhiteListingRequest, opts ...grpc.CallOption) (*QueryLiquidationWhiteListingResponse, error) + QueryLiquidationWhiteListings(ctx context.Context, in *QueryLiquidationWhiteListingsRequest, opts ...grpc.CallOption) (*QueryLiquidationWhiteListingsResponse, error) + QueryLockedVaultsHistory(ctx context.Context, in *QueryLockedVaultsHistoryRequest, opts ...grpc.CallOption) (*QueryLockedVaultsHistoryResponse, error) + QueryAppReserveFundsTxData(ctx context.Context, in *QueryAppReserveFundsTxDataRequest, opts ...grpc.CallOption) (*QueryAppReserveFundsTxDataResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/comdex.liquidationsV2.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryLockedVault(ctx context.Context, in *QueryLockedVaultRequest, opts ...grpc.CallOption) (*QueryLockedVaultResponse, error) { + out := new(QueryLockedVaultResponse) + err := c.cc.Invoke(ctx, "/comdex.liquidationsV2.v1beta1.Query/QueryLockedVault", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryLockedVaults(ctx context.Context, in *QueryLockedVaultsRequest, opts ...grpc.CallOption) (*QueryLockedVaultsResponse, error) { + out := new(QueryLockedVaultsResponse) + err := c.cc.Invoke(ctx, "/comdex.liquidationsV2.v1beta1.Query/QueryLockedVaults", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryLiquidationWhiteListing(ctx context.Context, in *QueryLiquidationWhiteListingRequest, opts ...grpc.CallOption) (*QueryLiquidationWhiteListingResponse, error) { + out := new(QueryLiquidationWhiteListingResponse) + err := c.cc.Invoke(ctx, "/comdex.liquidationsV2.v1beta1.Query/QueryLiquidationWhiteListing", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryLiquidationWhiteListings(ctx context.Context, in *QueryLiquidationWhiteListingsRequest, opts ...grpc.CallOption) (*QueryLiquidationWhiteListingsResponse, error) { + out := new(QueryLiquidationWhiteListingsResponse) + err := c.cc.Invoke(ctx, "/comdex.liquidationsV2.v1beta1.Query/QueryLiquidationWhiteListings", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryLockedVaultsHistory(ctx context.Context, in *QueryLockedVaultsHistoryRequest, opts ...grpc.CallOption) (*QueryLockedVaultsHistoryResponse, error) { + out := new(QueryLockedVaultsHistoryResponse) + err := c.cc.Invoke(ctx, "/comdex.liquidationsV2.v1beta1.Query/QueryLockedVaultsHistory", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAppReserveFundsTxData(ctx context.Context, in *QueryAppReserveFundsTxDataRequest, opts ...grpc.CallOption) (*QueryAppReserveFundsTxDataResponse, error) { + out := new(QueryAppReserveFundsTxDataResponse) + err := c.cc.Invoke(ctx, "/comdex.liquidationsV2.v1beta1.Query/QueryAppReserveFundsTxData", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + QueryLockedVault(context.Context, *QueryLockedVaultRequest) (*QueryLockedVaultResponse, error) + QueryLockedVaults(context.Context, *QueryLockedVaultsRequest) (*QueryLockedVaultsResponse, error) + QueryLiquidationWhiteListing(context.Context, *QueryLiquidationWhiteListingRequest) (*QueryLiquidationWhiteListingResponse, error) + QueryLiquidationWhiteListings(context.Context, *QueryLiquidationWhiteListingsRequest) (*QueryLiquidationWhiteListingsResponse, error) + QueryLockedVaultsHistory(context.Context, *QueryLockedVaultsHistoryRequest) (*QueryLockedVaultsHistoryResponse, error) + QueryAppReserveFundsTxData(context.Context, *QueryAppReserveFundsTxDataRequest) (*QueryAppReserveFundsTxDataResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) QueryLockedVault(ctx context.Context, req *QueryLockedVaultRequest) (*QueryLockedVaultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryLockedVault not implemented") +} +func (*UnimplementedQueryServer) QueryLockedVaults(ctx context.Context, req *QueryLockedVaultsRequest) (*QueryLockedVaultsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryLockedVaults not implemented") +} +func (*UnimplementedQueryServer) QueryLiquidationWhiteListing(ctx context.Context, req *QueryLiquidationWhiteListingRequest) (*QueryLiquidationWhiteListingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryLiquidationWhiteListing not implemented") +} +func (*UnimplementedQueryServer) QueryLiquidationWhiteListings(ctx context.Context, req *QueryLiquidationWhiteListingsRequest) (*QueryLiquidationWhiteListingsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryLiquidationWhiteListings not implemented") +} +func (*UnimplementedQueryServer) QueryLockedVaultsHistory(ctx context.Context, req *QueryLockedVaultsHistoryRequest) (*QueryLockedVaultsHistoryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryLockedVaultsHistory not implemented") +} +func (*UnimplementedQueryServer) QueryAppReserveFundsTxData(ctx context.Context, req *QueryAppReserveFundsTxDataRequest) (*QueryAppReserveFundsTxDataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAppReserveFundsTxData not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.liquidationsV2.v1beta1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryLockedVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLockedVaultRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryLockedVault(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.liquidationsV2.v1beta1.Query/QueryLockedVault", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryLockedVault(ctx, req.(*QueryLockedVaultRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryLockedVaults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLockedVaultsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryLockedVaults(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.liquidationsV2.v1beta1.Query/QueryLockedVaults", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryLockedVaults(ctx, req.(*QueryLockedVaultsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryLiquidationWhiteListing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLiquidationWhiteListingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryLiquidationWhiteListing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.liquidationsV2.v1beta1.Query/QueryLiquidationWhiteListing", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryLiquidationWhiteListing(ctx, req.(*QueryLiquidationWhiteListingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryLiquidationWhiteListings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLiquidationWhiteListingsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryLiquidationWhiteListings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.liquidationsV2.v1beta1.Query/QueryLiquidationWhiteListings", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryLiquidationWhiteListings(ctx, req.(*QueryLiquidationWhiteListingsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryLockedVaultsHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLockedVaultsHistoryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryLockedVaultsHistory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.liquidationsV2.v1beta1.Query/QueryLockedVaultsHistory", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryLockedVaultsHistory(ctx, req.(*QueryLockedVaultsHistoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAppReserveFundsTxData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAppReserveFundsTxDataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAppReserveFundsTxData(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.liquidationsV2.v1beta1.Query/QueryAppReserveFundsTxData", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAppReserveFundsTxData(ctx, req.(*QueryAppReserveFundsTxDataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "comdex.liquidationsV2.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "QueryLockedVault", + Handler: _Query_QueryLockedVault_Handler, + }, + { + MethodName: "QueryLockedVaults", + Handler: _Query_QueryLockedVaults_Handler, + }, + { + MethodName: "QueryLiquidationWhiteListing", + Handler: _Query_QueryLiquidationWhiteListing_Handler, + }, + { + MethodName: "QueryLiquidationWhiteListings", + Handler: _Query_QueryLiquidationWhiteListings_Handler, + }, + { + MethodName: "QueryLockedVaultsHistory", + Handler: _Query_QueryLockedVaultsHistory_Handler, + }, + { + MethodName: "QueryAppReserveFundsTxData", + Handler: _Query_QueryAppReserveFundsTxData_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "comdex/liquidationsV2/v1beta1/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryLockedVaultRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLockedVaultRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLockedVaultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x10 + } + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryLockedVaultResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLockedVaultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLockedVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.LockedVault.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryLockedVaultsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLockedVaultsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLockedVaultsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryLockedVaultsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLockedVaultsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLockedVaultsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.LockedVaults) > 0 { + for iNdEx := len(m.LockedVaults) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LockedVaults[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryLiquidationWhiteListingRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLiquidationWhiteListingRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLiquidationWhiteListingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryLiquidationWhiteListingResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLiquidationWhiteListingResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLiquidationWhiteListingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.LiquidationWhiteListing.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryLiquidationWhiteListingsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLiquidationWhiteListingsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLiquidationWhiteListingsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryLiquidationWhiteListingsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLiquidationWhiteListingsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLiquidationWhiteListingsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.LiquidationWhiteListings) > 0 { + for iNdEx := len(m.LiquidationWhiteListings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LiquidationWhiteListings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryLockedVaultsHistoryRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLockedVaultsHistoryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLockedVaultsHistoryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryLockedVaultsHistoryResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLockedVaultsHistoryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLockedVaultsHistoryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.LockedVaultsHistory) > 0 { + for iNdEx := len(m.LockedVaultsHistory) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LockedVaultsHistory[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryAppReserveFundsTxDataRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAppReserveFundsTxDataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAppReserveFundsTxDataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AppId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAppReserveFundsTxDataResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAppReserveFundsTxDataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAppReserveFundsTxDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.AppReserveFundsTxData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryLockedVaultRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n +} + +func (m *QueryLockedVaultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.LockedVault.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryLockedVaultsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLockedVaultsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LockedVaults) > 0 { + for _, e := range m.LockedVaults { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLiquidationWhiteListingRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + return n +} + +func (m *QueryLiquidationWhiteListingResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.LiquidationWhiteListing.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryLiquidationWhiteListingsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLiquidationWhiteListingsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LiquidationWhiteListings) > 0 { + for _, e := range m.LiquidationWhiteListings { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLockedVaultsHistoryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLockedVaultsHistoryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LockedVaultsHistory) > 0 { + for _, e := range m.LockedVaultsHistory { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAppReserveFundsTxDataRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AppId != 0 { + n += 1 + sovQuery(uint64(m.AppId)) + } + return n +} + +func (m *QueryAppReserveFundsTxDataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.AppReserveFundsTxData.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryLockedVaultRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLockedVaultRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLockedVaultRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryLockedVaultResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLockedVaultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLockedVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LockedVault", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LockedVault.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryLockedVaultsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLockedVaultsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLockedVaultsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryLockedVaultsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLockedVaultsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLockedVaultsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LockedVaults", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LockedVaults = append(m.LockedVaults, LockedVault{}) + if err := m.LockedVaults[len(m.LockedVaults)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryLiquidationWhiteListingRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLiquidationWhiteListingRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLiquidationWhiteListingRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryLiquidationWhiteListingResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLiquidationWhiteListingResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLiquidationWhiteListingResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidationWhiteListing", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LiquidationWhiteListing.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryLiquidationWhiteListingsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLiquidationWhiteListingsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLiquidationWhiteListingsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryLiquidationWhiteListingsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLiquidationWhiteListingsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLiquidationWhiteListingsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidationWhiteListings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LiquidationWhiteListings = append(m.LiquidationWhiteListings, LiquidationWhiteListing{}) + if err := m.LiquidationWhiteListings[len(m.LiquidationWhiteListings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ + if iNdEx > l { + return io.ErrUnexpectedEOF } - dAtA[offset] = uint8(v) - return base + return nil } -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryLockedVaultsHistoryRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLockedVaultsHistoryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLockedVaultsHistoryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } - var l int - _ = l - return n -} -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 + if iNdEx > l { + return io.ErrUnexpectedEOF } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n + return nil } +func (m *QueryLockedVaultsHistoryResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLockedVaultsHistoryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLockedVaultsHistoryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LockedVaultsHistory", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LockedVaultsHistory = append(m.LockedVaultsHistory, LockedVault{}) + if err := m.LockedVaultsHistory[len(m.LockedVaultsHistory)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAppReserveFundsTxDataRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -339,12 +2849,31 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAppReserveFundsTxDataRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAppReserveFundsTxDataRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AppId", wireType) + } + m.AppId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AppId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -366,7 +2895,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAppReserveFundsTxDataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -389,15 +2918,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAppReserveFundsTxDataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAppReserveFundsTxDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AppReserveFundsTxData", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -424,7 +2953,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AppReserveFundsTxData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/liquidationsV2/types/query.pb.gw.go b/x/liquidationsV2/types/query.pb.gw.go index f030c9001..c3dbe1a9a 100644 --- a/x/liquidationsV2/types/query.pb.gw.go +++ b/x/liquidationsV2/types/query.pb.gw.go @@ -51,6 +51,298 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } +func request_Query_QueryLockedVault_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLockedVaultRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.QueryLockedVault(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryLockedVault_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLockedVaultRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.QueryLockedVault(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryLockedVaults_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryLockedVaults_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLockedVaultsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryLockedVaults_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryLockedVaults(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryLockedVaults_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLockedVaultsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryLockedVaults_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryLockedVaults(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryLiquidationWhiteListing_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLiquidationWhiteListingRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + msg, err := client.QueryLiquidationWhiteListing(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryLiquidationWhiteListing_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLiquidationWhiteListingRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + msg, err := server.QueryLiquidationWhiteListing(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryLiquidationWhiteListings_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryLiquidationWhiteListings_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLiquidationWhiteListingsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryLiquidationWhiteListings_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryLiquidationWhiteListings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryLiquidationWhiteListings_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLiquidationWhiteListingsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryLiquidationWhiteListings_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryLiquidationWhiteListings(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryLockedVaultsHistory_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryLockedVaultsHistory_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLockedVaultsHistoryRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryLockedVaultsHistory_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryLockedVaultsHistory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryLockedVaultsHistory_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLockedVaultsHistoryRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryLockedVaultsHistory_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryLockedVaultsHistory(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryAppReserveFundsTxData_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAppReserveFundsTxDataRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + msg, err := client.QueryAppReserveFundsTxData(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAppReserveFundsTxData_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAppReserveFundsTxDataRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + + msg, err := server.QueryAppReserveFundsTxData(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -80,6 +372,144 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryLockedVault_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryLockedVault_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryLockedVault_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryLockedVaults_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryLockedVaults_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryLockedVaults_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryLiquidationWhiteListing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryLiquidationWhiteListing_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryLiquidationWhiteListing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryLiquidationWhiteListings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryLiquidationWhiteListings_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryLiquidationWhiteListings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryLockedVaultsHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryLockedVaultsHistory_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryLockedVaultsHistory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAppReserveFundsTxData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryAppReserveFundsTxData_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAppReserveFundsTxData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -141,13 +571,157 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryLockedVault_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryLockedVault_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryLockedVault_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryLockedVaults_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryLockedVaults_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryLockedVaults_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryLiquidationWhiteListing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryLiquidationWhiteListing_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryLiquidationWhiteListing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryLiquidationWhiteListings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryLiquidationWhiteListings_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryLiquidationWhiteListings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryLockedVaultsHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryLockedVaultsHistory_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryLockedVaultsHistory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAppReserveFundsTxData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryAppReserveFundsTxData_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAppReserveFundsTxData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex-official", "comdex", "liquidationsV2", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryLockedVault_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "liquidationsV2", "v1beta1", "locked_vault", "app_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryLockedVaults_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "liquidationsV2", "v1beta1", "locked_vaults"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryLiquidationWhiteListing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "liquidationsV2", "v1beta1", "liquidation_whiteListing", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryLiquidationWhiteListings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "liquidationsV2", "v1beta1", "liquidation_whiteListings"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryLockedVaultsHistory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "liquidationsV2", "v1beta1", "locked_vaults_history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAppReserveFundsTxData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "liquidationsV2", "v1beta1", "app_reserve_funds_tx_data", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_QueryLockedVault_0 = runtime.ForwardResponseMessage + + forward_Query_QueryLockedVaults_0 = runtime.ForwardResponseMessage + + forward_Query_QueryLiquidationWhiteListing_0 = runtime.ForwardResponseMessage + + forward_Query_QueryLiquidationWhiteListings_0 = runtime.ForwardResponseMessage + + forward_Query_QueryLockedVaultsHistory_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAppReserveFundsTxData_0 = runtime.ForwardResponseMessage ) From 0fadfbd7534545021717e783fcca33d835bfc673 Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 19 Jun 2023 12:13:04 +0530 Subject: [PATCH 098/155] liquidationsV2 testcases --- app/app.go | 2 + x/auctionsV2/abci.go | 92 +------ x/auctionsV2/keeper/auctions.go | 8 +- x/auctionsV2/keeper/keeper.go | 1 + x/auctionsV2/keeper/keeper_test.go | 4 +- x/auctionsV2/keeper/utils.go | 1 + x/auctionsV2/types/keys.go | 2 +- x/liquidationsV2/keeper/keeper_test.go | 158 +++++++++++- x/liquidationsV2/keeper/liquidate.go | 4 +- x/liquidationsV2/keeper/msg_server_test.go | 275 +++++++++++++++++++-- 10 files changed, 423 insertions(+), 124 deletions(-) diff --git a/app/app.go b/app/app.go index b5420cf62..9e1765ee1 100644 --- a/app/app.go +++ b/app/app.go @@ -1389,6 +1389,8 @@ func (a *App) ModuleAccountsPermissions() map[string][]string { wasm.ModuleName: {authtypes.Burner}, liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, rewardstypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + newliqtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + newauctypes.ModuleName: {authtypes.Minter, authtypes.Burner}, icatypes.ModuleName: nil, assettypes.ModuleName: nil, } diff --git a/x/auctionsV2/abci.go b/x/auctionsV2/abci.go index a76bace41..fd73b47e4 100644 --- a/x/auctionsV2/abci.go +++ b/x/auctionsV2/abci.go @@ -1,106 +1,16 @@ package auctionsV2 import ( - "github.com/comdex-official/comdex/x/auction/expected" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/comdex-official/comdex/x/auctionsV2/keeper" ) -func BeginBlocker(ctx sdk.Context, k keeper.Keeper, assetKeeper expected.AssetKeeper, collectorKeeper expected.CollectorKeeper, esmKeeper expected.EsmKeeper) { - - // defer telemetry.ModuleMeasureSince(types.ModuleName, ctx.BlockTime(), telemetry.MetricKeyBeginBlocker) - +func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { err := k.AuctionIterator(ctx) if err != nil { return } - - // // auctionMapData, auctionMappingFound := collectorKeeper.GetAllAuctionMappingForApp(ctx) - // if auctionMappingFound { - // for _, data := range auctionMapData { - // killSwitchParams, _ := esmKeeper.GetKillSwitchData(ctx, data.AppId) - // esmStatus, found := esmKeeper.GetESMStatus(ctx, data.AppId) - // status := false - // if found { - // status = esmStatus.Status - // } - // _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { - // err1 := k.SurplusActivator(ctx, data, killSwitchParams, status) - // if err1 != nil { - // ctx.EventManager().EmitEvent( - // sdk.NewEvent( - // types.EventTypeSurplusActivatorErr, - // sdk.NewAttribute(types.DataAppID, fmt.Sprintf("%d", data.AppId)), - // sdk.NewAttribute(types.DataAssetID, fmt.Sprintf("%d", data.AssetId)), - // sdk.NewAttribute(types.DataAssetOutOraclePrice, fmt.Sprintf("%t", data.AssetOutOraclePrice)), - // sdk.NewAttribute(types.DataAssetOutPrice, fmt.Sprintf("%d", data.AssetOutPrice)), - // sdk.NewAttribute(types.DatIsAuctionActive, fmt.Sprintf("%t", data.IsAuctionActive)), - // sdk.NewAttribute(types.DataIsDebtAuction, fmt.Sprintf("%t", data.IsDebtAuction)), - // sdk.NewAttribute(types.DataIsDistributor, fmt.Sprintf("%t", data.IsDistributor)), - // sdk.NewAttribute(types.DataIsSurplusAuction, fmt.Sprintf("%t", data.IsSurplusAuction)), - // sdk.NewAttribute(types.KillSwitchParamsBreakerEnabled, fmt.Sprintf("%t", killSwitchParams.BreakerEnable)), - // sdk.NewAttribute(types.Status, fmt.Sprintf("%t", status)), - // ), - // ) - // ctx.Logger().Error("error in surplus activator") - // return err1 - // } - // return nil - // }) - // _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { - // err2 := k.DebtActivator(ctx, data, killSwitchParams, status) - // if err2 != nil { - // ctx.EventManager().EmitEvent( - // sdk.NewEvent( - // types.EventTypeDebtActivatorErr, - // sdk.NewAttribute(types.DataAppID, fmt.Sprintf("%d", data.AppId)), - // sdk.NewAttribute(types.DataAssetID, fmt.Sprintf("%d", data.AssetId)), - // sdk.NewAttribute(types.DataAssetOutOraclePrice, fmt.Sprintf("%t", data.AssetOutOraclePrice)), - // sdk.NewAttribute(types.DataAssetOutPrice, fmt.Sprintf("%d", data.AssetOutPrice)), - // sdk.NewAttribute(types.DatIsAuctionActive, fmt.Sprintf("%t", data.IsAuctionActive)), - // sdk.NewAttribute(types.DataIsDebtAuction, fmt.Sprintf("%t", data.IsDebtAuction)), - // sdk.NewAttribute(types.DataIsDistributor, fmt.Sprintf("%t", data.IsDistributor)), - // sdk.NewAttribute(types.DataIsSurplusAuction, fmt.Sprintf("%t", data.IsSurplusAuction)), - // sdk.NewAttribute(types.KillSwitchParamsBreakerEnabled, fmt.Sprintf("%t", killSwitchParams.BreakerEnable)), - // sdk.NewAttribute(types.Status, fmt.Sprintf("%t", status)), - // ), - // ) - // ctx.Logger().Error("error in debt activator") - // return err2 - // } - // return nil - // }) - // } - // } - - // apps, appsFound := assetKeeper.GetApps(ctx) - - // if appsFound { - // for _, app := range apps { - // err4 := k.RestartDutch(ctx, app.Id) - // if err4 != nil { - // ctx.EventManager().EmitEvent( - // sdk.NewEvent( - // types.EventTypeRestartDutchErr, - // sdk.NewAttribute(types.DataAppID, fmt.Sprintf("%d", app.Id)), - // ), - // ) - // ctx.Logger().Error("error in restart dutch activator") - // } - - // err6 := k.RestartLendDutch(ctx, app.Id) - // if err6 != nil { - // ctx.EventManager().EmitEvent( - // sdk.NewEvent( - // types.EventTypeRestartLendDutchErr, - // sdk.NewAttribute(types.DataAppID, fmt.Sprintf("%d", app.Id)), - // ), - // ) - // ctx.Logger().Error("error in restart lend dutch activator") - // } - // } - // } err = k.LimitOrderBid(ctx) if err != nil { return diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index a56bf7d99..b4e23d365 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,6 +1,7 @@ package keeper import ( + "fmt" "time" auctiontypes "github.com/comdex-official/comdex/x/auction/types" @@ -38,9 +39,12 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati //Getting previous auction ID auctionID := k.GetAuctionID(ctx) + fmt.Println("auctionID", auctionID) //Price Calculation Function to determine auction different stage price - liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) - + liquidationWhitelistingAppData, found := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) + if !found { + return types.ErrAuctionParamsNotFound + } if !liquidationWhitelistingAppData.IsDutchActivated { return types.ErrDutchAuctionDisabled } diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index 1d0476695..cf0f50f52 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -66,6 +66,7 @@ func NewKeeper( func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } + func (k Keeper) Store(ctx sdk.Context) sdk.KVStore { return ctx.KVStore(k.storeKey) } diff --git a/x/auctionsV2/keeper/keeper_test.go b/x/auctionsV2/keeper/keeper_test.go index 25bc2200e..02f5ade5e 100644 --- a/x/auctionsV2/keeper/keeper_test.go +++ b/x/auctionsV2/keeper/keeper_test.go @@ -4,7 +4,7 @@ import ( chain "github.com/comdex-official/comdex/app" assetKeeper "github.com/comdex-official/comdex/x/asset/keeper" "github.com/comdex-official/comdex/x/auctionsV2/keeper" - auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" + "github.com/comdex-official/comdex/x/auctionsV2/types" collectKeeper "github.com/comdex-official/comdex/x/collector/keeper" lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" liquidationKeeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper" @@ -35,7 +35,7 @@ type KeeperTestSuite struct { liquidationMsgServer liquidationTypes.MsgServer vaultMsgServer vaultTypes.MsgServer keeper keeper.Keeper - auctionMsgServer auctionsV2types.MsgServer + auctionMsgServer types.MsgServer lendKeeper lendkeeper.Keeper lendQuerier lendkeeper.QueryServer } diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go index 2f272771c..25636b522 100644 --- a/x/auctionsV2/keeper/utils.go +++ b/x/auctionsV2/keeper/utils.go @@ -48,6 +48,7 @@ func (k Keeper) SetUserBidID(ctx sdk.Context, id uint64) { ) store.Set(key, value) } + func (k Keeper) GetUserBidID(ctx sdk.Context) uint64 { var ( store = k.Store(ctx) diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index 2e74387a3..9ee590df7 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -6,7 +6,7 @@ import ( const ( // ModuleName defines the module name - ModuleName = "auctions" + ModuleName = "auctionsV2" // StoreKey defines the primary module store key StoreKey = ModuleName diff --git a/x/liquidationsV2/keeper/keeper_test.go b/x/liquidationsV2/keeper/keeper_test.go index d98c7bd8e..3fd5e0ca0 100644 --- a/x/liquidationsV2/keeper/keeper_test.go +++ b/x/liquidationsV2/keeper/keeper_test.go @@ -3,10 +3,15 @@ package keeper_test import ( chain "github.com/comdex-official/comdex/app" assetKeeper "github.com/comdex-official/comdex/x/asset/keeper" + assettypes "github.com/comdex-official/comdex/x/asset/types" + auctionsV2Keeper "github.com/comdex-official/comdex/x/auctionsV2/keeper" + auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" + lendtypes "github.com/comdex-official/comdex/x/lend/types" liquidationKeeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper" "github.com/comdex-official/comdex/x/liquidationsV2/types" marketKeeper "github.com/comdex-official/comdex/x/market/keeper" + markettypes "github.com/comdex-official/comdex/x/market/types" vaultKeeper "github.com/comdex-official/comdex/x/vault/keeper" vaultTypes "github.com/comdex-official/comdex/x/vault/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -18,18 +23,20 @@ import ( type KeeperTestSuite struct { suite.Suite - app *chain.App - ctx sdk.Context - vaultKeeper vaultKeeper.Keeper - assetKeeper assetKeeper.Keeper - liquidationKeeper liquidationKeeper.Keeper - marketKeeper marketKeeper.Keeper - querier liquidationKeeper.QueryServer - vaultQuerier vaultKeeper.QueryServer - msgServer types.MsgServer - vaultMsgServer vaultTypes.MsgServer - lendKeeper lendkeeper.Keeper - lendQuerier lendkeeper.QueryServer + app *chain.App + ctx sdk.Context + vaultKeeper vaultKeeper.Keeper + assetKeeper assetKeeper.Keeper + liquidationKeeper liquidationKeeper.Keeper + marketKeeper marketKeeper.Keeper + querier liquidationKeeper.QueryServer + vaultQuerier vaultKeeper.QueryServer + msgServer types.MsgServer + vaultMsgServer vaultTypes.MsgServer + lendKeeper lendkeeper.Keeper + lendQuerier lendkeeper.QueryServer + auctionsV2Keeper auctionsV2Keeper.Keeper + auctionsV2MsgServer auctionsV2types.MsgServer } func TestKeeperTestSuite(t *testing.T) { @@ -49,4 +56,131 @@ func (s *KeeperTestSuite) SetupTest() { s.marketKeeper = s.app.MarketKeeper s.lendKeeper = s.app.LendKeeper s.lendQuerier = lendkeeper.QueryServer{Keeper: s.lendKeeper} + s.auctionsV2Keeper = s.app.NewaucKeeper + s.auctionsV2MsgServer = auctionsV2Keeper.NewMsgServerImpl(s.auctionsV2Keeper) +} + +func (s *KeeperTestSuite) CreateNewAsset(name, denom string, twa uint64) uint64 { + err := s.app.AssetKeeper.AddAssetRecords(s.ctx, assettypes.Asset{ + Name: name, + Denom: denom, + Decimals: sdk.NewInt(1000000), + IsOnChain: true, + IsOraclePriceRequired: true, + IsCdpMintable: true, + }) + s.Require().NoError(err) + assets := s.app.AssetKeeper.GetAssets(s.ctx) + var assetID uint64 + for _, asset := range assets { + if asset.Denom == denom { + assetID = asset.Id + break + } + } + s.Require().NotZero(assetID) + + twa1 := markettypes.TimeWeightedAverage{ + AssetID: assetID, + ScriptID: 10, + Twa: twa, + CurrentIndex: 1, + IsPriceActive: true, + PriceValue: nil, + } + + s.app.MarketKeeper.SetTwa(s.ctx, twa1) + + return assetID +} + +func newInt(i int64) sdk.Int { + return sdk.NewInt(i) +} + +func newDec(i string) sdk.Dec { + dec, _ := sdk.NewDecFromStr(i) + return dec +} + +func (s *KeeperTestSuite) AddAssetRatesStats(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdk.Dec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdk.Dec, CAssetID uint64) uint64 { + err := s.app.LendKeeper.AddAssetRatesParams(s.ctx, lendtypes.AssetRatesParams{ + AssetID: AssetID, + UOptimal: UOptimal, + Base: Base, + Slope1: Slope1, + Slope2: Slope2, + EnableStableBorrow: EnableStableBorrow, + StableBase: StableBase, + StableSlope1: StableSlope1, + StableSlope2: StableSlope2, + Ltv: LTV, + LiquidationThreshold: LiquidationThreshold, + LiquidationPenalty: LiquidationPenalty, + LiquidationBonus: LiquidationBonus, + ReserveFactor: ReserveFactor, + CAssetID: CAssetID, + }) + s.Require().NoError(err) + return AssetID +} + +func (s *KeeperTestSuite) CreateNewApp(appName, shortName string) uint64 { + err := s.app.AssetKeeper.AddAppRecords(s.ctx, assettypes.AppData{ + Name: appName, + ShortName: shortName, + MinGovDeposit: sdk.NewInt(0), + GovTimeInSeconds: 0, + GenesisToken: []assettypes.MintGenesisToken{}, + }) + s.Require().NoError(err) + found := s.app.AssetKeeper.HasAppForName(s.ctx, appName) + s.Require().True(found) + + apps, found := s.app.AssetKeeper.GetApps(s.ctx) + s.Require().True(found) + var appID uint64 + for _, app := range apps { + if app.Name == appName { + appID = app.Id + break + } + } + s.Require().NotZero(appID) + return appID +} + +func (s *KeeperTestSuite) AddAssetRatesPoolPairs(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdk.Dec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdk.Dec, CAssetID uint64, moduleName, cPoolName string, assetData []*lendtypes.AssetDataPoolMapping, MinUsdValueLeft uint64, IsIsolated bool) uint64 { + err := s.app.LendKeeper.AddAssetRatesPoolPairs(s.ctx, lendtypes.AssetRatesPoolPairs{ + AssetID: AssetID, + UOptimal: UOptimal, + Base: Base, + Slope1: Slope1, + Slope2: Slope2, + EnableStableBorrow: EnableStableBorrow, + StableBase: StableBase, + StableSlope1: StableSlope1, + StableSlope2: StableSlope2, + Ltv: LTV, + LiquidationThreshold: LiquidationThreshold, + LiquidationPenalty: LiquidationPenalty, + LiquidationBonus: LiquidationBonus, + ReserveFactor: ReserveFactor, + CAssetID: CAssetID, + ModuleName: moduleName, + CPoolName: cPoolName, + AssetData: assetData, + MinUsdValueLeft: MinUsdValueLeft, + //IsIsolated: IsIsolated, + }) + s.Require().NoError(err) + return AssetID +} + +func (s *KeeperTestSuite) fundAddr(addr sdk.AccAddress, amt sdk.Coins) { + s.T().Helper() + err := s.app.BankKeeper.MintCoins(s.ctx, types.ModuleName, amt) + s.Require().NoError(err) + err = s.app.BankKeeper.SendCoinsFromModuleToAccount(s.ctx, types.ModuleName, addr, amt) + s.Require().NoError(err) } diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 803e39756..e947dbdfa 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -136,7 +136,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64, liquid //This function will only trigger Dutch auction //before creating locked vault, checking that Dutch auction is already there in the whitelisted liquidation data if !whitelistingData.IsDutchActivated { - return fmt.Errorf("Error , dutch auction not activated by the app, this function is only to trigger dutch auctions %d", whitelistingData.IsDutchActivated) + return fmt.Errorf("error , dutch auction not activated by the app, this function is only to trigger dutch auctions") } @@ -212,7 +212,7 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair //Call auction activator err := k.auctionsV2.AuctionActivator(ctx, value) if err != nil { - return fmt.Errorf("Auction could not be initiated for %d %d", value, err) + return fmt.Errorf("Auction could not be initiated for %d ", err) } //struct for auction will stay same for english and Dutch // based on type received from diff --git a/x/liquidationsV2/keeper/msg_server_test.go b/x/liquidationsV2/keeper/msg_server_test.go index 9d74ca71d..39157c207 100644 --- a/x/liquidationsV2/keeper/msg_server_test.go +++ b/x/liquidationsV2/keeper/msg_server_test.go @@ -1,16 +1,263 @@ package keeper_test -// import ( -// "context" -// "testing" - -// keepertest "github.com/comdex-official/comdex/testutil/keeper" -// "github.com/comdex-official/comdex/x/liquidationsV2/keeper" -// "github.com/comdex-official/comdex/x/liquidationsV2/types" -// sdk "github.com/cosmos/cosmos-sdk/types" -// ) - -// func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { -// k, ctx := keepertest.NewliqKeeper(t) -// return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) -// } +import ( + "github.com/comdex-official/comdex/app/wasm/bindings" + assetTypes "github.com/comdex-official/comdex/x/asset/types" + lendKeeper "github.com/comdex-official/comdex/x/lend/keeper" + lendtypes "github.com/comdex-official/comdex/x/lend/types" + "github.com/comdex-official/comdex/x/liquidationsV2/types" + markettypes "github.com/comdex-official/comdex/x/market/types" + vaultKeeper1 "github.com/comdex-official/comdex/x/vault/keeper" + vaultTypes "github.com/comdex-official/comdex/x/vault/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (s *KeeperTestSuite) AddAppAssets() { + + assetOneID := s.CreateNewAsset("ASSETONE", "uasset1", 1000000) + assetTwoID := s.CreateNewAsset("ASSETTWO", "uasset2", 2000000) + assetThreeID := s.CreateNewAsset("ASSETTHREE", "uasset3", 1000000) + assetFourID := s.CreateNewAsset("ASSETFOUR", "uasset4", 2000000) + cAssetOneID := s.CreateNewAsset("CASSETONE", "ucasset1", 1000000) + cAssetTwoID := s.CreateNewAsset("CASSETTWO", "ucasset2", 2000000) + cAssetThreeID := s.CreateNewAsset("CASSETTHRE", "ucasset3", 2000000) + cAssetFourID := s.CreateNewAsset("CASSETFOUR", "ucasset4", 2000000) + + var ( + assetDataPoolOne []*lendtypes.AssetDataPoolMapping + assetDataPoolTwo []*lendtypes.AssetDataPoolMapping + ) + assetDataPoolOneAssetOne := &lendtypes.AssetDataPoolMapping{ + AssetID: assetOneID, + AssetTransitType: 3, + SupplyCap: sdk.NewDec(5000000000000000000), + } + assetDataPoolOneAssetTwo := &lendtypes.AssetDataPoolMapping{ + AssetID: assetTwoID, + AssetTransitType: 1, + SupplyCap: sdk.NewDec(1000000000000000000), + } + assetDataPoolOneAssetThree := &lendtypes.AssetDataPoolMapping{ + AssetID: assetThreeID, + AssetTransitType: 2, + SupplyCap: sdk.NewDec(5000000000000000000), + } + assetDataPoolTwoAssetFour := &lendtypes.AssetDataPoolMapping{ + AssetID: assetFourID, + AssetTransitType: 1, + SupplyCap: sdk.NewDec(3000000000000000000), + } + + assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) + assetDataPoolTwo = append(assetDataPoolTwo, assetDataPoolTwoAssetFour, assetDataPoolOneAssetOne, assetDataPoolOneAssetThree) + + s.AddAssetRatesStats(assetThreeID, newDec("0.8"), newDec("0.002"), newDec("0.06"), newDec("0.6"), true, newDec("0.04"), newDec("0.04"), newDec("0.06"), newDec("0.8"), newDec("0.85"), newDec("0.025"), newDec("0.025"), newDec("0.1"), cAssetThreeID) + s.AddAssetRatesStats(assetOneID, newDec("0.75"), newDec("0.002"), newDec("0.07"), newDec("1.25"), false, newDec("0.0"), newDec("0.0"), newDec("0.0"), newDec("0.7"), newDec("0.75"), newDec("0.05"), newDec("0.05"), newDec("0.2"), cAssetOneID) + s.AddAssetRatesPoolPairs(assetTwoID, newDec("0.5"), newDec("0.002"), newDec("0.08"), newDec("2.0"), false, newDec("0.0"), newDec("0.0"), newDec("0.0"), newDec("0.5"), newDec("0.55"), newDec("0.05"), newDec("0.05"), newDec("0.2"), cAssetTwoID, "cmdx", "CMDX-ATOM-CMST", assetDataPoolOne, 1000000, false) + s.AddAssetRatesPoolPairs(assetFourID, newDec("0.65"), newDec("0.002"), newDec("0.08"), newDec("1.5"), false, newDec("0.0"), newDec("0.0"), newDec("0.0"), newDec("0.6"), newDec("0.65"), newDec("0.05"), newDec("0.05"), newDec("0.2"), cAssetFourID, "osmo", "OSMO-ATOM-CMST", assetDataPoolTwo, 1000000, false) + + _ = s.CreateNewApp("cswap", "cswap") + _ = s.CreateNewApp("harbor", "hbr") + appThreeID := s.CreateNewApp("commodo", "cmdo") + s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), sdk.NewCoins(sdk.NewCoin("uasset1", newInt(1000000000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), sdk.NewCoins(sdk.NewCoin("uasset2", newInt(1000000000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), sdk.NewCoins(sdk.NewCoin("uasset3", newInt(1000000000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), sdk.NewCoins(sdk.NewCoin("uasset4", newInt(1000000000000000)))) + + s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7"), sdk.NewCoins(sdk.NewCoin("uasset1", newInt(1000000000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7"), sdk.NewCoins(sdk.NewCoin("uasset2", newInt(1000000000000000)))) + + msg := lendtypes.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", newInt(300)), 1, appThreeID) + msgLend2 := lendtypes.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetTwoID, sdk.NewCoin("uasset2", newInt(10000000000)), 1, appThreeID) + + msg3 := lendtypes.NewMsgFundModuleAccounts(1, assetOneID, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", sdk.NewCoin("uasset1", newInt(10000000000))) + msg4 := lendtypes.NewMsgFundModuleAccounts(1, assetTwoID, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", sdk.NewCoin("uasset2", newInt(10000000000))) + msg5 := lendtypes.NewMsgFundModuleAccounts(1, assetThreeID, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", sdk.NewCoin("uasset3", newInt(120000000))) + msg7 := lendtypes.NewMsgFundModuleAccounts(2, assetOneID, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", sdk.NewCoin("uasset1", newInt(10000000000))) + msg8 := lendtypes.NewMsgFundModuleAccounts(2, assetFourID, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", sdk.NewCoin("uasset4", newInt(10000000000))) + + lendkeeper := &s.lendKeeper + server := lendKeeper.NewMsgServerImpl(*lendkeeper) + + _, _ = server.Lend(sdk.WrapSDKContext(s.ctx), msg) + _, _ = server.Lend(sdk.WrapSDKContext(s.ctx), msgLend2) + _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg3) + _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg4) + _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg5) + _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg7) + _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg8) + + msg2 := lendtypes.NewMsgBorrow("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 1, false, sdk.NewCoin("ucasset1", newInt(100)), sdk.NewCoin("uasset2", newInt(10))) + _, _ = server.Borrow(sdk.WrapSDKContext(s.ctx), msg2) + + pair := assetTypes.Pair{AssetIn: 2, AssetOut: 3} + extendedPairVault := bindings.MsgAddExtendedPairsVault{ + AppID: 2, + PairID: 1, + StabilityFee: sdk.MustNewDecFromStr("0.01"), + ClosingFee: sdk.MustNewDecFromStr("0"), + LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), + DrawDownFee: sdk.MustNewDecFromStr("0.01"), + IsVaultActive: true, + DebtCeiling: sdk.NewInt(1000000000000), + DebtFloor: sdk.NewInt(1000000), + IsStableMintVault: false, + MinCr: sdk.MustNewDecFromStr("1.5"), + PairName: "CMDX-B", + AssetOutOraclePrice: true, + AssetOutPrice: 1000000, + MinUsdValueLeft: 1000000, + } + + assetkeeper, ctx := &s.assetKeeper, &s.ctx + err := assetkeeper.AddPairsRecords(*ctx, pair) + s.Require().NoError(err) + + err = assetkeeper.WasmAddExtendedPairsVaultRecords(*ctx, &extendedPairVault) + s.Require().NoError(err) + + // set liquidation whitelisting + dutchAuctionParams := types.DutchAuctionParam{ + Premium: newDec("0.1"), + Discount: newDec("0.1"), + DecrementFactor: sdk.NewInt(1), + } + englishAuctionParams := types.EnglishAuctionParam{DecrementFactor: sdk.NewInt(1)} + + liqWhitelistingHbr := types.LiquidationWhiteListing{ + AppId: 2, + Initiator: true, + IsDutchActivated: true, + DutchAuctionParam: &dutchAuctionParams, + IsEnglishActivated: true, + EnglishAuctionParam: &englishAuctionParams, + KeeeperIncentive: newDec("0.1"), + } + s.liquidationKeeper.SetLiquidationWhiteListing(s.ctx, liqWhitelistingHbr) + + liqWhitelistingCmdo := types.LiquidationWhiteListing{ + AppId: 3, + Initiator: true, + IsDutchActivated: true, + DutchAuctionParam: &dutchAuctionParams, + IsEnglishActivated: false, + EnglishAuctionParam: nil, + KeeeperIncentive: newDec("0.1"), + } + s.liquidationKeeper.SetLiquidationWhiteListing(s.ctx, liqWhitelistingCmdo) + +} + +func (s *KeeperTestSuite) CreateVault() { + userAddress1 := "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t" + userAddress2 := "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7" + vaultKeeper, ctx := &s.vaultKeeper, &s.ctx + s.AddAppAssets() + server := vaultKeeper1.NewMsgServer(*vaultKeeper) + + for index, tc := range []struct { + name string + msg vaultTypes.MsgCreateRequest + }{ + { + "Create Vault : AppID 1 extended pair 1 user address 1", + vaultTypes.MsgCreateRequest{ + From: userAddress1, + AppId: 2, + ExtendedPairVaultId: 1, + AmountIn: sdk.NewIntFromUint64(1000000), + AmountOut: sdk.NewIntFromUint64(1000000), + }, + }, + { + "Create Vault : AppID 1 extended pair 1 user address 2", + vaultTypes.MsgCreateRequest{ + From: userAddress2, + AppId: 2, + ExtendedPairVaultId: 1, + AmountIn: sdk.NewIntFromUint64(1000000), + AmountOut: sdk.NewIntFromUint64(1000000), + }, + }, + } { + s.Run(tc.name, func() { + _, err := server.MsgCreate(sdk.WrapSDKContext(*ctx), &tc.msg) + s.Require().NoError(err) + res, err := s.vaultQuerier.QueryAllVaults(sdk.WrapSDKContext(*ctx), &vaultTypes.QueryAllVaultsRequest{}) + s.Require().NoError(err) + _, err = s.vaultQuerier.QueryVaultInfoByVaultID(sdk.WrapSDKContext(*ctx), &vaultTypes.QueryVaultInfoByVaultIDRequest{Id: res.Vault[index].Id}) + s.Require().NoError(err) + }) + } +} + +func (s *KeeperTestSuite) GetVaultCount() int { + ctx := &s.ctx + res, err := s.vaultQuerier.QueryAllVaults(sdk.WrapSDKContext(*ctx), &vaultTypes.QueryAllVaultsRequest{}) + s.Require().NoError(err) + return len(res.Vault) +} + +func (s *KeeperTestSuite) GetVaultCountForExtendedPairIDbyAppID(appID, extID uint64) int { + vaultKeeper, ctx := &s.vaultKeeper, &s.ctx + res, found := vaultKeeper.GetAppExtendedPairVaultMappingData(*ctx, appID, extID) + s.Require().True(found) + return len(res.VaultIds) +} + +func (s *KeeperTestSuite) ChangeOraclePrice(asset uint64) { + s.SetOraclePrice(asset, 1000000) +} + +func (s *KeeperTestSuite) SetOraclePrice(assetID uint64, price uint64) { + market := markettypes.TimeWeightedAverage{ + AssetID: assetID, + ScriptID: 12, + Twa: price, + CurrentIndex: 0, + IsPriceActive: true, + PriceValue: []uint64{price}, + } + s.app.MarketKeeper.SetTwa(s.ctx, market) +} + +func (s *KeeperTestSuite) TestLiquidateVaults() { + liquidationKeeper, ctx := &s.liquidationKeeper, &s.ctx + s.CreateVault() + currentVaultsCount := 2 + s.Require().Equal(s.GetVaultCount(), currentVaultsCount) + s.Require().Equal(s.GetVaultCountForExtendedPairIDbyAppID(2, 1), currentVaultsCount) + beforeVault, found := s.vaultKeeper.GetVault(*ctx, 1) + s.Require().True(found) + + // Liquidation shouldn't happen as price not changed + err := liquidationKeeper.Liquidate(*ctx) + s.Require().NoError(err) + id := liquidationKeeper.GetLockedVaultID(*ctx) + s.Require().Equal(id, uint64(0)) + + // Liquidation should happen as price changed + s.ChangeOraclePrice(2) + err = liquidationKeeper.Liquidate(*ctx) + s.Require().NoError(err) + id = liquidationKeeper.GetLockedVaultID(*ctx) + s.Require().Equal(id, uint64(2)) + s.Require().Equal(s.GetVaultCount(), currentVaultsCount-2) + s.Require().Equal(s.GetVaultCountForExtendedPairIDbyAppID(uint64(1), 1), currentVaultsCount-2) + + lockedVault := liquidationKeeper.GetLockedVaults(*ctx) + s.Require().Equal(lockedVault[0].OriginalVaultId, beforeVault.Id) + s.Require().Equal(lockedVault[0].ExtendedPairId, beforeVault.ExtendedPairVaultID) + s.Require().Equal(lockedVault[0].Owner, beforeVault.Owner) + //s.Require().Equal(lockedVault[0].AmountIn, beforeVault.AmountIn) + //s.Require().Equal(lockedVault[0].AmountOut, beforeVault.AmountOut) + //s.Require().Equal(lockedVault[0].UpdatedAmountOut, sdk.ZeroInt()) + //s.Require().Equal(lockedVault[0].Initiator, liquidationTypes.ModuleName) + //s.Require().Equal(lockedVault[0].IsAuctionInProgress, true) + //s.Require().Equal(lockedVault[0].IsAuctionComplete, false) + //s.Require().Equal(lockedVault[0].SellOffHistory, []string(nil)) + price, err := s.app.MarketKeeper.CalcAssetPrice(*ctx, uint64(1), beforeVault.AmountIn) + s.Require().NoError(err) + s.Require().Equal(lockedVault[0].CollateralToBeAuctioned, price) + //s.Require().Equal(lockedVault[0].CrAtLiquidation, lockedVault[0].AmountIn.ToDec().Mul(s.GetAssetPrice(1)).Quo(lockedVault[0].AmountOut.ToDec().Mul(s.GetAssetPrice(2)))) +} From 3cd688623127417e47417be13a6e73a04f47d4ed Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 20 Jun 2023 11:52:07 +0530 Subject: [PATCH 099/155] updating liquidate borrow testcase --- app/app.go | 19 ++++ x/auctionsV2/keeper/auctions.go | 2 - x/lend/keeper/keeper.go | 7 +- x/liquidationsV2/keeper/liquidate.go | 21 ++-- x/liquidationsV2/keeper/msg_server_test.go | 120 ++++++++++++++++++--- 5 files changed, 141 insertions(+), 28 deletions(-) diff --git a/app/app.go b/app/app.go index 9e1765ee1..60e4a9f1b 100644 --- a/app/app.go +++ b/app/app.go @@ -771,6 +771,7 @@ func New( &app.EsmKeeper, &app.LendKeeper, ) + app.NewliqKeeper = newliqkeeper.NewKeeper( app.cdc, app.keys[newliqtypes.StoreKey], @@ -802,6 +803,24 @@ func New( app.CollectorKeeper, app.TokenmintKeeper, ) + + app.NewliqKeeper = newliqkeeper.NewKeeper( + app.cdc, + app.keys[newliqtypes.StoreKey], + app.keys[newliqtypes.MemStoreKey], + app.GetSubspace(newliqtypes.ModuleName), + app.AccountKeeper, + app.BankKeeper, + app.AssetKeeper, + app.VaultKeeper, + app.MarketKeeper, + app.EsmKeeper, + app.Rewardskeeper, + app.LendKeeper, + app.NewaucKeeper, + app.CollectorKeeper, + ) + wasmDir := filepath.Join(homePath, "wasm") wasmConfig, err := wasm.ReadWasmConfig(appOptions) if err != nil { diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index b4e23d365..34b105e18 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,7 +1,6 @@ package keeper import ( - "fmt" "time" auctiontypes "github.com/comdex-official/comdex/x/auction/types" @@ -39,7 +38,6 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati //Getting previous auction ID auctionID := k.GetAuctionID(ctx) - fmt.Println("auctionID", auctionID) //Price Calculation Function to determine auction different stage price liquidationWhitelistingAppData, found := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, liquidationData.AppId) if !found { diff --git a/x/lend/keeper/keeper.go b/x/lend/keeper/keeper.go index 0b3b2ded3..ad4821687 100644 --- a/x/lend/keeper/keeper.go +++ b/x/lend/keeper/keeper.go @@ -1714,7 +1714,12 @@ func (k Keeper) IterateBorrowForLiq(ctx sdk.Context, borrow types.BorrowAsset) ( if err != nil { return borrow, err } - currBorrowAPR, _ := k.GetBorrowAPRByAssetID(ctx, pair.AssetOutPoolID, pair.AssetOut, borrow.IsStableBorrow) + + currBorrowAPR, err := k.GetBorrowAPRByAssetID(ctx, pair.AssetOutPoolID, pair.AssetOut, borrow.IsStableBorrow) + if err != nil { + return borrow, err + } + interestPerInteraction, indexGlobalCurrent, _, reserveGlobalIndex, err := k.CalculateBorrowInterest(ctx, borrow.AmountOut.Amount.String(), currBorrowAPR, reserveRates, borrow) if err != nil { return borrow, err diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index e947dbdfa..91f7ebf6e 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -3,7 +3,6 @@ package keeper import ( "fmt" assettypes "github.com/comdex-official/comdex/x/asset/types" - lendtypes "github.com/comdex-official/comdex/x/lend/types" utils "github.com/comdex-official/comdex/types" @@ -167,6 +166,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64, liquid return nil } + func (k Keeper) ReturnCoin(ctx sdk.Context, assetID uint64, amount sdk.Int) sdk.Coin { asset, _ := k.asset.GetAsset(ctx, assetID) return sdk.NewCoin(asset.Denom, amount) @@ -276,7 +276,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro // calculating and updating the interest accumulated before checking for liquidations borrowPos, err := k.lend.CalculateBorrowInterestForLiquidation(ctx, borrowPos.ID) if err != nil { - return fmt.Errorf("error in calculating Borrow Interest before liquidation") + return fmt.Errorf("error in calculating Borrow Interest before liquidation %d", err) } if !borrowPos.StableBorrowRate.Equal(sdk.ZeroDec()) { borrowPos, err = k.lend.ReBalanceStableRates(ctx, borrowPos) @@ -311,7 +311,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro return err } if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold) { - err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold) + err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold, lendPair, pool, assetIn) if err != nil { return fmt.Errorf("error in first condition UpdateLockedBorrows in UpdateLockedBorrows , liquidate_borrow.go for ID ") } @@ -323,7 +323,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro return err } if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetOne.LiquidationThreshold)) { - err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold) + err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold, lendPair, pool, assetIn) if err != nil { return fmt.Errorf("error in second condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") } @@ -335,18 +335,17 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro } if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetTwo.LiquidationThreshold)) { - err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold) + err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold, lendPair, pool, assetIn) if err != nil { return fmt.Errorf("error in third condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") } } } } - k.lend.UpdateBorrowStats(ctx, lendPair, borrowPos.IsStableBorrow, borrowPos.AmountOut.Amount, false) return nil } -func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsset, owner string, appID uint64, currentCollateralizationRatio sdk.Dec, assetRatesStats lendtypes.AssetRatesParams) error { +func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsset, owner string, appID uint64, currentCollateralizationRatio sdk.Dec, assetRatesStats lendtypes.AssetRatesParams, lendPair lendtypes.Extended_Pair, pool lendtypes.Pool, assetIn assettypes.Asset) error { whitelistingData, found := k.GetLiquidationWhiteListing(ctx, appID) if !found { return fmt.Errorf("Liquidation not enabled for App ID %d", appID) @@ -360,11 +359,17 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsse //Calculating auction bonus to be given auctionBonusToBeGiven := sdk.NewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationBonus).TruncateInt() - err := k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false, pair.AssetIn, pair.AssetOut) + err := k.bank.SendCoinsFromModuleToModule(ctx, pool.ModuleName, auctionsV2types.ModuleName, sdk.NewCoins(sdk.NewCoin(assetIn.Denom, borrow.AmountIn.Amount))) + if err != nil { + return err + } + + err = k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false, pair.AssetIn, pair.AssetOut) if err != nil { return err } + k.lend.UpdateBorrowStats(ctx, lendPair, borrow.IsStableBorrow, borrow.AmountOut.Amount, false) return nil } diff --git a/x/liquidationsV2/keeper/msg_server_test.go b/x/liquidationsV2/keeper/msg_server_test.go index 39157c207..16da772d9 100644 --- a/x/liquidationsV2/keeper/msg_server_test.go +++ b/x/liquidationsV2/keeper/msg_server_test.go @@ -14,7 +14,7 @@ import ( func (s *KeeperTestSuite) AddAppAssets() { - assetOneID := s.CreateNewAsset("ASSETONE", "uasset1", 1000000) + assetOneID := s.CreateNewAsset("ASSETONE", "uasset1", 2000000) assetTwoID := s.CreateNewAsset("ASSETTWO", "uasset2", 2000000) assetThreeID := s.CreateNewAsset("ASSETTHREE", "uasset3", 1000000) assetFourID := s.CreateNewAsset("ASSETFOUR", "uasset4", 2000000) @@ -67,8 +67,9 @@ func (s *KeeperTestSuite) AddAppAssets() { s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7"), sdk.NewCoins(sdk.NewCoin("uasset1", newInt(1000000000000000)))) s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7"), sdk.NewCoins(sdk.NewCoin("uasset2", newInt(1000000000000000)))) - msg := lendtypes.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", newInt(300)), 1, appThreeID) + msgLend1 := lendtypes.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", newInt(3000000000)), 1, appThreeID) msgLend2 := lendtypes.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetTwoID, sdk.NewCoin("uasset2", newInt(10000000000)), 1, appThreeID) + msgLend3 := lendtypes.NewMsgLend("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", assetOneID, sdk.NewCoin("uasset1", newInt(10000000000)), 1, appThreeID) msg3 := lendtypes.NewMsgFundModuleAccounts(1, assetOneID, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", sdk.NewCoin("uasset1", newInt(10000000000))) msg4 := lendtypes.NewMsgFundModuleAccounts(1, assetTwoID, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", sdk.NewCoin("uasset2", newInt(10000000000))) @@ -79,16 +80,22 @@ func (s *KeeperTestSuite) AddAppAssets() { lendkeeper := &s.lendKeeper server := lendKeeper.NewMsgServerImpl(*lendkeeper) - _, _ = server.Lend(sdk.WrapSDKContext(s.ctx), msg) + _, _ = server.Lend(sdk.WrapSDKContext(s.ctx), msgLend1) _, _ = server.Lend(sdk.WrapSDKContext(s.ctx), msgLend2) + _, _ = server.Lend(sdk.WrapSDKContext(s.ctx), msgLend3) _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg3) _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg4) _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg5) _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg7) _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg8) - msg2 := lendtypes.NewMsgBorrow("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 1, false, sdk.NewCoin("ucasset1", newInt(100)), sdk.NewCoin("uasset2", newInt(10))) - _, _ = server.Borrow(sdk.WrapSDKContext(s.ctx), msg2) + msg2 := lendtypes.NewMsgBorrow("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 1, false, sdk.NewCoin("ucasset1", newInt(100000000)), sdk.NewCoin("uasset2", newInt(70000000))) + _, err := server.Borrow(sdk.WrapSDKContext(s.ctx), msg2) + s.Require().NoError(err) + + msg22 := lendtypes.NewMsgBorrow("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 3, 1, false, sdk.NewCoin("ucasset1", newInt(1000000000)), sdk.NewCoin("uasset2", newInt(700000000))) + _, err = server.Borrow(sdk.WrapSDKContext(s.ctx), msg22) + s.Require().NoError(err) pair := assetTypes.Pair{AssetIn: 2, AssetOut: 3} extendedPairVault := bindings.MsgAddExtendedPairsVault{ @@ -110,7 +117,7 @@ func (s *KeeperTestSuite) AddAppAssets() { } assetkeeper, ctx := &s.assetKeeper, &s.ctx - err := assetkeeper.AddPairsRecords(*ctx, pair) + err = assetkeeper.AddPairsRecords(*ctx, pair) s.Require().NoError(err) err = assetkeeper.WasmAddExtendedPairsVaultRecords(*ctx, &extendedPairVault) @@ -198,6 +205,13 @@ func (s *KeeperTestSuite) GetVaultCount() int { return len(res.Vault) } +func (s *KeeperTestSuite) GetBorrowsCount() int { + ctx := &s.ctx + res, err := s.lendQuerier.QueryBorrows(sdk.WrapSDKContext(*ctx), &lendtypes.QueryBorrowsRequest{}) + s.Require().NoError(err) + return len(res.Borrows) +} + func (s *KeeperTestSuite) GetVaultCountForExtendedPairIDbyAppID(appID, extID uint64) int { vaultKeeper, ctx := &s.vaultKeeper, &s.ctx res, found := vaultKeeper.GetAppExtendedPairVaultMappingData(*ctx, appID, extID) @@ -243,21 +257,93 @@ func (s *KeeperTestSuite) TestLiquidateVaults() { id = liquidationKeeper.GetLockedVaultID(*ctx) s.Require().Equal(id, uint64(2)) s.Require().Equal(s.GetVaultCount(), currentVaultsCount-2) - s.Require().Equal(s.GetVaultCountForExtendedPairIDbyAppID(uint64(1), 1), currentVaultsCount-2) + s.Require().Equal(s.GetVaultCountForExtendedPairIDbyAppID(2, 1), currentVaultsCount-2) lockedVault := liquidationKeeper.GetLockedVaults(*ctx) s.Require().Equal(lockedVault[0].OriginalVaultId, beforeVault.Id) s.Require().Equal(lockedVault[0].ExtendedPairId, beforeVault.ExtendedPairVaultID) s.Require().Equal(lockedVault[0].Owner, beforeVault.Owner) - //s.Require().Equal(lockedVault[0].AmountIn, beforeVault.AmountIn) - //s.Require().Equal(lockedVault[0].AmountOut, beforeVault.AmountOut) - //s.Require().Equal(lockedVault[0].UpdatedAmountOut, sdk.ZeroInt()) - //s.Require().Equal(lockedVault[0].Initiator, liquidationTypes.ModuleName) - //s.Require().Equal(lockedVault[0].IsAuctionInProgress, true) - //s.Require().Equal(lockedVault[0].IsAuctionComplete, false) - //s.Require().Equal(lockedVault[0].SellOffHistory, []string(nil)) - price, err := s.app.MarketKeeper.CalcAssetPrice(*ctx, uint64(1), beforeVault.AmountIn) + s.Require().Equal(lockedVault[0].CollateralToken.Amount, beforeVault.AmountIn) + s.Require().Equal(lockedVault[0].DebtToken.Amount, beforeVault.AmountOut) + s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(beforeVault.AmountOut.ToDec().Mul(newDec("0.12")).TruncateInt())) + s.Require().Equal(lockedVault[0].FeeToBeCollected, beforeVault.AmountOut.ToDec().Mul(newDec("0.12")).TruncateInt()) + s.Require().Equal(lockedVault[0].IsDebtCmst, false) + s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(2)) + s.Require().Equal(lockedVault[0].DebtAssetId, uint64(3)) + price, err := s.app.MarketKeeper.CalcAssetPrice(*ctx, 2, beforeVault.AmountIn) + s.Require().NoError(err) + s.Require().Equal(lockedVault[0].CollateralToBeAuctioned.Amount, price.TruncateInt()) +} + +func (s *KeeperTestSuite) TestLiquidateBorrows() { + liquidationKeeper, ctx := &s.liquidationKeeper, &s.ctx + s.AddAppAssets() + currentBorrowsCount := 2 + s.Require().Equal(s.GetBorrowsCount(), currentBorrowsCount) + + beforeBorrow, found := s.lendKeeper.GetBorrow(*ctx, 1) + s.Require().True(found) + + beforeLend, found := s.lendKeeper.GetLend(*ctx, beforeBorrow.LendingID) + s.Require().True(found) + + // Liquidation shouldn't happen as price not changed + err := liquidationKeeper.Liquidate(*ctx) s.Require().NoError(err) - s.Require().Equal(lockedVault[0].CollateralToBeAuctioned, price) - //s.Require().Equal(lockedVault[0].CrAtLiquidation, lockedVault[0].AmountIn.ToDec().Mul(s.GetAssetPrice(1)).Quo(lockedVault[0].AmountOut.ToDec().Mul(s.GetAssetPrice(2)))) + id := liquidationKeeper.GetLockedVaultID(*ctx) + s.Require().Equal(id, uint64(0)) + + assetStatsLend, _ := s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 1) + s.Require().Equal(len(assetStatsLend.LendIds), 2) + s.Require().Equal(len(assetStatsLend.BorrowIds), 0) + s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) + s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(13000000000)) + + assetStatsBorrow, _ := s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 2) + s.Require().Equal(len(assetStatsBorrow.LendIds), 1) + s.Require().Equal(len(assetStatsBorrow.BorrowIds), 2) + s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdk.NewInt(770000000)) + s.Require().Equal(assetStatsBorrow.TotalLend, sdk.NewInt(10000000000)) + + modBalInitial, _ := s.lendKeeper.GetModuleBalanceByPoolID(*ctx, 1) + + // Liquidation should happen as price changed + s.ChangeOraclePrice(1) + err = liquidationKeeper.Liquidate(*ctx) + s.Require().NoError(err) + id = liquidationKeeper.GetLockedVaultID(*ctx) + s.Require().Equal(id, uint64(2)) + s.Require().Equal(s.GetBorrowsCount(), currentBorrowsCount) + + lockedVault := liquidationKeeper.GetLockedVaults(*ctx) + s.Require().Equal(lockedVault[0].OriginalVaultId, beforeBorrow.ID) + s.Require().Equal(lockedVault[0].ExtendedPairId, beforeBorrow.PairID) + s.Require().Equal(lockedVault[0].Owner, beforeLend.Owner) + s.Require().Equal(lockedVault[0].CollateralToken.Amount, beforeBorrow.AmountIn.Amount) + s.Require().Equal(lockedVault[0].DebtToken.Amount, beforeBorrow.AmountOut.Amount) + s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(beforeBorrow.AmountOut.Amount.ToDec().Mul(newDec("0.05")).TruncateInt())) + s.Require().Equal(lockedVault[0].FeeToBeCollected, beforeBorrow.AmountOut.Amount.ToDec().Mul(newDec("0.05")).TruncateInt()) + s.Require().Equal(lockedVault[0].IsDebtCmst, false) + s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(1)) + s.Require().Equal(lockedVault[0].DebtAssetId, uint64(2)) + + // get data of total borrow and lend and tally + assetStatsLend, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 1) + s.Require().Equal(len(assetStatsLend.LendIds), 2) + s.Require().Equal(len(assetStatsLend.BorrowIds), 0) + s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) + s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(13000000000)) + + assetStatsBorrow, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 2) + s.Require().Equal(len(assetStatsBorrow.LendIds), 1) + s.Require().Equal(len(assetStatsBorrow.BorrowIds), 2) + s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdk.NewInt(0)) + s.Require().Equal(assetStatsBorrow.TotalLend, sdk.NewInt(10000000000)) + + afterBorrow, found := s.lendKeeper.GetBorrow(*ctx, 1) + s.Require().True(found) + s.Require().Equal(afterBorrow.IsLiquidated, true) + + modBalFinal, _ := s.lendKeeper.GetModuleBalanceByPoolID(*ctx, 1) + s.Require().Equal(modBalInitial.ModuleBalanceStats[0].Balance.Amount.Sub(modBalFinal.ModuleBalanceStats[0].Balance.Amount), sdk.NewInt(1100000000)) } From 42ccd042ba492decaa3549ec650a337067fe56b4 Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 20 Jun 2023 13:22:18 +0530 Subject: [PATCH 100/155] updating LiquidateInternalKeeper for vaults and borrows --- x/liquidationsV2/keeper/liquidate.go | 22 +-- x/liquidationsV2/keeper/msg_server_test.go | 204 +++++++++++++++++++++ 2 files changed, 215 insertions(+), 11 deletions(-) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 91f7ebf6e..0178e3beb 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -89,7 +89,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64, liquid esmStatus, found := k.esm.GetESMStatus(ctx, vault.AppId) klwsParams, _ := k.esm.GetKillSwitchData(ctx, vault.AppId) if (found && esmStatus.Status) || klwsParams.BreakerEnable { - return fmt.Errorf("Kill Switch Or ESM is enabled For Liquidation,") + return fmt.Errorf("kill Switch Or ESM is enabled For Liquidation") } //Checking if app has enabled liquidations or not @@ -224,7 +224,7 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context, offsetCounterId uint64) error borrows, found := k.lend.GetBorrows(ctx) params := k.GetParams(ctx) if !found { - ctx.Logger().Error("Params Not Found in Liquidation, liquidate_borrow.go") + ctx.Logger().Error("Params Not Found in Liquidation") return nil } liquidationOffsetHolder, found := k.GetLiquidationOffsetHolder(ctx, types.VaultLiquidationsOffsetPrefix, offsetCounterId) @@ -240,7 +240,7 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context, offsetCounterId uint64) error } newBorrowIDs := borrowIDs[start:end] for l := range newBorrowIDs { - err := k.LiquidateIndividualBorrow(ctx, newBorrowIDs[l]) + err := k.LiquidateIndividualBorrow(ctx, newBorrowIDs[l], "", false) if err != nil { return err } @@ -251,10 +251,10 @@ func (k Keeper) LiquidateBorrows(ctx sdk.Context, offsetCounterId uint64) error return nil } -func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) error { +func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64, liquidator string, isInternalkeeper bool) error { borrowPos, found := k.lend.GetBorrow(ctx, borrowID) if !found { - return nil + return fmt.Errorf("vault ID not found %d", borrowID) } if borrowPos.IsLiquidated { return nil @@ -311,7 +311,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro return err } if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold) { - err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold, lendPair, pool, assetIn) + err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold, lendPair, pool, assetIn, liquidator, isInternalkeeper) if err != nil { return fmt.Errorf("error in first condition UpdateLockedBorrows in UpdateLockedBorrows , liquidate_borrow.go for ID ") } @@ -323,7 +323,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro return err } if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetOne.LiquidationThreshold)) { - err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold, lendPair, pool, assetIn) + err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold, lendPair, pool, assetIn, liquidator, isInternalkeeper) if err != nil { return fmt.Errorf("error in second condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") } @@ -335,7 +335,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro } if sdk.Dec.GT(currentCollateralizationRatio, liqThreshold.LiquidationThreshold.Mul(liqThresholdBridgedAssetTwo.LiquidationThreshold)) { - err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold, lendPair, pool, assetIn) + err = k.UpdateLockedBorrows(ctx, borrowPos, lendPos.Owner, lendPos.AppID, currentCollateralizationRatio, liqThreshold, lendPair, pool, assetIn, liquidator, isInternalkeeper) if err != nil { return fmt.Errorf("error in third condition UpdateLockedBorrows in UpdateLockedBorrows, liquidate_borrow.go for ID ") } @@ -345,7 +345,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64) erro return nil } -func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsset, owner string, appID uint64, currentCollateralizationRatio sdk.Dec, assetRatesStats lendtypes.AssetRatesParams, lendPair lendtypes.Extended_Pair, pool lendtypes.Pool, assetIn assettypes.Asset) error { +func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsset, owner string, appID uint64, currentCollateralizationRatio sdk.Dec, assetRatesStats lendtypes.AssetRatesParams, lendPair lendtypes.Extended_Pair, pool lendtypes.Pool, assetIn assettypes.Asset, liquidator string, isInternalkeeper bool) error { whitelistingData, found := k.GetLiquidationWhiteListing(ctx, appID) if !found { return fmt.Errorf("Liquidation not enabled for App ID %d", appID) @@ -364,7 +364,7 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsse return err } - err = k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, false, "", "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false, pair.AssetIn, pair.AssetOut) + err = k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, isInternalkeeper, liquidator, "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false, pair.AssetIn, pair.AssetOut) if err != nil { return err } @@ -380,7 +380,7 @@ func (k Keeper) MsgLiquidate(ctx sdk.Context, liquidator string, liqType, id uin return err } } else if liqType == 1 { - err := k.LiquidateIndividualBorrow(ctx, id) + err := k.LiquidateIndividualBorrow(ctx, id, liquidator, true) if err != nil { return err } diff --git a/x/liquidationsV2/keeper/msg_server_test.go b/x/liquidationsV2/keeper/msg_server_test.go index 16da772d9..236c5e0b6 100644 --- a/x/liquidationsV2/keeper/msg_server_test.go +++ b/x/liquidationsV2/keeper/msg_server_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "fmt" "github.com/comdex-official/comdex/app/wasm/bindings" assetTypes "github.com/comdex-official/comdex/x/asset/types" lendKeeper "github.com/comdex-official/comdex/x/lend/keeper" @@ -347,3 +348,206 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { modBalFinal, _ := s.lendKeeper.GetModuleBalanceByPoolID(*ctx, 1) s.Require().Equal(modBalInitial.ModuleBalanceStats[0].Balance.Amount.Sub(modBalFinal.ModuleBalanceStats[0].Balance.Amount), sdk.NewInt(1100000000)) } + +func (s *KeeperTestSuite) TestLiquidateInternalKeeperForVault() { + addr, _ := sdk.AccAddressFromBech32("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7") + liquidationKeeper, ctx := &s.liquidationKeeper, &s.ctx + s.CreateVault() + currentVaultsCount := 2 + s.Require().Equal(s.GetVaultCount(), currentVaultsCount) + s.Require().Equal(s.GetVaultCountForExtendedPairIDbyAppID(2, 1), currentVaultsCount) + beforeVault, found := s.vaultKeeper.GetVault(*ctx, 1) + s.Require().True(found) + + // Liquidation shouldn't happen as price not changed + err := liquidationKeeper.Liquidate(*ctx) + s.Require().NoError(err) + id := liquidationKeeper.GetLockedVaultID(*ctx) + s.Require().Equal(id, uint64(0)) + + // Liquidation should happen as price changed + s.ChangeOraclePrice(2) + + testCases := []struct { + Name string + Msg types.MsgLiquidateInternalKeeperRequest + ExpErr error + ExpResp *types.MsgLiquidateInternalKeeperResponse + }{ + { + Name: "asset does not exist", + Msg: *types.NewMsgLiquidateInternalKeeperRequest(addr, 0, 10), + ExpErr: fmt.Errorf("Vault ID not found 0"), + ExpResp: nil, + }, + { + Name: "success valid case", + Msg: *types.NewMsgLiquidateInternalKeeperRequest(addr, 0, 1), + ExpErr: nil, + ExpResp: &types.MsgLiquidateInternalKeeperResponse{}, + }, + } + for _, tc := range testCases { + tc := tc + s.Run(tc.Name, func() { + // add funds to acount for valid case + //if tc.ExpErr == nil { + // + // + //} + + ctx := sdk.WrapSDKContext(s.ctx) + resp, err := s.msgServer.MsgLiquidateInternalKeeper(ctx, &tc.Msg) + if tc.ExpErr != nil { + s.Require().Error(err) + s.Require().EqualError(err, tc.ExpErr.Error()) + s.Require().Equal(tc.ExpResp, resp) + } else { + s.Require().NoError(err) + s.Require().NotNil(resp) + s.Require().Equal(tc.ExpResp, resp) + + s.Require().NoError(err) + id = liquidationKeeper.GetLockedVaultID(s.ctx) + s.Require().Equal(id, uint64(1)) + s.Require().Equal(s.GetVaultCount(), currentVaultsCount-1) + s.Require().Equal(s.GetVaultCountForExtendedPairIDbyAppID(2, 1), currentVaultsCount-1) + + lockedVault := liquidationKeeper.GetLockedVaults(s.ctx) + s.Require().Equal(lockedVault[0].OriginalVaultId, beforeVault.Id) + s.Require().Equal(lockedVault[0].ExtendedPairId, beforeVault.ExtendedPairVaultID) + s.Require().Equal(lockedVault[0].Owner, beforeVault.Owner) + s.Require().Equal(lockedVault[0].CollateralToken.Amount, beforeVault.AmountIn) + s.Require().Equal(lockedVault[0].DebtToken.Amount, beforeVault.AmountOut) + s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(beforeVault.AmountOut.ToDec().Mul(newDec("0.12")).TruncateInt())) + s.Require().Equal(lockedVault[0].FeeToBeCollected, beforeVault.AmountOut.ToDec().Mul(newDec("0.12")).TruncateInt()) + s.Require().Equal(lockedVault[0].IsDebtCmst, false) + s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(2)) + s.Require().Equal(lockedVault[0].DebtAssetId, uint64(3)) + price, err := s.app.MarketKeeper.CalcAssetPrice(s.ctx, 2, beforeVault.AmountIn) + s.Require().NoError(err) + s.Require().Equal(lockedVault[0].CollateralToBeAuctioned.Amount, price.TruncateInt()) + s.Require().Equal(lockedVault[0].IsInternalKeeper, true) + s.Require().Equal(lockedVault[0].InternalKeeperAddress, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7") + } + }) + } +} + +func (s *KeeperTestSuite) TestLiquidateInternalKeeperForBorrow() { + addr, _ := sdk.AccAddressFromBech32("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7") + liquidationKeeper, ctx := &s.liquidationKeeper, &s.ctx + s.AddAppAssets() + currentBorrowsCount := 2 + s.Require().Equal(s.GetBorrowsCount(), currentBorrowsCount) + + beforeBorrow, found := s.lendKeeper.GetBorrow(*ctx, 1) + s.Require().True(found) + + beforeLend, found := s.lendKeeper.GetLend(*ctx, beforeBorrow.LendingID) + s.Require().True(found) + + // Liquidation shouldn't happen as price not changed + err := liquidationKeeper.Liquidate(*ctx) + s.Require().NoError(err) + id := liquidationKeeper.GetLockedVaultID(*ctx) + s.Require().Equal(id, uint64(0)) + + assetStatsLend, _ := s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 1) + s.Require().Equal(len(assetStatsLend.LendIds), 2) + s.Require().Equal(len(assetStatsLend.BorrowIds), 0) + s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) + s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(13000000000)) + + assetStatsBorrow, _ := s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 2) + s.Require().Equal(len(assetStatsBorrow.LendIds), 1) + s.Require().Equal(len(assetStatsBorrow.BorrowIds), 2) + s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdk.NewInt(770000000)) + s.Require().Equal(assetStatsBorrow.TotalLend, sdk.NewInt(10000000000)) + + modBalInitial, _ := s.lendKeeper.GetModuleBalanceByPoolID(*ctx, 1) + s.ChangeOraclePrice(1) + + testCases := []struct { + Name string + Msg types.MsgLiquidateInternalKeeperRequest + ExpErr error + ExpResp *types.MsgLiquidateInternalKeeperResponse + }{ + { + Name: "asset does not exist", + Msg: *types.NewMsgLiquidateInternalKeeperRequest(addr, 1, 10), + ExpErr: fmt.Errorf("vault ID not found 10"), + ExpResp: nil, + }, + { + Name: "success valid case", + Msg: *types.NewMsgLiquidateInternalKeeperRequest(addr, 1, 1), + ExpErr: nil, + ExpResp: &types.MsgLiquidateInternalKeeperResponse{}, + }, + } + for _, tc := range testCases { + tc := tc + s.Run(tc.Name, func() { + // add funds to acount for valid case + //if tc.ExpErr == nil { + // + // + //} + + ctx := sdk.WrapSDKContext(s.ctx) + resp, err := s.msgServer.MsgLiquidateInternalKeeper(ctx, &tc.Msg) + if tc.ExpErr != nil { + s.Require().Error(err) + s.Require().EqualError(err, tc.ExpErr.Error()) + s.Require().Equal(tc.ExpResp, resp) + } else { + s.Require().NoError(err) + s.Require().NotNil(resp) + s.Require().Equal(tc.ExpResp, resp) + + s.Require().NoError(err) + id = liquidationKeeper.GetLockedVaultID(s.ctx) + fmt.Println("id", id) + s.Require().Equal(id, uint64(1)) + s.Require().Equal(s.GetBorrowsCount(), currentBorrowsCount) + + lockedVault := liquidationKeeper.GetLockedVaults(s.ctx) + s.Require().Equal(lockedVault[0].OriginalVaultId, beforeBorrow.ID) + s.Require().Equal(lockedVault[0].ExtendedPairId, beforeBorrow.PairID) + s.Require().Equal(lockedVault[0].Owner, beforeLend.Owner) + s.Require().Equal(lockedVault[0].CollateralToken.Amount, beforeBorrow.AmountIn.Amount) + s.Require().Equal(lockedVault[0].DebtToken.Amount, beforeBorrow.AmountOut.Amount) + s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(beforeBorrow.AmountOut.Amount.ToDec().Mul(newDec("0.05")).TruncateInt())) + s.Require().Equal(lockedVault[0].FeeToBeCollected, beforeBorrow.AmountOut.Amount.ToDec().Mul(newDec("0.05")).TruncateInt()) + s.Require().Equal(lockedVault[0].IsDebtCmst, false) + s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(1)) + s.Require().Equal(lockedVault[0].DebtAssetId, uint64(2)) + + // get data of total borrow and lend and tally + assetStatsLend, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(s.ctx, 1, 1) + s.Require().Equal(len(assetStatsLend.LendIds), 2) + s.Require().Equal(len(assetStatsLend.BorrowIds), 0) + s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) + s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(13000000000)) + + assetStatsBorrow, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(s.ctx, 1, 2) + s.Require().Equal(len(assetStatsBorrow.LendIds), 1) + s.Require().Equal(len(assetStatsBorrow.BorrowIds), 2) + s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdk.NewInt(700000000)) + s.Require().Equal(assetStatsBorrow.TotalLend, sdk.NewInt(10000000000)) + + afterBorrow, found := s.lendKeeper.GetBorrow(s.ctx, 1) + s.Require().True(found) + s.Require().Equal(afterBorrow.IsLiquidated, true) + + modBalFinal, _ := s.lendKeeper.GetModuleBalanceByPoolID(s.ctx, 1) + s.Require().Equal(modBalInitial.ModuleBalanceStats[0].Balance.Amount.Sub(modBalFinal.ModuleBalanceStats[0].Balance.Amount), sdk.NewInt(100000000)) + + s.Require().Equal(lockedVault[0].IsInternalKeeper, true) + s.Require().Equal(lockedVault[0].InternalKeeperAddress, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7") + } + }) + } +} From 9608fc338d2631428ac165a68a2ec19fe4c8b9a0 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 21 Jun 2023 10:22:32 +0530 Subject: [PATCH 101/155] added testcase for AppReserveFunds and LiquidateExternal --- x/liquidationsV2/expected/keeper.go | 3 +- x/liquidationsV2/keeper/keeper_test.go | 5 + x/liquidationsV2/keeper/liquidate.go | 27 +++- x/liquidationsV2/keeper/msg_server_test.go | 137 +++++++++++++++++++++ 4 files changed, 168 insertions(+), 4 deletions(-) diff --git a/x/liquidationsV2/expected/keeper.go b/x/liquidationsV2/expected/keeper.go index 40b296a30..1761e3c24 100644 --- a/x/liquidationsV2/expected/keeper.go +++ b/x/liquidationsV2/expected/keeper.go @@ -2,11 +2,11 @@ package expected import ( assettypes "github.com/comdex-official/comdex/x/asset/types" + auctiontypes "github.com/comdex-official/comdex/x/auctionsV2/types" collectortypes "github.com/comdex-official/comdex/x/collector/types" esmtypes "github.com/comdex-official/comdex/x/esm/types" lendtypes "github.com/comdex-official/comdex/x/lend/types" liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" - auctiontypes "github.com/comdex-official/comdex/x/auctionsV2/types" markettypes "github.com/comdex-official/comdex/x/market/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" "github.com/comdex-official/comdex/x/vault/types" @@ -32,6 +32,7 @@ type AssetKeeper interface { GetPair(ctx sdk.Context, id uint64) (assettypes.Pair, bool) GetApps(ctx sdk.Context) (apps []assettypes.AppData, found bool) GetPairsVault(ctx sdk.Context, id uint64) (pairs assettypes.ExtendedPairVault, found bool) + GetApp(ctx sdk.Context, id uint64) (app assettypes.AppData, found bool) } type VaultKeeper interface { diff --git a/x/liquidationsV2/keeper/keeper_test.go b/x/liquidationsV2/keeper/keeper_test.go index 3fd5e0ca0..6166a008d 100644 --- a/x/liquidationsV2/keeper/keeper_test.go +++ b/x/liquidationsV2/keeper/keeper_test.go @@ -184,3 +184,8 @@ func (s *KeeperTestSuite) fundAddr(addr sdk.AccAddress, amt sdk.Coins) { err = s.app.BankKeeper.SendCoinsFromModuleToAccount(s.ctx, types.ModuleName, addr, amt) s.Require().NoError(err) } + +func (s *KeeperTestSuite) addAuctionParams(auctionParams auctionsV2types.AuctionParams) { + s.T().Helper() + s.app.NewaucKeeper.SetAuctionParams(s.ctx, auctionParams) +} diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 0178e3beb..9cfb0005f 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -503,6 +503,20 @@ func (k Keeper) SurplusTokenAmount(ctx sdk.Context, CollateralAssetId, DebtAsset } func (k Keeper) MsgAppReserveFundsFn(ctx sdk.Context, from string, appId, assetId uint64, tokenQuantity sdk.Coin) error { + asset, found := k.asset.GetAsset(ctx, assetId) + if !found { + return assettypes.ErrorAssetDoesNotExist + } + + if asset.Denom != tokenQuantity.Denom { + return assettypes.ErrorInvalidDenom + } + + _, found = k.asset.GetApp(ctx, appId) + if !found { + return assettypes.ErrorUnknownAppType + } + appReserveFunds, found := k.GetAppReserveFunds(ctx, appId, assetId) if !found { appReserveFunds = types.AppReserveFunds{ @@ -533,11 +547,15 @@ func (k Keeper) MsgAppReserveFundsFn(ctx sdk.Context, from string, appId, assetI TokenQuantity: tokenQuantity, } - appReserveFundsTxData, _ := k.GetAppReserveFundsTxData(ctx, appId) + appReserveFundsTxData, found := k.GetAppReserveFundsTxData(ctx, appId) + if !found { + appReserveFundsTxData.AppId = appId + } appReserveFundsTxData.AssetTxData = append(appReserveFundsTxData.AssetTxData, assetTxData) k.SetAppReserveFundsTxData(ctx, appReserveFundsTxData) return nil } + func (k Keeper) WithdrawAppReserveFundsFn(ctx sdk.Context, appId, assetId uint64, tokenQuantity sdk.Coin) error { appReserveFunds, found := k.GetAppReserveFunds(ctx, appId, assetId) if !found { @@ -620,9 +638,12 @@ func (k Keeper) MsgLiquidateExternal(ctx sdk.Context, from string, appID uint64, // check if the assets exists // check if reserve funds are added for the debt or not // send tokens from the liquidator's address to the auction module - auctionParams, _ := k.auctionsV2.GetAuctionParams(ctx) + auctionParams, found := k.auctionsV2.GetAuctionParams(ctx) + if !found { + return auctionsV2types.ErrAuctionParamsNotFound + } - _, found := k.asset.GetAsset(ctx, collateralAssetId) + _, found = k.asset.GetAsset(ctx, collateralAssetId) if !found { return assettypes.ErrorAssetDoesNotExist } diff --git a/x/liquidationsV2/keeper/msg_server_test.go b/x/liquidationsV2/keeper/msg_server_test.go index 236c5e0b6..e2c79fa20 100644 --- a/x/liquidationsV2/keeper/msg_server_test.go +++ b/x/liquidationsV2/keeper/msg_server_test.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/comdex-official/comdex/app/wasm/bindings" assetTypes "github.com/comdex-official/comdex/x/asset/types" + auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" lendKeeper "github.com/comdex-official/comdex/x/lend/keeper" lendtypes "github.com/comdex-official/comdex/x/lend/types" "github.com/comdex-official/comdex/x/liquidationsV2/types" @@ -154,6 +155,19 @@ func (s *KeeperTestSuite) AddAppAssets() { } s.liquidationKeeper.SetLiquidationWhiteListing(s.ctx, liqWhitelistingCmdo) + auctionParams := auctionsV2types.AuctionParams{ + AuctionDurationSeconds: 3600, + Step: newDec("0.1"), + WithdrawalFee: newDec("0.0"), + ClosingFee: newDec("0.0"), + MinUsdValueLeft: 100000, + BidFactor: newDec("0.1"), + LiquidationPenalty: newDec("0.1"), + AuctionBonus: newDec("0.0"), + } + + s.addAuctionParams(auctionParams) + } func (s *KeeperTestSuite) CreateVault() { @@ -551,3 +565,126 @@ func (s *KeeperTestSuite) TestLiquidateInternalKeeperForBorrow() { }) } } + +func (s *KeeperTestSuite) TestAppReserveFunds() { + liquidationKeeper := &s.liquidationKeeper + s.AddAppAssets() + + testCases := []struct { + Name string + Msg types.MsgAppReserveFundsRequest + ExpErr error + ExpResp *types.MsgAppReserveFundsResponse + }{ + { + Name: "asset does not exist", + Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 1, 10, sdk.NewCoin("uasset1", sdk.NewInt(100000000))), + ExpErr: assetTypes.ErrorAssetDoesNotExist, + ExpResp: nil, + }, + { + Name: "wrong denom", + Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 1, 1, sdk.NewCoin("uasset2", sdk.NewInt(100000000))), + ExpErr: assetTypes.ErrorInvalidDenom, + ExpResp: nil, + }, + { + Name: "wrong app", + Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 10, 1, sdk.NewCoin("uasset1", sdk.NewInt(100000000))), + ExpErr: assetTypes.ErrorUnknownAppType, + ExpResp: nil, + }, + { + Name: "success valid case 1", + Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 2, 1, sdk.NewCoin("uasset1", sdk.NewInt(100000000))), + ExpErr: nil, + ExpResp: &types.MsgAppReserveFundsResponse{}, + }, + { + Name: "success valid case 2", + Msg: *types.NewMsgAppReserveFundsRequest("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 2, 2, sdk.NewCoin("uasset2", sdk.NewInt(100000000))), + ExpErr: nil, + ExpResp: &types.MsgAppReserveFundsResponse{}, + }, + } + for _, tc := range testCases { + tc := tc + s.Run(tc.Name, func() { + ctx := sdk.WrapSDKContext(s.ctx) + resp, err := s.msgServer.MsgAppReserveFunds(ctx, &tc.Msg) + if tc.ExpErr != nil { + s.Require().Error(err) + s.Require().EqualError(err, tc.ExpErr.Error()) + s.Require().Equal(tc.ExpResp, resp) + } else { + s.Require().NoError(err) + s.Require().NotNil(resp) + s.Require().Equal(tc.ExpResp, resp) + appResFunds, found := liquidationKeeper.GetAppReserveFunds(s.ctx, 2, 1) + s.Require().Equal(found, true) + s.Require().Equal(appResFunds.AppId, uint64(2)) + s.Require().Equal(appResFunds.AssetId, uint64(1)) + s.Require().Equal(appResFunds.TokenQuantity, sdk.NewCoin("uasset1", sdk.NewInt(100000000))) + + _, found = liquidationKeeper.GetAppReserveFundsTxData(s.ctx, 2) + s.Require().Equal(found, true) + } + }) + } +} + +func (s *KeeperTestSuite) TestLiquidateExternal() { + addr, _ := sdk.AccAddressFromBech32("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7") + liquidationKeeper := &s.liquidationKeeper + s.AddAppAssets() + err := liquidationKeeper.MsgAppReserveFundsFn(s.ctx, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 3, 2, sdk.NewCoin("uasset2", sdk.NewInt(100000000))) + if err != nil { + return + } + + testCases := []struct { + Name string + Msg types.MsgLiquidateExternalKeeperRequest + ExpErr error + ExpResp *types.MsgLiquidateExternalKeeperResponse + }{ + { + Name: "asset does not exist", + Msg: *types.NewMsgLiquidateExternalKeeperRequest(addr, 3, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", sdk.NewCoin("uasset1", sdk.NewInt(100000000)), sdk.NewCoin("uasset2", sdk.NewInt(100000000)), sdk.NewDecFromInt(sdk.NewInt(0)), sdk.NewDecFromInt(sdk.NewInt(0)), true, 10, 2, false), + ExpErr: assetTypes.ErrorAssetDoesNotExist, + ExpResp: nil, + }, + { + Name: "success valid case", + Msg: *types.NewMsgLiquidateExternalKeeperRequest(addr, 3, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", sdk.NewCoin("uasset1", sdk.NewInt(100000000)), sdk.NewCoin("uasset2", sdk.NewInt(100000000)), sdk.NewDecFromInt(sdk.NewInt(0)), sdk.NewDecFromInt(sdk.NewInt(0)), true, 1, 2, false), + ExpErr: nil, + ExpResp: &types.MsgLiquidateExternalKeeperResponse{}, + }, + } + for _, tc := range testCases { + tc := tc + s.Run(tc.Name, func() { + ctx := sdk.WrapSDKContext(s.ctx) + resp, err := s.msgServer.MsgLiquidateExternalKeeper(ctx, &tc.Msg) + if tc.ExpErr != nil { + s.Require().Error(err) + s.Require().EqualError(err, tc.ExpErr.Error()) + s.Require().Equal(tc.ExpResp, resp) + } else { + s.Require().NoError(err) + s.Require().NotNil(resp) + s.Require().Equal(tc.ExpResp, resp) + appResFunds, found := liquidationKeeper.GetAppReserveFunds(s.ctx, 3, 2) + s.Require().Equal(found, true) + s.Require().Equal(appResFunds.AppId, uint64(3)) + s.Require().Equal(appResFunds.AssetId, uint64(2)) + s.Require().Equal(appResFunds.TokenQuantity, sdk.NewCoin("uasset2", sdk.NewInt(100000000))) + + _, found = liquidationKeeper.GetAppReserveFundsTxData(s.ctx, 3) + s.Require().Equal(found, true) + id := liquidationKeeper.GetLockedVaultID(s.ctx) + s.Require().Equal(id, uint64(1)) + } + }) + } +} From 87df22c086368cf1de7e74221cc7f07c69701d24 Mon Sep 17 00:00:00 2001 From: Pratik Date: Thu, 22 Jun 2023 10:42:27 +0530 Subject: [PATCH 102/155] adding auction params gov proposals --- app/app.go | 5 + proto/comdex/auctionsV2/v1beta1/bid.proto | 4 +- x/auctionsV2/client/cli/flags.go | 28 ++++++ x/auctionsV2/client/cli/parse.go | 53 +++++++++++ x/auctionsV2/client/cli/tx.go | 109 ++++++++++++++++++++++ x/auctionsV2/client/proposal_handlers.go | 11 +++ x/auctionsV2/client/rest/tx.go | 29 ++++++ x/auctionsV2/handler.go | 16 ++++ x/auctionsV2/keeper/gov.go | 10 ++ x/auctionsV2/keeper/keeper.go | 5 + x/auctionsV2/types/errors.go | 1 + x/auctionsV2/types/gov.go | 52 +++++++++++ 12 files changed, 321 insertions(+), 2 deletions(-) create mode 100644 x/auctionsV2/client/cli/flags.go create mode 100644 x/auctionsV2/client/cli/parse.go create mode 100644 x/auctionsV2/client/proposal_handlers.go create mode 100644 x/auctionsV2/client/rest/tx.go create mode 100644 x/auctionsV2/keeper/gov.go create mode 100644 x/auctionsV2/types/gov.go diff --git a/app/app.go b/app/app.go index 60e4a9f1b..96984b1d3 100644 --- a/app/app.go +++ b/app/app.go @@ -176,10 +176,12 @@ import ( liquiditytypes "github.com/comdex-official/comdex/x/liquidity/types" "github.com/comdex-official/comdex/x/liquidationsV2" + newliqclient "github.com/comdex-official/comdex/x/liquidationsV2/client" newliqkeeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper" newliqtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" "github.com/comdex-official/comdex/x/auctionsV2" + newaucclient "github.com/comdex-official/comdex/x/auctionsV2/client" newauckeeper "github.com/comdex-official/comdex/x/auctionsV2/keeper" newauctypes "github.com/comdex-official/comdex/x/auctionsV2/types" @@ -233,6 +235,9 @@ func GetGovProposalHandlers() []govclient.ProposalHandler { proposalHandlers = append(proposalHandlers, wasmclient.ProposalHandlers...) proposalHandlers = append(proposalHandlers, assetclient.AddAssetsHandler...) proposalHandlers = append(proposalHandlers, liquidityclient.LiquidityProposalHandler...) + proposalHandlers = append(proposalHandlers, newliqclient.LiquidationsV2Handler...) + proposalHandlers = append(proposalHandlers, newaucclient.AuctionsV2Handler...) + return proposalHandlers } diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto index 18e0cb3a9..a673e1b2c 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -121,6 +121,7 @@ message AuctionParams{ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"liquidation_penalty\"" ]; + string auction_bonus = 8 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, @@ -129,8 +130,6 @@ message AuctionParams{ } - - message LimitOrderBidsForUser{ string bidder_address = 1 [ (gogoproto.moretags) = "yaml:\"bidder\"" @@ -140,6 +139,7 @@ message LimitOrderBidsForUser{ (gogoproto.moretags) = "yaml:\"limit_order_bid_key\"" ]; } + message LimitOrderUserKey{ uint64 debt_token_id = 1 [ diff --git a/x/auctionsV2/client/cli/flags.go b/x/auctionsV2/client/cli/flags.go new file mode 100644 index 000000000..ec4dc7a4a --- /dev/null +++ b/x/auctionsV2/client/cli/flags.go @@ -0,0 +1,28 @@ +package cli + +import flag "github.com/spf13/pflag" + +const ( + FlagAddAuctionParams = "add-auction-params" +) + +func FlagSetAuctionParams() *flag.FlagSet { + fs := flag.NewFlagSet("", flag.ContinueOnError) + + fs.String(FlagAddAuctionParams, "", "add auction params json file path") + return fs +} + +type createAuctionParamsInputs struct { + AuctionDurationSeconds string `json:"auction_duration_seconds"` + Step string `json:"step"` + WithdrawalFee string `json:"withdrawal_fee"` + ClosingFee string `json:"closing_fee"` + MinUsdValueLeft string `json:"min_usd_value_left"` + BidFactor string `json:"bid_factor"` + LiquidationPenalty string `json:"liquidation_penalty"` + AuctionBonus string `json:"auction_bonus"` + Title string + Description string + Deposit string +} diff --git a/x/auctionsV2/client/cli/parse.go b/x/auctionsV2/client/cli/parse.go new file mode 100644 index 000000000..2b6644e05 --- /dev/null +++ b/x/auctionsV2/client/cli/parse.go @@ -0,0 +1,53 @@ +package cli + +import ( + "bytes" + "encoding/json" + "fmt" + "github.com/spf13/pflag" + "os" +) + +type ( + XAuctionParamsMappingInputs createAuctionParamsInputs +) + +type XAuctionParamsMappingInputsExceptions struct { + XAuctionParamsMappingInputs + Other *string // Other won't raise an error +} + +func parseAuctionParamsFlags(fs *pflag.FlagSet) (*createAuctionParamsInputs, error) { + auctionParams := &createAuctionParamsInputs{} + addAuctionParamsFile, _ := fs.GetString(FlagAddAuctionParams) + + if addAuctionParamsFile == "" { + return nil, fmt.Errorf("must pass in add asset mapping json using the --%s flag", addAuctionParamsFile) + } + + contents, err := os.ReadFile(addAuctionParamsFile) + if err != nil { + return nil, err + } + + // make exception if unknown field exists + err = auctionParams.UnmarshalJSON(contents) + if err != nil { + return nil, err + } + + return auctionParams, nil +} + +func (release *createAuctionParamsInputs) UnmarshalJSON(data []byte) error { + var addAuctionParamsInputsE XAuctionParamsMappingInputsExceptions + dec := json.NewDecoder(bytes.NewReader(data)) + dec.DisallowUnknownFields() // Force + + if err := dec.Decode(&addAuctionParamsInputsE); err != nil { + return err + } + + *release = createAuctionParamsInputs(addAuctionParamsInputsE.XAuctionParamsMappingInputs) + return nil +} diff --git a/x/auctionsV2/client/cli/tx.go b/x/auctionsV2/client/cli/tx.go index 683e0b086..c86df2492 100644 --- a/x/auctionsV2/client/cli/tx.go +++ b/x/auctionsV2/client/cli/tx.go @@ -5,6 +5,9 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/client/cli" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + flag "github.com/spf13/pflag" "strconv" "time" @@ -197,3 +200,109 @@ func txWithdrawLimitDutchBid() *cobra.Command { flags.AddTxFlagsToCmd(cmd) return cmd } + +func NewAddAuctionParamsProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "add-auction-params [flags]", + Args: cobra.ExactArgs(0), + Short: "Submit auction params", + Long: `Must provide path to a add auction params in JSON file (--add-auction-params)`, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + + txf, msg, err := AddAuctionParams(clientCtx, txf, cmd.Flags()) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) + }, + } + + cmd.Flags().AddFlagSet(FlagSetAuctionParams()) + cmd.Flags().String(cli.FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") + + return cmd +} + +func AddAuctionParams(clientCtx client.Context, txf tx.Factory, fs *flag.FlagSet) (tx.Factory, sdk.Msg, error) { + auctionParams, err := parseAuctionParamsFlags(fs) + if err != nil { + return txf, nil, fmt.Errorf("failed to parse liquidationWhitelisting: %w", err) + } + from := clientCtx.GetFromAddress() + + auctionDurationSeconds, err := strconv.ParseUint(auctionParams.AuctionDurationSeconds, 10, 64) + if err != nil { + return txf, nil, fmt.Errorf("failed to parse appId: %w", err) + } + + step, err := sdk.NewDecFromStr(auctionParams.Step) + if err != nil { + return txf, nil, err + } + + withdrawalFee, err := sdk.NewDecFromStr(auctionParams.WithdrawalFee) + if err != nil { + return txf, nil, err + } + + closingFee, err := sdk.NewDecFromStr(auctionParams.ClosingFee) + if err != nil { + return txf, nil, err + } + + minUsdValueLeft, err := strconv.ParseUint(auctionParams.MinUsdValueLeft, 10, 64) + if err != nil { + return txf, nil, fmt.Errorf("failed to parse appId: %w", err) + } + + bidFactor, err := sdk.NewDecFromStr(auctionParams.BidFactor) + if err != nil { + return txf, nil, err + } + + liquidationPenalty, err := sdk.NewDecFromStr(auctionParams.LiquidationPenalty) + if err != nil { + return txf, nil, err + } + + auctionBonus, err := sdk.NewDecFromStr(auctionParams.AuctionBonus) + if err != nil { + return txf, nil, err + } + + auctionParamStruct := types.AuctionParams{ + AuctionDurationSeconds: auctionDurationSeconds, + Step: step, + WithdrawalFee: withdrawalFee, + ClosingFee: closingFee, + MinUsdValueLeft: minUsdValueLeft, + BidFactor: bidFactor, + LiquidationPenalty: liquidationPenalty, + AuctionBonus: auctionBonus, + } + + deposit, err := sdk.ParseCoinsNormalized(auctionParams.Deposit) + if err != nil { + return txf, nil, err + } + + content := types.NewDutchAutoBidParamsProposal(auctionParams.Title, auctionParams.Description, auctionParamStruct) + + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return txf, nil, err + } + + if err = msg.ValidateBasic(); err != nil { + return txf, nil, err + } + + return txf, msg, nil +} diff --git a/x/auctionsV2/client/proposal_handlers.go b/x/auctionsV2/client/proposal_handlers.go new file mode 100644 index 000000000..e5f258eee --- /dev/null +++ b/x/auctionsV2/client/proposal_handlers.go @@ -0,0 +1,11 @@ +package client + +import ( + "github.com/comdex-official/comdex/x/auctionsV2/client/cli" + "github.com/comdex-official/comdex/x/auctionsV2/client/rest" + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" +) + +var AuctionsV2Handler = []govclient.ProposalHandler{ + govclient.NewProposalHandler(cli.NewAddAuctionParamsProposal, rest.AddAuctionParamsRESTHandler), +} diff --git a/x/auctionsV2/client/rest/tx.go b/x/auctionsV2/client/rest/tx.go new file mode 100644 index 000000000..536802169 --- /dev/null +++ b/x/auctionsV2/client/rest/tx.go @@ -0,0 +1,29 @@ +package rest + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/types/rest" + govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest" + "net/http" +) + +type ( + AddAuctionParamsRequest struct{} +) + +func AddAuctionParamsRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "add-auction-params", + Handler: AuctionParamsRequestRESTHandler(clientCtx), + } +} + +func AuctionParamsRequestRESTHandler(clientCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req AddAuctionParamsRequest + + if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) { + return + } + } +} diff --git a/x/auctionsV2/handler.go b/x/auctionsV2/handler.go index bebdfa7d2..62fc4272a 100644 --- a/x/auctionsV2/handler.go +++ b/x/auctionsV2/handler.go @@ -5,6 +5,7 @@ import ( "github.com/comdex-official/comdex/x/auctionsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) func NewHandler(k keeper.Keeper) sdk.Handler { @@ -35,3 +36,18 @@ func NewHandler(k keeper.Keeper) sdk.Handler { } } } + +func NewAuctionsV2Handler(k keeper.Keeper) govtypes.Handler { + return func(ctx sdk.Context, content govtypes.Content) error { + switch c := content.(type) { + case *types.DutchAutoBidParamsProposal: + return handleAddAuctionParamsProposal(ctx, k, c) + default: + return sdkerrors.Wrapf(types.ErrorUnknownProposalType, "%T", c) + } + } +} + +func handleAddAuctionParamsProposal(ctx sdk.Context, k keeper.Keeper, p *types.DutchAutoBidParamsProposal) error { + return k.HandleAuctionParamsProposal(ctx, p) +} diff --git a/x/auctionsV2/keeper/gov.go b/x/auctionsV2/keeper/gov.go new file mode 100644 index 000000000..382e379a2 --- /dev/null +++ b/x/auctionsV2/keeper/gov.go @@ -0,0 +1,10 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/auctionsV2/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) HandleAuctionParamsProposal(ctx sdk.Context, p *types.DutchAutoBidParamsProposal) error { + return k.AddAuctionParams(ctx, p.AuctionParams) +} diff --git a/x/auctionsV2/keeper/keeper.go b/x/auctionsV2/keeper/keeper.go index cf0f50f52..b589c39f9 100644 --- a/x/auctionsV2/keeper/keeper.go +++ b/x/auctionsV2/keeper/keeper.go @@ -97,3 +97,8 @@ func (k Keeper) GetAuctionParams(ctx sdk.Context) (auctionParams types.AuctionPa k.cdc.MustUnmarshal(value, &auctionParams) return auctionParams, true } + +func (k Keeper) AddAuctionParams(ctx sdk.Context, auctionParams types.AuctionParams) error { + k.SetAuctionParams(ctx, auctionParams) + return nil +} diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index 6fe694764..7b812a719 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -18,4 +18,5 @@ var ( ErrLiquidationNotFound = sdkerrors.Register(ModuleName, 708, "Liquidation data not found for the auction") ErrBidNotFound = sdkerrors.Register(ModuleName, 709, "There exists no active bid for the user with given params") ErrAuctionParamsNotFound = sdkerrors.Register(ModuleName, 710, "There exists no auction params") + ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 711, "unknown proposal type") ) diff --git a/x/auctionsV2/types/gov.go b/x/auctionsV2/types/gov.go new file mode 100644 index 000000000..c2ac6281d --- /dev/null +++ b/x/auctionsV2/types/gov.go @@ -0,0 +1,52 @@ +package types + +import ( + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +const ( + ProposalDutchAutoBidParams = "DutchAutoBidParams" +) + +func init() { + govtypes.RegisterProposalType(ProposalDutchAutoBidParams) + govtypes.RegisterProposalTypeCodec(&DutchAutoBidParamsProposal{}, "comdex/AddDutchAutoBidParamsProposal") +} + +var ( + _ govtypes.Content = &DutchAutoBidParamsProposal{} +) + +func NewDutchAutoBidParamsProposal(title, description string, dutchAutoBidParams AuctionParams) govtypes.Content { + return &DutchAutoBidParamsProposal{ + Title: title, + Description: description, + AuctionParams: dutchAutoBidParams, + } +} + +func (m *DutchAutoBidParamsProposal) ProposalRoute() string { + return RouterKey +} + +func (m *DutchAutoBidParamsProposal) ProposalType() string { + return ProposalDutchAutoBidParams +} + +func (m *DutchAutoBidParamsProposal) ValidateBasic() error { + err := govtypes.ValidateAbstract(m) + if err != nil { + return err + } + + if err := m.AuctionParams.Validate(); err != nil { + return err + } + + return nil +} + +func (m *AuctionParams) Validate() error { + //TODO: add conditions + return nil +} From 9715fdb8ab0401deef5d75852acc91c8c1720307 Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 27 Jun 2023 11:39:15 +0530 Subject: [PATCH 103/155] auctionsV2 testcase --- x/auctionsV2/keeper/auctions.go | 38 +- x/auctionsV2/keeper/bid.go | 41 +- x/auctionsV2/keeper/keeper_test.go | 133 ++++- x/auctionsV2/keeper/msg_server.go | 3 +- x/auctionsV2/keeper/msg_server_test.go | 688 +++++++++++++++++++++++++ x/auctionsV2/types/errors.go | 1 + x/liquidationsV2/keeper/liquidate.go | 18 +- 7 files changed, 855 insertions(+), 67 deletions(-) create mode 100644 x/auctionsV2/keeper/msg_server_test.go diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 34b105e18..fa132db8a 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -69,7 +69,9 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati //Premium : Initial Price i.e price of the collateral at which the auction will start //Discount: Final Price , i.e less than the oracle price of the collateral asset and at this , auction would end //Decrement Factor: Linear decrease in the price of the collateral every block is governed by this. - CollateralTokenInitialPrice := k.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), dutchAuctionParams.Premium) + //CollateralTokenInitialPrice := k.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), dutchAuctionParams.Premium) + CollateralTokenInitialPrice := sdk.NewDecFromInt(sdk.NewIntFromUint64(twaDataCollateral.Twa)).Add(k.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), dutchAuctionParams.Premium)) + // CollateralTokenEndPrice := k.getOutflowTokenEndPrice(CollateralTokenInitialPrice, dutchAuctionParams.Cusp) auctionParams, _ := k.GetAuctionParams(ctx) @@ -234,40 +236,6 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { return nil } -// DutchAuctionsIterator iterates over existing active dutch auctions and does 2 main job -// First: if auction time is complete and target not reached with collateral available then Restart -// Second: if not restarting update the price -// func (k Keeper) DutchAuctionsIterator(ctx sdk.Context) error { -// dutchAuctions := k.GetAuctions(ctx) -// // SET current price of inflow token and outflow token - -// for _, dutchAuction := range dutchAuctions { -// lockedVault, found := k.LiquidationsV2.GetLockedVault(ctx, dutchAuction.AppId, dutchAuction.LockedVaultId) -// if !found { -// return auctiontypes.ErrorInvalidLockedVault -// } -// _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { -// // First case to check if we have to restart the auction -// if ctx.BlockTime().After(dutchAuction.EndTime) { -// // restart -// err := k.RestartDutchAuctions(ctx, dutchAuction, lockedVault) -// if err != nil { -// return err -// } - -// } else { -// // Second case to only reduce the price -// err := k.UpdateDutchAuctionPrice(ctx, dutchAuction) -// if err != nil { -// return err -// } -// } -// return nil -// }) -// } -// return nil -// } - func (k Keeper) RestartDutchAuction(ctx sdk.Context, dutchAuction types.Auction) error { auctionParams, _ := k.GetAuctionParams(ctx) liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, dutchAuction.AppId) diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 2dba13cd7..5d02397fc 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -22,7 +22,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s liquidationWhitelistingAppData, _ := k.LiquidationsV2.GetLiquidationWhiteListing(ctx, auctionData.AppId) if bid.Denom != auctionData.DebtToken.Denom { - return bidId, sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid token is not the debt token ", bid.Denom) + return bidId, types.ErrorUnknownDebtToken } liquidationData, _ := k.LiquidationsV2.GetLockedVault(ctx, auctionData.AppId, auctionData.LockedVaultId) //Price data of the token from market module @@ -83,10 +83,10 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s return bidId, err } } - //Burn Debt Token, + //Burn Debt Token, only for vault liquidationPenalty := sdk.NewCoin(auctionData.DebtToken.Denom, liquidationData.FeeToBeCollected) var tokensToBurn sdk.Coin - if liquidationData.InitiatorType != "external" { + if liquidationData.InitiatorType == "vault" { tokensToBurn = liquidationData.TargetDebt.Sub(liquidationPenalty) if tokensToBurn.Amount.GT(sdk.ZeroInt()) { err := k.bankKeeper.BurnCoins(ctx, auctionsV2types.ModuleName, sdk.NewCoins(tokensToBurn)) @@ -182,9 +182,8 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //Updating mapping data of vault k.vault.UpdateTokenMintedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, tokensToBurn.Amount, false) k.vault.UpdateCollateralLockedAmountLockerMapping(ctx, auctionData.AppId, liquidationData.ExtendedPairId, liquidationData.CollateralToken.Amount, false) - } else if liquidationData.InitiatorType == "borrow" { + } else if liquidationData.InitiatorType == "lend" { //Check if they are initiated through a keeper, if so they will be incentivised - //TODO: // send money back to the debt pool (assetOut pool) // liquidation penalty to the reserve and interest to the pool // send token to the bidder @@ -216,7 +215,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //if bid amount is less than the target bid //Calculating collateral token value from bid(debt) token value _, collateralTokenQuantity, _ := k.vault.GetAmountOfOtherToken(ctx, auctionData.DebtAssetId, debtPrice, bid.Amount, auctionData.CollateralAssetId, auctionData.CollateralTokenAuctionPrice) - debtLeft := bid.Amount.Sub(bid.Amount) + debtLeft := auctionData.DebtToken.Amount.Sub(bid.Amount) debtuDollar, _ := k.CalcDollarValueForToken(ctx, auctionData.DebtAssetId, debtPrice, debtLeft) if !(debtuDollar).GT(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.MinUsdValueLeft))) { return bidId, types.ErrCannotLeaveDebtLessThanDust @@ -318,7 +317,7 @@ func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder tokenCollateralData = bid } if bid.Denom != tokenLastBid.Denom { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "Bid is not in correct denom ", bid.Denom) + return types.ErrorUnknownDebtToken } if auctionData.BiddingIds != nil { @@ -479,6 +478,16 @@ func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, Collatera if !found { return assettypes.ErrorAssetDoesNotExist } + + debtToken, found := k.asset.GetAsset(ctx, DebtTokenId) + if !found { + return assettypes.ErrorAssetDoesNotExist + } + + if debtToken.Denom != amount.Denom { + return types.ErrorUnknownDebtToken + } + userLimitBid, found := k.GetUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) if !found { userLimitBid = types.LimitOrderBid{ @@ -525,8 +534,8 @@ func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenI } // return all the tokens back to the user if userLimitBid.DebtToken.Amount.GT(sdk.ZeroInt()) { - feesToBecollected := auctionParams.ClosingFee.Mul(sdk.NewDecFromInt(userLimitBid.DebtToken.Amount)).TruncateInt() - userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(feesToBecollected) + feesToBeCollected := auctionParams.ClosingFee.Mul(sdk.NewDecFromInt(userLimitBid.DebtToken.Amount)).TruncateInt() + userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(feesToBeCollected) err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, sdk.NewCoins(userLimitBid.DebtToken)) if err != nil { @@ -537,9 +546,9 @@ func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenI if !found { var feeData types.AuctionFeesCollectionFromLimitBidTx feeData.AssetId = DebtTokenId - feeData.Amount = feesToBecollected + feeData.Amount = feesToBeCollected } else { - feeData.Amount = feeData.Amount.Add(feesToBecollected) + feeData.Amount = feeData.Amount.Add(feesToBeCollected) } err := k.SetAuctionLimitBidFeeData(ctx, feeData) if err != nil { @@ -557,7 +566,7 @@ func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenI func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, CollateralTokenId, DebtTokenId uint64, PremiumDiscount sdk.Int, amount sdk.Coin) error { userLimitBid, found := k.GetUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) if !found { - // return err not found + return types.ErrBidNotFound } bidderAddr, err := sdk.AccAddressFromBech32(bidder) @@ -576,8 +585,8 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater // return all the tokens back to the user if userLimitBid.DebtToken.Amount.GT(sdk.ZeroInt()) { - feesToBecollected := auctionParams.WithdrawalFee.Mul(sdk.NewDecFromInt(amount.Amount)).TruncateInt() - userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(feesToBecollected) + feesToBeCollected := auctionParams.WithdrawalFee.Mul(sdk.NewDecFromInt(amount.Amount)).TruncateInt() + userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(feesToBeCollected) err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, sdk.NewCoins(amount)) if err != nil { @@ -588,9 +597,9 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater if !found { var feeData types.AuctionFeesCollectionFromLimitBidTx feeData.AssetId = DebtTokenId - feeData.Amount = feesToBecollected + feeData.Amount = feesToBeCollected } else { - feeData.Amount = feeData.Amount.Add(feesToBecollected) + feeData.Amount = feeData.Amount.Add(feesToBeCollected) } err := k.SetAuctionLimitBidFeeData(ctx, feeData) if err != nil { diff --git a/x/auctionsV2/keeper/keeper_test.go b/x/auctionsV2/keeper/keeper_test.go index 02f5ade5e..e58a7ee66 100644 --- a/x/auctionsV2/keeper/keeper_test.go +++ b/x/auctionsV2/keeper/keeper_test.go @@ -3,13 +3,17 @@ package keeper_test import ( chain "github.com/comdex-official/comdex/app" assetKeeper "github.com/comdex-official/comdex/x/asset/keeper" + assettypes "github.com/comdex-official/comdex/x/asset/types" "github.com/comdex-official/comdex/x/auctionsV2/keeper" "github.com/comdex-official/comdex/x/auctionsV2/types" + auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" collectKeeper "github.com/comdex-official/comdex/x/collector/keeper" lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" + lendtypes "github.com/comdex-official/comdex/x/lend/types" liquidationKeeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper" liquidationTypes "github.com/comdex-official/comdex/x/liquidationsV2/types" marketKeeper "github.com/comdex-official/comdex/x/market/keeper" + markettypes "github.com/comdex-official/comdex/x/market/types" tokenmintKeeper "github.com/comdex-official/comdex/x/tokenmint/keeper" vaultKeeper "github.com/comdex-official/comdex/x/vault/keeper" vaultTypes "github.com/comdex-official/comdex/x/vault/types" @@ -71,11 +75,132 @@ func (s *KeeperTestSuite) getBalance(addr string, denom string) (coin sdk.Coin, return s.app.BankKeeper.GetBalance(s.ctx, addr1, denom), nil } -func (s *KeeperTestSuite) fundAddr(addr sdk.AccAddress, amt sdk.Coin) { - amt1 := sdk.NewCoins(amt) +func (s *KeeperTestSuite) CreateNewAsset(name, denom string, twa uint64) uint64 { + err := s.app.AssetKeeper.AddAssetRecords(s.ctx, assettypes.Asset{ + Name: name, + Denom: denom, + Decimals: sdk.NewInt(1000000), + IsOnChain: true, + IsOraclePriceRequired: true, + IsCdpMintable: true, + }) + s.Require().NoError(err) + assets := s.app.AssetKeeper.GetAssets(s.ctx) + var assetID uint64 + for _, asset := range assets { + if asset.Denom == denom { + assetID = asset.Id + break + } + } + s.Require().NotZero(assetID) + + twa1 := markettypes.TimeWeightedAverage{ + AssetID: assetID, + ScriptID: 10, + Twa: twa, + CurrentIndex: 1, + IsPriceActive: true, + PriceValue: nil, + } + + s.app.MarketKeeper.SetTwa(s.ctx, twa1) + + return assetID +} + +func newInt(i int64) sdk.Int { + return sdk.NewInt(i) +} + +func newDec(i string) sdk.Dec { + dec, _ := sdk.NewDecFromStr(i) + return dec +} + +func (s *KeeperTestSuite) AddAssetRatesStats(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdk.Dec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdk.Dec, CAssetID uint64) uint64 { + err := s.app.LendKeeper.AddAssetRatesParams(s.ctx, lendtypes.AssetRatesParams{ + AssetID: AssetID, + UOptimal: UOptimal, + Base: Base, + Slope1: Slope1, + Slope2: Slope2, + EnableStableBorrow: EnableStableBorrow, + StableBase: StableBase, + StableSlope1: StableSlope1, + StableSlope2: StableSlope2, + Ltv: LTV, + LiquidationThreshold: LiquidationThreshold, + LiquidationPenalty: LiquidationPenalty, + LiquidationBonus: LiquidationBonus, + ReserveFactor: ReserveFactor, + CAssetID: CAssetID, + }) + s.Require().NoError(err) + return AssetID +} + +func (s *KeeperTestSuite) CreateNewApp(appName, shortName string) uint64 { + err := s.app.AssetKeeper.AddAppRecords(s.ctx, assettypes.AppData{ + Name: appName, + ShortName: shortName, + MinGovDeposit: sdk.NewInt(0), + GovTimeInSeconds: 0, + GenesisToken: []assettypes.MintGenesisToken{}, + }) + s.Require().NoError(err) + found := s.app.AssetKeeper.HasAppForName(s.ctx, appName) + s.Require().True(found) + + apps, found := s.app.AssetKeeper.GetApps(s.ctx) + s.Require().True(found) + var appID uint64 + for _, app := range apps { + if app.Name == appName { + appID = app.Id + break + } + } + s.Require().NotZero(appID) + return appID +} + +func (s *KeeperTestSuite) AddAssetRatesPoolPairs(AssetID uint64, UOptimal, Base, Slope1, Slope2 sdk.Dec, EnableStableBorrow bool, StableBase, StableSlope1, StableSlope2, LTV, LiquidationThreshold, LiquidationPenalty, LiquidationBonus, ReserveFactor sdk.Dec, CAssetID uint64, moduleName, cPoolName string, assetData []*lendtypes.AssetDataPoolMapping, MinUsdValueLeft uint64, IsIsolated bool) uint64 { + err := s.app.LendKeeper.AddAssetRatesPoolPairs(s.ctx, lendtypes.AssetRatesPoolPairs{ + AssetID: AssetID, + UOptimal: UOptimal, + Base: Base, + Slope1: Slope1, + Slope2: Slope2, + EnableStableBorrow: EnableStableBorrow, + StableBase: StableBase, + StableSlope1: StableSlope1, + StableSlope2: StableSlope2, + Ltv: LTV, + LiquidationThreshold: LiquidationThreshold, + LiquidationPenalty: LiquidationPenalty, + LiquidationBonus: LiquidationBonus, + ReserveFactor: ReserveFactor, + CAssetID: CAssetID, + ModuleName: moduleName, + CPoolName: cPoolName, + AssetData: assetData, + MinUsdValueLeft: MinUsdValueLeft, + //IsIsolated: IsIsolated, + }) + s.Require().NoError(err) + return AssetID +} + +func (s *KeeperTestSuite) fundAddr(addr sdk.AccAddress, amt sdk.Coins) { s.T().Helper() - err := s.app.BankKeeper.MintCoins(s.ctx, liquidationTypes.ModuleName, amt1) + err := s.app.BankKeeper.MintCoins(s.ctx, types.ModuleName, amt) s.Require().NoError(err) - err = s.app.BankKeeper.SendCoinsFromModuleToAccount(s.ctx, liquidationTypes.ModuleName, addr, amt1) + err = s.app.BankKeeper.SendCoinsFromModuleToAccount(s.ctx, types.ModuleName, addr, amt) s.Require().NoError(err) } + +func (s *KeeperTestSuite) addAuctionParams(auctionParams auctionsV2types.AuctionParams) { + s.T().Helper() + s.app.NewaucKeeper.SetAuctionParams(s.ctx, auctionParams) +} diff --git a/x/auctionsV2/keeper/msg_server.go b/x/auctionsV2/keeper/msg_server.go index 088650041..cee71850a 100644 --- a/x/auctionsV2/keeper/msg_server.go +++ b/x/auctionsV2/keeper/msg_server.go @@ -33,7 +33,6 @@ func (k msgServer) MsgPlaceMarketBid(goCtx context.Context, msg *types.MsgPlaceM //From auction ID, checking the whether its an english or a dutch auction //If true triggering Dutch Auction Bid Request if auctionData.AuctionType { - _, err = k.PlaceDutchAuctionBid(ctx, msg.AuctionId, bidder.String(), msg.Amount, auctionData, false) if err != nil { return nil, err @@ -62,7 +61,7 @@ func (k msgServer) MsgDepositLimitBid(goCtx context.Context, msg *types.MsgDepos func (k msgServer) MsgCancelLimitBid(goCtx context.Context, msg *types.MsgCancelLimitBidRequest) (*types.MsgCancelLimitBidResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - err := k.CancelLimitAuctionBid(ctx, msg.Bidder, msg.CollateralTokenId, msg.DebtTokenId, msg.PremiumDiscount) + err := k.CancelLimitAuctionBid(ctx, msg.Bidder, msg.DebtTokenId, msg.CollateralTokenId, msg.PremiumDiscount) if err != nil { return nil, err } diff --git a/x/auctionsV2/keeper/msg_server_test.go b/x/auctionsV2/keeper/msg_server_test.go new file mode 100644 index 000000000..435e0629a --- /dev/null +++ b/x/auctionsV2/keeper/msg_server_test.go @@ -0,0 +1,688 @@ +package keeper_test + +import ( + "github.com/comdex-official/comdex/app/wasm/bindings" + assetTypes "github.com/comdex-official/comdex/x/asset/types" + auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" + lendKeeper "github.com/comdex-official/comdex/x/lend/keeper" + lendtypes "github.com/comdex-official/comdex/x/lend/types" + "github.com/comdex-official/comdex/x/liquidationsV2/types" + markettypes "github.com/comdex-official/comdex/x/market/types" + vaultKeeper1 "github.com/comdex-official/comdex/x/vault/keeper" + vaultTypes "github.com/comdex-official/comdex/x/vault/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +func (s *KeeperTestSuite) AddAppAssets() { + + assetOneID := s.CreateNewAsset("ASSETONE", "uasset1", 2000000) + assetTwoID := s.CreateNewAsset("ASSETTWO", "uasset2", 2000000) + assetThreeID := s.CreateNewAsset("ASSETTHREE", "uasset3", 1000000) + assetFourID := s.CreateNewAsset("ASSETFOUR", "uasset4", 2000000) + cAssetOneID := s.CreateNewAsset("CASSETONE", "ucasset1", 1000000) + cAssetTwoID := s.CreateNewAsset("CASSETTWO", "ucasset2", 2000000) + cAssetThreeID := s.CreateNewAsset("CASSETTHRE", "ucasset3", 2000000) + cAssetFourID := s.CreateNewAsset("CASSETFOUR", "ucasset4", 2000000) + + var ( + assetDataPoolOne []*lendtypes.AssetDataPoolMapping + assetDataPoolTwo []*lendtypes.AssetDataPoolMapping + ) + assetDataPoolOneAssetOne := &lendtypes.AssetDataPoolMapping{ + AssetID: assetOneID, + AssetTransitType: 3, + SupplyCap: sdk.NewDec(5000000000000000000), + } + assetDataPoolOneAssetTwo := &lendtypes.AssetDataPoolMapping{ + AssetID: assetTwoID, + AssetTransitType: 1, + SupplyCap: sdk.NewDec(1000000000000000000), + } + assetDataPoolOneAssetThree := &lendtypes.AssetDataPoolMapping{ + AssetID: assetThreeID, + AssetTransitType: 2, + SupplyCap: sdk.NewDec(5000000000000000000), + } + assetDataPoolTwoAssetFour := &lendtypes.AssetDataPoolMapping{ + AssetID: assetFourID, + AssetTransitType: 1, + SupplyCap: sdk.NewDec(3000000000000000000), + } + + assetDataPoolOne = append(assetDataPoolOne, assetDataPoolOneAssetOne, assetDataPoolOneAssetTwo, assetDataPoolOneAssetThree) + assetDataPoolTwo = append(assetDataPoolTwo, assetDataPoolTwoAssetFour, assetDataPoolOneAssetOne, assetDataPoolOneAssetThree) + + s.AddAssetRatesStats(assetThreeID, newDec("0.8"), newDec("0.002"), newDec("0.06"), newDec("0.6"), true, newDec("0.04"), newDec("0.04"), newDec("0.06"), newDec("0.8"), newDec("0.85"), newDec("0.025"), newDec("0.025"), newDec("0.1"), cAssetThreeID) + s.AddAssetRatesStats(assetOneID, newDec("0.75"), newDec("0.002"), newDec("0.07"), newDec("1.25"), false, newDec("0.0"), newDec("0.0"), newDec("0.0"), newDec("0.7"), newDec("0.75"), newDec("0.05"), newDec("0.05"), newDec("0.2"), cAssetOneID) + s.AddAssetRatesPoolPairs(assetTwoID, newDec("0.5"), newDec("0.002"), newDec("0.08"), newDec("2.0"), false, newDec("0.0"), newDec("0.0"), newDec("0.0"), newDec("0.5"), newDec("0.55"), newDec("0.05"), newDec("0.05"), newDec("0.2"), cAssetTwoID, "cmdx", "CMDX-ATOM-CMST", assetDataPoolOne, 1000000, false) + s.AddAssetRatesPoolPairs(assetFourID, newDec("0.65"), newDec("0.002"), newDec("0.08"), newDec("1.5"), false, newDec("0.0"), newDec("0.0"), newDec("0.0"), newDec("0.6"), newDec("0.65"), newDec("0.05"), newDec("0.05"), newDec("0.2"), cAssetFourID, "osmo", "OSMO-ATOM-CMST", assetDataPoolTwo, 1000000, false) + + _ = s.CreateNewApp("cswap", "cswap") + _ = s.CreateNewApp("harbor", "hbr") + appThreeID := s.CreateNewApp("commodo", "cmdo") + s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), sdk.NewCoins(sdk.NewCoin("uasset1", newInt(1000000000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), sdk.NewCoins(sdk.NewCoin("uasset2", newInt(1000000000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), sdk.NewCoins(sdk.NewCoin("uasset3", newInt(1000000000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t"), sdk.NewCoins(sdk.NewCoin("uasset4", newInt(1000000000000000)))) + + s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7"), sdk.NewCoins(sdk.NewCoin("uasset1", newInt(1000000000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7"), sdk.NewCoins(sdk.NewCoin("uasset2", newInt(1000000000000000)))) + s.fundAddr(sdk.MustAccAddressFromBech32("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7"), sdk.NewCoins(sdk.NewCoin("uasset3", newInt(13000000)))) + + msgLend1 := lendtypes.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetOneID, sdk.NewCoin("uasset1", newInt(3000000000)), 1, appThreeID) + msgLend2 := lendtypes.NewMsgLend("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", assetTwoID, sdk.NewCoin("uasset2", newInt(10000000000)), 1, appThreeID) + msgLend3 := lendtypes.NewMsgLend("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", assetOneID, sdk.NewCoin("uasset1", newInt(10000000000)), 1, appThreeID) + + msg3 := lendtypes.NewMsgFundModuleAccounts(1, assetOneID, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", sdk.NewCoin("uasset1", newInt(10000000000))) + msg4 := lendtypes.NewMsgFundModuleAccounts(1, assetTwoID, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", sdk.NewCoin("uasset2", newInt(10000000000))) + msg5 := lendtypes.NewMsgFundModuleAccounts(1, assetThreeID, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", sdk.NewCoin("uasset3", newInt(120000000))) + msg7 := lendtypes.NewMsgFundModuleAccounts(2, assetOneID, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", sdk.NewCoin("uasset1", newInt(10000000000))) + msg8 := lendtypes.NewMsgFundModuleAccounts(2, assetFourID, "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", sdk.NewCoin("uasset4", newInt(10000000000))) + + lendkeeper := &s.lendKeeper + server := lendKeeper.NewMsgServerImpl(*lendkeeper) + + _, _ = server.Lend(sdk.WrapSDKContext(s.ctx), msgLend1) + _, _ = server.Lend(sdk.WrapSDKContext(s.ctx), msgLend2) + _, _ = server.Lend(sdk.WrapSDKContext(s.ctx), msgLend3) + _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg3) + _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg4) + _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg5) + _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg7) + _, _ = server.FundModuleAccounts(sdk.WrapSDKContext(s.ctx), msg8) + + msg2 := lendtypes.NewMsgBorrow("cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t", 1, 1, false, sdk.NewCoin("ucasset1", newInt(100000000)), sdk.NewCoin("uasset2", newInt(70000000))) + _, err := server.Borrow(sdk.WrapSDKContext(s.ctx), msg2) + s.Require().NoError(err) + + msg22 := lendtypes.NewMsgBorrow("cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", 3, 1, false, sdk.NewCoin("ucasset1", newInt(1000000000)), sdk.NewCoin("uasset2", newInt(700000000))) + _, err = server.Borrow(sdk.WrapSDKContext(s.ctx), msg22) + s.Require().NoError(err) + + pair := assetTypes.Pair{AssetIn: 2, AssetOut: 3} + extendedPairVault := bindings.MsgAddExtendedPairsVault{ + AppID: 2, + PairID: 1, + StabilityFee: sdk.MustNewDecFromStr("0.01"), + ClosingFee: sdk.MustNewDecFromStr("0"), + LiquidationPenalty: sdk.MustNewDecFromStr("0.12"), + DrawDownFee: sdk.MustNewDecFromStr("0.01"), + IsVaultActive: true, + DebtCeiling: sdk.NewInt(1000000000000), + DebtFloor: sdk.NewInt(1000000), + IsStableMintVault: false, + MinCr: sdk.MustNewDecFromStr("1.5"), + PairName: "CMDX-B", + AssetOutOraclePrice: true, + AssetOutPrice: 1000000, + MinUsdValueLeft: 1000000, + } + + assetkeeper, ctx := &s.assetKeeper, &s.ctx + err = assetkeeper.AddPairsRecords(*ctx, pair) + s.Require().NoError(err) + + err = assetkeeper.WasmAddExtendedPairsVaultRecords(*ctx, &extendedPairVault) + s.Require().NoError(err) + + // set liquidation whitelisting + dutchAuctionParams := types.DutchAuctionParam{ + Premium: newDec("0.2"), + Discount: newDec("0.1"), + DecrementFactor: sdk.NewInt(1), + } + englishAuctionParams := types.EnglishAuctionParam{DecrementFactor: sdk.NewInt(1)} + + liqWhitelistingHbr := types.LiquidationWhiteListing{ + AppId: 2, + Initiator: true, + IsDutchActivated: true, + DutchAuctionParam: &dutchAuctionParams, + IsEnglishActivated: true, + EnglishAuctionParam: &englishAuctionParams, + KeeeperIncentive: newDec("0.1"), + } + s.liquidationKeeper.SetLiquidationWhiteListing(s.ctx, liqWhitelistingHbr) + + liqWhitelistingCmdo := types.LiquidationWhiteListing{ + AppId: 3, + Initiator: true, + IsDutchActivated: true, + DutchAuctionParam: &dutchAuctionParams, + IsEnglishActivated: false, + EnglishAuctionParam: nil, + KeeeperIncentive: newDec("0.1"), + } + s.liquidationKeeper.SetLiquidationWhiteListing(s.ctx, liqWhitelistingCmdo) + + auctionParams := auctionsV2types.AuctionParams{ + AuctionDurationSeconds: 3600, + Step: newDec("0.1"), + WithdrawalFee: newDec("0.0"), + ClosingFee: newDec("0.0"), + MinUsdValueLeft: 100000, + BidFactor: newDec("0.1"), + LiquidationPenalty: newDec("0.1"), + AuctionBonus: newDec("0.0"), + } + + s.addAuctionParams(auctionParams) + +} + +func (s *KeeperTestSuite) CreateVault() { + userAddress1 := "cosmos1yq8lgssgxlx9smjhes6ryjasmqmd3ts2559g0t" + userAddress2 := "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7" + vaultKeeper, ctx := &s.vaultKeeper, &s.ctx + s.AddAppAssets() + server := vaultKeeper1.NewMsgServer(*vaultKeeper) + + for index, tc := range []struct { + name string + msg vaultTypes.MsgCreateRequest + }{ + { + "Create Vault : AppID 1 extended pair 1 user address 1", + vaultTypes.MsgCreateRequest{ + From: userAddress1, + AppId: 2, + ExtendedPairVaultId: 1, + AmountIn: sdk.NewIntFromUint64(1000000), + AmountOut: sdk.NewIntFromUint64(1000000), + }, + }, + { + "Create Vault : AppID 1 extended pair 1 user address 2", + vaultTypes.MsgCreateRequest{ + From: userAddress2, + AppId: 2, + ExtendedPairVaultId: 1, + AmountIn: sdk.NewIntFromUint64(1000000), + AmountOut: sdk.NewIntFromUint64(1000000), + }, + }, + } { + s.Run(tc.name, func() { + _, err := server.MsgCreate(sdk.WrapSDKContext(*ctx), &tc.msg) + s.Require().NoError(err) + res, err := s.vaultQuerier.QueryAllVaults(sdk.WrapSDKContext(*ctx), &vaultTypes.QueryAllVaultsRequest{}) + s.Require().NoError(err) + _, err = s.vaultQuerier.QueryVaultInfoByVaultID(sdk.WrapSDKContext(*ctx), &vaultTypes.QueryVaultInfoByVaultIDRequest{Id: res.Vault[index].Id}) + s.Require().NoError(err) + }) + } +} + +func (s *KeeperTestSuite) GetVaultCount() int { + ctx := &s.ctx + res, err := s.vaultQuerier.QueryAllVaults(sdk.WrapSDKContext(*ctx), &vaultTypes.QueryAllVaultsRequest{}) + s.Require().NoError(err) + return len(res.Vault) +} + +func (s *KeeperTestSuite) GetBorrowsCount() int { + ctx := &s.ctx + res, err := s.lendQuerier.QueryBorrows(sdk.WrapSDKContext(*ctx), &lendtypes.QueryBorrowsRequest{}) + s.Require().NoError(err) + return len(res.Borrows) +} + +func (s *KeeperTestSuite) GetVaultCountForExtendedPairIDbyAppID(appID, extID uint64) int { + vaultKeeper, ctx := &s.vaultKeeper, &s.ctx + res, found := vaultKeeper.GetAppExtendedPairVaultMappingData(*ctx, appID, extID) + s.Require().True(found) + return len(res.VaultIds) +} + +func (s *KeeperTestSuite) ChangeOraclePrice(asset uint64) { + s.SetOraclePrice(asset, 1000000) +} + +func (s *KeeperTestSuite) ChangeOraclePrice1(asset uint64) { + s.SetOraclePrice(asset, 1800000) +} + +func (s *KeeperTestSuite) SetOraclePrice(assetID uint64, price uint64) { + market := markettypes.TimeWeightedAverage{ + AssetID: assetID, + ScriptID: 12, + Twa: price, + CurrentIndex: 0, + IsPriceActive: true, + PriceValue: []uint64{price}, + } + s.app.MarketKeeper.SetTwa(s.ctx, market) +} + +func (s *KeeperTestSuite) TestLiquidateVaults() { + liquidationKeeper, ctx := &s.liquidationKeeper, &s.ctx + s.CreateVault() + currentVaultsCount := 2 + s.Require().Equal(s.GetVaultCount(), currentVaultsCount) + s.Require().Equal(s.GetVaultCountForExtendedPairIDbyAppID(2, 1), currentVaultsCount) + beforeVault, found := s.vaultKeeper.GetVault(*ctx, 1) + s.Require().True(found) + + // Liquidation shouldn't happen as price not changed + err := liquidationKeeper.Liquidate(*ctx) + s.Require().NoError(err) + id := liquidationKeeper.GetLockedVaultID(*ctx) + s.Require().Equal(id, uint64(0)) + + // Liquidation should happen as price changed + s.ChangeOraclePrice(2) + err = liquidationKeeper.Liquidate(*ctx) + s.Require().NoError(err) + id = liquidationKeeper.GetLockedVaultID(*ctx) + s.Require().Equal(id, uint64(2)) + s.Require().Equal(s.GetVaultCount(), currentVaultsCount-2) + s.Require().Equal(s.GetVaultCountForExtendedPairIDbyAppID(2, 1), currentVaultsCount-2) + + lockedVault := liquidationKeeper.GetLockedVaults(*ctx) + s.Require().Equal(lockedVault[0].OriginalVaultId, beforeVault.Id) + s.Require().Equal(lockedVault[0].ExtendedPairId, beforeVault.ExtendedPairVaultID) + s.Require().Equal(lockedVault[0].Owner, beforeVault.Owner) + s.Require().Equal(lockedVault[0].CollateralToken.Amount, beforeVault.AmountIn) + s.Require().Equal(lockedVault[0].DebtToken.Amount, beforeVault.AmountOut) + s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(beforeVault.AmountOut.ToDec().Mul(newDec("0.12")).TruncateInt())) + s.Require().Equal(lockedVault[0].FeeToBeCollected, beforeVault.AmountOut.ToDec().Mul(newDec("0.12")).TruncateInt()) + s.Require().Equal(lockedVault[0].IsDebtCmst, false) + s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(2)) + s.Require().Equal(lockedVault[0].DebtAssetId, uint64(3)) + price, err := s.app.MarketKeeper.CalcAssetPrice(*ctx, 2, beforeVault.AmountIn) + s.Require().NoError(err) + s.Require().Equal(lockedVault[0].CollateralToBeAuctioned.Amount, price.TruncateInt()) + + // get auctions and tally them + auctions := s.app.NewaucKeeper.GetAuctions(s.ctx) + s.Require().Equal(len(auctions), 2) + s.Require().Equal(auctions[0].AppId, lockedVault[0].AppId) + s.Require().Equal(auctions[0].AuctionType, lockedVault[0].AuctionType) + s.Require().Equal(auctions[0].CollateralAssetId, lockedVault[0].CollateralAssetId) + s.Require().Equal(auctions[0].DebtAssetId, lockedVault[0].DebtAssetId) + s.Require().Equal(auctions[0].BonusAmount, lockedVault[0].BonusToBeGiven) + s.Require().Equal(auctions[0].LockedVaultId, lockedVault[0].LockedVaultId) + s.Require().Equal(auctions[0].CollateralToken, lockedVault[0].CollateralToken) + s.Require().Equal(auctions[0].DebtToken, lockedVault[0].TargetDebt) + + twaDataCollateral, _ := s.app.MarketKeeper.GetTwa(s.ctx, lockedVault[0].CollateralAssetId) + liquidationWhitelistingAppData, _ := s.app.NewliqKeeper.GetLiquidationWhiteListing(s.ctx, lockedVault[0].AppId) + CollateralTokenInitialPrice := s.app.NewaucKeeper.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), liquidationWhitelistingAppData.DutchAuctionParam.Premium) + s.Require().Equal(auctions[0].CollateralTokenAuctionPrice, CollateralTokenInitialPrice.Add(sdk.NewDecFromInt(sdk.NewIntFromUint64(twaDataCollateral.Twa)))) + +} + +func (s *KeeperTestSuite) TestLiquidateBorrows() { + liquidationKeeper, ctx := &s.liquidationKeeper, &s.ctx + s.AddAppAssets() + currentBorrowsCount := 2 + s.Require().Equal(s.GetBorrowsCount(), currentBorrowsCount) + + beforeBorrow, found := s.lendKeeper.GetBorrow(*ctx, 1) + s.Require().True(found) + + beforeLend, found := s.lendKeeper.GetLend(*ctx, beforeBorrow.LendingID) + s.Require().True(found) + + // Liquidation shouldn't happen as price not changed + err := liquidationKeeper.Liquidate(*ctx) + s.Require().NoError(err) + id := liquidationKeeper.GetLockedVaultID(*ctx) + s.Require().Equal(id, uint64(0)) + + assetStatsLend, _ := s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 1) + s.Require().Equal(len(assetStatsLend.LendIds), 2) + s.Require().Equal(len(assetStatsLend.BorrowIds), 0) + s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) + s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(13000000000)) + + assetStatsBorrow, _ := s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 2) + s.Require().Equal(len(assetStatsBorrow.LendIds), 1) + s.Require().Equal(len(assetStatsBorrow.BorrowIds), 2) + s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdk.NewInt(770000000)) + s.Require().Equal(assetStatsBorrow.TotalLend, sdk.NewInt(10000000000)) + + modBalInitial, _ := s.lendKeeper.GetModuleBalanceByPoolID(*ctx, 1) + + // Liquidation should happen as price changed + s.ChangeOraclePrice1(1) + err = liquidationKeeper.Liquidate(*ctx) + s.Require().NoError(err) + id = liquidationKeeper.GetLockedVaultID(*ctx) + s.Require().Equal(id, uint64(2)) + s.Require().Equal(s.GetBorrowsCount(), currentBorrowsCount) + + lockedVault := liquidationKeeper.GetLockedVaults(*ctx) + s.Require().Equal(lockedVault[0].OriginalVaultId, beforeBorrow.ID) + s.Require().Equal(lockedVault[0].ExtendedPairId, beforeBorrow.PairID) + s.Require().Equal(lockedVault[0].Owner, beforeLend.Owner) + s.Require().Equal(lockedVault[0].CollateralToken.Amount, beforeBorrow.AmountIn.Amount) + s.Require().Equal(lockedVault[0].DebtToken.Amount, beforeBorrow.AmountOut.Amount) + s.Require().Equal(lockedVault[0].TargetDebt.Amount, lockedVault[0].DebtToken.Amount.Add(beforeBorrow.AmountOut.Amount.ToDec().Mul(newDec("0.05")).TruncateInt())) + s.Require().Equal(lockedVault[0].FeeToBeCollected, beforeBorrow.AmountOut.Amount.ToDec().Mul(newDec("0.05")).TruncateInt()) + s.Require().Equal(lockedVault[0].IsDebtCmst, false) + s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(1)) + s.Require().Equal(lockedVault[0].DebtAssetId, uint64(2)) + + // get data of total borrow and lend and tally + assetStatsLend, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 1) + s.Require().Equal(len(assetStatsLend.LendIds), 2) + s.Require().Equal(len(assetStatsLend.BorrowIds), 0) + s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) + s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(13000000000)) + + assetStatsBorrow, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 2) + s.Require().Equal(len(assetStatsBorrow.LendIds), 1) + s.Require().Equal(len(assetStatsBorrow.BorrowIds), 2) + s.Require().Equal(assetStatsBorrow.TotalBorrowed, sdk.NewInt(0)) + s.Require().Equal(assetStatsBorrow.TotalLend, sdk.NewInt(10000000000)) + + afterBorrow, found := s.lendKeeper.GetBorrow(*ctx, 1) + s.Require().True(found) + s.Require().Equal(afterBorrow.IsLiquidated, true) + + modBalFinal, _ := s.lendKeeper.GetModuleBalanceByPoolID(*ctx, 1) + s.Require().Equal(modBalInitial.ModuleBalanceStats[0].Balance.Amount.Sub(modBalFinal.ModuleBalanceStats[0].Balance.Amount), sdk.NewInt(1100000000)) + + // get auctions and tally them + auctions := s.app.NewaucKeeper.GetAuctions(s.ctx) + s.Require().Equal(len(auctions), 2) + s.Require().Equal(auctions[0].AppId, lockedVault[0].AppId) + s.Require().Equal(auctions[0].AuctionType, lockedVault[0].AuctionType) + s.Require().Equal(auctions[0].CollateralAssetId, lockedVault[0].CollateralAssetId) + s.Require().Equal(auctions[0].DebtAssetId, lockedVault[0].DebtAssetId) + s.Require().Equal(auctions[0].BonusAmount, lockedVault[0].BonusToBeGiven) + s.Require().Equal(auctions[0].LockedVaultId, lockedVault[0].LockedVaultId) + s.Require().Equal(auctions[0].CollateralToken, lockedVault[0].CollateralToken) + s.Require().Equal(auctions[0].DebtToken, lockedVault[0].TargetDebt) + + twaDataCollateral, _ := s.app.MarketKeeper.GetTwa(s.ctx, lockedVault[0].CollateralAssetId) + liquidationWhitelistingAppData, _ := s.app.NewliqKeeper.GetLiquidationWhiteListing(s.ctx, lockedVault[0].AppId) + CollateralTokenInitialPrice := s.app.NewaucKeeper.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), liquidationWhitelistingAppData.DutchAuctionParam.Premium) + s.Require().Equal(auctions[0].CollateralTokenAuctionPrice, CollateralTokenInitialPrice.Add(sdk.NewDecFromInt(sdk.NewIntFromUint64(twaDataCollateral.Twa)))) +} + +func (s *KeeperTestSuite) TestPlaceMarketBidForVaults() { + s.TestLiquidateVaults() + //auctionKeeper := &s.keeper + bidder := "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7" + testCases := []struct { + Name string + Msg auctionsV2types.MsgPlaceMarketBidRequest + ExpErr error + ExpResp *auctionsV2types.MsgPlaceMarketBidResponse + }{ + { + Name: "auction does not exist", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 10, sdk.NewCoin("uasset2", sdk.NewInt(100000))), + ExpErr: sdkerrors.ErrNotFound, + ExpResp: nil, + }, + { + Name: "dust amount", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(1110000))), + ExpErr: auctionsV2types.ErrCannotLeaveDebtLessThanDust, + ExpResp: nil, + }, + { + Name: "success valid case partial", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(100000))), + ExpErr: nil, + ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, + }, + { + Name: "success valid case full", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(1020000))), + ExpErr: nil, + ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, + }, + } + + for _, tc := range testCases { + tc := tc + s.Run(tc.Name, func() { + + ctx := sdk.WrapSDKContext(s.ctx) + resp, err := s.auctionMsgServer.MsgPlaceMarketBid(ctx, &tc.Msg) + if tc.ExpErr != nil { + s.Require().Error(err) + s.Require().EqualError(err, tc.ExpErr.Error()) + s.Require().Equal(tc.ExpResp, resp) + } else { + s.Require().NoError(err) + s.Require().NotNil(resp) + s.Require().Equal(tc.ExpResp, resp) + + } + }) + } +} + +func (s *KeeperTestSuite) TestPlaceMarketBidForBorrows() { + s.TestLiquidateBorrows() + bidder := "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7" + testCases := []struct { + Name string + Msg auctionsV2types.MsgPlaceMarketBidRequest + ExpErr error + ExpResp *auctionsV2types.MsgPlaceMarketBidResponse + }{ + { + Name: "auction does not exist", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 10, sdk.NewCoin("uasset2", sdk.NewInt(100000))), + ExpErr: sdkerrors.ErrNotFound, + ExpResp: nil, + }, + { + Name: "dust amount", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset2", sdk.NewInt(73450000))), + ExpErr: auctionsV2types.ErrCannotLeaveDebtLessThanDust, + ExpResp: nil, + }, + { + Name: "success valid case partial", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset2", sdk.NewInt(53000000))), + ExpErr: nil, + ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, + }, + { + Name: "success valid case full", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset2", sdk.NewInt(20500000))), + ExpErr: nil, + ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, + }, + } + + for _, tc := range testCases { + tc := tc + s.Run(tc.Name, func() { + + ctx := sdk.WrapSDKContext(s.ctx) + resp, err := s.auctionMsgServer.MsgPlaceMarketBid(ctx, &tc.Msg) + if tc.ExpErr != nil { + s.Require().Error(err) + s.Require().EqualError(err, tc.ExpErr.Error()) + s.Require().Equal(tc.ExpResp, resp) + } else { + s.Require().NoError(err) + s.Require().NotNil(resp) + s.Require().Equal(tc.ExpResp, resp) + + } + }) + } +} + +func (s *KeeperTestSuite) TestDepositLimitBid() { + s.AddAppAssets() + auctionKeeper := &s.keeper + bidder := "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7" + + testCases := []struct { + Name string + Msg auctionsV2types.MsgDepositLimitBidRequest + ExpErr error + ExpResp *auctionsV2types.MsgDepositLimitBidResponse + }{ + { + Name: "asset does not exist", + Msg: *auctionsV2types.NewMsgDepositLimitBid(bidder, 10, 2, sdk.NewInt(2), sdk.NewCoin("uasset2", sdk.NewInt(1000000))), + ExpErr: assetTypes.ErrorAssetDoesNotExist, + ExpResp: nil, + }, + { + Name: "asset does not exist", + Msg: *auctionsV2types.NewMsgDepositLimitBid(bidder, 1, 20, sdk.NewInt(2), sdk.NewCoin("uasset2", sdk.NewInt(1000000))), + ExpErr: assetTypes.ErrorAssetDoesNotExist, + ExpResp: nil, + }, + { + Name: "asset denom does not exist", + Msg: *auctionsV2types.NewMsgDepositLimitBid(bidder, 1, 2, sdk.NewInt(2), sdk.NewCoin("uasset1", sdk.NewInt(1000000))), + ExpErr: auctionsV2types.ErrorUnknownDebtToken, + ExpResp: nil, + }, + { + Name: "success valid case", + Msg: *auctionsV2types.NewMsgDepositLimitBid(bidder, 1, 2, sdk.NewInt(2), sdk.NewCoin("uasset2", sdk.NewInt(1000000))), + ExpErr: nil, + ExpResp: &auctionsV2types.MsgDepositLimitBidResponse{}, + }, + } + for _, tc := range testCases { + tc := tc + s.Run(tc.Name, func() { + + ctx := sdk.WrapSDKContext(s.ctx) + resp, err := s.auctionMsgServer.MsgDepositLimitBid(ctx, &tc.Msg) + if tc.ExpErr != nil { + s.Require().Error(err) + s.Require().EqualError(err, tc.ExpErr.Error()) + s.Require().Equal(tc.ExpResp, resp) + } else { + s.Require().NoError(err) + s.Require().NotNil(resp) + s.Require().Equal(tc.ExpResp, resp) + + userLimitAuctionBid, found := auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdk.NewInt(2), bidder) + s.Require().Equal(found, true) + userLimitAuctionBidByPremium, found := auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 2, 1, sdk.NewInt(2)) + s.Require().Equal(found, true) + + s.Require().Equal(userLimitAuctionBid, userLimitAuctionBidByPremium[0]) + + } + }) + } + +} + +func (s *KeeperTestSuite) TestCancelLimitBid() { + s.TestDepositLimitBid() + bidder := "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7" + + auctionKeeper := &s.keeper + id := auctionKeeper.GetLimitAuctionBidID(s.ctx) + s.Require().Equal(id, uint64(1)) + _, found := auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdk.NewInt(2), bidder) + s.Require().Equal(found, true) + + testCases := []struct { + Name string + Msg auctionsV2types.MsgCancelLimitBidRequest + ExpErr error + ExpResp *auctionsV2types.MsgCancelLimitBidResponse + }{ + { + Name: "asset does not exist", + Msg: *auctionsV2types.NewMsgCancelLimitBid(bidder, 10, 2, sdk.NewInt(2)), + ExpErr: auctionsV2types.ErrBidNotFound, + ExpResp: nil, + }, + { + Name: "success valid case", + Msg: *auctionsV2types.NewMsgCancelLimitBid(bidder, 1, 2, sdk.NewInt(2)), + ExpErr: nil, + ExpResp: &auctionsV2types.MsgCancelLimitBidResponse{}, + }, + } + for _, tc := range testCases { + tc := tc + s.Run(tc.Name, func() { + + ctx := sdk.WrapSDKContext(s.ctx) + resp, err := s.auctionMsgServer.MsgCancelLimitBid(ctx, &tc.Msg) + if tc.ExpErr != nil { + s.Require().Error(err) + s.Require().EqualError(err, tc.ExpErr.Error()) + s.Require().Equal(tc.ExpResp, resp) + } else { + s.Require().NoError(err) + s.Require().NotNil(resp) + s.Require().Equal(tc.ExpResp, resp) + + _, found = auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdk.NewInt(2), bidder) + s.Require().Equal(found, false) + _, found = auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 2, 1, sdk.NewInt(2)) + s.Require().Equal(found, false) + } + }) + } + +} + +func (s *KeeperTestSuite) TestWithdrawLimitBid() { + s.TestDepositLimitBid() + bidder := "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7" + + auctionKeeper := &s.keeper + id := auctionKeeper.GetLimitAuctionBidID(s.ctx) + s.Require().Equal(id, uint64(1)) + _, found := auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdk.NewInt(2), bidder) + s.Require().Equal(found, true) + + testCases := []struct { + Name string + Msg auctionsV2types.MsgWithdrawLimitBidRequest + ExpErr error + ExpResp *auctionsV2types.MsgWithdrawLimitBidResponse + }{ + { + Name: "asset does not exist", + Msg: *auctionsV2types.NewMsgWithdrawLimitBid(bidder, 10, 2, sdk.NewInt(2), sdk.NewCoin("uasset2", sdk.NewInt(500000))), + ExpErr: auctionsV2types.ErrBidNotFound, + ExpResp: nil, + }, + { + Name: "success valid case", + Msg: *auctionsV2types.NewMsgWithdrawLimitBid(bidder, 1, 2, sdk.NewInt(2), sdk.NewCoin("uasset2", sdk.NewInt(500000))), + ExpErr: nil, + ExpResp: &auctionsV2types.MsgWithdrawLimitBidResponse{}, + }, + } + for _, tc := range testCases { + tc := tc + s.Run(tc.Name, func() { + + ctx := sdk.WrapSDKContext(s.ctx) + resp, err := s.auctionMsgServer.MsgWithdrawLimitBid(ctx, &tc.Msg) + if tc.ExpErr != nil { + s.Require().Error(err) + s.Require().EqualError(err, tc.ExpErr.Error()) + s.Require().Equal(tc.ExpResp, resp) + } else { + s.Require().NoError(err) + s.Require().NotNil(resp) + s.Require().Equal(tc.ExpResp, resp) + + GetUserLimitBidData, found := auctionKeeper.GetUserLimitBidData(s.ctx, 2, 1, sdk.NewInt(2), bidder) + s.Require().Equal(found, true) + s.Require().Equal(GetUserLimitBidData.DebtToken.Amount, sdk.NewInt(500000)) + + _, found = auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 2, 1, sdk.NewInt(2)) + s.Require().Equal(found, true) + } + }) + } +} diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index 7b812a719..b0b785780 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -19,4 +19,5 @@ var ( ErrBidNotFound = sdkerrors.Register(ModuleName, 709, "There exists no active bid for the user with given params") ErrAuctionParamsNotFound = sdkerrors.Register(ModuleName, 710, "There exists no auction params") ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 711, "unknown proposal type") + ErrorUnknownDebtToken = sdkerrors.Register(ModuleName, 712, "Bid token is not the debt token") ) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 9cfb0005f..c02b1719e 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -2,11 +2,10 @@ package keeper import ( "fmt" - assettypes "github.com/comdex-official/comdex/x/asset/types" - lendtypes "github.com/comdex-official/comdex/x/lend/types" - utils "github.com/comdex-official/comdex/types" + assettypes "github.com/comdex-official/comdex/x/asset/types" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" + lendtypes "github.com/comdex-official/comdex/x/lend/types" "github.com/comdex-official/comdex/x/liquidationsV2/types" rewardstypes "github.com/comdex-official/comdex/x/rewards/types" vaulttypes "github.com/comdex-official/comdex/x/vault/types" @@ -114,10 +113,10 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64, liquid return fmt.Errorf("error Calculating vault interest in Liquidation, liquidate_vaults.go for vaultID %d", vault.Id) } //Calling vault to use the updated values of the vault - vault, _ := k.vault.GetVault(ctx, vault.Id) + vault, _ = k.vault.GetVault(ctx, vault.Id) - totalOut := vault.AmountOut.Add(vault.InterestAccumulated).Add(vault.ClosingFeeAccumulated) - collateralizationRatio, err := k.vault.CalculateCollateralizationRatio(ctx, vault.ExtendedPairVaultID, vault.AmountIn, totalOut) + totalOut = vault.AmountOut.Add(vault.InterestAccumulated).Add(vault.ClosingFeeAccumulated) + collateralizationRatio, err = k.vault.CalculateCollateralizationRatio(ctx, vault.ExtendedPairVaultID, vault.AmountIn, totalOut) if err != nil { return fmt.Errorf("error Calculating CR in Liquidation, liquidate_vaults.go for vaultID %d", vault.Id) } @@ -125,7 +124,7 @@ func (k Keeper) LiquidateIndividualVault(ctx sdk.Context, vaultID uint64, liquid feesToBeCollected := sdk.NewDecFromInt(totalOut).Mul(extPair.LiquidationPenalty).TruncateInt() //Calculating auction bonus to be given - auctionBonusToBeGiven := sdk.NewDecFromInt(totalOut).Mul(extPair.LiquidationPenalty).TruncateInt() + auctionBonusToBeGiven := sdk.ZeroInt() //Checking if the vault getting liquidated is a cmst based vault or not //This is primarily to infer that primary market will consider cmst at $1 at the time of buying it @@ -364,7 +363,7 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsse return err } - err = k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, borrow.AmountIn, borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, isInternalkeeper, liquidator, "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false, pair.AssetIn, pair.AssetOut) + err = k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, sdk.NewCoin(assetIn.Denom, borrow.AmountIn.Amount), borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, isInternalkeeper, liquidator, "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false, pair.AssetIn, pair.AssetOut) if err != nil { return err } @@ -676,7 +675,6 @@ func (k Keeper) MsgLiquidateExternal(ctx sdk.Context, from string, appID uint64, } func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData types.LockedVault, auctionData auctionsV2types.Auction) error { - //TODO: // send money back to the debt pool (assetOut pool) // liquidation penalty to the reserve and interest to the pool // send token to the bidder @@ -687,7 +685,7 @@ func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData t pair, _ := k.lend.GetLendPair(ctx, borrowPos.PairID) pool, _ := k.lend.GetPool(ctx, pair.AssetOutPoolID) poolAssetLBMappingData, _ := k.lend.GetAssetStatsByPoolIDAndAssetID(ctx, pair.AssetOutPoolID, pair.AssetOut) - amountToPool := auctionData.DebtToken // subtract liquidation penalty and interest after sending all the collateral to pool + amountToPool := liquidationData.DebtToken assetOutStats, _ := k.lend.GetAssetRatesParams(ctx, pair.AssetOut) cAsset, _ := k.asset.GetAsset(ctx, assetOutStats.CAssetID) From c996f6efae5a11e393385e94971caa96ce6dc4b2 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 28 Jun 2023 12:54:20 +0530 Subject: [PATCH 104/155] english auction testcase --- x/auctionsV2/keeper/auctions.go | 12 +- x/auctionsV2/keeper/auctions_test.go | 149 ++++++++++++++++ x/auctionsV2/keeper/bid.go | 7 +- x/auctionsV2/keeper/msg_server.go | 1 - x/auctionsV2/keeper/msg_server_test.go | 193 +++++++++++++++++++++ x/liquidationsV2/keeper/keeper_test.go | 3 + x/liquidationsV2/keeper/liquidate.go | 8 +- x/liquidationsV2/keeper/msg_server_test.go | 190 ++++++++++++++++++++ 8 files changed, 549 insertions(+), 14 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index fa132db8a..914ba06a1 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -125,11 +125,13 @@ func (k Keeper) EnglishAuctionActivator(ctx sdk.Context, liquidationData liquida // CollateralTokenAuctionPrice: CollateralTokenInitialPrice, // CollateralTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))), // DebtTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))), - LockedVaultId: liquidationData.LockedVaultId, - StartTime: ctx.BlockTime(), - EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), - AppId: liquidationData.AppId, - AuctionType: liquidationData.AuctionType, + LockedVaultId: liquidationData.LockedVaultId, + StartTime: ctx.BlockTime(), + EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), + AppId: liquidationData.AppId, + AuctionType: liquidationData.AuctionType, + CollateralAssetId: liquidationData.CollateralAssetId, + DebtAssetId: liquidationData.DebtAssetId, } k.SetAuctionID(ctx, auctionData.AuctionId) err := k.SetAuction(ctx, auctionData) diff --git a/x/auctionsV2/keeper/auctions_test.go b/x/auctionsV2/keeper/auctions_test.go index 942926490..91d7caff6 100644 --- a/x/auctionsV2/keeper/auctions_test.go +++ b/x/auctionsV2/keeper/auctions_test.go @@ -1 +1,150 @@ package keeper_test + +import ( + "github.com/comdex-official/comdex/app/wasm/bindings" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (s *KeeperTestSuite) WasmSetCollectorLookupTableAndAuctionControlForSurplus() { + // userAddress := "cosmos1q7q90qsl9g0gl2zz0njxwv2a649yqrtyxtnv3v" + collectorKeeper, ctx := &s.collectorKeeper, &s.ctx + + for _, tc := range []struct { + name string + msg bindings.MsgSetCollectorLookupTable + }{ + { + "Wasm Add MsgSetCollectorLookupTable AppID 2 CollectorAssetID 2", + bindings.MsgSetCollectorLookupTable{ + AppID: 2, + CollectorAssetID: 2, + SecondaryAssetID: 3, + SurplusThreshold: sdk.NewInt(10000000), + DebtThreshold: sdk.NewInt(5000000), + LockerSavingRate: sdk.MustNewDecFromStr("0.1"), + LotSize: sdk.NewInt(200000), + BidFactor: sdk.MustNewDecFromStr("0.01"), + DebtLotSize: sdk.NewInt(2000000), + }, + }, + } { + s.Run(tc.name, func() { + err := collectorKeeper.WasmSetCollectorLookupTable(*ctx, &tc.msg) + s.Require().NoError(err) + result, found := collectorKeeper.GetCollectorLookupTable(*ctx, tc.msg.AppID, tc.msg.CollectorAssetID) + s.Require().True(found) + s.Require().Equal(result.AppId, tc.msg.AppID) + s.Require().Equal(result.CollectorAssetId, tc.msg.CollectorAssetID) + s.Require().Equal(result.SecondaryAssetId, tc.msg.SecondaryAssetID) + s.Require().Equal(result.SurplusThreshold, tc.msg.SurplusThreshold) + s.Require().Equal(result.DebtThreshold, tc.msg.DebtThreshold) + s.Require().Equal(result.LockerSavingRate, tc.msg.LockerSavingRate) + s.Require().Equal(result.LotSize, tc.msg.LotSize) + s.Require().Equal(result.BidFactor, tc.msg.BidFactor) + s.Require().Equal(result.DebtLotSize, tc.msg.DebtLotSize) + }) + } + // s.AddAuctionParams() + for _, tc := range []struct { + name string + msg bindings.MsgSetAuctionMappingForApp + }{ + { + "Wasm Add Auction Control AppID 2 AssetID 2", + bindings.MsgSetAuctionMappingForApp{ + AppID: 2, + AssetIDs: uint64(2), + IsSurplusAuctions: true, + IsDebtAuctions: false, + IsDistributor: false, + AssetOutOraclePrices: false, + AssetOutPrices: uint64(1000000), + }, + }, + } { + s.Run(tc.name, func() { + err := collectorKeeper.WasmSetAuctionMappingForApp(*ctx, &tc.msg) + s.Require().NoError(err) + result1, found := collectorKeeper.GetAuctionMappingForApp(*ctx, tc.msg.AppID, tc.msg.AssetIDs) + s.Require().True(found) + s.Require().Equal(result1.AssetId, tc.msg.AssetIDs) + s.Require().Equal(result1.IsSurplusAuction, tc.msg.IsSurplusAuctions) + s.Require().Equal(result1.IsDebtAuction, tc.msg.IsDebtAuctions) + s.Require().Equal(result1.IsDistributor, tc.msg.IsDistributor) + s.Require().Equal(result1.IsAuctionActive, false) + s.Require().Equal(result1.AssetOutOraclePrice, tc.msg.AssetOutOraclePrices) + s.Require().Equal(result1.AssetOutPrice, tc.msg.AssetOutPrices) + }) + } +} + +func (s *KeeperTestSuite) WasmSetCollectorLookupTableAndAuctionControlForDebt() { + collectorKeeper, ctx := &s.collectorKeeper, &s.ctx + + for _, tc := range []struct { + name string + msg bindings.MsgSetCollectorLookupTable + }{ + { + "Wasm Add MsgSetCollectorLookupTable AppID 2 CollectorAssetID 2", + bindings.MsgSetCollectorLookupTable{ + AppID: 2, + CollectorAssetID: 2, + SecondaryAssetID: 3, + SurplusThreshold: sdk.NewInt(10000000), + DebtThreshold: sdk.NewInt(5000000), + LockerSavingRate: sdk.MustNewDecFromStr("0.1"), + LotSize: sdk.NewInt(200000), + BidFactor: sdk.MustNewDecFromStr("0.01"), + DebtLotSize: sdk.NewInt(2000000), + }, + }, + } { + s.Run(tc.name, func() { + err := collectorKeeper.WasmSetCollectorLookupTable(*ctx, &tc.msg) + s.Require().NoError(err) + result, found := collectorKeeper.GetCollectorLookupTable(*ctx, tc.msg.AppID, tc.msg.CollectorAssetID) + s.Require().True(found) + s.Require().Equal(result.AppId, tc.msg.AppID) + s.Require().Equal(result.CollectorAssetId, tc.msg.CollectorAssetID) + s.Require().Equal(result.SecondaryAssetId, tc.msg.SecondaryAssetID) + s.Require().Equal(result.SurplusThreshold, tc.msg.SurplusThreshold) + s.Require().Equal(result.DebtThreshold, tc.msg.DebtThreshold) + s.Require().Equal(result.LockerSavingRate, tc.msg.LockerSavingRate) + s.Require().Equal(result.LotSize, tc.msg.LotSize) + s.Require().Equal(result.BidFactor, tc.msg.BidFactor) + s.Require().Equal(result.DebtLotSize, tc.msg.DebtLotSize) + }) + } + for _, tc := range []struct { + name string + msg bindings.MsgSetAuctionMappingForApp + }{ + { + "Wasm Add Auction Control AppID 2 AssetID 2", + bindings.MsgSetAuctionMappingForApp{ + AppID: 2, + AssetIDs: uint64(2), + IsSurplusAuctions: false, + IsDebtAuctions: true, + IsDistributor: false, + AssetOutOraclePrices: false, + AssetOutPrices: uint64(1000000), + }, + }, + } { + s.Run(tc.name, func() { + err := collectorKeeper.WasmSetAuctionMappingForApp(*ctx, &tc.msg) + s.Require().NoError(err) + result1, found := collectorKeeper.GetAuctionMappingForApp(*ctx, tc.msg.AppID, tc.msg.AssetIDs) + s.Require().True(found) + s.Require().Equal(result1.AssetId, tc.msg.AssetIDs) + s.Require().Equal(result1.IsSurplusAuction, tc.msg.IsSurplusAuctions) + s.Require().Equal(result1.IsDebtAuction, tc.msg.IsDebtAuctions) + s.Require().Equal(result1.IsDistributor, tc.msg.IsDistributor) + s.Require().Equal(result1.IsAuctionActive, false) + s.Require().Equal(result1.AssetOutOraclePrice, tc.msg.AssetOutOraclePrices) + s.Require().Equal(result1.AssetOutPrice, tc.msg.AssetOutPrices) + }) + } +} diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 5d02397fc..66e069fbe 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -323,14 +323,15 @@ func (k Keeper) PlaceEnglishAuctionBid(ctx sdk.Context, auctionID uint64, bidder change := auctionParams.BidFactor.MulInt(tokenLastBid.Amount).Ceil().TruncateInt() bidAmount := tokenLastBid.Amount.Add(change) - if bid.Amount.LT(bidAmount) { - return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be less than or equal to %d ", bidAmount.Uint64()) - } if liquidationData.InitiatorType == "debt" { bidAmount = tokenLastBid.Amount.Sub(change) if bid.Amount.GT(bidAmount) { return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be less than or equal to %d ", bidAmount.Uint64()) } + } else { + if bid.Amount.LT(bidAmount) { + return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "bid should be greater than or equal to %d ", bidAmount.Uint64()) + } } } else { if liquidationData.InitiatorType != "debt" && bid.Amount.LT(tokenLastBid.Amount) { diff --git a/x/auctionsV2/keeper/msg_server.go b/x/auctionsV2/keeper/msg_server.go index cee71850a..7ded10923 100644 --- a/x/auctionsV2/keeper/msg_server.go +++ b/x/auctionsV2/keeper/msg_server.go @@ -27,7 +27,6 @@ func (k msgServer) MsgPlaceMarketBid(goCtx context.Context, msg *types.MsgPlaceM } auctionData, err := k.GetAuction(ctx, msg.AuctionId) if err != nil { - return nil, err } //From auction ID, checking the whether its an english or a dutch auction diff --git a/x/auctionsV2/keeper/msg_server_test.go b/x/auctionsV2/keeper/msg_server_test.go index 435e0629a..7e3cb4e8a 100644 --- a/x/auctionsV2/keeper/msg_server_test.go +++ b/x/auctionsV2/keeper/msg_server_test.go @@ -1,9 +1,11 @@ package keeper_test import ( + "fmt" "github.com/comdex-official/comdex/app/wasm/bindings" assetTypes "github.com/comdex-official/comdex/x/asset/types" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" + collectortypes "github.com/comdex-official/comdex/x/collector/types" lendKeeper "github.com/comdex-official/comdex/x/lend/keeper" lendtypes "github.com/comdex-official/comdex/x/lend/types" "github.com/comdex-official/comdex/x/liquidationsV2/types" @@ -686,3 +688,194 @@ func (s *KeeperTestSuite) TestWithdrawLimitBid() { }) } } + +func (s *KeeperTestSuite) TestDebtActivator() { + collectorKeeper := &s.collectorKeeper + liquidationKeeper := &s.liquidationKeeper + s.AddAppAssets() + s.WasmSetCollectorLookupTableAndAuctionControlForDebt() + + err := collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdk.NewIntFromUint64(4700000)) + s.Require().NoError(err) + k, ctx := &s.liquidationKeeper, &s.ctx + err = k.Liquidate(*ctx) + s.Require().NoError(err) + lockedVault := liquidationKeeper.GetLockedVaults(s.ctx) + s.Require().Equal(lockedVault[0].OriginalVaultId, uint64(0)) + s.Require().Equal(lockedVault[0].ExtendedPairId, uint64(0)) + s.Require().Equal(lockedVault[0].Owner, "") + s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(2)) + s.Require().Equal(lockedVault[0].DebtAssetId, uint64(3)) + s.Require().Equal(lockedVault[0].InitiatorType, "debt") + +} + +func (s *KeeperTestSuite) TestSurplusActivator() { + collectorKeeper := &s.collectorKeeper + liquidationKeeper := &s.liquidationKeeper + s.AddAppAssets() + s.WasmSetCollectorLookupTableAndAuctionControlForSurplus() + err := s.app.BankKeeper.MintCoins(s.ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(10000000)))) + s.Require().NoError(err) + err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(10000000)))) + s.Require().NoError(err) + + err = collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdk.NewIntFromUint64(100000000)) + s.Require().NoError(err) + k, ctx := &s.liquidationKeeper, &s.ctx + err = k.Liquidate(*ctx) + s.Require().NoError(err) + lockedVault := liquidationKeeper.GetLockedVaults(s.ctx) + s.Require().Equal(lockedVault[0].OriginalVaultId, uint64(0)) + s.Require().Equal(lockedVault[0].ExtendedPairId, uint64(0)) + s.Require().Equal(lockedVault[0].Owner, "") + s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(2)) + s.Require().Equal(lockedVault[0].DebtAssetId, uint64(3)) + s.Require().Equal(lockedVault[0].InitiatorType, "surplus") +} + +func (s *KeeperTestSuite) TestDebtAuctionBid() { + s.TestDebtActivator() + bidder := "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7" + + testCases := []struct { + Name string + Msg auctionsV2types.MsgPlaceMarketBidRequest + ExpErr error + ExpResp *auctionsV2types.MsgPlaceMarketBidResponse + }{ + { + Name: "auction does not exist", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 10, sdk.NewCoin("uasset2", sdk.NewInt(100000))), + ExpErr: sdkerrors.ErrNotFound, + ExpResp: nil, + }, + { + Name: "bidding amount is greater than maximum bidding amount", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset2", sdk.NewInt(53000000))), + ExpErr: auctionsV2types.ErrorMaxBidAmount, + ExpResp: nil, + }, + { + Name: "success valid case", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset2", sdk.NewInt(200000))), + ExpErr: nil, + ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, + }, + { + Name: "bid should be less than or equal to 180000", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset2", sdk.NewInt(200000))), + ExpErr: fmt.Errorf("bid should be less than or equal to 180000 : not found"), + ExpResp: nil, + }, + { + Name: "success valid case 2", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset2", sdk.NewInt(180000))), + ExpErr: nil, + ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, + }, + } + + for _, tc := range testCases { + tc := tc + s.Run(tc.Name, func() { + + ctx := sdk.WrapSDKContext(s.ctx) + resp, err := s.auctionMsgServer.MsgPlaceMarketBid(ctx, &tc.Msg) + if tc.ExpErr != nil { + s.Require().Error(err) + s.Require().EqualError(err, tc.ExpErr.Error()) + s.Require().Equal(tc.ExpResp, resp) + } else { + s.Require().NoError(err) + s.Require().NotNil(resp) + s.Require().Equal(tc.ExpResp, resp) + + } + }) + } + + //auctionKeeper := &s.keeper + //debtAuction := auctionKeeper.GetAuctions(s.ctx) + //fmt.Println("debtAuction", debtAuction) + //fmt.Println("debtAuction[0].AuctionId", debtAuction[0].AuctionId) + //fmt.Println("debtAuction[0].CollateralToken", debtAuction[0].CollateralToken) + //fmt.Println("debtAuction[0].DebtToken", debtAuction[0].DebtToken) + //fmt.Println("debtAuction[0].ActiveBiddingId", debtAuction[0].ActiveBiddingId) + //fmt.Println("debtAuction[0].BiddingIds", debtAuction[0].BiddingIds) + //fmt.Println("debtAuction[0].CollateralTokenAuctionPrice", debtAuction[0].CollateralTokenAuctionPrice) + //fmt.Println("debtAuction[0].CollateralTokenOraclePrice", debtAuction[0].CollateralTokenOraclePrice) + //fmt.Println("debtAuction[0].DebtTokenOraclePrice", debtAuction[0].DebtTokenOraclePrice) + //fmt.Println("debtAuction[0].LockedVaultId", debtAuction[0].LockedVaultId) + //fmt.Println("debtAuction[0].StartTime", debtAuction[0].StartTime) + //fmt.Println("debtAuction[0].EndTime", debtAuction[0].EndTime) + //fmt.Println("debtAuction[0].AppId", debtAuction[0].AppId) + //fmt.Println("debtAuction[0].AuctionType", debtAuction[0].AuctionType) + //fmt.Println("debtAuction[0].CollateralAssetId", debtAuction[0].CollateralAssetId) + //fmt.Println("debtAuction[0].DebtAssetId", debtAuction[0].DebtAssetId) + //fmt.Println("debtAuction[0].BonusAmount", debtAuction[0].BonusAmount) + +} + +func (s *KeeperTestSuite) TestSurplusAuctionBid() { + s.TestSurplusActivator() + bidder := "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7" + + testCases := []struct { + Name string + Msg auctionsV2types.MsgPlaceMarketBidRequest + ExpErr error + ExpResp *auctionsV2types.MsgPlaceMarketBidResponse + }{ + { + Name: "auction does not exist", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 10, sdk.NewCoin("uasset3", sdk.NewInt(100000))), + ExpErr: sdkerrors.ErrNotFound, + ExpResp: nil, + }, + //{ + // Name: "bidding amount is lower than minimum bidding amount", + // Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(5300))), + // ExpErr: auctionsV2types.ErrorLowBidAmount, + // ExpResp: nil, + //}, + { + Name: "success valid case", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(200000))), + ExpErr: nil, + ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, + }, + { + Name: "bid should be greater than or equal to 220000", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(200000))), + ExpErr: fmt.Errorf("bid should be greater than or equal to 220000 : not found"), + ExpResp: nil, + }, + { + Name: "success valid case 2", + Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(220000))), + ExpErr: nil, + ExpResp: &auctionsV2types.MsgPlaceMarketBidResponse{}, + }, + } + + for _, tc := range testCases { + tc := tc + s.Run(tc.Name, func() { + + ctx := sdk.WrapSDKContext(s.ctx) + resp, err := s.auctionMsgServer.MsgPlaceMarketBid(ctx, &tc.Msg) + if tc.ExpErr != nil { + s.Require().Error(err) + s.Require().EqualError(err, tc.ExpErr.Error()) + s.Require().Equal(tc.ExpResp, resp) + } else { + s.Require().NoError(err) + s.Require().NotNil(resp) + s.Require().Equal(tc.ExpResp, resp) + + } + }) + } + +} diff --git a/x/liquidationsV2/keeper/keeper_test.go b/x/liquidationsV2/keeper/keeper_test.go index 6166a008d..0a898da47 100644 --- a/x/liquidationsV2/keeper/keeper_test.go +++ b/x/liquidationsV2/keeper/keeper_test.go @@ -6,6 +6,7 @@ import ( assettypes "github.com/comdex-official/comdex/x/asset/types" auctionsV2Keeper "github.com/comdex-official/comdex/x/auctionsV2/keeper" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" + collectKeeper "github.com/comdex-official/comdex/x/collector/keeper" lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" lendtypes "github.com/comdex-official/comdex/x/lend/types" liquidationKeeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper" @@ -37,6 +38,7 @@ type KeeperTestSuite struct { lendQuerier lendkeeper.QueryServer auctionsV2Keeper auctionsV2Keeper.Keeper auctionsV2MsgServer auctionsV2types.MsgServer + collectorKeeper collectKeeper.Keeper } func TestKeeperTestSuite(t *testing.T) { @@ -58,6 +60,7 @@ func (s *KeeperTestSuite) SetupTest() { s.lendQuerier = lendkeeper.QueryServer{Keeper: s.lendKeeper} s.auctionsV2Keeper = s.app.NewaucKeeper s.auctionsV2MsgServer = auctionsV2Keeper.NewMsgServerImpl(s.auctionsV2Keeper) + s.collectorKeeper = s.app.CollectorKeeper } func (s *KeeperTestSuite) CreateNewAsset(name, denom string, twa uint64) uint64 { diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index c02b1719e..54198cef7 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -383,10 +383,8 @@ func (k Keeper) MsgLiquidate(ctx sdk.Context, liquidator string, liqType, id uin if err != nil { return err } - } else { - // TODO: for other apps } - // TODO: send liquidation bonus to liquidator address logic + return nil } @@ -453,7 +451,7 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint if netFeeCollectedData.NetFeesCollected.LTE(collector.DebtThreshold.Sub(collector.LotSize)) { // net = 200 debtThreshold = 500 , lotSize = 100 collateralToken, debtToken := k.DebtTokenAmount(ctx, collateralAssetID, debtAssetID, collector.LotSize, collector.DebtLotSize) - err := k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, false, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "debt", false, true, collateralAssetID, collateralAssetID) + err := k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, false, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "debt", false, true, collateralAssetID, debtAssetID) if err != nil { return err } @@ -470,7 +468,7 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint if err != nil { return err } - err = k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, false, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "surplus", false, false, collateralAssetID, collateralAssetID) + err = k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, false, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "surplus", false, false, collateralAssetID, debtAssetID) if err != nil { return err } diff --git a/x/liquidationsV2/keeper/msg_server_test.go b/x/liquidationsV2/keeper/msg_server_test.go index e2c79fa20..a8e7590c9 100644 --- a/x/liquidationsV2/keeper/msg_server_test.go +++ b/x/liquidationsV2/keeper/msg_server_test.go @@ -5,6 +5,7 @@ import ( "github.com/comdex-official/comdex/app/wasm/bindings" assetTypes "github.com/comdex-official/comdex/x/asset/types" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" + collectortypes "github.com/comdex-official/comdex/x/collector/types" lendKeeper "github.com/comdex-official/comdex/x/lend/keeper" lendtypes "github.com/comdex-official/comdex/x/lend/types" "github.com/comdex-official/comdex/x/liquidationsV2/types" @@ -688,3 +689,192 @@ func (s *KeeperTestSuite) TestLiquidateExternal() { }) } } + +func (s *KeeperTestSuite) WasmSetCollectorLookupTableAndAuctionControlForSurplus() { + // userAddress := "cosmos1q7q90qsl9g0gl2zz0njxwv2a649yqrtyxtnv3v" + collectorKeeper, ctx := &s.collectorKeeper, &s.ctx + + for _, tc := range []struct { + name string + msg bindings.MsgSetCollectorLookupTable + }{ + { + "Wasm Add MsgSetCollectorLookupTable AppID 2 CollectorAssetID 2", + bindings.MsgSetCollectorLookupTable{ + AppID: 2, + CollectorAssetID: 2, + SecondaryAssetID: 3, + SurplusThreshold: sdk.NewInt(10000000), + DebtThreshold: sdk.NewInt(5000000), + LockerSavingRate: sdk.MustNewDecFromStr("0.1"), + LotSize: sdk.NewInt(200000), + BidFactor: sdk.MustNewDecFromStr("0.01"), + DebtLotSize: sdk.NewInt(2000000), + }, + }, + } { + s.Run(tc.name, func() { + err := collectorKeeper.WasmSetCollectorLookupTable(*ctx, &tc.msg) + s.Require().NoError(err) + result, found := collectorKeeper.GetCollectorLookupTable(*ctx, tc.msg.AppID, tc.msg.CollectorAssetID) + s.Require().True(found) + s.Require().Equal(result.AppId, tc.msg.AppID) + s.Require().Equal(result.CollectorAssetId, tc.msg.CollectorAssetID) + s.Require().Equal(result.SecondaryAssetId, tc.msg.SecondaryAssetID) + s.Require().Equal(result.SurplusThreshold, tc.msg.SurplusThreshold) + s.Require().Equal(result.DebtThreshold, tc.msg.DebtThreshold) + s.Require().Equal(result.LockerSavingRate, tc.msg.LockerSavingRate) + s.Require().Equal(result.LotSize, tc.msg.LotSize) + s.Require().Equal(result.BidFactor, tc.msg.BidFactor) + s.Require().Equal(result.DebtLotSize, tc.msg.DebtLotSize) + }) + } + // s.AddAuctionParams() + for _, tc := range []struct { + name string + msg bindings.MsgSetAuctionMappingForApp + }{ + { + "Wasm Add Auction Control AppID 2 AssetID 2", + bindings.MsgSetAuctionMappingForApp{ + AppID: 2, + AssetIDs: uint64(2), + IsSurplusAuctions: true, + IsDebtAuctions: false, + IsDistributor: false, + AssetOutOraclePrices: false, + AssetOutPrices: uint64(1000000), + }, + }, + } { + s.Run(tc.name, func() { + err := collectorKeeper.WasmSetAuctionMappingForApp(*ctx, &tc.msg) + s.Require().NoError(err) + result1, found := collectorKeeper.GetAuctionMappingForApp(*ctx, tc.msg.AppID, tc.msg.AssetIDs) + s.Require().True(found) + s.Require().Equal(result1.AssetId, tc.msg.AssetIDs) + s.Require().Equal(result1.IsSurplusAuction, tc.msg.IsSurplusAuctions) + s.Require().Equal(result1.IsDebtAuction, tc.msg.IsDebtAuctions) + s.Require().Equal(result1.IsDistributor, tc.msg.IsDistributor) + s.Require().Equal(result1.IsAuctionActive, false) + s.Require().Equal(result1.AssetOutOraclePrice, tc.msg.AssetOutOraclePrices) + s.Require().Equal(result1.AssetOutPrice, tc.msg.AssetOutPrices) + }) + } +} + +func (s *KeeperTestSuite) WasmSetCollectorLookupTableAndAuctionControlForDebt() { + collectorKeeper, ctx := &s.collectorKeeper, &s.ctx + + for _, tc := range []struct { + name string + msg bindings.MsgSetCollectorLookupTable + }{ + { + "Wasm Add MsgSetCollectorLookupTable AppID 2 CollectorAssetID 2", + bindings.MsgSetCollectorLookupTable{ + AppID: 2, + CollectorAssetID: 2, + SecondaryAssetID: 3, + SurplusThreshold: sdk.NewInt(10000000), + DebtThreshold: sdk.NewInt(5000000), + LockerSavingRate: sdk.MustNewDecFromStr("0.1"), + LotSize: sdk.NewInt(200000), + BidFactor: sdk.MustNewDecFromStr("0.01"), + DebtLotSize: sdk.NewInt(2000000), + }, + }, + } { + s.Run(tc.name, func() { + err := collectorKeeper.WasmSetCollectorLookupTable(*ctx, &tc.msg) + s.Require().NoError(err) + result, found := collectorKeeper.GetCollectorLookupTable(*ctx, tc.msg.AppID, tc.msg.CollectorAssetID) + s.Require().True(found) + s.Require().Equal(result.AppId, tc.msg.AppID) + s.Require().Equal(result.CollectorAssetId, tc.msg.CollectorAssetID) + s.Require().Equal(result.SecondaryAssetId, tc.msg.SecondaryAssetID) + s.Require().Equal(result.SurplusThreshold, tc.msg.SurplusThreshold) + s.Require().Equal(result.DebtThreshold, tc.msg.DebtThreshold) + s.Require().Equal(result.LockerSavingRate, tc.msg.LockerSavingRate) + s.Require().Equal(result.LotSize, tc.msg.LotSize) + s.Require().Equal(result.BidFactor, tc.msg.BidFactor) + s.Require().Equal(result.DebtLotSize, tc.msg.DebtLotSize) + }) + } + for _, tc := range []struct { + name string + msg bindings.MsgSetAuctionMappingForApp + }{ + { + "Wasm Add Auction Control AppID 2 AssetID 2", + bindings.MsgSetAuctionMappingForApp{ + AppID: 2, + AssetIDs: uint64(2), + IsSurplusAuctions: false, + IsDebtAuctions: true, + IsDistributor: false, + AssetOutOraclePrices: false, + AssetOutPrices: uint64(1000000), + }, + }, + } { + s.Run(tc.name, func() { + err := collectorKeeper.WasmSetAuctionMappingForApp(*ctx, &tc.msg) + s.Require().NoError(err) + result1, found := collectorKeeper.GetAuctionMappingForApp(*ctx, tc.msg.AppID, tc.msg.AssetIDs) + s.Require().True(found) + s.Require().Equal(result1.AssetId, tc.msg.AssetIDs) + s.Require().Equal(result1.IsSurplusAuction, tc.msg.IsSurplusAuctions) + s.Require().Equal(result1.IsDebtAuction, tc.msg.IsDebtAuctions) + s.Require().Equal(result1.IsDistributor, tc.msg.IsDistributor) + s.Require().Equal(result1.IsAuctionActive, false) + s.Require().Equal(result1.AssetOutOraclePrice, tc.msg.AssetOutOraclePrices) + s.Require().Equal(result1.AssetOutPrice, tc.msg.AssetOutPrices) + }) + } +} + +func (s *KeeperTestSuite) TestDebtActivator() { + collectorKeeper := &s.collectorKeeper + liquidationKeeper := &s.liquidationKeeper + s.AddAppAssets() + s.WasmSetCollectorLookupTableAndAuctionControlForDebt() + + err := collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdk.NewIntFromUint64(4700000)) + s.Require().NoError(err) + k, ctx := &s.liquidationKeeper, &s.ctx + err = k.Liquidate(*ctx) + s.Require().NoError(err) + lockedVault := liquidationKeeper.GetLockedVaults(s.ctx) + s.Require().Equal(lockedVault[0].OriginalVaultId, uint64(0)) + s.Require().Equal(lockedVault[0].ExtendedPairId, uint64(0)) + s.Require().Equal(lockedVault[0].Owner, "") + s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(2)) + s.Require().Equal(lockedVault[0].DebtAssetId, uint64(3)) + s.Require().Equal(lockedVault[0].InitiatorType, "debt") + +} + +func (s *KeeperTestSuite) TestSurplusActivator() { + collectorKeeper := &s.collectorKeeper + liquidationKeeper := &s.liquidationKeeper + s.AddAppAssets() + s.WasmSetCollectorLookupTableAndAuctionControlForSurplus() + err := s.app.BankKeeper.MintCoins(s.ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(10000000)))) + s.Require().NoError(err) + err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(10000000)))) + s.Require().NoError(err) + + err = collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdk.NewIntFromUint64(100000000)) + s.Require().NoError(err) + k, ctx := &s.liquidationKeeper, &s.ctx + err = k.Liquidate(*ctx) + s.Require().NoError(err) + lockedVault := liquidationKeeper.GetLockedVaults(s.ctx) + s.Require().Equal(lockedVault[0].OriginalVaultId, uint64(0)) + s.Require().Equal(lockedVault[0].ExtendedPairId, uint64(0)) + s.Require().Equal(lockedVault[0].Owner, "") + s.Require().Equal(lockedVault[0].CollateralAssetId, uint64(2)) + s.Require().Equal(lockedVault[0].DebtAssetId, uint64(3)) + s.Require().Equal(lockedVault[0].InitiatorType, "surplus") +} From 50c397784b1dd59239cac1f74d90716ed3a9eae6 Mon Sep 17 00:00:00 2001 From: Pratik Date: Thu, 29 Jun 2023 16:36:04 +0530 Subject: [PATCH 105/155] abci functions testcase --- proto/comdex/auctionsV2/v1beta1/auction.proto | 15 +- x/auctionsV2/keeper/auctions.go | 19 +- x/auctionsV2/keeper/msg_server_test.go | 103 ++++++++++- x/auctionsV2/types/auction.pb.go | 171 ++++++++++++------ x/liquidationsV2/keeper/msg_server_test.go | 1 - x/tokenmint/keeper/mint.go | 2 + 6 files changed, 222 insertions(+), 89 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index 3837e20c9..00b7a3fa1 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -35,13 +35,6 @@ message Auction{ (gogoproto.moretags) = "yaml:\"inflow_token_target_amount\"", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - // string collateral_figure = 2 [ - // (gogoproto.nullable) = false, - // (gogoproto.moretags) = "yaml:\"collateral_token\"", - // (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" - // ]; - - uint64 active_bidding_id = 4 [ (gogoproto.moretags) = "yaml:\"active_bidding_id\"" @@ -87,9 +80,6 @@ message Auction{ bool auction_type = 14 [ (gogoproto.customname) = "AuctionType", (gogoproto.moretags) = "yaml:\"auction_type\""]; - // uint64 auction_status = 20 [ - // (gogoproto.moretags) = "yaml:\"auction_status\"" - // ]; uint64 collateral_asset_id = 15 [ (gogoproto.moretags) = "yaml:\"collateral_asset_id\"" @@ -103,6 +93,11 @@ message Auction{ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" ]; + string collateral_token_initial_price = 18 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"collateral_token_initial_price\"" + ]; } diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 914ba06a1..ac88ccfa9 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,6 +1,7 @@ package keeper import ( + "fmt" "time" auctiontypes "github.com/comdex-official/comdex/x/auction/types" @@ -69,8 +70,7 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati //Premium : Initial Price i.e price of the collateral at which the auction will start //Discount: Final Price , i.e less than the oracle price of the collateral asset and at this , auction would end //Decrement Factor: Linear decrease in the price of the collateral every block is governed by this. - //CollateralTokenInitialPrice := k.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), dutchAuctionParams.Premium) - CollateralTokenInitialPrice := sdk.NewDecFromInt(sdk.NewIntFromUint64(twaDataCollateral.Twa)).Add(k.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), dutchAuctionParams.Premium)) + CollateralTokenInitialPrice := k.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), dutchAuctionParams.Premium) // CollateralTokenEndPrice := k.getOutflowTokenEndPrice(CollateralTokenInitialPrice, dutchAuctionParams.Cusp) auctionParams, _ := k.GetAuctionParams(ctx) @@ -91,6 +91,7 @@ func (k Keeper) DutchAuctionActivator(ctx sdk.Context, liquidationData liquidati CollateralAssetId: liquidationData.CollateralAssetId, DebtAssetId: liquidationData.DebtAssetId, BonusAmount: liquidationData.BonusToBeGiven, + CollateralTokenInitialPrice: CollateralTokenInitialPrice, } k.SetAuctionID(ctx, auctionData.AuctionId) @@ -197,7 +198,7 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { } } else { - //Else udate price params + //Else update price params err := k.UpdateDutchAuction(ctx, auction) if err != nil { return err @@ -214,7 +215,7 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { if ctx.BlockTime().After(auction.EndTime) { if auction.ActiveBiddingId != uint64(0) { - //If atleast there is one bidding on the auction + //If at least there is one bidding on the auction err := k.CloseEnglishAuction(ctx, auction) if err != nil { return err @@ -271,6 +272,7 @@ func (k Keeper) RestartDutchAuction(ctx sdk.Context, dutchAuction types.Auction) //Only updating necessary params dutchAuction.CollateralTokenAuctionPrice = CollateralTokenInitialPrice + dutchAuction.CollateralTokenInitialPrice = CollateralTokenInitialPrice dutchAuction.CollateralTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))) dutchAuction.DebtTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))) // dutchAuction.StartTime = ctx.BlockTime() @@ -308,9 +310,9 @@ func (k Keeper) UpdateDutchAuction(ctx sdk.Context, dutchAuction types.Auction) dutchAuction.CollateralTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))) dutchAuction.DebtTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))) - numerator := dutchAuction.CollateralTokenAuctionPrice.Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) //cmdx - CollateralTokenAuctionEndPrice := k.GetCollateralTokenEndPrice(dutchAuction.CollateralTokenAuctionPrice, dutchAuctionParams.Discount) - denominator := dutchAuction.CollateralTokenAuctionPrice.Sub(CollateralTokenAuctionEndPrice) + numerator := dutchAuction.CollateralTokenInitialPrice.Mul(sdk.NewDecFromInt(sdk.NewIntFromUint64(auctionParams.AuctionDurationSeconds))) //cmdx + CollateralTokenAuctionEndPrice := k.GetCollateralTokenEndPrice(dutchAuction.CollateralTokenInitialPrice, dutchAuctionParams.Discount) + denominator := dutchAuction.CollateralTokenInitialPrice.Sub(CollateralTokenAuctionEndPrice) timeToReachZeroPrice := numerator.Quo(denominator) timeElapsed := ctx.BlockTime().Sub(dutchAuction.StartTime) // Example: CollateralTokenAuctionPrice = 1.2 @@ -324,7 +326,7 @@ func (k Keeper) UpdateDutchAuction(ctx sdk.Context, dutchAuction types.Auction) // timeDifference = 33.3- 0 = 33.3 // resultantPrice = 1.2 *33.3 // currentPrice = 1.2*33.3/33.3 = 1.2 unit - collateralTokenAuctionPrice := k.GetPriceFromLinearDecreaseFunction(dutchAuction.CollateralTokenAuctionPrice, sdk.NewInt(timeToReachZeroPrice.TruncateInt64()), sdk.NewInt(int64(timeElapsed.Seconds()))) + collateralTokenAuctionPrice := k.GetPriceFromLinearDecreaseFunction(dutchAuction.CollateralTokenInitialPrice, sdk.NewInt(timeToReachZeroPrice.TruncateInt64()), sdk.NewInt(int64(timeElapsed.Seconds()))) dutchAuction.CollateralTokenAuctionPrice = collateralTokenAuctionPrice err := k.SetAuction(ctx, dutchAuction) @@ -380,6 +382,7 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio } err = k.tokenMint.BurnTokensForApp(ctx, englishAuction.AppId, englishAuction.DebtAssetId, englishAuction.DebtToken.Amount) + fmt.Println(err) if err != nil { return err } diff --git a/x/auctionsV2/keeper/msg_server_test.go b/x/auctionsV2/keeper/msg_server_test.go index 7e3cb4e8a..43cc73050 100644 --- a/x/auctionsV2/keeper/msg_server_test.go +++ b/x/auctionsV2/keeper/msg_server_test.go @@ -3,7 +3,9 @@ package keeper_test import ( "fmt" "github.com/comdex-official/comdex/app/wasm/bindings" + utils "github.com/comdex-official/comdex/types" assetTypes "github.com/comdex-official/comdex/x/asset/types" + "github.com/comdex-official/comdex/x/auctionsV2" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" collectortypes "github.com/comdex-official/comdex/x/collector/types" lendKeeper "github.com/comdex-official/comdex/x/lend/keeper" @@ -130,8 +132,8 @@ func (s *KeeperTestSuite) AddAppAssets() { // set liquidation whitelisting dutchAuctionParams := types.DutchAuctionParam{ - Premium: newDec("0.2"), - Discount: newDec("0.1"), + Premium: newDec("1.2"), + Discount: newDec("0.7"), DecrementFactor: sdk.NewInt(1), } englishAuctionParams := types.EnglishAuctionParam{DecrementFactor: sdk.NewInt(1)} @@ -311,7 +313,7 @@ func (s *KeeperTestSuite) TestLiquidateVaults() { twaDataCollateral, _ := s.app.MarketKeeper.GetTwa(s.ctx, lockedVault[0].CollateralAssetId) liquidationWhitelistingAppData, _ := s.app.NewliqKeeper.GetLiquidationWhiteListing(s.ctx, lockedVault[0].AppId) CollateralTokenInitialPrice := s.app.NewaucKeeper.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), liquidationWhitelistingAppData.DutchAuctionParam.Premium) - s.Require().Equal(auctions[0].CollateralTokenAuctionPrice, CollateralTokenInitialPrice.Add(sdk.NewDecFromInt(sdk.NewIntFromUint64(twaDataCollateral.Twa)))) + s.Require().Equal(auctions[0].CollateralTokenAuctionPrice, CollateralTokenInitialPrice) } @@ -402,7 +404,7 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { twaDataCollateral, _ := s.app.MarketKeeper.GetTwa(s.ctx, lockedVault[0].CollateralAssetId) liquidationWhitelistingAppData, _ := s.app.NewliqKeeper.GetLiquidationWhiteListing(s.ctx, lockedVault[0].AppId) CollateralTokenInitialPrice := s.app.NewaucKeeper.GetCollalteralTokenInitialPrice(sdk.NewIntFromUint64(twaDataCollateral.Twa), liquidationWhitelistingAppData.DutchAuctionParam.Premium) - s.Require().Equal(auctions[0].CollateralTokenAuctionPrice, CollateralTokenInitialPrice.Add(sdk.NewDecFromInt(sdk.NewIntFromUint64(twaDataCollateral.Twa)))) + s.Require().Equal(auctions[0].CollateralTokenAuctionPrice, CollateralTokenInitialPrice) } func (s *KeeperTestSuite) TestPlaceMarketBidForVaults() { @@ -833,12 +835,6 @@ func (s *KeeperTestSuite) TestSurplusAuctionBid() { ExpErr: sdkerrors.ErrNotFound, ExpResp: nil, }, - //{ - // Name: "bidding amount is lower than minimum bidding amount", - // Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(5300))), - // ExpErr: auctionsV2types.ErrorLowBidAmount, - // ExpResp: nil, - //}, { Name: "success valid case", Msg: *auctionsV2types.NewMsgPlaceMarketBid(bidder, 1, sdk.NewCoin("uasset3", sdk.NewInt(200000))), @@ -879,3 +875,90 @@ func (s *KeeperTestSuite) TestSurplusAuctionBid() { } } + +func (s *KeeperTestSuite) TestAuctionIterator() { + s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T12:00:00Z")) + s.TestLiquidateVaults() + + // debt auction + collectorKeeper := &s.collectorKeeper + s.WasmSetCollectorLookupTableAndAuctionControlForDebt() + err := collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdk.NewIntFromUint64(4700000)) + s.Require().NoError(err) + k := &s.liquidationKeeper + err = k.Liquidate(s.ctx) + s.Require().NoError(err) + + auction, _ := s.keeper.GetAuction(s.ctx, 1) + s.Require().Equal(auction.CollateralTokenAuctionPrice, sdk.NewDecFromInt(sdk.NewInt(1200000))) + + // update auction price + s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T12:30:00Z")) + auctionsV2.BeginBlocker(s.ctx, s.keeper) + auction, _ = s.keeper.GetAuction(s.ctx, 1) + s.Require().Equal(auction.CollateralTokenAuctionPrice, sdk.NewDecFromInt(sdk.NewInt(1020000))) + + s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T12:59:59Z")) + auctionsV2.BeginBlocker(s.ctx, s.keeper) + auction, _ = s.keeper.GetAuction(s.ctx, 1) + s.Require().Equal(auction.CollateralTokenAuctionPrice, sdk.NewDecFromInt(sdk.NewInt(840100))) + + // restart auction + s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T13:30:00Z")) + auctionsV2.BeginBlocker(s.ctx, s.keeper) + auction, _ = s.keeper.GetAuction(s.ctx, 1) + s.Require().Equal(auction.CollateralTokenAuctionPrice, sdk.NewDecFromInt(sdk.NewInt(1200000))) +} + +func (s *KeeperTestSuite) TestAuctionIteratorSurplus() { + s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T12:00:00Z")) + s.TestLiquidateVaults() + //winnerAddress := "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7" + + collectorKeeper := &s.collectorKeeper + k := &s.liquidationKeeper + // surplus auction + + //tokenmintKeeper := &s.tokenmintKeeper + //server := tokenmintKeeper1.NewMsgServer(*tokenmintKeeper) + //msg1 := tokenminttypes.MsgMintNewTokensRequest{ + // From: winnerAddress, + // AppId: 1, + // AssetId: 3, + //} + //_, err := server.MsgMintNewTokens(sdk.WrapSDKContext(s.ctx), &msg1) + //s.Require().NoError(err) + + s.WasmSetCollectorLookupTableAndAuctionControlForSurplus() + err := s.app.BankKeeper.MintCoins(s.ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(10000000)))) + s.Require().NoError(err) + err = s.app.BankKeeper.SendCoinsFromModuleToModule(s.ctx, types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uasset2", sdk.NewInt(10000000)))) + s.Require().NoError(err) + err = collectorKeeper.SetNetFeeCollectedData(s.ctx, uint64(2), 2, sdk.NewIntFromUint64(100000000)) + s.Require().NoError(err) + k, ctx := &s.liquidationKeeper, &s.ctx + err = k.Liquidate(*ctx) + s.Require().NoError(err) + + auction, _ := s.keeper.GetAuction(s.ctx, 1) + s.Require().Equal(auction.CollateralTokenAuctionPrice, sdk.NewDecFromInt(sdk.NewInt(1200000))) + + // update auction price and bid for english auction + + s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T12:30:00Z")) + auctionsV2.BeginBlocker(s.ctx, s.keeper) + + msg := auctionsV2types.MsgPlaceMarketBidRequest{ + AuctionId: 3, + Bidder: "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", + Amount: sdk.NewCoin("uasset3", sdk.NewInt(220000)), + } + _, err = s.auctionMsgServer.MsgPlaceMarketBid(sdk.WrapSDKContext(s.ctx), &msg) + s.Require().NoError(err) + + // restart auction + s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T13:30:00Z")) + auctionsV2.BeginBlocker(s.ctx, s.keeper) + auction, _ = s.keeper.GetAuction(s.ctx, 1) + s.Require().Equal(auction.CollateralTokenAuctionPrice, sdk.NewDecFromInt(sdk.NewInt(1200000))) +} diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index a0199223a..d302ec4f0 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -108,6 +108,7 @@ type Auction struct { CollateralAssetId uint64 `protobuf:"varint,15,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` DebtAssetId uint64 `protobuf:"varint,16,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` BonusAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,17,opt,name=bonus_amount,json=bonusAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bonus_amount" yaml:"bonus_amount"` + CollateralTokenInitialPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,18,opt,name=collateral_token_initial_price,json=collateralTokenInitialPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_token_initial_price" yaml:"collateral_token_initial_price"` } func (m *Auction) Reset() { *m = Auction{} } @@ -290,66 +291,68 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 942 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0xdb, 0x36, - 0x18, 0x8e, 0x9a, 0xe6, 0xc3, 0xb4, 0x33, 0xd7, 0x6a, 0xda, 0x28, 0xce, 0x62, 0xb9, 0x3c, 0xb4, - 0xc6, 0x80, 0xc8, 0x68, 0xd7, 0xd3, 0xb0, 0x4b, 0xb4, 0x15, 0xa8, 0x87, 0xad, 0x1d, 0xb8, 0xa0, - 0x18, 0x76, 0x31, 0x28, 0x91, 0x76, 0x88, 0xc8, 0xa2, 0x66, 0xd1, 0xe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x44, 0xad, 0x32, 0x7a, 0x28, 0x83, 0x03, 0x62, 0x7f, 0x0a, 0xb6, 0x94, 0x83, 0xe6, - 0x4c, 0xf7, 0x14, 0x93, 0x93, 0x67, 0xee, 0xb6, 0x66, 0x5a, 0xd8, 0x86, 0xa8, 0x2e, 0xd7, 0x45, - 0xf6, 0x31, 0x68, 0x04, 0x3c, 0x9e, 0xa5, 0x66, 0x56, 0x39, 0x2d, 0x65, 0xba, 0x17, 0xb7, 0x30, - 0xdd, 0x20, 0x16, 0xe5, 0xb9, 0xab, 0x5c, 0x10, 0xd5, 0xd5, 0xf2, 0x50, 0xaf, 0x5e, 0x80, 0xe6, - 0xd2, 0x58, 0xb1, 0x1f, 0x80, 0xf5, 0x80, 0x91, 0xf9, 0x77, 0x03, 0xad, 0x05, 0x8c, 0x0c, 0x88, - 0xbd, 0x07, 0x6a, 0x32, 0xcc, 0x25, 0x54, 0x7d, 0x14, 0x6a, 0x68, 0xb3, 0x48, 0xf5, 0x5f, 0xbd, - 0xbb, 0xe8, 0x58, 0xef, 0x2f, 0x3a, 0xd6, 0x5f, 0x17, 0x1d, 0xeb, 0xfc, 0xb2, 0xb3, 0xf2, 0xfe, - 0xb2, 0xb3, 0xf2, 0xfb, 0x65, 0x67, 0xe5, 0xbb, 0xe7, 0x0b, 0x62, 0xe5, 0x68, 0x3b, 0xe0, 0xa3, - 0x11, 0x0b, 0x19, 0x8e, 0xcc, 0xba, 0xbf, 0xf0, 0x13, 0x45, 0xc9, 0x0f, 0xd6, 0x95, 0x7b, 0x3e, - 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x5d, 0xf0, 0x40, 0xc4, 0x08, 0x00, 0x00, + // 975 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0x1b, 0x45, + 0x18, 0xce, 0x36, 0xcd, 0x87, 0xc7, 0x31, 0xae, 0xb7, 0x69, 0xb3, 0x71, 0x88, 0xd7, 0x1d, 0x89, + 0xd6, 0x42, 0xca, 0x5a, 0x2d, 0x3d, 0x21, 0x2e, 0x59, 0xa8, 0x54, 0x23, 0x68, 0xd1, 0x12, 0x15, + 0xc4, 0xc5, 0x9a, 0xdd, 0x19, 0x3b, 0xa3, 0xac, 0x77, 0x16, 0xef, 0x38, 0x25, 0x3f, 0x81, 0x0b, + 0xca, 0x09, 0x09, 0x89, 0x1b, 0x7f, 0xa6, 0xc7, 0x72, 0x43, 0x1c, 0x16, 0x94, 0xfc, 0x83, 0x3d, + 0x72, 0x42, 0xf3, 0xb1, 0xde, 0xf5, 0x07, 0x0a, 0xee, 0x29, 0x99, 0x77, 0xde, 0xf7, 0x79, 0x9f, + 0x79, 0xe7, 0x99, 0x67, 0x0d, 0x1e, 0x05, 0x6c, 0x84, 0xc9, 0x0f, 0x5d, 0x34, 0x09, 0x38, 0x65, + 0x51, 0xf2, 0xea, 0x49, 0xf7, 0xfc, 0xb1, 0x4f, 0x38, 0x7a, 0x9c, 0x87, 0x9c, 0x78, 0xcc, 0x38, + 0x33, 0xf7, 0x55, 0xa2, 0x53, 0x24, 0x3a, 0x3a, 0xb1, 0xb9, 0x3b, 0x64, 0x43, 0x26, 0xb3, 0xba, + 0xe2, 0x3f, 0x55, 0xd0, 0xb4, 0x87, 0x8c, 0x0d, 0x43, 0xd2, 0x95, 0x2b, 0x7f, 0x32, 0xe8, 0x72, + 0x3a, 0x22, 0x09, 0x47, 0xa3, 0x58, 0x27, 0xb4, 0x02, 0x96, 0x8c, 0x58, 0xd2, 0xf5, 0x51, 0x42, + 0xa6, 0x4d, 0x03, 0x46, 0x75, 0xc7, 0xe6, 0x91, 0xa6, 0x16, 0xd2, 0xef, 0x27, 0x14, 0xa3, 0x79, + 0x7a, 0x79, 0x98, 0xa8, 0x74, 0xf8, 0xdb, 0x2d, 0xd0, 0x38, 0x56, 0xe4, 0x9e, 0xd3, 0x84, 0xb3, + 0x31, 0x0d, 0x50, 0x68, 0x3e, 0x05, 0x40, 0x33, 0xee, 0x53, 0x6c, 0x19, 0x6d, 0xa3, 0x73, 0xdb, + 0xbd, 0x97, 0xa5, 0x76, 0xe3, 0x02, 0x8d, 0xc2, 0x8f, 0x61, 0xb1, 0x07, 0xbd, 0x8a, 0x5e, 0xf4, + 0xb0, 0x19, 0x03, 0x33, 0xdf, 0x39, 0x9d, 0x62, 0x59, 0xb7, 0xda, 0x46, 0xa7, 0xfa, 0x04, 0x3a, + 0xff, 0x39, 0x09, 0x47, 0xf7, 0x77, 0x0f, 0xb3, 0xd4, 0xde, 0x9f, 0xed, 0x50, 0xe0, 0x40, 0xaf, + 0x81, 0x16, 0x78, 0x0e, 0xc0, 0x4e, 0xc8, 0x82, 0x33, 0x82, 0xfb, 0xe7, 0x68, 0x12, 0x72, 0x6b, + 0x5d, 0xf6, 0xfa, 0x30, 0xef, 0x35, 0x3b, 0x83, 0x69, 0xbf, 0x2f, 0x64, 0xc9, 0x2b, 0x51, 0xe1, + 0xee, 0x65, 0xa9, 0x7d, 0x57, 0xf5, 0x2c, 0x23, 0x41, 0xaf, 0x1a, 0x16, 0x59, 0xf0, 0xf7, 0x1a, + 0xd8, 0xd2, 0x2c, 0xdf, 0x71, 0x36, 0x97, 0x06, 0xb8, 0x13, 0xb0, 0x30, 0x44, 0x9c, 0x8c, 0x51, + 0xd8, 0xe7, 0xec, 0x8c, 0x44, 0x7a, 0x34, 0xfb, 0x8e, 0xba, 0x52, 0x47, 0x5c, 0xe9, 0x94, 0xe4, + 0xa7, 0x8c, 0x46, 0xee, 0xe7, 0x6f, 0x52, 0x7b, 0x2d, 0x4b, 0xed, 0x3d, 0x85, 0x3d, 0x0f, 0x00, + 0xff, 0x49, 0xed, 0x47, 0x43, 0xca, 0x4f, 0x27, 0xbe, 0x38, 0x72, 0x57, 0x4b, 0x43, 0xfd, 0x39, + 0x4a, 0xf0, 0x59, 0x97, 0x5f, 0xc4, 0x24, 0x91, 0x58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xa7, 0x33, 0xc7, 0x11, 0xce, 0x7b, 0xc4, 0x06, + 0x03, 0x1a, 0x50, 0x14, 0xea, 0x75, 0x77, 0xe6, 0x17, 0x94, 0x3c, 0xa0, 0xbf, 0x29, 0xc5, 0xfd, + 0xd1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x34, 0x5b, 0x6b, 0x89, 0x63, 0x09, 0x00, 0x00, } func (m *AuctionHistorical) Marshal() (dAtA []byte, err error) { @@ -424,6 +427,18 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.CollateralTokenInitialPrice.Size() + i -= size + if _, err := m.CollateralTokenInitialPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 { size := m.BonusAmount.Size() i -= size @@ -676,6 +691,8 @@ func (m *Auction) Size() (n int) { } l = m.BonusAmount.Size() n += 2 + l + sovAuction(uint64(l)) + l = m.CollateralTokenInitialPrice.Size() + n += 2 + l + sovAuction(uint64(l)) return n } @@ -1307,6 +1324,40 @@ func (m *Auction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenInitialPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CollateralTokenInitialPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAuction(dAtA[iNdEx:]) diff --git a/x/liquidationsV2/keeper/msg_server_test.go b/x/liquidationsV2/keeper/msg_server_test.go index a8e7590c9..05f69661f 100644 --- a/x/liquidationsV2/keeper/msg_server_test.go +++ b/x/liquidationsV2/keeper/msg_server_test.go @@ -524,7 +524,6 @@ func (s *KeeperTestSuite) TestLiquidateInternalKeeperForBorrow() { s.Require().NoError(err) id = liquidationKeeper.GetLockedVaultID(s.ctx) - fmt.Println("id", id) s.Require().Equal(id, uint64(1)) s.Require().Equal(s.GetBorrowsCount(), currentBorrowsCount) diff --git a/x/tokenmint/keeper/mint.go b/x/tokenmint/keeper/mint.go index a25dd4c7a..e1b148a55 100644 --- a/x/tokenmint/keeper/mint.go +++ b/x/tokenmint/keeper/mint.go @@ -1,6 +1,7 @@ package keeper import ( + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/comdex-official/comdex/x/tokenmint/types" @@ -108,6 +109,7 @@ func (k Keeper) MintNewTokensForApp(ctx sdk.Context, appMappingID uint64, assetI func (k Keeper) BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, amount sdk.Int) error { assetData, found := k.asset.GetAsset(ctx, assetID) + fmt.Println("assetID", assetID) if !found { return types.ErrorAssetDoesNotExist } From f4c19a764c7cb26a395da3a1e9b5278339320228 Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 3 Jul 2023 16:20:32 +0530 Subject: [PATCH 106/155] TestLimitBid testcase added --- x/auctionsV2/keeper/auctions.go | 7 +++--- x/auctionsV2/keeper/msg_server_test.go | 31 +++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index ac88ccfa9..385f7c220 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -523,12 +523,13 @@ func (k Keeper) LimitOrderBid(ctx sdk.Context) error { individualBids.BiddingId = append(individualBids.BiddingId, biddingId) k.SetUserLimitBidData(ctx, individualBids, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt()) } else { - _, err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr.String(), individualBids.DebtToken, auction, true) + biddingId, err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr.String(), individualBids.DebtToken, auction, true) if err != nil { return err } - k.DeleteUserLimitBidData(ctx, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt(), individualBids.BidderAddress) - k.UpdateUserLimitBidDataForAddress(ctx, individualBids, false) + individualBids.DebtToken.Amount = individualBids.DebtToken.Amount.Sub(auction.DebtToken.Amount) + individualBids.BiddingId = append(individualBids.BiddingId, biddingId) + k.SetUserLimitBidData(ctx, individualBids, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt()) } } diff --git a/x/auctionsV2/keeper/msg_server_test.go b/x/auctionsV2/keeper/msg_server_test.go index 43cc73050..6b67e1531 100644 --- a/x/auctionsV2/keeper/msg_server_test.go +++ b/x/auctionsV2/keeper/msg_server_test.go @@ -519,7 +519,7 @@ func (s *KeeperTestSuite) TestPlaceMarketBidForBorrows() { } func (s *KeeperTestSuite) TestDepositLimitBid() { - s.AddAppAssets() + s.TestLiquidateVaults() auctionKeeper := &s.keeper bidder := "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7" @@ -962,3 +962,32 @@ func (s *KeeperTestSuite) TestAuctionIteratorSurplus() { auction, _ = s.keeper.GetAuction(s.ctx, 1) s.Require().Equal(auction.CollateralTokenAuctionPrice, sdk.NewDecFromInt(sdk.NewInt(1200000))) } + +func (s *KeeperTestSuite) TestLimitBid() { + s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T12:00:00Z")) + s.TestLiquidateVaults() + auctions := s.app.NewaucKeeper.GetAuctions(s.ctx) + s.Require().Equal(len(auctions), 2) + + bidder := "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7" + + auctionKeeper := &s.keeper + liquidationKeeper := &s.liquidationKeeper + err := liquidationKeeper.MsgAppReserveFundsFn(s.ctx, bidder, 2, 3, sdk.NewCoin("uasset3", sdk.NewInt(5990000))) + s.Require().NoError(err) + + err = auctionKeeper.DepositLimitAuctionBid(s.ctx, bidder, 2, 3, sdk.NewInt(9), sdk.NewCoin("uasset3", sdk.NewInt(7000000))) + s.Require().NoError(err) + + a, _ := auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 3, 2, sdk.NewInt(9)) + s.Require().Equal(len(a), 1) + + s.ctx = s.ctx.WithBlockTime(utils.ParseTime("2023-06-01T12:49:00Z")) + auctionsV2.BeginBlocker(s.ctx, s.keeper) + + a, _ = auctionKeeper.GetUserLimitBidDataByPremium(s.ctx, 3, 2, sdk.NewInt(9)) + s.Require().Equal(len(a), 1) + + auctions = s.app.NewaucKeeper.GetAuctions(s.ctx) + s.Require().Equal(len(auctions), 0) +} From 3240f51f462c29edd05386c3f4e1c8b9eea5db90 Mon Sep 17 00:00:00 2001 From: Pratik Date: Thu, 6 Jul 2023 17:43:28 +0530 Subject: [PATCH 107/155] removed beginblocker functions for auction and liquidation module --- app/app.go | 10 +++++----- x/auction/module.go | 2 +- x/liquidation/module.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/app.go b/app/app.go index eba950c72..d4c848d5c 100644 --- a/app/app.go +++ b/app/app.go @@ -1485,11 +1485,11 @@ func upgradeHandlers(upgradeInfo storetypes.UpgradeInfo, a *App, storeUpgrades * case upgradeInfo.Name == mv12.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height): storeUpgrades = &storetypes.StoreUpgrades{ - Added: []string{icqtypes.StoreKey}, - } - case upgradeInfo.Name == mv12.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height): - storeUpgrades = &storetypes.StoreUpgrades{ - Added: []string{}, + Added: []string{ + icqtypes.StoreKey, + newliqtypes.StoreKey, + newauctypes.StoreKey, + }, } } return storeUpgrades diff --git a/x/auction/module.go b/x/auction/module.go index 2d27e32df..883bd0ef2 100644 --- a/x/auction/module.go +++ b/x/auction/module.go @@ -175,7 +175,7 @@ func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - BeginBlocker(ctx, am.keeper, am.assetKeeper, am.collectKeeper, am.esmKeeper) + //BeginBlocker(ctx, am.keeper, am.assetKeeper, am.collectKeeper, am.esmKeeper) } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It diff --git a/x/liquidation/module.go b/x/liquidation/module.go index 964664d61..a3650763f 100644 --- a/x/liquidation/module.go +++ b/x/liquidation/module.go @@ -166,7 +166,7 @@ func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. func (am AppModule) BeginBlock(ctx sdk.Context, request abci.RequestBeginBlock) { - BeginBlocker(ctx, request, am.keeper) + //BeginBlocker(ctx, request, am.keeper) } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It From 57892cc37028e2507859e676adcb597d1e0a7f30 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 18:53:43 +0000 Subject: [PATCH 108/155] Bump github.com/osmosis-labs/osmosis/v15 from 15.1.2 to 15.2.0 Bumps [github.com/osmosis-labs/osmosis/v15](https://github.com/osmosis-labs/osmosis) from 15.1.2 to 15.2.0. - [Release notes](https://github.com/osmosis-labs/osmosis/releases) - [Changelog](https://github.com/osmosis-labs/osmosis/blob/v15.2.0/CHANGELOG.md) - [Commits](https://github.com/osmosis-labs/osmosis/compare/v15.1.2...v15.2.0) --- updated-dependencies: - dependency-name: github.com/osmosis-labs/osmosis/v15 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 1a350a3cf..328c883b0 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( require ( github.com/cosmos/ibc-go/v4 v4.4.2 github.com/golangci/golangci-lint v1.53.3 - github.com/osmosis-labs/osmosis/v15 v15.1.2 + github.com/osmosis-labs/osmosis/v15 v15.2.0 github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.6 github.com/rakyll/statik v0.1.7 github.com/spf13/pflag v1.0.5 @@ -67,7 +67,7 @@ require ( github.com/bombsimon/wsl/v3 v3.4.0 // indirect github.com/breml/bidichk v0.2.4 // indirect github.com/breml/errchkjson v0.3.1 // indirect - github.com/btcsuite/btcd v0.22.2 // indirect + github.com/btcsuite/btcd v0.22.3 // indirect github.com/butuzov/ireturn v0.2.0 // indirect github.com/butuzov/mirror v1.1.0 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect diff --git a/go.sum b/go.sum index 64c901a95..48bbe660f 100644 --- a/go.sum +++ b/go.sum @@ -525,8 +525,8 @@ github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MR github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= -github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= -github.com/btcsuite/btcd v0.22.2/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= +github.com/btcsuite/btcd v0.22.3 h1:kYNaWFvOw6xvqP0vR20RP1Zq1DVMBxEO8QN5d1/EfNg= +github.com/btcsuite/btcd v0.22.3/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= @@ -2020,8 +2020,8 @@ github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnz github.com/osmosis-labs/osmosis/osmomath v0.0.4 h1:5cJfDi8mOuAzLfsQFoTGJvm/qca7Gj7wvDiVSTE1ibk= github.com/osmosis-labs/osmosis/osmoutils v0.0.4 h1:W/lvzFsyt30GGi0+nD3Ktxlwe5Tl6ipKWilyyLjJ9Ro= github.com/osmosis-labs/osmosis/osmoutils v0.0.4/go.mod h1:2MStAdC2TajbhgkAwT3SZPtMW/Bbvp0JYGPRle+5Qsc= -github.com/osmosis-labs/osmosis/v15 v15.1.2 h1:Y/F6xMhS1hacdAW0Ra22SaKLUGIpgqC6DmrWRUklKQk= -github.com/osmosis-labs/osmosis/v15 v15.1.2/go.mod h1:djA/5r1/HaZIYtk3r5qCjkQutfkEv/0IzIKR3evV3eA= +github.com/osmosis-labs/osmosis/v15 v15.2.0 h1:fFTeI2E344TtrrywP8neSq8iPB/gc5nEvaQvKNCn0bU= +github.com/osmosis-labs/osmosis/v15 v15.2.0/go.mod h1:wD/Qpm7eMtZVwXhGiJOr/fWMopVrOXtTgJIZrqe20g8= github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.6 h1:PjfLL5rwwm44CeLnNQssrFgmj4BdeIS5DriKYhGz7IM= github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.6/go.mod h1:2Aqs0L6JnMfo+P+It8q7hJsP1YB+Is5DJc4nRSiBF/U= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= From 40a7519a5703d79a0ee5b045754673fbd5225e25 Mon Sep 17 00:00:00 2001 From: Chandragupta Singh Date: Mon, 10 Jul 2023 00:39:03 +0530 Subject: [PATCH 109/155] go version upgrade to 1.20 --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/golangci-lint.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- Makefile | 4 ++-- README.md | 2 +- go.mod | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 053e7b2dd..619159dac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v4.0.1 with: - go-version: 1.19 + go-version: 1.20 id: go - name: Check out code into the Go module directory˛˜ diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1087b5951..73eb2f706 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v3 - uses: actions/setup-go@v4.0.1 with: - go-version: 1.19 + go-version: 1.20 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 12a02cd0e..5b7ad551d 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/setup-go@v4.0.1 with: - go-version: 1.19 # we run the linter with go 1.19 to match dev laptops even though we use 1.18 for the chain (don't update the chain to 1.19 please-- there is an issue in golang causing 1.19 to output some hashes differently from 1.18) + go-version: 1.20 # we run the linter with go 1.20 to match dev laptops even though we use 1.18 for the chain (don't update the chain to 1.19 please-- there is an issue in golang causing 1.19 to output some hashes differently from 1.18) - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb420387f..9c85cb511 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v4.0.1 with: - go-version: 1.19 + go-version: 1.20 id: go - name: Check out code into the Go module directory diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37bbce692..4fe1ab26e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,7 @@ jobs: name: Setup Golang uses: actions/setup-go@v4.0.1 with: - go-version: 1.19 + go-version: 1.20 - name: Display go version run: go version diff --git a/Makefile b/Makefile index 7d8547e30..d10eebd38 100644 --- a/Makefile +++ b/Makefile @@ -94,8 +94,8 @@ endif #$(info $$BUILD_FLAGS is [$(BUILD_FLAGS)]) check_version: -ifneq ($(GO_MINOR_VERSION),19) - @echo "ERROR: Please upgrade Go version to 1.19+" +ifneq ($(GO_MINOR_VERSION),20) + @echo "ERROR: Please upgrade Go version to 1.20+" exit 1 endif diff --git a/README.md b/README.md index 04428c73f..93f6fad5f 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ If you have technical questions or concerns, ask a developer or community member ### Installation -Requires [Go 1.19+](https://golang.org/dl/) +Requires [Go 1.20+](https://golang.org/dl/) ### Linux diff --git a/go.mod b/go.mod index 1a350a3cf..90081a739 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/comdex-official/comdex -go 1.19 +go 1.20 require ( github.com/CosmWasm/wasmd v0.31.0 From 43eb63ddd28425211e09e7d82d50da6569e6182c Mon Sep 17 00:00:00 2001 From: Chandragupta Singh Date: Mon, 10 Jul 2023 01:31:13 +0530 Subject: [PATCH 110/155] update workflow for go test --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/golangci-lint.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 619159dac..bf2b2b938 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v4.0.1 with: - go-version: 1.20 + go-version: 1.20.5 id: go - name: Check out code into the Go module directory˛˜ diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 73eb2f706..8c34a32fb 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v3 - uses: actions/setup-go@v4.0.1 with: - go-version: 1.20 + go-version: 1.20.5 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 5b7ad551d..c687d75be 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/setup-go@v4.0.1 with: - go-version: 1.20 # we run the linter with go 1.20 to match dev laptops even though we use 1.18 for the chain (don't update the chain to 1.19 please-- there is an issue in golang causing 1.19 to output some hashes differently from 1.18) + go-version: 1.20.5 # we run the linter with go 1.20 to match dev laptops even though we use 1.18 for the chain (don't update the chain to 1.19 please-- there is an issue in golang causing 1.19 to output some hashes differently from 1.18) - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9c85cb511..b90949eec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v4.0.1 with: - go-version: 1.20 + go-version: 1.20.5 id: go - name: Check out code into the Go module directory diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4fe1ab26e..abe696c52 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,7 @@ jobs: name: Setup Golang uses: actions/setup-go@v4.0.1 with: - go-version: 1.20 + go-version: 1.20.5 - name: Display go version run: go version From b3c1a4006840512f9ce678d149b631db557032be Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 10 Jul 2023 10:58:03 +0530 Subject: [PATCH 111/155] genesis for auctionsV2 and liquidationsV2 added --- proto/comdex/auctionsV2/v1beta1/auction.proto | 1 + proto/comdex/auctionsV2/v1beta1/bid.proto | 5 - proto/comdex/auctionsV2/v1beta1/genesis.proto | 12 +- .../liquidationsV2/v1beta1/genesis.proto | 11 +- proto/comdex/liquidationsV2/v1beta1/gov.proto | 2 - .../liquidationsV2/v1beta1/liquidate.proto | 6 - .../liquidationsV2/v1beta1/params.proto | 2 - proto/comdex/liquidationsV2/v1beta1/tx.proto | 1 - x/auctionsV2/genesis.go | 29 +- x/auctionsV2/keeper/genesis.go | 50 +++ x/auctionsV2/keeper/utils.go | 27 +- x/auctionsV2/types/genesis.go | 22 +- x/auctionsV2/types/genesis.pb.go | 291 +++++++++++++++++- x/liquidationsV2/genesis.go | 27 +- x/liquidationsV2/keeper/genesis.go | 50 +++ x/liquidationsV2/types/genesis.go | 24 +- x/liquidationsV2/types/genesis.pb.go | 219 ++++++++++++- x/liquidationsV2/types/gov.pb.go | 44 ++- x/liquidationsV2/types/params.pb.go | 20 +- x/liquidationsV2/types/tx.pb.go | 94 +++--- 20 files changed, 755 insertions(+), 182 deletions(-) create mode 100644 x/auctionsV2/keeper/genesis.go create mode 100644 x/liquidationsV2/keeper/genesis.go diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index 00b7a3fa1..6c328fb3a 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -20,6 +20,7 @@ message AuctionHistorical{ ]; } + message Auction{ uint64 auction_id = 1 [ (gogoproto.moretags) = "yaml:\"auction_id\"" diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto index a673e1b2c..e90c27d46 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -157,11 +157,6 @@ string premium_discount = 3 [ uint64 limit_order_bidding_id = 4 [ (gogoproto.moretags) = "yaml:\"limit_order_bidding_id\"" ]; - - - - - } message AuctionFeesCollectionFromLimitBidTx{ diff --git a/proto/comdex/auctionsV2/v1beta1/genesis.proto b/proto/comdex/auctionsV2/v1beta1/genesis.proto index 96d9ec396..14524e865 100644 --- a/proto/comdex/auctionsV2/v1beta1/genesis.proto +++ b/proto/comdex/auctionsV2/v1beta1/genesis.proto @@ -3,9 +3,19 @@ package comdex.auctionsV2.v1beta1; import "gogoproto/gogo.proto"; import "comdex/auctionsV2/v1beta1/params.proto"; +import "comdex/auctionsV2/v1beta1/auction.proto"; +import "comdex/auctionsV2/v1beta1/bid.proto"; option go_package = "github.com/comdex-official/comdex/x/auctionsV2/types"; message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; + repeated Auction auction = 1 + [ (gogoproto.moretags) = "yaml:\"auction\"", (gogoproto.nullable) = false ]; + AuctionParams auctionParams = 2 + [ (gogoproto.moretags) = "yaml:\"auctionParams\"", (gogoproto.nullable) = false ]; + repeated AuctionFeesCollectionFromLimitBidTx auctionFeesCollectionFromLimitBidTx = 3 + [ (gogoproto.moretags) = "yaml:\"auctionFeesCollectionFromLimitBidTx\"", (gogoproto.nullable) = false ]; + Params params = 4 [(gogoproto.nullable) = false]; + uint64 AuctionId = 5; + uint64 UserBiddingID = 6 ; } diff --git a/proto/comdex/liquidationsV2/v1beta1/genesis.proto b/proto/comdex/liquidationsV2/v1beta1/genesis.proto index 94f8db9e7..ed3096c44 100644 --- a/proto/comdex/liquidationsV2/v1beta1/genesis.proto +++ b/proto/comdex/liquidationsV2/v1beta1/genesis.proto @@ -3,9 +3,16 @@ package comdex.liquidationsV2.v1beta1; import "gogoproto/gogo.proto"; import "comdex/liquidationsV2/v1beta1/params.proto"; +import "comdex/liquidationsV2/v1beta1/liquidate.proto"; option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; -} + repeated LockedVault lockedVault = 1 + [ (gogoproto.moretags) = "yaml:\"lockedVault\"", (gogoproto.nullable) = false ]; + repeated LiquidationWhiteListing liquidationWhiteListing = 2 + [ (gogoproto.moretags) = "yaml:\"liquidationWhiteListing\"", (gogoproto.nullable) = false ]; + repeated AppReserveFunds appReserveFunds = 3 + [ (gogoproto.moretags) = "yaml:\"appReserveFunds\"", (gogoproto.nullable) = false ]; + Params params = 4 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/proto/comdex/liquidationsV2/v1beta1/gov.proto b/proto/comdex/liquidationsV2/v1beta1/gov.proto index 40e895fbe..719791f40 100644 --- a/proto/comdex/liquidationsV2/v1beta1/gov.proto +++ b/proto/comdex/liquidationsV2/v1beta1/gov.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package comdex.liquidationsV2.v1beta1; import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "cosmos/base/v1beta1/coin.proto"; import "comdex/liquidationsV2/v1beta1/liquidate.proto"; option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; diff --git a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto index 27223f71d..3e4ec5f8e 100644 --- a/proto/comdex/liquidationsV2/v1beta1/liquidate.proto +++ b/proto/comdex/liquidationsV2/v1beta1/liquidate.proto @@ -12,7 +12,6 @@ option (gogoproto.goproto_getters_all) = false; message LiquidationWhiteListing { - uint64 app_id = 1 [ (gogoproto.customname) = "AppId", (gogoproto.moretags) = "yaml:\"app_id\""]; @@ -91,7 +90,6 @@ message AssetTxData{ } message DutchAuctionParam{ - string premium = 1 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, @@ -116,7 +114,6 @@ message EnglishAuctionParam{ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"decrement_factor\"" ]; - } message LiquidationOffsetHolder { @@ -133,7 +130,6 @@ message LiquidationOffsetHolder { //market to liquidate their positions and take part in auctions. message LockedVault { - uint64 id = 1 [ (gogoproto.customname) = "LockedVaultId", (gogoproto.moretags) = "yaml:\"id\""]; @@ -234,8 +230,6 @@ message LockedVault { ]; uint64 debt_asset_id = 22 [ (gogoproto.moretags) = "yaml:\"debt_asset_id\"" - - ]; } diff --git a/proto/comdex/liquidationsV2/v1beta1/params.proto b/proto/comdex/liquidationsV2/v1beta1/params.proto index 70cc04b08..b5aad1f59 100644 --- a/proto/comdex/liquidationsV2/v1beta1/params.proto +++ b/proto/comdex/liquidationsV2/v1beta1/params.proto @@ -1,8 +1,6 @@ syntax = "proto3"; package comdex.liquidationsV2.v1beta1; -import "gogoproto/gogo.proto"; - option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; message Params { diff --git a/proto/comdex/liquidationsV2/v1beta1/tx.proto b/proto/comdex/liquidationsV2/v1beta1/tx.proto index a0006e648..09b34c65a 100644 --- a/proto/comdex/liquidationsV2/v1beta1/tx.proto +++ b/proto/comdex/liquidationsV2/v1beta1/tx.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package comdex.liquidationsV2.v1beta1; import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/comdex-official/comdex/x/liquidationsV2/types"; diff --git a/x/auctionsV2/genesis.go b/x/auctionsV2/genesis.go index 00580e289..cfc833fee 100644 --- a/x/auctionsV2/genesis.go +++ b/x/auctionsV2/genesis.go @@ -9,16 +9,31 @@ import ( // InitGenesis initializes the capability module's state from a provided genesis // state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - // this line is used by starport scaffolding # genesis/module/init + var auctionID, userBidID uint64 + for _, item := range genState.Auction { + k.SetGenAuction(ctx, item) + } + + k.SetAuctionParams(ctx, genState.AuctionParams) + + for _, item := range genState.AuctionFeesCollectionFromLimitBidTx { + k.SetGenAuctionLimitBidFeeData(ctx, item) + } + k.SetParams(ctx, genState.Params) + k.SetAuctionID(ctx, auctionID) + k.SetUserBidID(ctx, userBidID) } // ExportGenesis returns the capability module's exported genesis. func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { - genesis := types.DefaultGenesis() - genesis.Params = k.GetParams(ctx) - - // this line is used by starport scaffolding # genesis/module/export - - return genesis + auctionParams, _ := k.GetAuctionParams(ctx) + return types.NewGenesisState( + k.GetAuctions(ctx), + auctionParams, + k.GetGenAuctionLimitBidFeeData(ctx), + k.GetParams(ctx), + k.GetAuctionID(ctx), + k.GetUserBidID(ctx), + ) } diff --git a/x/auctionsV2/keeper/genesis.go b/x/auctionsV2/keeper/genesis.go new file mode 100644 index 000000000..8ac84fee6 --- /dev/null +++ b/x/auctionsV2/keeper/genesis.go @@ -0,0 +1,50 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/auctionsV2/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) SetGenAuction(ctx sdk.Context, auction types.Auction) { + + var ( + store = k.Store(ctx) + key = types.AuctionKey(auction.AuctionId) + value = k.cdc.MustMarshal(&auction) + ) + + store.Set(key, value) +} + +func (k Keeper) SetGenAuctionLimitBidFeeData(ctx sdk.Context, feeData types.AuctionFeesCollectionFromLimitBidTx) { + + var ( + store = k.Store(ctx) + key = types.AuctionLimitBidFeeKey(feeData.AssetId) + value = k.cdc.MustMarshal(&feeData) + ) + + store.Set(key, value) +} + +func (k Keeper) GetGenAuctionLimitBidFeeData(ctx sdk.Context) (auctionFeesCollectionFromLimitBidTx []types.AuctionFeesCollectionFromLimitBidTx) { + var ( + store = k.Store(ctx) + iter = sdk.KVStorePrefixIterator(store, types.AuctionLimitBidFeeKeyPrefix) + ) + + defer func(iter sdk.Iterator) { + err := iter.Close() + if err != nil { + return + } + }(iter) + + for ; iter.Valid(); iter.Next() { + var data types.AuctionFeesCollectionFromLimitBidTx + k.cdc.MustUnmarshal(iter.Value(), &data) + auctionFeesCollectionFromLimitBidTx = append(auctionFeesCollectionFromLimitBidTx, data) + } + + return auctionFeesCollectionFromLimitBidTx +} diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go index 25636b522..89f23cef8 100644 --- a/x/auctionsV2/keeper/utils.go +++ b/x/auctionsV2/keeper/utils.go @@ -89,6 +89,7 @@ func (k Keeper) SetAuctionLimitBidFeeData(ctx sdk.Context, feeData types.Auction store.Set(key, value) return nil } + func (k Keeper) GetAuctionLimitBidFeeData(ctx sdk.Context, assetId uint64) (feeData types.AuctionFeesCollectionFromLimitBidTx, found bool) { var ( store = k.Store(ctx) @@ -128,31 +129,6 @@ func (k Keeper) SetUserBid(ctx sdk.Context, userBid types.Bid) error { return nil } -// func (k Keeper) AddAuctionParams(ctx sdk.Context, liquidationData liquidationtypes.LockedVault,auctionID uint64) (auction types.Auctions, err error) { - -// auctionData := types.Auctions{ -// AuctionId: auctionID + 1, -// CollateralToken: liquidationData.CollateralToken, -// DebtToken: liquidationData.TargetDebt, -// CollateralTokenAuctionPrice: CollateralTokenInitialPrice, -// CollateralTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))), -// DebtTokenOraclePrice: sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))), -// LockedVaultId: liquidationData.LockedVaultId, -// StartTime: ctx.BlockTime(), -// EndTime: ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)), -// AppId: liquidationData.AppId, -// AuctionType: liquidationData.AuctionType, -// } - -// err := k.SetAuction(ctx, auctionData) -// if err != nil { -// return auction, err -// } - -// return auctionData, nil - -// } - func (k Keeper) DeleteAuction(ctx sdk.Context, auction types.Auction) error { var ( @@ -229,6 +205,7 @@ func (k Keeper) GetAuctions(ctx sdk.Context) (auctions []types.Auction) { return auctions } + func (k Keeper) GetAuctionHistoricals(ctx sdk.Context) (auctions []types.AuctionHistorical) { var ( store = k.Store(ctx) diff --git a/x/auctionsV2/types/genesis.go b/x/auctionsV2/types/genesis.go index 569211827..0c0a32cdc 100644 --- a/x/auctionsV2/types/genesis.go +++ b/x/auctionsV2/types/genesis.go @@ -3,18 +3,32 @@ package types // DefaultIndex is the default capability global index const DefaultIndex uint64 = 1 +func NewGenesisState(auction []Auction, auctionParams AuctionParams, auctionFeesCollectionFromLimitBidTx []AuctionFeesCollectionFromLimitBidTx, params Params, auctionId, userBiddingID uint64) *GenesisState { + return &GenesisState{ + Auction: auction, + AuctionParams: auctionParams, + AuctionFeesCollectionFromLimitBidTx: auctionFeesCollectionFromLimitBidTx, + Params: params, + AuctionId: auctionId, + UserBiddingID: userBiddingID, + } +} + // DefaultGenesis returns the default Capability genesis state func DefaultGenesis() *GenesisState { + var auctionId, userBiddingID uint64 return &GenesisState{ - // this line is used by starport scaffolding # genesis/types/default - Params: DefaultParams(), + Auction: []Auction{}, + AuctionParams: AuctionParams{}, + AuctionFeesCollectionFromLimitBidTx: []AuctionFeesCollectionFromLimitBidTx{}, + Params: DefaultParams(), + AuctionId: auctionId, + UserBiddingID: userBiddingID, } } // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - // this line is used by starport scaffolding # genesis/types/validate - return gs.Params.Validate() } diff --git a/x/auctionsV2/types/genesis.pb.go b/x/auctionsV2/types/genesis.pb.go index 70e86b595..f7757d334 100644 --- a/x/auctionsV2/types/genesis.pb.go +++ b/x/auctionsV2/types/genesis.pb.go @@ -24,7 +24,12 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + Auction []Auction `protobuf:"bytes,1,rep,name=auction,proto3" json:"auction" yaml:"auction"` + AuctionParams AuctionParams `protobuf:"bytes,2,opt,name=auctionParams,proto3" json:"auctionParams" yaml:"auctionParams"` + AuctionFeesCollectionFromLimitBidTx []AuctionFeesCollectionFromLimitBidTx `protobuf:"bytes,3,rep,name=auctionFeesCollectionFromLimitBidTx,proto3" json:"auctionFeesCollectionFromLimitBidTx" yaml:"auctionFeesCollectionFromLimitBidTx"` + Params Params `protobuf:"bytes,4,opt,name=params,proto3" json:"params"` + AuctionId uint64 `protobuf:"varint,5,opt,name=AuctionId,proto3" json:"AuctionId,omitempty"` + UserBiddingID uint64 `protobuf:"varint,6,opt,name=UserBiddingID,proto3" json:"UserBiddingID,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -60,6 +65,27 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo +func (m *GenesisState) GetAuction() []Auction { + if m != nil { + return m.Auction + } + return nil +} + +func (m *GenesisState) GetAuctionParams() AuctionParams { + if m != nil { + return m.AuctionParams + } + return AuctionParams{} +} + +func (m *GenesisState) GetAuctionFeesCollectionFromLimitBidTx() []AuctionFeesCollectionFromLimitBidTx { + if m != nil { + return m.AuctionFeesCollectionFromLimitBidTx + } + return nil +} + func (m *GenesisState) GetParams() Params { if m != nil { return m.Params @@ -67,6 +93,20 @@ func (m *GenesisState) GetParams() Params { return Params{} } +func (m *GenesisState) GetAuctionId() uint64 { + if m != nil { + return m.AuctionId + } + return 0 +} + +func (m *GenesisState) GetUserBiddingID() uint64 { + if m != nil { + return m.UserBiddingID + } + return 0 +} + func init() { proto.RegisterType((*GenesisState)(nil), "comdex.auctionsV2.v1beta1.GenesisState") } @@ -76,20 +116,32 @@ func init() { } var fileDescriptor_eebc68c04739f45f = []byte{ - // 207 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4f, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, 0x33, 0xd2, 0x2f, 0x33, - 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x84, 0x28, 0xd4, 0x43, 0x28, 0xd4, 0x83, 0x2a, 0x94, 0x12, 0x49, - 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0xa4, 0xd4, 0x70, 0x9b, 0x5c, 0x90, - 0x58, 0x94, 0x98, 0x0b, 0x35, 0x58, 0xc9, 0x9f, 0x8b, 0xc7, 0x1d, 0x62, 0x53, 0x70, 0x49, 0x62, - 0x49, 0xaa, 0x90, 0x3d, 0x17, 0x1b, 0x44, 0x5e, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x51, - 0x0f, 0xa7, 0xcd, 0x7a, 0x01, 0x60, 0x85, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xb5, - 0x39, 0xf9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, - 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x49, 0x7a, 0x66, - 0x49, 0x46, 0x69, 0x12, 0xc8, 0x40, 0x7d, 0x88, 0xa1, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, - 0x89, 0x39, 0x50, 0xbe, 0x3e, 0x8a, 0x7b, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xee, - 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xff, 0x32, 0x82, 0x5d, 0x2b, 0x01, 0x00, 0x00, + // 390 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x4e, 0xc2, 0x30, + 0x18, 0xc7, 0x37, 0x99, 0x18, 0x8b, 0x78, 0x58, 0x88, 0x99, 0x84, 0x0c, 0x1c, 0x46, 0x17, 0x13, + 0xb7, 0x30, 0x3d, 0x79, 0xd0, 0x38, 0x8d, 0x86, 0xc4, 0x18, 0x33, 0xd1, 0x83, 0xb7, 0x8e, 0x95, + 0xd9, 0x64, 0xa3, 0x64, 0x2b, 0x06, 0xde, 0xc2, 0x27, 0xf0, 0x69, 0x3c, 0x70, 0xe4, 0xe8, 0x89, + 0x18, 0x78, 0x03, 0x9f, 0xc0, 0xb0, 0xd6, 0x90, 0x1d, 0x18, 0xde, 0xda, 0x6f, 0xbf, 0xef, 0xdf, + 0xdf, 0xd7, 0x15, 0x1c, 0xb6, 0x49, 0xe8, 0xa1, 0x81, 0x09, 0xfb, 0x6d, 0x8a, 0x49, 0x37, 0x7e, + 0xb6, 0xcc, 0xb7, 0x86, 0x8b, 0x28, 0x6c, 0x98, 0x3e, 0xea, 0xa2, 0x18, 0xc7, 0x46, 0x2f, 0x22, + 0x94, 0xc8, 0xbb, 0x0c, 0x34, 0x16, 0xa0, 0xc1, 0xc1, 0x72, 0xc9, 0x27, 0x3e, 0x49, 0x28, 0x73, + 0xbe, 0x62, 0x0d, 0xe5, 0x83, 0xe5, 0xc9, 0x3d, 0x18, 0xc1, 0x90, 0x07, 0x97, 0x33, 0x0c, 0x78, + 0x89, 0x83, 0xf5, 0xe5, 0xa0, 0x8b, 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xe2, 0xf7, 0x54, 0x15, 0xdf, + 0x67, 0xaa, 0x30, 0x9e, 0xa9, 0xc2, 0xd7, 0x4c, 0x15, 0x5e, 0x4e, 0x7d, 0x4c, 0x5f, 0xfb, 0xee, + 0x5c, 0xca, 0x64, 0x62, 0xc7, 0xa4, 0xd3, 0xc1, 0x6d, 0x0c, 0x03, 0xbe, 0x37, 0x53, 0x8f, 0x8f, + 0x0e, 0x7b, 0x28, 0x76, 0xf3, 0xc9, 0xbb, 0x3b, 0xf9, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x21, + 0x4c, 0x4d, 0x49, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -112,6 +164,16 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.UserBiddingID != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.UserBiddingID)) + i-- + dAtA[i] = 0x30 + } + if m.AuctionId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.AuctionId)) + i-- + dAtA[i] = 0x28 + } { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -121,7 +183,45 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x22 + if len(m.AuctionFeesCollectionFromLimitBidTx) > 0 { + for iNdEx := len(m.AuctionFeesCollectionFromLimitBidTx) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AuctionFeesCollectionFromLimitBidTx[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.AuctionParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Auction) > 0 { + for iNdEx := len(m.Auction) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Auction[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } return len(dAtA) - i, nil } @@ -142,8 +242,28 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l + if len(m.Auction) > 0 { + for _, e := range m.Auction { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + l = m.AuctionParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.AuctionFeesCollectionFromLimitBidTx) > 0 { + for _, e := range m.AuctionFeesCollectionFromLimitBidTx { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) + if m.AuctionId != 0 { + n += 1 + sovGenesis(uint64(m.AuctionId)) + } + if m.UserBiddingID != 0 { + n += 1 + sovGenesis(uint64(m.UserBiddingID)) + } return n } @@ -183,6 +303,107 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Auction = append(m.Auction, Auction{}) + if err := m.Auction[len(m.Auction)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AuctionParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionFeesCollectionFromLimitBidTx", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuctionFeesCollectionFromLimitBidTx = append(m.AuctionFeesCollectionFromLimitBidTx, AuctionFeesCollectionFromLimitBidTx{}) + if err := m.AuctionFeesCollectionFromLimitBidTx[len(m.AuctionFeesCollectionFromLimitBidTx)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } @@ -215,6 +436,44 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserBiddingID", wireType) + } + m.UserBiddingID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserBiddingID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/liquidationsV2/genesis.go b/x/liquidationsV2/genesis.go index 32fb04602..5a583a1d0 100644 --- a/x/liquidationsV2/genesis.go +++ b/x/liquidationsV2/genesis.go @@ -9,16 +9,29 @@ import ( // InitGenesis initializes the capability module's state from a provided genesis // state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - // this line is used by starport scaffolding # genesis/module/init + var lockedVaultID uint64 + for _, item := range genState.LockedVault { + k.SetLockedVault(ctx, item) + lockedVaultID = lockedVaultID + 1 + } + + for _, item := range genState.LiquidationWhiteListing { + k.SetLiquidationWhiteListing(ctx, item) + } + + for _, item := range genState.AppReserveFunds { + k.SetAppReserveFunds(ctx, item) + } + k.SetParams(ctx, genState.Params) } // ExportGenesis returns the capability module's exported genesis. func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { - genesis := types.DefaultGenesis() - genesis.Params = k.GetParams(ctx) - - // this line is used by starport scaffolding # genesis/module/export - - return genesis + return types.NewGenesisState( + k.GetLockedVaults(ctx), + k.GetGenLiquidationWhiteListing(ctx), + k.GetGenAppReserveFunds(ctx), + k.GetParams(ctx), + ) } diff --git a/x/liquidationsV2/keeper/genesis.go b/x/liquidationsV2/keeper/genesis.go new file mode 100644 index 000000000..68e94daaf --- /dev/null +++ b/x/liquidationsV2/keeper/genesis.go @@ -0,0 +1,50 @@ +package keeper + +import ( + "github.com/comdex-official/comdex/x/liquidationsV2/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) GetGenLiquidationWhiteListing(ctx sdk.Context) (liquidationWhiteListing []types.LiquidationWhiteListing) { + var ( + store = k.Store(ctx) + iter = sdk.KVStorePrefixIterator(store, types.LiquidationWhiteListingKeyPrefix) + ) + + defer func(iter sdk.Iterator) { + err := iter.Close() + if err != nil { + return + } + }(iter) + + for ; iter.Valid(); iter.Next() { + var data types.LiquidationWhiteListing + k.cdc.MustUnmarshal(iter.Value(), &data) + liquidationWhiteListing = append(liquidationWhiteListing, data) + } + + return liquidationWhiteListing +} + +func (k Keeper) GetGenAppReserveFunds(ctx sdk.Context) (appReserveFunds []types.AppReserveFunds) { + var ( + store = k.Store(ctx) + iter = sdk.KVStorePrefixIterator(store, types.AppReserveFundsKeyPrefix) + ) + + defer func(iter sdk.Iterator) { + err := iter.Close() + if err != nil { + return + } + }(iter) + + for ; iter.Valid(); iter.Next() { + var data types.AppReserveFunds + k.cdc.MustUnmarshal(iter.Value(), &data) + appReserveFunds = append(appReserveFunds, data) + } + + return appReserveFunds +} diff --git a/x/liquidationsV2/types/genesis.go b/x/liquidationsV2/types/genesis.go index aa82115f8..4057137b9 100644 --- a/x/liquidationsV2/types/genesis.go +++ b/x/liquidationsV2/types/genesis.go @@ -1,24 +1,30 @@ package types -import ( -// this line is used by starport scaffolding # genesis/types/import -) - // DefaultIndex is the default capability global index const DefaultIndex uint64 = 1 // DefaultGenesis returns the default Capability genesis state -func DefaultGenesis() *GenesisState { + +func NewGenesisState(lockedVault []LockedVault, whitelistedApps []LiquidationWhiteListing, appReserveFunds []AppReserveFunds, params Params) *GenesisState { return &GenesisState{ - // this line is used by starport scaffolding # genesis/types/default - Params: DefaultParams(), + LockedVault: lockedVault, + LiquidationWhiteListing: whitelistedApps, + AppReserveFunds: appReserveFunds, + Params: params, } } +func DefaultGenesis() *GenesisState { + return NewGenesisState( + []LockedVault{}, + []LiquidationWhiteListing{}, + []AppReserveFunds{}, + DefaultParams(), + ) +} + // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - // this line is used by starport scaffolding # genesis/types/validate - return gs.Params.Validate() } diff --git a/x/liquidationsV2/types/genesis.pb.go b/x/liquidationsV2/types/genesis.pb.go index 7654ad098..73aef3044 100644 --- a/x/liquidationsV2/types/genesis.pb.go +++ b/x/liquidationsV2/types/genesis.pb.go @@ -24,7 +24,10 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + LockedVault []LockedVault `protobuf:"bytes,1,rep,name=lockedVault,proto3" json:"lockedVault" yaml:"lockedVault"` + LiquidationWhiteListing []LiquidationWhiteListing `protobuf:"bytes,2,rep,name=liquidationWhiteListing,proto3" json:"liquidationWhiteListing" yaml:"liquidationWhiteListing"` + AppReserveFunds []AppReserveFunds `protobuf:"bytes,3,rep,name=appReserveFunds,proto3" json:"appReserveFunds" yaml:"appReserveFunds"` + Params Params `protobuf:"bytes,4,opt,name=params,proto3" json:"params"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -60,6 +63,27 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo +func (m *GenesisState) GetLockedVault() []LockedVault { + if m != nil { + return m.LockedVault + } + return nil +} + +func (m *GenesisState) GetLiquidationWhiteListing() []LiquidationWhiteListing { + if m != nil { + return m.LiquidationWhiteListing + } + return nil +} + +func (m *GenesisState) GetAppReserveFunds() []AppReserveFunds { + if m != nil { + return m.AppReserveFunds + } + return nil +} + func (m *GenesisState) GetParams() Params { if m != nil { return m.Params @@ -76,21 +100,30 @@ func init() { } var fileDescriptor_7ee1f29509948006 = []byte{ - // 211 bytes of a gzipped FileDescriptorProto + // 359 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0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62, 0x03, 0xbb, 0xd7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x5b, 0x7e, 0x80, 0x3f, - 0x01, 0x00, 0x00, + 0xe1, 0xb7, 0xa1, 0x20, 0xb1, 0x28, 0x31, 0x17, 0x6a, 0x81, 0x94, 0x2e, 0x7e, 0xb5, 0x30, 0xe1, + 0x54, 0x88, 0x72, 0xa5, 0x4b, 0xcc, 0x5c, 0x3c, 0xee, 0x10, 0x17, 0x06, 0x97, 0x24, 0x96, 0xa4, + 0x0a, 0x65, 0x70, 0x71, 0xe7, 0xe4, 0x27, 0x67, 0xa7, 0xa6, 0x84, 0x25, 0x96, 0xe6, 0x94, 0x48, + 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x1b, 0x69, 0xe9, 0xe1, 0x75, 0xb6, 0x9e, 0x0f, 0x42, 0x87, 0x93, + 0xd4, 0x89, 0x7b, 0xf2, 0x0c, 0x9f, 0xee, 0xc9, 0x0b, 0x55, 0x26, 0xe6, 0xe6, 0x58, 0x29, 0x21, + 0x19, 0xa6, 0x14, 0x84, 0x6c, 0xb4, 0xd0, 0x0c, 0x46, 0x2e, 0x71, 0x24, 0xf3, 0xc2, 0x33, 0x32, + 0x4b, 0x52, 0x7d, 0x32, 0x8b, 0x4b, 0x32, 0xf3, 0xd2, 0x25, 0x98, 0xc0, 0xd6, 0x9a, 0x11, 0xb2, + 0x16, 0xbb, 0x6e, 0x27, 0x35, 0xa8, 0x13, 0xe4, 0xa0, 0x4e, 0xc0, 0xae, 0x4c, 0x29, 0x08, 0x97, + 0xf5, 0x42, 0x15, 0x5c, 0xfc, 0x89, 0x05, 0x05, 0x41, 0xa9, 0xc5, 0xa9, 0x45, 0x65, 0xa9, 0x6e, + 0xa5, 0x79, 0x29, 0xc5, 0x12, 0xcc, 0x60, 0x17, 0xe9, 0x11, 0x70, 0x91, 0x23, 0xaa, 0x2e, 0x27, + 0x39, 0xa8, 0x4b, 0xc4, 0x20, 0x2e, 0x41, 0x33, 0x54, 0x29, 0x08, 0xdd, 0x1a, 0x21, 0x67, 0x2e, + 0x36, 0x48, 0x74, 0x4a, 0xb0, 0x28, 0x30, 0x6a, 0x70, 0x1b, 0xa9, 0x12, 0xb0, 0x30, 0x00, 0xac, + 0xd8, 0x89, 0x05, 0x64, 0x4f, 0x10, 0x54, 0xab, 0x53, 0xd0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, + 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, + 0x1e, 0xcb, 0x31, 0x44, 0x59, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0x81, 0x0c, 0xd5, 0x87, 0x18, + 0xac, 0x9b, 0x9f, 0x96, 0x96, 0x99, 0x9c, 0x99, 0x98, 0x03, 0xe5, 0xeb, 0x63, 0x24, 0x9d, 0x92, + 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x7a, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x83, + 0x6b, 0x5d, 0x40, 0xee, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -122,7 +155,49 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x22 + if len(m.AppReserveFunds) > 0 { + for iNdEx := len(m.AppReserveFunds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AppReserveFunds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.LiquidationWhiteListing) > 0 { + for iNdEx := len(m.LiquidationWhiteListing) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LiquidationWhiteListing[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.LockedVault) > 0 { + for iNdEx := len(m.LockedVault) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LockedVault[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } return len(dAtA) - i, nil } @@ -143,6 +218,24 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l + if len(m.LockedVault) > 0 { + for _, e := range m.LockedVault { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.LiquidationWhiteListing) > 0 { + for _, e := range m.LiquidationWhiteListing { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.AppReserveFunds) > 0 { + for _, e := range m.AppReserveFunds { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) return n @@ -184,6 +277,108 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LockedVault", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LockedVault = append(m.LockedVault, LockedVault{}) + if err := m.LockedVault[len(m.LockedVault)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidationWhiteListing", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LiquidationWhiteListing = append(m.LiquidationWhiteListing, LiquidationWhiteListing{}) + if err := m.LiquidationWhiteListing[len(m.LiquidationWhiteListing)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppReserveFunds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppReserveFunds = append(m.AppReserveFunds, AppReserveFunds{}) + if err := m.AppReserveFunds[len(m.AppReserveFunds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } diff --git a/x/liquidationsV2/types/gov.pb.go b/x/liquidationsV2/types/gov.pb.go index 575d93ae7..f8f83d14c 100644 --- a/x/liquidationsV2/types/gov.pb.go +++ b/x/liquidationsV2/types/gov.pb.go @@ -5,10 +5,8 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -73,28 +71,26 @@ func init() { } var fileDescriptor_4fbf1b0be7d4e97b = []byte{ - // 336 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xcd, 0x4e, 0xc2, 0x40, - 0x14, 0x85, 0x5b, 0xff, 0x12, 0x0b, 0x0b, 0xd3, 0x18, 0x43, 0x88, 0x4e, 0x49, 0x17, 0xca, 0x86, - 0x4e, 0xc0, 0xc4, 0x10, 0x97, 0xac, 0x59, 0x18, 0x16, 0x9a, 0xb0, 0x72, 0x5a, 0x86, 0xe1, 0x26, - 0x53, 0x6e, 0x65, 0x06, 0x94, 0xb7, 0xf0, 0x31, 0x7c, 0x14, 0x96, 0x2c, 0x5d, 0x11, 0x2d, 0x6f, - 0xc0, 0x13, 0x18, 0x3a, 0x45, 0x21, 0x26, 0xec, 0xe6, 0xde, 0xfb, 0x9d, 0x39, 0x27, 0xc7, 0xb9, - 0x89, 0x30, 0xee, 0xf1, 0x37, 0x2a, 0xe1, 0x65, 0x0c, 0x3d, 0xa6, 0x01, 0x87, 0xea, 0xb1, 0x41, - 0x27, 0xf5, 0x90, 0x6b, 0x56, 0xa7, 0x02, 0x27, 0x41, 0x32, 0x42, 0x8d, 0xee, 0x95, 0x01, 0x83, - 0x5d, 0x30, 0xc8, 0xc1, 0xf2, 0xb9, 0x40, 0x81, 0x19, 0x49, 0xd7, 0x2f, 0x23, 0x2a, 0x7b, 0x02, - 0x51, 0x48, 0x4e, 0xb3, 0x29, 0x1c, 0xf7, 0xa9, 0x86, 0x98, 0x2b, 0xcd, 0xe2, 0x24, 0x07, 0x48, - 0x84, 0x2a, 0x46, 0x45, 0x43, 0xa6, 0xf8, 0xaf, 0x69, 0x84, 0x30, 0xcc, 0xef, 0xb5, 0xfd, 0xf1, - 0x36, 0x6b, 0x6e, 0x70, 0x3f, 0xb5, 0x9d, 0xcb, 0xa7, 0x01, 0x68, 0x2e, 0x41, 0xe9, 0xf6, 0x9f, - 0xe6, 0x61, 0x84, 0x09, 0x2a, 0x26, 0xdd, 0x6b, 0xe7, 0x58, 0x83, 0x96, 0xbc, 0x64, 0x57, 0xec, - 0xea, 0x69, 0xeb, 0x6c, 0xb5, 0xf0, 0x8a, 0x53, 0x16, 0xcb, 0x7b, 0x3f, 0x5b, 0xfb, 0x1d, 0x73, - 0x76, 0x9b, 0x4e, 0xa1, 0xc7, 0x55, 0x34, 0x82, 0x64, 0x2d, 0x2f, 0x1d, 0x64, 0xf4, 0xc5, 0x6a, - 0xe1, 0xb9, 0x86, 0xde, 0x3a, 0xfa, 0x9d, 0x6d, 0xd4, 0x7d, 0x76, 0x8a, 0xaf, 0x9b, 0x04, 0x30, - 0x14, 0xa5, 0xc3, 0x8a, 0x5d, 0x2d, 0x34, 0xee, 0x82, 0xbd, 0xf5, 0x05, 0x5b, 0x59, 0xb3, 0xfc, - 0x6d, 0xa3, 0x6e, 0x1d, 0xcd, 0x16, 0x9e, 0xd5, 0xd9, 0xf9, 0xb1, 0xd5, 0x9d, 0x7d, 0x13, 0xeb, - 0x23, 0x25, 0xd6, 0x2c, 0x25, 0xf6, 0x3c, 0x25, 0xf6, 0x57, 0x4a, 0xec, 0xf7, 0x25, 0xb1, 0xe6, - 0x4b, 0x62, 0x7d, 0x2e, 0x89, 0xd5, 0x6d, 0x0a, 0xd0, 0x83, 0x71, 0xb8, 0xf6, 0xa4, 0xc6, 0xb7, - 0x86, 0xfd, 0x3e, 0x44, 0xc0, 0x64, 0x3e, 0xd3, 0x7f, 0x95, 0xea, 0x69, 0xc2, 0x55, 0x78, 0x92, - 0xf5, 0x78, 0xfb, 0x13, 0x00, 0x00, 0xff, 0xff, 0xff, 0x8d, 0x3e, 0x86, 0x17, 0x02, 0x00, 0x00, + // 299 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4f, 0xce, 0xcf, 0x4d, + 0x49, 0xad, 0xd0, 0xcf, 0xc9, 0x2c, 0x2c, 0xcd, 0x4c, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x0e, + 0x33, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0xcf, 0x2f, 0xd3, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x85, 0x28, 0xd4, 0x43, 0x55, 0xa8, 0x07, 0x55, 0x28, 0x25, 0x92, + 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa9, 0x0f, 0x62, 0x41, 0x34, 0x49, 0xe9, 0xe2, 0x37, 0x1d, 0x26, + 0x9c, 0x0a, 0x51, 0xae, 0xf4, 0x88, 0x91, 0x4b, 0x26, 0x3c, 0x23, 0xb3, 0x24, 0x35, 0x27, 0xb3, + 0xb8, 0xc4, 0x07, 0xa1, 0x27, 0xa0, 0x28, 0xbf, 0x20, 0xbf, 0x38, 0x31, 0x47, 0x48, 0x8d, 0x8b, + 0xb5, 0x24, 0xb3, 0x24, 0x27, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, 0x49, 0xe0, 0xd3, 0x3d, + 0x79, 0x9e, 0xca, 0xc4, 0xdc, 0x1c, 0x2b, 0x25, 0xb0, 0xb0, 0x52, 0x10, 0x44, 0x5a, 0xc8, 0x82, + 0x8b, 0x3b, 0x25, 0xb5, 0x38, 0xb9, 0x28, 0xb3, 0x00, 0xa4, 0x5d, 0x82, 0x09, 0xac, 0x5a, 0xec, + 0xd3, 0x3d, 0x79, 0x21, 0x88, 0x6a, 0x24, 0x49, 0xa5, 0x20, 0x64, 0xa5, 0x42, 0x09, 0x5c, 0x3c, + 0xe5, 0x30, 0x17, 0x64, 0xe6, 0xa5, 0x4b, 0x30, 0x2b, 0x30, 0x6a, 0x70, 0x1b, 0x99, 0xe9, 0xe1, + 0xf5, 0xbd, 0x1e, 0x92, 0x5b, 0xc1, 0xee, 0xf7, 0x81, 0xe8, 0x76, 0x62, 0x39, 0x71, 0x4f, 0x9e, + 0x21, 0x08, 0xc5, 0x44, 0xa7, 0xa8, 0x13, 0x0f, 0xe5, 0x18, 0x56, 0x3c, 0x92, 0x63, 0x38, 0xf1, + 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, + 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x8b, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, + 0x90, 0x9d, 0xfa, 0x10, 0x7b, 0x75, 0xf3, 0xd3, 0xd2, 0x32, 0x93, 0x33, 0x13, 0x73, 0xa0, 0x7c, + 0x7d, 0x8c, 0x20, 0x2d, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x87, 0xa3, 0x31, 0x20, 0x00, + 0x00, 0xff, 0xff, 0x7e, 0x8b, 0x01, 0x13, 0xd6, 0x01, 0x00, 0x00, } func (m *WhitelistLiquidationProposal) Marshal() (dAtA []byte, err error) { diff --git a/x/liquidationsV2/types/params.pb.go b/x/liquidationsV2/types/params.pb.go index 0435dfbe9..0fb2eb101 100644 --- a/x/liquidationsV2/types/params.pb.go +++ b/x/liquidationsV2/types/params.pb.go @@ -5,7 +5,6 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -76,20 +75,19 @@ func init() { } var fileDescriptor_32258fedf7caac4b = []byte{ - // 199 bytes of a gzipped FileDescriptorProto + // 186 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2,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 0xfd, 0x00, 0x00, 0x00, + 0xab, 0x64, 0xc7, 0xc5, 0x16, 0x00, 0x56, 0x2e, 0x64, 0xc2, 0x25, 0x86, 0xa4, 0x26, 0x3e, 0x29, + 0xb1, 0x24, 0x39, 0x23, 0xbe, 0x38, 0xb3, 0x2a, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0x25, 0x48, + 0x04, 0x49, 0xd6, 0x09, 0x24, 0x19, 0x9c, 0x59, 0x95, 0xea, 0x14, 0x74, 0xe2, 0x91, 0x1c, 0xe3, + 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, + 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x16, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, + 0xb9, 0xfa, 0x10, 0x37, 0xe8, 0xe6, 0xa7, 0xa5, 0x65, 0x26, 0x67, 0x26, 0xe6, 0x40, 0xf9, 0xfa, + 0x18, 0x3e, 0x28, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xbb, 0xdc, 0x18, 0x10, 0x00, 0x00, + 0xff, 0xff, 0x1b, 0xc5, 0x30, 0x7c, 0xe7, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/liquidationsV2/types/tx.pb.go b/x/liquidationsV2/types/tx.pb.go index f5667aa8c..ac7e78b61 100644 --- a/x/liquidationsV2/types/tx.pb.go +++ b/x/liquidationsV2/types/tx.pb.go @@ -14,7 +14,6 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -276,55 +275,54 @@ func init() { } var fileDescriptor_51c735c845851e88 = []byte{ - // 758 bytes of a gzipped FileDescriptorProto + // 739 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x53, 0xd3, 0x4e, - 0x18, 0x6e, 0x4a, 0x4b, 0xe9, 0xf2, 0xe3, 0x87, 0x04, 0x66, 0x2c, 0x1d, 0x4d, 0x30, 0x38, 0xca, + 0x18, 0x6e, 0x4a, 0x4b, 0xe9, 0xf2, 0xe3, 0x87, 0x04, 0x66, 0x2c, 0x19, 0x4d, 0x30, 0x38, 0xca, 0x85, 0x64, 0xc0, 0x0b, 0x38, 0x1e, 0x6c, 0x41, 0x66, 0x50, 0xd0, 0x31, 0xc3, 0x78, 0xe0, 0xd2, - 0xd9, 0x36, 0xdb, 0xb8, 0x43, 0x92, 0x4d, 0xbb, 0x5b, 0xa4, 0x17, 0xaf, 0x8e, 0x37, 0xbe, 0x82, - 0x37, 0x3e, 0x0a, 0x47, 0x8e, 0x7a, 0xc9, 0x68, 0xf9, 0x06, 0x3d, 0x78, 0xf0, 0xe4, 0xec, 0x6e, - 0xfa, 0x97, 0x5a, 0x04, 0x4f, 0xed, 0xee, 0x3e, 0xcf, 0xbb, 0xef, 0xf3, 0xbc, 0xef, 0xbb, 0x01, - 0x8f, 0x2a, 0xc4, 0x77, 0xd0, 0x89, 0xe5, 0xe1, 0x5a, 0x03, 0x3b, 0x90, 0x61, 0x12, 0xd0, 0x77, - 0xeb, 0xd6, 0xf1, 0x5a, 0x19, 0x31, 0xb8, 0x66, 0xb1, 0x13, 0x33, 0xac, 0x13, 0x46, 0xd4, 0xfb, - 0x12, 0x67, 0x0e, 0xe2, 0xcc, 0x18, 0x97, 0x5f, 0x70, 0x89, 0x4b, 0x04, 0xd2, 0xe2, 0xff, 0x24, - 0x29, 0xaf, 0xbb, 0x84, 0xb8, 0x1e, 0xb2, 0xc4, 0xaa, 0xdc, 0xa8, 0x5a, 0x0c, 0xfb, 0x88, 0x32, - 0xe8, 0x87, 0x31, 0x40, 0xab, 0x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 0xff, 0xff, 0xa3, 0xde, 0x8d, 0x78, 0x55, + 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From 126a6015389daaa5efb7ca320240c76f3a5c9efb Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 10 Jul 2023 11:32:24 +0530 Subject: [PATCH 112/155] added error logs and event emmiter --- x/auctionsV2/abci.go | 35 +++++++++++++++++++++++++++-------- x/auctionsV2/types/events.go | 6 ++++++ x/lend/keeper/migrate.go | 2 ++ 3 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 x/auctionsV2/types/events.go diff --git a/x/auctionsV2/abci.go b/x/auctionsV2/abci.go index fd73b47e4..899c0f808 100644 --- a/x/auctionsV2/abci.go +++ b/x/auctionsV2/abci.go @@ -1,18 +1,37 @@ package auctionsV2 import ( + utils "github.com/comdex-official/comdex/types" + "github.com/comdex-official/comdex/x/auctionsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/comdex-official/comdex/x/auctionsV2/keeper" ) func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { - err := k.AuctionIterator(ctx) - if err != nil { - return - } - err = k.LimitOrderBid(ctx) - if err != nil { - return - } + _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { + err := k.AuctionIterator(ctx) + if err != nil { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeAuctionIteratorErr, + ), + ) + ctx.Logger().Error("error in Auction iterator") + } + return nil + }) + + _ = utils.ApplyFuncIfNoError(ctx, func(ctx sdk.Context) error { + err := k.LimitOrderBid(ctx) + if err != nil { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeLimitOrderBidErr, + ), + ) + ctx.Logger().Error("error in Auction Limit order bid") + } + return nil + }) } diff --git a/x/auctionsV2/types/events.go b/x/auctionsV2/types/events.go new file mode 100644 index 000000000..2b095623e --- /dev/null +++ b/x/auctionsV2/types/events.go @@ -0,0 +1,6 @@ +package types + +const ( + EventTypeAuctionIteratorErr = "auction_iterator_error" + EventTypeLimitOrderBidErr = "auction_limit_order_bid_error" +) diff --git a/x/lend/keeper/migrate.go b/x/lend/keeper/migrate.go index 0e39adcd6..5f8699578 100644 --- a/x/lend/keeper/migrate.go +++ b/x/lend/keeper/migrate.go @@ -152,6 +152,7 @@ func MigrateLendPairs(store sdk.KVStore, cdc codec.BinaryCodec) error { defer func(iterator storetypes.Iterator) { err := iterator.Close() if err != nil { + return } }(iterator) @@ -195,6 +196,7 @@ func MigrateAssetRatesParams(store sdk.KVStore, cdc codec.BinaryCodec) error { defer func(iterator storetypes.Iterator) { err := iterator.Close() if err != nil { + return } }(iterator) From 784ad6ae3e52d417c30f7abd3aeaed8e4c44a222 Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 10 Jul 2023 11:38:09 +0530 Subject: [PATCH 113/155] refactoring app.go --- app/app.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index d4c848d5c..00f846f5d 100644 --- a/app/app.go +++ b/app/app.go @@ -424,8 +424,7 @@ func New( markettypes.StoreKey, bandoraclemoduletypes.StoreKey, lockertypes.StoreKey, wasm.StoreKey, authzkeeper.StoreKey, auctiontypes.StoreKey, tokenminttypes.StoreKey, rewardstypes.StoreKey, feegrant.StoreKey, liquiditytypes.StoreKey, esmtypes.ModuleName, lendtypes.StoreKey, - newliqtypes.StoreKey, newauctypes.StoreKey, ibchookstypes.StoreKey, packetforwardtypes.StoreKey, - ibchookstypes.StoreKey, icqtypes.StoreKey, packetforwardtypes.StoreKey, + newliqtypes.StoreKey, newauctypes.StoreKey, ibchookstypes.StoreKey, packetforwardtypes.StoreKey, icqtypes.StoreKey, ) ) From 60b16cfdc36c606a7db2f68fb9cb37b3ef88f58c Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 10 Jul 2023 11:49:06 +0530 Subject: [PATCH 114/155] resolving testcase error --- x/liquidationsV2/types/genesis_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/x/liquidationsV2/types/genesis_test.go b/x/liquidationsV2/types/genesis_test.go index 8ce20f8f7..13d170a09 100644 --- a/x/liquidationsV2/types/genesis_test.go +++ b/x/liquidationsV2/types/genesis_test.go @@ -20,13 +20,9 @@ func TestGenesisState_Validate(t *testing.T) { }, { desc: "valid genesis state", - genState: &types.GenesisState{ - - // this line is used by starport scaffolding # types/genesis/validField - }, - valid: true, + genState: &types.GenesisState{}, + valid: false, }, - // this line is used by starport scaffolding # types/genesis/testcase } { t.Run(tc.desc, func(t *testing.T) { err := tc.genState.Validate() From 6c404ac463743ccac02ae64ae0f31b61774aa1ed Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 10 Jul 2023 16:35:57 +0530 Subject: [PATCH 115/155] refactoring app.go --- app/app.go | 46 +++++++++++++++------------------------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/app/app.go b/app/app.go index 00f846f5d..b5ab1a41e 100644 --- a/app/app.go +++ b/app/app.go @@ -792,14 +792,14 @@ func New( app.GetSubspace(newliqtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - app.AssetKeeper, - app.VaultKeeper, - app.MarketKeeper, - app.EsmKeeper, - app.Rewardskeeper, - app.LendKeeper, - app.NewaucKeeper, - app.CollectorKeeper, + &app.AssetKeeper, + &app.VaultKeeper, + &app.MarketKeeper, + &app.EsmKeeper, + &app.Rewardskeeper, + &app.LendKeeper, + &app.NewaucKeeper, + &app.CollectorKeeper, ) app.NewaucKeeper = newauckeeper.NewKeeper( @@ -807,32 +807,16 @@ func New( app.keys[newauctypes.StoreKey], app.keys[newauctypes.MemStoreKey], app.GetSubspace(newauctypes.ModuleName), - app.NewliqKeeper, + &app.NewliqKeeper, app.BankKeeper, - app.MarketKeeper, - app.AssetKeeper, - app.EsmKeeper, - app.VaultKeeper, - app.CollectorKeeper, - app.TokenmintKeeper, + &app.MarketKeeper, + &app.AssetKeeper, + &app.EsmKeeper, + &app.VaultKeeper, + &app.CollectorKeeper, + &app.TokenmintKeeper, ) - app.NewliqKeeper = newliqkeeper.NewKeeper( - app.cdc, - app.keys[newliqtypes.StoreKey], - app.keys[newliqtypes.MemStoreKey], - app.GetSubspace(newliqtypes.ModuleName), - app.AccountKeeper, - app.BankKeeper, - app.AssetKeeper, - app.VaultKeeper, - app.MarketKeeper, - app.EsmKeeper, - app.Rewardskeeper, - app.LendKeeper, - app.NewaucKeeper, - app.CollectorKeeper, - ) // ICQ Keeper icqKeeper := icqkeeper.NewKeeper( appCodec, From f18e2e7f9b103ca9ddfd32394098d50d24432851 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 18:40:01 +0000 Subject: [PATCH 116/155] Bump actions/labeler from 4.2.0 to 4.3.0 Bumps [actions/labeler](https://github.com/actions/labeler) from 4.2.0 to 4.3.0. - [Release notes](https://github.com/actions/labeler/releases) - [Commits](https://github.com/actions/labeler/compare/v4.2.0...v4.3.0) --- updated-dependencies: - dependency-name: actions/labeler dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index ee6245a7b..75c2f9738 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -6,6 +6,6 @@ jobs: labeler: runs-on: ubuntu-latest steps: - - uses: actions/labeler@v4.2.0 + - uses: actions/labeler@v4.3.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" From f19c465cf53a1641cbdff4bac6ba316ae8c5032f Mon Sep 17 00:00:00 2001 From: Pratik Date: Thu, 13 Jul 2023 18:09:36 +0530 Subject: [PATCH 117/155] adding auction queries --- app/upgrades/mainnet/v12/constants.go | 2 +- proto/comdex/auctionsV2/v1beta1/bid.proto | 38 +- proto/comdex/auctionsV2/v1beta1/query.proto | 58 + x/auctionsV2/client/cli/query.go | 206 ++ x/auctionsV2/keeper/bid.go | 19 + x/auctionsV2/keeper/grpc_query.go | 106 +- x/auctionsV2/keeper/utils.go | 34 + x/auctionsV2/types/keys.go | 22 + x/auctionsV2/types/query.pb.go | 2197 ++++++++++++++++--- x/auctionsV2/types/query.pb.gw.go | 423 ++++ 10 files changed, 2788 insertions(+), 317 deletions(-) diff --git a/app/upgrades/mainnet/v12/constants.go b/app/upgrades/mainnet/v12/constants.go index 9ba6229ba..38e9eb4a1 100644 --- a/app/upgrades/mainnet/v12/constants.go +++ b/app/upgrades/mainnet/v12/constants.go @@ -1,7 +1,7 @@ package v12 const ( - UpgradeName = "v12.0.0" + UpgradeName = "v12.rc1" UpgradeHeight = "" UpgradeInfo = `'{ "binaries": { diff --git a/proto/comdex/auctionsV2/v1beta1/bid.proto b/proto/comdex/auctionsV2/v1beta1/bid.proto index e90c27d46..22e820f67 100644 --- a/proto/comdex/auctionsV2/v1beta1/bid.proto +++ b/proto/comdex/auctionsV2/v1beta1/bid.proto @@ -56,7 +56,7 @@ message LimitOrderBid{ ]; uint64 collateral_token_id = 3 [ - + (gogoproto.moretags) = "yaml:\"collateral_token_id\"" ]; string premium_discount = 4 [ @@ -65,9 +65,9 @@ message LimitOrderBid{ (gogoproto.moretags) = "yaml:\"premium_discount\"" ]; uint64 debt_token_id = 5 [ - - (gogoproto.moretags) = "yaml:\"debt_token_id\"" -]; + + (gogoproto.moretags) = "yaml:\"debt_token_id\"" + ]; cosmos.base.v1beta1.Coin debt_token = 6 [ @@ -142,26 +142,26 @@ message LimitOrderBidsForUser{ message LimitOrderUserKey{ uint64 debt_token_id = 1 [ - -(gogoproto.moretags) = "yaml:\"debt_token_id\""]; + + (gogoproto.moretags) = "yaml:\"debt_token_id\""]; uint64 collateral_token_id = 2 [ - - (gogoproto.moretags) = "yaml:\"collateral_token_id\"" -]; -string premium_discount = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"premium_discount\"" -]; -uint64 limit_order_bidding_id = 4 [ - (gogoproto.moretags) = "yaml:\"limit_order_bidding_id\"" -]; + + (gogoproto.moretags) = "yaml:\"collateral_token_id\"" + ]; + string premium_discount = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"premium_discount\"" + ]; + uint64 limit_order_bidding_id = 4 [ + (gogoproto.moretags) = "yaml:\"limit_order_bidding_id\"" + ]; } message AuctionFeesCollectionFromLimitBidTx{ - uint64 asset_id=1 [ - (gogoproto.moretags) = "yaml:\"asset_id\""]; + uint64 asset_id = 1 [ + (gogoproto.moretags) = "yaml:\"asset_id\""]; string amount = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false, diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index f341b741f..f9fcef6a9 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -69,6 +69,55 @@ message QueryAuctionParamsResponse { ]; } +message QueryUserLimitBidsRequest { + string bidder = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryUserLimitBidsResponse { + LimitOrderBidsForUser limitOrderBids = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"limit_order_bids\"" + ]; +} + +message QueryUserLimitBidsByAssetIDRequest { + string bidder = 1; + uint64 collateral_token_id = 2; + uint64 debt_token_id = 3; + cosmos.base.query.v1beta1.PageRequest pagination = 4 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryUserLimitBidsByAssetIDResponse { + string bidder = 1 [ + (gogoproto.moretags) = "yaml:\"bidder\"" + ]; + repeated LimitOrderBid limitOrderBids = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"limit_order_bids\"" + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 3 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryLimitBidsRequest { + uint64 collateral_token_id = 1; + uint64 debt_token_id = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryLimitBidsResponse { + repeated LimitOrderBid limitOrderBids = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"limit_order_bids\"" + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 3 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/comdex/auctions/v2/params"; @@ -85,4 +134,13 @@ service Query { rpc AuctionParams(QueryAuctionParamsRequest) returns (QueryAuctionParamsResponse) { option (google.api.http).get = "/comdex/auctions/v2/auction_params"; } + rpc UserLimitBids(QueryUserLimitBidsRequest) returns (QueryUserLimitBidsResponse) { + option (google.api.http).get = "/comdex/auctions/v2/userlimitorderbids/{bidder}"; + } + rpc UserLimitBidsByAssetID(QueryUserLimitBidsByAssetIDRequest) returns (QueryUserLimitBidsByAssetIDResponse) { + option (google.api.http).get = "/comdex/auctions/v2/userlimitorderbids/{bidder}/{collateral_token_id}/{debt_token_id}"; + } + rpc LimitBids(QueryLimitBidsRequest) returns (QueryLimitBidsResponse) { + option (google.api.http).get = "/comdex/auctions/v2/limitorderbids/{collateral_token_id}/{debt_token_id}"; + } } \ No newline at end of file diff --git a/x/auctionsV2/client/cli/query.go b/x/auctionsV2/client/cli/query.go index fd3fec3c8..72ff518e1 100644 --- a/x/auctionsV2/client/cli/query.go +++ b/x/auctionsV2/client/cli/query.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" "strconv" // "strings" @@ -30,6 +31,11 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand( queryAuction(), queryAuctions(), + queryBids(), + queryUserLimitOrderBids(), + queryAuctionParams(), + queryUserLimitOrderBidsByAssetID(), + queryLimitOrderBids(), ) return cmd @@ -107,3 +113,203 @@ func queryAuctions() *cobra.Command { flags.AddPaginationFlagsToCmd(cmd, "auctions") return cmd } + +func queryBids() *cobra.Command { + cmd := &cobra.Command{ + Use: "bids [bidder] [history]", + Short: "Query bids by bidder address", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + bidder, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + history, err := strconv.ParseBool(args[1]) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.Bids( + context.Background(), + &types.QueryBidsRequest{ + Bidder: bidder.String(), + History: history, + Pagination: pagination, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "bids") + + return cmd +} + +func queryUserLimitOrderBids() *cobra.Command { + cmd := &cobra.Command{ + Use: "user-limit-order-bids [bidder]", + Short: "Query limit order bids by bidder address", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + bidder, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.UserLimitBids( + context.Background(), + &types.QueryUserLimitBidsRequest{ + Bidder: bidder.String(), + Pagination: pagination, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "user-limit-order-bids") + + return cmd +} + +func queryAuctionParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "auction-params", + Short: "Query auction params", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.AuctionParams( + context.Background(), + &types.QueryAuctionParamsRequest{}, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "auction-params") + + return cmd +} + +func queryUserLimitOrderBidsByAssetID() *cobra.Command { + cmd := &cobra.Command{ + Use: "user-limit-order-bids-by-asset-id [bidder] [collateral-token-id] [debt-token-id] ", + Short: "Query limit order bids by bidder address and asset id", + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + bidder, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + collateralID, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + debtID, err := strconv.ParseUint(args[2], 10, 64) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.UserLimitBidsByAssetID( + context.Background(), + &types.QueryUserLimitBidsByAssetIDRequest{ + Bidder: bidder.String(), + CollateralTokenId: collateralID, + DebtTokenId: debtID, + Pagination: pagination, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "user-limit-order-bids-by-asset-id") + + return cmd +} + +func queryLimitOrderBids() *cobra.Command { + cmd := &cobra.Command{ + Use: "limit-order-bids [collateral-token-id] [debt-token-id] ", + Short: "Query limit order bids by asset id", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + collateralID, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + debtID, err := strconv.ParseUint(args[2], 10, 64) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.LimitBids( + context.Background(), + &types.QueryLimitBidsRequest{ + CollateralTokenId: collateralID, + DebtTokenId: debtID, + Pagination: pagination, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "limit-order-bids") + + return cmd +} \ No newline at end of file diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 66e069fbe..deed0cc31 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -203,6 +203,20 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if err != nil { return 0, err } + + // Set Bid History + userBid, err := k.GetUserBid(ctx, biddingId) + if err != nil { + return 0, err + } + err = k.DeleteIndividualUserBid(ctx, userBid) + if err != nil { + return 0, err + } + err = k.SetBidHistorical(ctx, userBid) + if err != nil { + return 0, err + } //Close Auction err = k.DeleteAuction(ctx, auctionData) if err != nil { @@ -290,6 +304,11 @@ func (k Keeper) CreateUserBid(ctx sdk.Context, appID uint64, BidderAddress strin if err != nil { return bidding_id, err } + err = k.SetIndividualUserBid(ctx, bidding) + if err != nil { + return bidding_id, err + } + return bidding.BiddingId, nil } diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index 4150c81f4..c3637f88c 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -98,11 +98,9 @@ func (q QueryServer) Bids(c context.Context, req *types.QueryBidsRequest) (*type items []types.Bid ) if req.History { - //TODO: add historical key - //key = types.HistoryUserAuctionTypeKey(req.Bidder, req.AppId, types.DutchString) + key = types.GetBidHistoricalKey(req.Bidder) } else { - key = types.UserBidKeyPrefix - + key = types.GetUserBidHistoricalKey(req.Bidder) } pagination, err := query.FilteredPaginate( @@ -160,3 +158,103 @@ func (q QueryServer) Params(c context.Context, req *types.QueryParamsRequest) (* return &types.QueryParamsResponse{Params: q.GetParams(ctx)}, nil } + +func (q QueryServer) UserLimitBids(c context.Context, req *types.QueryUserLimitBidsRequest) (*types.QueryUserLimitBidsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + item types.LimitOrderBidsForUser + ctx = sdk.UnwrapSDKContext(c) + ) + + item, found := q.GetUserLimitBidDataByAddress(ctx, req.Bidder) + if !found { + return nil, nil + } + + return &types.QueryUserLimitBidsResponse{ + LimitOrderBids: item, + }, nil +} + +func (q QueryServer) UserLimitBidsByAssetID(c context.Context, req *types.QueryUserLimitBidsByAssetIDRequest) (*types.QueryUserLimitBidsByAssetIDResponse, error) { + + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + items []types.LimitOrderBid + ctx = sdk.UnwrapSDKContext(c) + key []byte + ) + key = types.LimitBidKeyForAssetID(req.DebtTokenId, req.CollateralTokenId) + + pagination, err := query.FilteredPaginate( + prefix.NewStore(q.Store(ctx), key), + req.Pagination, + func(_, value []byte, accumulate bool) (bool, error) { + var item types.LimitOrderBid + if err := q.cdc.Unmarshal(value, &item); err != nil { + return false, err + } + + if accumulate { + if item.BidderAddress == req.Bidder { + items = append(items, item) + } + } + + return true, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryUserLimitBidsByAssetIDResponse{ + Bidder: req.Bidder, + LimitOrderBids: items, + Pagination: pagination, + }, nil +} + +func (q QueryServer) LimitBids(c context.Context, req *types.QueryLimitBidsRequest) (*types.QueryLimitBidsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + items []types.LimitOrderBid + ctx = sdk.UnwrapSDKContext(c) + key []byte + ) + key = types.LimitBidKeyForAssetID(req.DebtTokenId, req.CollateralTokenId) + + pagination, err := query.FilteredPaginate( + prefix.NewStore(q.Store(ctx), key), + req.Pagination, + func(_, value []byte, accumulate bool) (bool, error) { + var item types.LimitOrderBid + if err := q.cdc.Unmarshal(value, &item); err != nil { + return false, err + } + + if accumulate { + items = append(items, item) + } + + return true, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryLimitBidsResponse{ + LimitOrderBids: items, + Pagination: pagination, + }, nil +} diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go index 89f23cef8..d03b079a0 100644 --- a/x/auctionsV2/keeper/utils.go +++ b/x/auctionsV2/keeper/utils.go @@ -117,6 +117,30 @@ func (k Keeper) SetAuctionHistorical(ctx sdk.Context, auction types.AuctionHisto return nil } +func (k Keeper) SetBidHistorical(ctx sdk.Context, bid types.Bid) error { + + var ( + store = k.Store(ctx) + key = types.BidHistoricalKey(bid.BiddingId, bid.BidderAddress) + value = k.cdc.MustMarshal(&bid) + ) + + store.Set(key, value) + return nil +} + +func (k Keeper) SetIndividualUserBid(ctx sdk.Context, userBid types.Bid) error { + + var ( + store = k.Store(ctx) + key = types.UserBidHistoricalKey(userBid.BiddingId, userBid.BidderAddress) + value = k.cdc.MustMarshal(&userBid) + ) + + store.Set(key, value) + return nil +} + func (k Keeper) SetUserBid(ctx sdk.Context, userBid types.Bid) error { var ( @@ -129,6 +153,16 @@ func (k Keeper) SetUserBid(ctx sdk.Context, userBid types.Bid) error { return nil } +func (k Keeper) DeleteIndividualUserBid(ctx sdk.Context, userBid types.Bid) error { + + var ( + store = k.Store(ctx) + key = types.UserBidHistoricalKey(userBid.BiddingId, userBid.BidderAddress) + ) + store.Delete(key) + return nil +} + func (k Keeper) DeleteAuction(ctx sdk.Context, auction types.Auction) error { var ( diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index 9ee590df7..6bdf03ec8 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -39,6 +39,8 @@ var ( UserLimitBidMappingKeyForAddressPrefix = []byte{0x09} AuctionLimitBidFeeKeyPrefix = []byte{0x10} ExternalAuctionLimitBidFeeKeyPrefix = []byte{0x11} + BidHistoricalKeyPrefix = []byte{0x12} + UserBidHistoricalKeyPrefix = []byte{0x13} ) func AuctionKey(auctionID uint64) []byte { @@ -51,10 +53,26 @@ func AuctionHistoricalKey(auctionID uint64) []byte { return append(append(AuctionHistoricalKeyPrefix, sdk.Uint64ToBigEndian(auctionID)...)) } +func BidHistoricalKey(bidID uint64, address string) []byte { + return append(append(BidHistoricalKeyPrefix, address...), sdk.Uint64ToBigEndian(bidID)...) +} + +func GetBidHistoricalKey(address string) []byte { + return append(BidHistoricalKeyPrefix, address...) +} + func UserBidKey(userBidId uint64) []byte { return append(append(UserBidKeyPrefix, sdk.Uint64ToBigEndian(userBidId)...)) } +func UserBidHistoricalKey(bidID uint64, address string) []byte { + return append(append(UserBidHistoricalKeyPrefix, address...), sdk.Uint64ToBigEndian(bidID)...) +} + +func GetUserBidHistoricalKey(address string) []byte { + return append(UserBidHistoricalKeyPrefix, address...) +} + func UserLimitBidKey(debtTokenID, collateralTokenID uint64, premium sdk.Int, address string) []byte { return append(append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), sdk.Uint64ToBigEndian((premium.Uint64()))...), address...) } @@ -63,6 +81,10 @@ func UserLimitBidKeyForPremium(debtTokenID, collateralTokenID uint64, premium sd return append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), sdk.Uint64ToBigEndian((premium.Uint64()))...) } +func LimitBidKeyForAssetID(debtTokenID, collateralTokenID uint64) []byte { + return append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...)) +} + func UserLimitBidKeyForAddress(address string) []byte { return append(UserLimitBidMappingKeyForAddressPrefix, address...) } diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index 8be5d21ab..1ca29d6de 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -510,6 +510,342 @@ func (m *QueryAuctionParamsResponse) GetAuctionParams() AuctionParams { return AuctionParams{} } +type QueryUserLimitBidsRequest struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryUserLimitBidsRequest) Reset() { *m = QueryUserLimitBidsRequest{} } +func (m *QueryUserLimitBidsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryUserLimitBidsRequest) ProtoMessage() {} +func (*QueryUserLimitBidsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{10} +} +func (m *QueryUserLimitBidsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryUserLimitBidsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryUserLimitBidsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryUserLimitBidsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUserLimitBidsRequest.Merge(m, src) +} +func (m *QueryUserLimitBidsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryUserLimitBidsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUserLimitBidsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryUserLimitBidsRequest proto.InternalMessageInfo + +func (m *QueryUserLimitBidsRequest) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *QueryUserLimitBidsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryUserLimitBidsResponse struct { + LimitOrderBids LimitOrderBidsForUser `protobuf:"bytes,1,opt,name=limitOrderBids,proto3" json:"limitOrderBids" yaml:"limit_order_bids"` +} + +func (m *QueryUserLimitBidsResponse) Reset() { *m = QueryUserLimitBidsResponse{} } +func (m *QueryUserLimitBidsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryUserLimitBidsResponse) ProtoMessage() {} +func (*QueryUserLimitBidsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{11} +} +func (m *QueryUserLimitBidsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryUserLimitBidsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryUserLimitBidsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryUserLimitBidsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUserLimitBidsResponse.Merge(m, src) +} +func (m *QueryUserLimitBidsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryUserLimitBidsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUserLimitBidsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryUserLimitBidsResponse proto.InternalMessageInfo + +func (m *QueryUserLimitBidsResponse) GetLimitOrderBids() LimitOrderBidsForUser { + if m != nil { + return m.LimitOrderBids + } + return LimitOrderBidsForUser{} +} + +type QueryUserLimitBidsByAssetIDRequest struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + CollateralTokenId uint64 `protobuf:"varint,2,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` + DebtTokenId uint64 `protobuf:"varint,3,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryUserLimitBidsByAssetIDRequest) Reset() { *m = QueryUserLimitBidsByAssetIDRequest{} } +func (m *QueryUserLimitBidsByAssetIDRequest) String() string { return proto.CompactTextString(m) } +func (*QueryUserLimitBidsByAssetIDRequest) ProtoMessage() {} +func (*QueryUserLimitBidsByAssetIDRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{12} +} +func (m *QueryUserLimitBidsByAssetIDRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryUserLimitBidsByAssetIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryUserLimitBidsByAssetIDRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryUserLimitBidsByAssetIDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUserLimitBidsByAssetIDRequest.Merge(m, src) +} +func (m *QueryUserLimitBidsByAssetIDRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryUserLimitBidsByAssetIDRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUserLimitBidsByAssetIDRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryUserLimitBidsByAssetIDRequest proto.InternalMessageInfo + +func (m *QueryUserLimitBidsByAssetIDRequest) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *QueryUserLimitBidsByAssetIDRequest) GetCollateralTokenId() uint64 { + if m != nil { + return m.CollateralTokenId + } + return 0 +} + +func (m *QueryUserLimitBidsByAssetIDRequest) GetDebtTokenId() uint64 { + if m != nil { + return m.DebtTokenId + } + return 0 +} + +func (m *QueryUserLimitBidsByAssetIDRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryUserLimitBidsByAssetIDResponse struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` + LimitOrderBids []LimitOrderBid `protobuf:"bytes,2,rep,name=limitOrderBids,proto3" json:"limitOrderBids" yaml:"limit_order_bids"` + Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryUserLimitBidsByAssetIDResponse) Reset() { *m = QueryUserLimitBidsByAssetIDResponse{} } +func (m *QueryUserLimitBidsByAssetIDResponse) String() string { return proto.CompactTextString(m) } +func (*QueryUserLimitBidsByAssetIDResponse) ProtoMessage() {} +func (*QueryUserLimitBidsByAssetIDResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{13} +} +func (m *QueryUserLimitBidsByAssetIDResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryUserLimitBidsByAssetIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryUserLimitBidsByAssetIDResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryUserLimitBidsByAssetIDResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUserLimitBidsByAssetIDResponse.Merge(m, src) +} +func (m *QueryUserLimitBidsByAssetIDResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryUserLimitBidsByAssetIDResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUserLimitBidsByAssetIDResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryUserLimitBidsByAssetIDResponse proto.InternalMessageInfo + +func (m *QueryUserLimitBidsByAssetIDResponse) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *QueryUserLimitBidsByAssetIDResponse) GetLimitOrderBids() []LimitOrderBid { + if m != nil { + return m.LimitOrderBids + } + return nil +} + +func (m *QueryUserLimitBidsByAssetIDResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryLimitBidsRequest struct { + CollateralTokenId uint64 `protobuf:"varint,1,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` + DebtTokenId uint64 `protobuf:"varint,2,opt,name=debt_token_id,json=debtTokenId,proto3" json:"debt_token_id,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryLimitBidsRequest) Reset() { *m = QueryLimitBidsRequest{} } +func (m *QueryLimitBidsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLimitBidsRequest) ProtoMessage() {} +func (*QueryLimitBidsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{14} +} +func (m *QueryLimitBidsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLimitBidsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLimitBidsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLimitBidsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLimitBidsRequest.Merge(m, src) +} +func (m *QueryLimitBidsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLimitBidsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLimitBidsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLimitBidsRequest proto.InternalMessageInfo + +func (m *QueryLimitBidsRequest) GetCollateralTokenId() uint64 { + if m != nil { + return m.CollateralTokenId + } + return 0 +} + +func (m *QueryLimitBidsRequest) GetDebtTokenId() uint64 { + if m != nil { + return m.DebtTokenId + } + return 0 +} + +func (m *QueryLimitBidsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryLimitBidsResponse struct { + LimitOrderBids []LimitOrderBid `protobuf:"bytes,2,rep,name=limitOrderBids,proto3" json:"limitOrderBids" yaml:"limit_order_bids"` + Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryLimitBidsResponse) Reset() { *m = QueryLimitBidsResponse{} } +func (m *QueryLimitBidsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLimitBidsResponse) ProtoMessage() {} +func (*QueryLimitBidsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{15} +} +func (m *QueryLimitBidsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLimitBidsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLimitBidsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLimitBidsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLimitBidsResponse.Merge(m, src) +} +func (m *QueryLimitBidsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLimitBidsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLimitBidsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLimitBidsResponse proto.InternalMessageInfo + +func (m *QueryLimitBidsResponse) GetLimitOrderBids() []LimitOrderBid { + if m != nil { + return m.LimitOrderBids + } + return nil +} + +func (m *QueryLimitBidsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryParamsResponse") @@ -521,6 +857,12 @@ func init() { proto.RegisterType((*QueryBidsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryBidsResponse") proto.RegisterType((*QueryAuctionParamsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionParamsRequest") proto.RegisterType((*QueryAuctionParamsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionParamsResponse") + proto.RegisterType((*QueryUserLimitBidsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryUserLimitBidsRequest") + proto.RegisterType((*QueryUserLimitBidsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryUserLimitBidsResponse") + proto.RegisterType((*QueryUserLimitBidsByAssetIDRequest)(nil), "comdex.auctionsV2.v1beta1.QueryUserLimitBidsByAssetIDRequest") + proto.RegisterType((*QueryUserLimitBidsByAssetIDResponse)(nil), "comdex.auctionsV2.v1beta1.QueryUserLimitBidsByAssetIDResponse") + proto.RegisterType((*QueryLimitBidsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidsRequest") + proto.RegisterType((*QueryLimitBidsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidsResponse") } func init() { @@ -528,56 +870,75 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 777 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcf, 0x4f, 0x13, 0x4d, - 0x18, 0xc7, 0x3b, 0xd0, 0xb7, 0xc0, 0x10, 0x78, 0x5f, 0x86, 0x1f, 0x6f, 0x59, 0x61, 0x8b, 0xa3, - 0x42, 0x05, 0xd9, 0x95, 0x82, 0x17, 0x2e, 0xc6, 0xbd, 0x18, 0x2f, 0x44, 0x37, 0x06, 0x13, 0x13, - 0x35, 0xbb, 0xdd, 0x65, 0xd9, 0xa4, 0xed, 0x94, 0xee, 0x96, 0xd8, 0x10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d, 0x0e, 0xb4, 0x45, 0x0a, - 0xdd, 0x80, 0xe0, 0xb3, 0x7a, 0xd4, 0x9e, 0xb7, 0xc7, 0xea, 0x11, 0x3c, 0x9a, 0x63, 0xf2, 0x11, - 0xe1, 0xd1, 0x70, 0x94, 0x90, 0xa4, 0x27, 0xb7, 0xa2, 0xbb, 0x9d, 0x7c, 0x03, 0xb0, 0x2a, 0x9c, - 0x35, 0x4f, 0x96, 0xfb, 0xb0, 0x7a, 0x11, 0xbe, 0x0f, 0x08, 0xa7, 0x83, 0x17, 0x47, 0xd6, 0x06, - 0x1d, 0x15, 0x99, 0x1e, 0xd2, 0xad, 0x64, 0x62, 0x60, 0xda, 0xe4, 0x4c, 0xeb, 0x64, 0xad, 0x1b, - 0x53, 0xf0, 0xe4, 0xd4, 0x23, 0xf1, 0x86, 0xa3, 0xc1, 0x7d, 0x45, 0x78, 0x22, 0xd6, 0xb9, 0x64, - 0x2b, 0x61, 0x18, 0xf1, 0xee, 0xbb, 0xf3, 0x97, 0xbb, 0x80, 0x79, 0x95, 0x33, 0x5f, 0x27, 0xb4, - 0x4f, 0x8e, 0xf0, 0x68, 0xb4, 0x9d, 0x93, 0x33, 0x19, 0x9d, 0x9e, 0xc9, 0xe8, 0xc7, 0x99, 0x8c, - 0xde, 0x9d, 0xcb, 0xa9, 0xd3, 0x73, 0x39, 0xf5, 0xfd, 0x5c, 0x4e, 0x3d, 0xdd, 0x72, 0x5c, 0x7f, - 0xbf, 0x6e, 0x06, 0x08, 0xe0, 0xb3, 0xce, 0xf6, 0xf6, 0xdc, 0xa2, 0x6b, 0x94, 0x42, 0xdf, 0xd8, - 0xbf, 0x09, 0xbf, 0x51, 0xb5, 0x3d, 0x33, 0xc3, 0xff, 0x48, 0x6c, 0xfe, 0x0e, 0x00, 0x00, 0xff, - 0xff, 0x10, 0xb1, 0x6f, 0x33, 0x62, 0x09, 0x00, 0x00, + // 1085 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00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, 0x40, 0x7e, + 0x42, 0x38, 0xa3, 0x5c, 0x00, 0xf1, 0x54, 0xa3, 0x1e, 0x14, 0xf1, 0x54, 0x23, 0x6f, 0x7c, 0xfa, + 0x9a, 0xa0, 0xba, 0x45, 0xf4, 0x28, 0xaa, 0x2d, 0x8f, 0xb9, 0x62, 0x66, 0x88, 0x29, 0xa2, 0x88, + 0x4d, 0xfe, 0x41, 0x78, 0x2d, 0xfa, 0xe2, 0x22, 0xaf, 0x4f, 0x44, 0x65, 0xf0, 0x8a, 0xcf, 0xbd, + 0xf1, 0x5f, 0xcd, 0x21, 0xa5, 0xfb, 0x22, 0xa5, 0x7b, 0xe4, 0xce, 0x84, 0x29, 0xe9, 0x9d, 0x88, + 0xeb, 0x64, 0x5f, 0xef, 0x28, 0x97, 0xc6, 0x3e, 0xf9, 0x19, 0xe1, 0x85, 0x5e, 0xb1, 0x62, 0x0f, + 0xd9, 0x50, 0xa1, 0xb6, 0x26, 0xb0, 0x80, 0x8c, 0x6e, 0x89, 0x8c, 0xde, 0x23, 0xef, 0x46, 0x65, + 0x34, 0x98, 0x4d, 0x92, 0x24, 0x8c, 0x9b, 0x4f, 0x8e, 0xf2, 0xe8, 0xe0, 0x28, 0x8f, 0x7e, 0x3f, + 0xca, 0xa3, 0x2f, 0x8f, 0xf3, 0x53, 0x07, 0xc7, 0xf9, 0xa9, 0xdf, 0x8e, 0xf3, 0x53, 0x1f, 0x6e, + 0x57, 0x1d, 0xff, 0x61, 0xab, 0x1c, 0x90, 0x84, 0x68, 0x9b, 0xfc, 0xc1, 0x03, 0xa7, 0xe2, 0x58, + 0xb5, 0x30, 0xba, 0xf2, 0x15, 0xef, 0xb7, 0x9b, 0xcc, 0x2b, 0xcf, 0x8a, 0x0f, 0xf8, 0xab, 0xff, + 0x06, 0x00, 0x00, 0xff, 0xff, 0x15, 0x15, 0xc9, 0xbd, 0xda, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -597,6 +958,9 @@ type QueryClient interface { Auctions(ctx context.Context, in *QueryAuctionsRequest, opts ...grpc.CallOption) (*QueryAuctionsResponse, error) Bids(ctx context.Context, in *QueryBidsRequest, opts ...grpc.CallOption) (*QueryBidsResponse, error) AuctionParams(ctx context.Context, in *QueryAuctionParamsRequest, opts ...grpc.CallOption) (*QueryAuctionParamsResponse, error) + UserLimitBids(ctx context.Context, in *QueryUserLimitBidsRequest, opts ...grpc.CallOption) (*QueryUserLimitBidsResponse, error) + UserLimitBidsByAssetID(ctx context.Context, in *QueryUserLimitBidsByAssetIDRequest, opts ...grpc.CallOption) (*QueryUserLimitBidsByAssetIDResponse, error) + LimitBids(ctx context.Context, in *QueryLimitBidsRequest, opts ...grpc.CallOption) (*QueryLimitBidsResponse, error) } type queryClient struct { @@ -652,6 +1016,33 @@ func (c *queryClient) AuctionParams(ctx context.Context, in *QueryAuctionParamsR return out, nil } +func (c *queryClient) UserLimitBids(ctx context.Context, in *QueryUserLimitBidsRequest, opts ...grpc.CallOption) (*QueryUserLimitBidsResponse, error) { + out := new(QueryUserLimitBidsResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/UserLimitBids", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) UserLimitBidsByAssetID(ctx context.Context, in *QueryUserLimitBidsByAssetIDRequest, opts ...grpc.CallOption) (*QueryUserLimitBidsByAssetIDResponse, error) { + out := new(QueryUserLimitBidsByAssetIDResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/UserLimitBidsByAssetID", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) LimitBids(ctx context.Context, in *QueryLimitBidsRequest, opts ...grpc.CallOption) (*QueryLimitBidsResponse, error) { + out := new(QueryLimitBidsResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/LimitBids", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) @@ -659,6 +1050,9 @@ type QueryServer interface { Auctions(context.Context, *QueryAuctionsRequest) (*QueryAuctionsResponse, error) Bids(context.Context, *QueryBidsRequest) (*QueryBidsResponse, error) AuctionParams(context.Context, *QueryAuctionParamsRequest) (*QueryAuctionParamsResponse, error) + UserLimitBids(context.Context, *QueryUserLimitBidsRequest) (*QueryUserLimitBidsResponse, error) + UserLimitBidsByAssetID(context.Context, *QueryUserLimitBidsByAssetIDRequest) (*QueryUserLimitBidsByAssetIDResponse, error) + LimitBids(context.Context, *QueryLimitBidsRequest) (*QueryLimitBidsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -680,6 +1074,15 @@ func (*UnimplementedQueryServer) Bids(ctx context.Context, req *QueryBidsRequest func (*UnimplementedQueryServer) AuctionParams(ctx context.Context, req *QueryAuctionParamsRequest) (*QueryAuctionParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AuctionParams not implemented") } +func (*UnimplementedQueryServer) UserLimitBids(ctx context.Context, req *QueryUserLimitBidsRequest) (*QueryUserLimitBidsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserLimitBids not implemented") +} +func (*UnimplementedQueryServer) UserLimitBidsByAssetID(ctx context.Context, req *QueryUserLimitBidsByAssetIDRequest) (*QueryUserLimitBidsByAssetIDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserLimitBidsByAssetID not implemented") +} +func (*UnimplementedQueryServer) LimitBids(ctx context.Context, req *QueryLimitBidsRequest) (*QueryLimitBidsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LimitBids not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -775,31 +1178,97 @@ func _Query_AuctionParams_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.auctionsV2.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Auction", - Handler: _Query_Auction_Handler, - }, - { - MethodName: "Auctions", - Handler: _Query_Auctions_Handler, - }, - { - MethodName: "Bids", - Handler: _Query_Bids_Handler, - }, - { - MethodName: "AuctionParams", - Handler: _Query_AuctionParams_Handler, - }, - }, +func _Query_UserLimitBids_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryUserLimitBidsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).UserLimitBids(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Query/UserLimitBids", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).UserLimitBids(ctx, req.(*QueryUserLimitBidsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_UserLimitBidsByAssetID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryUserLimitBidsByAssetIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).UserLimitBidsByAssetID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Query/UserLimitBidsByAssetID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).UserLimitBidsByAssetID(ctx, req.(*QueryUserLimitBidsByAssetIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_LimitBids_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLimitBidsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LimitBids(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Query/LimitBids", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LimitBids(ctx, req.(*QueryLimitBidsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "comdex.auctionsV2.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Auction", + Handler: _Query_Auction_Handler, + }, + { + MethodName: "Auctions", + Handler: _Query_Auctions_Handler, + }, + { + MethodName: "Bids", + Handler: _Query_Bids_Handler, + }, + { + MethodName: "AuctionParams", + Handler: _Query_AuctionParams_Handler, + }, + { + MethodName: "UserLimitBids", + Handler: _Query_UserLimitBids_Handler, + }, + { + MethodName: "UserLimitBidsByAssetID", + Handler: _Query_UserLimitBidsByAssetID_Handler, + }, + { + MethodName: "LimitBids", + Handler: _Query_LimitBids_Handler, + }, + }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/auctionsV2/v1beta1/query.proto", } @@ -1189,130 +1658,407 @@ func (m *QueryAuctionParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryUserLimitBidsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n +func (m *QueryUserLimitBidsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAuctionRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryUserLimitBidsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.AuctionId != 0 { - n += 1 + sovQuery(uint64(m.AuctionId)) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - if m.History { - n += 2 + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryAuctionResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryUserLimitBidsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - l = m.Auction.Size() - n += 1 + l + sovQuery(uint64(l)) - return n + return dAtA[:n], nil } -func (m *QueryAuctionsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.History { - n += 2 - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n +func (m *QueryUserLimitBidsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAuctionsResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryUserLimitBidsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Auctions) > 0 { - for _, e := range m.Auctions { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + { + size, err := m.LimitOrderBids.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryBidsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryUserLimitBidsByAssetIDRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *QueryUserLimitBidsByAssetIDRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryUserLimitBidsByAssetIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - if m.History { - n += 2 + if m.DebtTokenId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.DebtTokenId)) + i-- + dAtA[i] = 0x18 } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.CollateralTokenId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.CollateralTokenId)) + i-- + dAtA[i] = 0x10 } - return n + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *QueryBidsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryUserLimitBidsByAssetIDResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *QueryUserLimitBidsByAssetIDResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryUserLimitBidsByAssetIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if len(m.Bids) > 0 { - for _, e := range m.Bids { + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.LimitOrderBids) > 0 { + for iNdEx := len(m.LimitOrderBids) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LimitOrderBids[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryLimitBidsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLimitBidsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLimitBidsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.DebtTokenId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.DebtTokenId)) + i-- + dAtA[i] = 0x10 + } + if m.CollateralTokenId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.CollateralTokenId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryLimitBidsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLimitBidsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLimitBidsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.LimitOrderBids) > 0 { + for iNdEx := len(m.LimitOrderBids) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LimitOrderBids[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAuctionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionId != 0 { + n += 1 + sovQuery(uint64(m.AuctionId)) + } + if m.History { + n += 2 + } + return n +} + +func (m *QueryAuctionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Auction.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAuctionsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAuctionsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Auctions) > 0 { + for _, e := range m.Auctions { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBidsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBidsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Bids) > 0 { + for _, e := range m.Bids { l = e.Size() n += 1 + l + sovQuery(uint64(l)) } @@ -1344,11 +2090,123 @@ func (m *QueryAuctionParamsResponse) Size() (n int) { return n } -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *QueryUserLimitBidsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *QueryUserLimitBidsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.LimitOrderBids.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryUserLimitBidsByAssetIDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.CollateralTokenId != 0 { + n += 1 + sovQuery(uint64(m.CollateralTokenId)) + } + if m.DebtTokenId != 0 { + n += 1 + sovQuery(uint64(m.DebtTokenId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryUserLimitBidsByAssetIDResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.LimitOrderBids) > 0 { + for _, e := range m.LimitOrderBids { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLimitBidsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CollateralTokenId != 0 { + n += 1 + sovQuery(uint64(m.CollateralTokenId)) + } + if m.DebtTokenId != 0 { + n += 1 + sovQuery(uint64(m.DebtTokenId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLimitBidsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LimitOrderBids) > 0 { + for _, e := range m.LimitOrderBids { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) @@ -1360,25 +2218,506 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { if shift >= 64 { return ErrIntOverflowQuery } - if iNdEx >= l { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAuctionRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAuctionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + m.AuctionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAuctionResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAuctionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Auction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAuctionsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAuctionsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAuctionsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAuctionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.Auctions = append(m.Auctions, Auction{}) + if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1400,7 +2739,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryBidsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1423,15 +2762,67 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryBidsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryBidsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1458,7 +2849,10 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1483,7 +2877,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAuctionRequest) Unmarshal(dAtA []byte) error { +func (m *QueryBidsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1506,17 +2900,17 @@ func (m *QueryAuctionRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAuctionRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryBidsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAuctionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryBidsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) } - m.AuctionId = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1526,31 +2920,144 @@ func (m *QueryAuctionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.AuctionId |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bids", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bids = append(m.Bids, Bid{}) + if err := m.Bids[len(m.Bids)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAuctionParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - m.History = bool(v != 0) + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAuctionParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAuctionParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1572,7 +3079,7 @@ func (m *QueryAuctionRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAuctionResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAuctionParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1595,15 +3102,15 @@ func (m *QueryAuctionResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAuctionResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAuctionParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAuctionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAuctionParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AuctionParams", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1630,7 +3137,7 @@ func (m *QueryAuctionResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Auction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AuctionParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1655,7 +3162,7 @@ func (m *QueryAuctionResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAuctionsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryUserLimitBidsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1678,17 +3185,17 @@ func (m *QueryAuctionsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAuctionsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryUserLimitBidsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAuctionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryUserLimitBidsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) } - var v int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1698,12 +3205,24 @@ func (m *QueryAuctionsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.History = bool(v != 0) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) @@ -1761,7 +3280,7 @@ func (m *QueryAuctionsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAuctionsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryUserLimitBidsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1784,49 +3303,15 @@ func (m *QueryAuctionsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAuctionsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryUserLimitBidsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAuctionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryUserLimitBidsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Auctions = append(m.Auctions, Auction{}) - if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderBids", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1853,10 +3338,7 @@ func (m *QueryAuctionsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.LimitOrderBids.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1881,7 +3363,7 @@ func (m *QueryAuctionsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryBidsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryUserLimitBidsByAssetIDRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1904,10 +3386,10 @@ func (m *QueryBidsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryBidsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryUserLimitBidsByAssetIDRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBidsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryUserLimitBidsByAssetIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1944,9 +3426,9 @@ func (m *QueryBidsRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenId", wireType) } - var v int + m.CollateralTokenId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1956,13 +3438,31 @@ func (m *QueryBidsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.CollateralTokenId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.History = bool(v != 0) case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenId", wireType) + } + m.DebtTokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DebtTokenId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } @@ -2019,7 +3519,7 @@ func (m *QueryBidsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryBidsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryUserLimitBidsByAssetIDResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2042,10 +3542,10 @@ func (m *QueryBidsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryBidsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryUserLimitBidsByAssetIDResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBidsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryUserLimitBidsByAssetIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2082,7 +3582,7 @@ func (m *QueryBidsResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bids", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderBids", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2109,8 +3609,8 @@ func (m *QueryBidsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Bids = append(m.Bids, Bid{}) - if err := m.Bids[len(m.Bids)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.LimitOrderBids = append(m.LimitOrderBids, LimitOrderBid{}) + if err := m.LimitOrderBids[len(m.LimitOrderBids)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2171,7 +3671,7 @@ func (m *QueryBidsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAuctionParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryLimitBidsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2194,12 +3694,86 @@ func (m *QueryAuctionParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAuctionParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryLimitBidsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAuctionParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryLimitBidsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralTokenId", wireType) + } + m.CollateralTokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CollateralTokenId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtTokenId", wireType) + } + m.DebtTokenId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DebtTokenId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2221,7 +3795,7 @@ func (m *QueryAuctionParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAuctionParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryLimitBidsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2244,15 +3818,15 @@ func (m *QueryAuctionParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAuctionParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryLimitBidsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAuctionParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryLimitBidsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionParams", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderBids", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2279,7 +3853,44 @@ func (m *QueryAuctionParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AuctionParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.LimitOrderBids = append(m.LimitOrderBids, LimitOrderBid{}) + if err := m.LimitOrderBids[len(m.LimitOrderBids)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/auctionsV2/types/query.pb.gw.go b/x/auctionsV2/types/query.pb.gw.go index a2b7d9e6a..d2c59fd97 100644 --- a/x/auctionsV2/types/query.pb.gw.go +++ b/x/auctionsV2/types/query.pb.gw.go @@ -311,6 +311,288 @@ func local_request_Query_AuctionParams_0(ctx context.Context, marshaler runtime. } +var ( + filter_Query_UserLimitBids_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_UserLimitBids_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryUserLimitBidsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_UserLimitBids_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UserLimitBids(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_UserLimitBids_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryUserLimitBidsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_UserLimitBids_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UserLimitBids(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_UserLimitBidsByAssetID_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "collateral_token_id": 1, "debt_token_id": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} +) + +func request_Query_UserLimitBidsByAssetID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryUserLimitBidsByAssetIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["collateral_token_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "collateral_token_id") + } + + protoReq.CollateralTokenId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "collateral_token_id", err) + } + + val, ok = pathParams["debt_token_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "debt_token_id") + } + + protoReq.DebtTokenId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "debt_token_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_UserLimitBidsByAssetID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UserLimitBidsByAssetID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_UserLimitBidsByAssetID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryUserLimitBidsByAssetIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["collateral_token_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "collateral_token_id") + } + + protoReq.CollateralTokenId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "collateral_token_id", err) + } + + val, ok = pathParams["debt_token_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "debt_token_id") + } + + protoReq.DebtTokenId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "debt_token_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_UserLimitBidsByAssetID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UserLimitBidsByAssetID(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_LimitBids_0 = &utilities.DoubleArray{Encoding: map[string]int{"collateral_token_id": 0, "debt_token_id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_Query_LimitBids_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLimitBidsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["collateral_token_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "collateral_token_id") + } + + protoReq.CollateralTokenId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "collateral_token_id", err) + } + + val, ok = pathParams["debt_token_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "debt_token_id") + } + + protoReq.DebtTokenId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "debt_token_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LimitBids_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.LimitBids(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_LimitBids_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLimitBidsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["collateral_token_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "collateral_token_id") + } + + protoReq.CollateralTokenId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "collateral_token_id", err) + } + + val, ok = pathParams["debt_token_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "debt_token_id") + } + + protoReq.DebtTokenId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "debt_token_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LimitBids_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.LimitBids(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -432,6 +714,75 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_UserLimitBids_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_UserLimitBids_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_UserLimitBids_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_UserLimitBidsByAssetID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_UserLimitBidsByAssetID_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_UserLimitBidsByAssetID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_LimitBids_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_LimitBids_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_LimitBids_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -573,6 +924,66 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_UserLimitBids_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_UserLimitBids_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_UserLimitBids_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_UserLimitBidsByAssetID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_UserLimitBidsByAssetID_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_UserLimitBidsByAssetID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_LimitBids_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_LimitBids_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_LimitBids_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -586,6 +997,12 @@ var ( pattern_Query_Bids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auctions", "v2", "bids", "bidder", "history"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AuctionParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "auctions", "v2", "auction_params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_UserLimitBids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "auctions", "v2", "userlimitorderbids", "bidder"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_UserLimitBidsByAssetID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auctions", "v2", "userlimitorderbids", "bidder", "collateral_token_id", "debt_token_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_LimitBids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auctions", "v2", "limitorderbids", "collateral_token_id", "debt_token_id"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -598,4 +1015,10 @@ var ( forward_Query_Bids_0 = runtime.ForwardResponseMessage forward_Query_AuctionParams_0 = runtime.ForwardResponseMessage + + forward_Query_UserLimitBids_0 = runtime.ForwardResponseMessage + + forward_Query_UserLimitBidsByAssetID_0 = runtime.ForwardResponseMessage + + forward_Query_LimitBids_0 = runtime.ForwardResponseMessage ) From 766a2b01c6613c88b80e400f3f6130bcd8113454 Mon Sep 17 00:00:00 2001 From: Pratik Date: Thu, 13 Jul 2023 18:46:34 +0530 Subject: [PATCH 118/155] renaming variables -> snake_case --- proto/comdex/auctionsV2/v1beta1/query.proto | 6 +- x/auctionsV2/types/query.pb.go | 144 ++++++++++---------- 2 files changed, 75 insertions(+), 75 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index f9fcef6a9..ae2025cec 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -76,7 +76,7 @@ message QueryUserLimitBidsRequest { } message QueryUserLimitBidsResponse { - LimitOrderBidsForUser limitOrderBids = 1 [ + LimitOrderBidsForUser limit_order_bids = 1 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"limit_order_bids\"" ]; @@ -94,7 +94,7 @@ message QueryUserLimitBidsByAssetIDResponse { string bidder = 1 [ (gogoproto.moretags) = "yaml:\"bidder\"" ]; - repeated LimitOrderBid limitOrderBids = 2 [ + repeated LimitOrderBid limit_order_bids = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"limit_order_bids\"" ]; @@ -110,7 +110,7 @@ message QueryLimitBidsRequest { } message QueryLimitBidsResponse { - repeated LimitOrderBid limitOrderBids = 2 [ + repeated LimitOrderBid limit_order_bids = 2 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"limit_order_bids\"" ]; diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index 1ca29d6de..3a557ee62 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -563,7 +563,7 @@ func (m *QueryUserLimitBidsRequest) GetPagination() *query.PageRequest { } type QueryUserLimitBidsResponse struct { - LimitOrderBids LimitOrderBidsForUser `protobuf:"bytes,1,opt,name=limitOrderBids,proto3" json:"limitOrderBids" yaml:"limit_order_bids"` + LimitOrderBids LimitOrderBidsForUser `protobuf:"bytes,1,opt,name=limit_order_bids,json=limitOrderBids,proto3" json:"limit_order_bids" yaml:"limit_order_bids"` } func (m *QueryUserLimitBidsResponse) Reset() { *m = QueryUserLimitBidsResponse{} } @@ -676,7 +676,7 @@ func (m *QueryUserLimitBidsByAssetIDRequest) GetPagination() *query.PageRequest type QueryUserLimitBidsByAssetIDResponse struct { Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` - LimitOrderBids []LimitOrderBid `protobuf:"bytes,2,rep,name=limitOrderBids,proto3" json:"limitOrderBids" yaml:"limit_order_bids"` + LimitOrderBids []LimitOrderBid `protobuf:"bytes,2,rep,name=limit_order_bids,json=limitOrderBids,proto3" json:"limit_order_bids" yaml:"limit_order_bids"` Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` } @@ -795,7 +795,7 @@ func (m *QueryLimitBidsRequest) GetPagination() *query.PageRequest { } type QueryLimitBidsResponse struct { - LimitOrderBids []LimitOrderBid `protobuf:"bytes,2,rep,name=limitOrderBids,proto3" json:"limitOrderBids" yaml:"limit_order_bids"` + LimitOrderBids []LimitOrderBid `protobuf:"bytes,2,rep,name=limit_order_bids,json=limitOrderBids,proto3" json:"limit_order_bids" yaml:"limit_order_bids"` Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` } @@ -870,75 +870,75 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 1085 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0x38, 0x21, 0x1f, 0x63, 0x39, 0x90, 0xc9, 0x47, 0x5d, 0xd3, 0xda, 0x61, 0x0a, 0xa9, - 0x69, 0xc9, 0x6e, 0xe3, 0x06, 0x21, 0x55, 0x02, 0xd4, 0x15, 0x02, 0x82, 0xaa, 0x52, 0x56, 0xfd, - 0x90, 0x90, 0x4a, 0xb4, 0xf6, 0x4e, 0xdd, 0x15, 0xb6, 0xc7, 0xd9, 0x5d, 0x57, 0x58, 0x56, 0x2e, - 0x5c, 0x41, 0x02, 0x81, 0x04, 0x5c, 0x38, 0x55, 0x42, 0xfc, 0x03, 0xfc, 0x03, 0x9c, 0x2a, 0x4e, - 0x91, 0xb8, 0x70, 0x8a, 0x50, 0x82, 0xc4, 0x81, 0x03, 0x52, 0x0e, 0x9c, 0xd1, 0xce, 0xbc, 0xb5, - 0x3d, 0xf6, 0xda, 0xbb, 0x46, 0xe9, 0x85, 0x9b, 0x3d, 0xf3, 0x7b, 0xef, 0xfd, 0xde, 0xef, 0xbd, - 0x79, 0x33, 0x8b, 0x5f, 0xaa, 0xf0, 0xba, 0xcd, 0x3e, 0xd1, 0xad, 0x56, 0xc5, 0x77, 0x78, 0xc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c7, 0xf9, 0xa9, 0xdf, 0x8e, 0xf3, 0x53, 0x1f, 0x6e, - 0x57, 0x1d, 0xff, 0x61, 0xab, 0x1c, 0x90, 0x84, 0x68, 0x9b, 0xfc, 0xc1, 0x03, 0xa7, 0xe2, 0x58, - 0xb5, 0x30, 0xba, 0xf2, 0x15, 0xef, 0xb7, 0x9b, 0xcc, 0x2b, 0xcf, 0x8a, 0x0f, 0xf8, 0xab, 0xff, - 0x06, 0x00, 0x00, 0xff, 0xff, 0x15, 0x15, 0xc9, 0xbd, 0xda, 0x10, 0x00, 0x00, + // 1088 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x97, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0x33, 0x8e, 0xc9, 0x8f, 0xb1, 0x1c, 0x9a, 0xc9, 0x8f, 0xba, 0xa6, 0xb5, 0xc3, 0x14, + 0x52, 0xd3, 0x92, 0xdd, 0xc6, 0x0d, 0x42, 0xaa, 0x04, 0xa8, 0x2b, 0x04, 0x04, 0xa1, 0x52, 0x56, + 0xfd, 0x21, 0x21, 0x95, 0x68, 0xed, 0xdd, 0xba, 0x2b, 0x6c, 0x8f, 0xbb, 0xb3, 0xae, 0xb0, 0xac, + 0x5c, 0xb8, 0x82, 0x04, 0x02, 0x09, 0xc1, 0x81, 0x13, 0x02, 0xf1, 0x0f, 0xf0, 0x0f, 0x70, 0xaa, + 0x38, 0x45, 0xe2, 0xc2, 0x29, 0x42, 0x09, 0x12, 0x27, 0x84, 0x94, 0x03, 0x67, 0xb4, 0x33, 0x6f, + 0x6d, 0x8f, 0xb3, 0xf6, 0xae, 0x51, 0x72, 0xe1, 0x96, 0xcc, 0xbe, 0xf7, 0xe6, 0xf3, 0xbe, 0xef, + 0xcd, 0x9b, 0x31, 0x7e, 0xbe, 0xca, 0x1a, 0xb6, 0xf3, 0x91, 0x6e, 0xb5, 0xab, 0xb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a6, 0x7e, 0x3b, 0x2c, 0x4c, + 0xbd, 0xbf, 0x55, 0x73, 0xfd, 0x87, 0xed, 0x4a, 0x00, 0x09, 0xbb, 0x6d, 0xb0, 0x07, 0x0f, 0xdc, + 0xaa, 0x6b, 0xd5, 0xc3, 0xdd, 0x95, 0xdf, 0xf2, 0x7e, 0xa7, 0xe5, 0xf0, 0xca, 0x8c, 0xf8, 0x19, + 0x7f, 0xed, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0x17, 0xa8, 0x3b, 0xe0, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From 6d9d9b8475687d87b3231d3b3e6da20fa2d5b1c4 Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 17 Jul 2023 09:47:18 +0530 Subject: [PATCH 119/155] initializing states --- app/app.go | 6 +-- app/upgrades/mainnet/v12/upgrades.go | 77 ++++++++++++++++++++++++++++ x/auctionsV2/module.go | 2 +- x/liquidationsV2/module.go | 2 +- 4 files changed, 82 insertions(+), 5 deletions(-) diff --git a/app/app.go b/app/app.go index b5ab1a41e..084ee9f12 100644 --- a/app/app.go +++ b/app/app.go @@ -1449,7 +1449,7 @@ func (a *App) registerUpgradeHandlers() { case upgradeInfo.Name == mv12.UpgradeName: a.UpgradeKeeper.SetUpgradeHandler( mv12.UpgradeName, - mv12.CreateUpgradeHandlerV12(a.mm, a.configurator, a.ICQKeeper), + mv12.CreateUpgradeHandlerV12(a.mm, a.configurator, a.ICQKeeper, a.NewliqKeeper, a.NewaucKeeper), ) } @@ -1470,8 +1470,8 @@ func upgradeHandlers(upgradeInfo storetypes.UpgradeInfo, a *App, storeUpgrades * storeUpgrades = &storetypes.StoreUpgrades{ Added: []string{ icqtypes.StoreKey, - newliqtypes.StoreKey, - newauctypes.StoreKey, + newliqtypes.ModuleName, + newauctypes.ModuleName, }, } } diff --git a/app/upgrades/mainnet/v12/upgrades.go b/app/upgrades/mainnet/v12/upgrades.go index af4d37a5e..bfa650e6b 100644 --- a/app/upgrades/mainnet/v12/upgrades.go +++ b/app/upgrades/mainnet/v12/upgrades.go @@ -1,6 +1,10 @@ package v12 import ( + auctionkeeper "github.com/comdex-official/comdex/x/auctionsV2/keeper" + auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" + liquidationkeeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper" + liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" @@ -18,6 +22,8 @@ func CreateUpgradeHandlerV12( mm *module.Manager, configurator module.Configurator, icqkeeper *icqkeeper.Keeper, + liquidationKeeper liquidationkeeper.Keeper, + auctionKeeper auctionkeeper.Keeper, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info("Applying main net upgrade - v.12.0.0") @@ -30,6 +36,77 @@ func CreateUpgradeHandlerV12( if err != nil { return nil, err } + InitializeStates(ctx, liquidationKeeper, auctionKeeper) return vm, err } } + +func InitializeStates( + ctx sdk.Context, + liquidationKeeper liquidationkeeper.Keeper, + auctionKeeper auctionkeeper.Keeper, +) { + dutchAuctionParams := liquidationtypes.DutchAuctionParam{ + Premium: newDec("1.2"), + Discount: newDec("0.7"), + DecrementFactor: sdk.NewInt(1), + } + englishAuctionParams := liquidationtypes.EnglishAuctionParam{DecrementFactor: sdk.NewInt(1)} + + harborParams := liquidationtypes.LiquidationWhiteListing{ + AppId: 2, + Initiator: false, + IsDutchActivated: true, + DutchAuctionParam: &dutchAuctionParams, + IsEnglishActivated: false, + EnglishAuctionParam: &englishAuctionParams, + KeeeperIncentive: sdk.ZeroDec(), + } + + commodoParams := liquidationtypes.LiquidationWhiteListing{ + AppId: 3, + Initiator: false, + IsDutchActivated: true, + DutchAuctionParam: &dutchAuctionParams, + IsEnglishActivated: false, + EnglishAuctionParam: nil, + KeeeperIncentive: sdk.ZeroDec(), + } + + liquidationKeeper.SetLiquidationWhiteListing(ctx, harborParams) + liquidationKeeper.SetLiquidationWhiteListing(ctx, commodoParams) + + appReserveFundsTxDataHbr, found := liquidationKeeper.GetAppReserveFundsTxData(ctx, 2) + if !found { + appReserveFundsTxDataHbr.AppId = 2 + } + appReserveFundsTxDataHbr.AssetTxData = append(appReserveFundsTxDataHbr.AssetTxData, liquidationtypes.AssetTxData{}) + liquidationKeeper.SetAppReserveFundsTxData(ctx, appReserveFundsTxDataHbr) + + appReserveFundsTxDataCmdo, found := liquidationKeeper.GetAppReserveFundsTxData(ctx, 3) + if !found { + appReserveFundsTxDataCmdo.AppId = 3 + } + appReserveFundsTxDataCmdo.AssetTxData = append(appReserveFundsTxDataCmdo.AssetTxData, liquidationtypes.AssetTxData{}) + liquidationKeeper.SetAppReserveFundsTxData(ctx, appReserveFundsTxDataCmdo) + + auctionParams := auctionsV2types.AuctionParams{ + AuctionDurationSeconds: 18000, + Step: newDec("0.1"), + WithdrawalFee: newDec("0.0"), + ClosingFee: newDec("0.0"), + MinUsdValueLeft: 100000, + BidFactor: newDec("0.1"), + LiquidationPenalty: newDec("0.1"), + AuctionBonus: newDec("0.0"), + } + auctionKeeper.SetAuctionParams(ctx, auctionParams) + auctionKeeper.SetParams(ctx, auctionsV2types.Params{}) + auctionKeeper.SetAuctionID(ctx, 0) + auctionKeeper.SetUserBidID(ctx, 0) +} + +func newDec(i string) sdk.Dec { + dec, _ := sdk.NewDecFromStr(i) + return dec +} \ No newline at end of file diff --git a/x/auctionsV2/module.go b/x/auctionsV2/module.go index fa7911fc7..e20b3cd31 100644 --- a/x/auctionsV2/module.go +++ b/x/auctionsV2/module.go @@ -157,7 +157,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 2 } +func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} diff --git a/x/liquidationsV2/module.go b/x/liquidationsV2/module.go index 9f88ca2c1..8939ff159 100644 --- a/x/liquidationsV2/module.go +++ b/x/liquidationsV2/module.go @@ -159,7 +159,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 2 } +func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. func (am AppModule) BeginBlock(ctx sdk.Context, request abci.RequestBeginBlock) { From 90ed2454157003b5d88673ff988b17c342050e3d Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 17 Jul 2023 19:15:32 +0530 Subject: [PATCH 120/155] updating app.go, go.mod --- app/app.go | 5 +++-- go.mod | 4 ++-- go.sum | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/app.go b/app/app.go index 084ee9f12..cf9488666 100644 --- a/app/app.go +++ b/app/app.go @@ -825,7 +825,7 @@ func New( app.IbcKeeper.ChannelKeeper, // may be replaced with middleware app.IbcKeeper.ChannelKeeper, &app.IbcKeeper.PortKeeper, - app.ScopedICQKeeper, + scopedICliQKeeper, app.GRPCQueryRouter(), ) app.ICQKeeper = &icqKeeper @@ -881,7 +881,8 @@ func New( AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IbcKeeper.ClientKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IbcKeeper.ClientKeeper)). AddRoute(liquiditytypes.RouterKey, liquidity.NewLiquidityProposalHandler(app.LiquidityKeeper)). - AddRoute(newliqtypes.RouterKey, liquidationsV2.NewLiquidationsV2Handler(app.NewliqKeeper)) + AddRoute(newliqtypes.RouterKey, liquidationsV2.NewLiquidationsV2Handler(app.NewliqKeeper)). + AddRoute(newauctypes.RouterKey, auctionsV2.NewAuctionsV2Handler(app.NewaucKeeper)) if len(wasmEnabledProposals) != 0 { govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, wasmEnabledProposals)) diff --git a/go.mod b/go.mod index 90081a739..8dbe39328 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/CosmWasm/wasmd v0.31.0 github.com/CosmWasm/wasmvm v1.2.1 github.com/bandprotocol/bandchain-packet v0.0.3 - github.com/cosmos/cosmos-sdk v0.46.11 + github.com/cosmos/cosmos-sdk v0.46.13 github.com/cosmos/ibc-apps/modules/async-icq/v4 v4.0.0-20230524151648-c02fa46c2860 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.3 @@ -31,7 +31,7 @@ require ( github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.6 github.com/rakyll/statik v0.1.7 github.com/spf13/pflag v1.0.5 - github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.6 + github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4 gopkg.in/yaml.v2 v2.4.0 mvdan.cc/gofumpt v0.5.0 ) diff --git a/go.sum b/go.sum index 64c901a95..10c5d393e 100644 --- a/go.sum +++ b/go.sum @@ -2367,6 +2367,8 @@ github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUW github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/strangelove-ventures/async-icq/v4 v4.0.0-rc0 h1:foE/5O2/XiqGsdTKx3R0BTfKgW9KnUYyQLZt0WFSesE= +github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4 h1:8Tn4Gy/DAq7wzV1CxEGv80ujZ+nUvzgwwdCobO/Gj8Y= +github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4/go.mod h1:AG8F5pdk3x1h7PlRvPoMem3623W+w8HJHrWYkVJ51kk= github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.6 h1:aY64yjKZyDyzlIbDOkGBPvVpR0ArzIjunpCRKqoIm7o= github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.6/go.mod h1:4zAtg449/JISRmf+sbmqolqSLP+QJBh+EtWkWtt/AKE= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= From 954ba7b2a8932ca6873f9c4d735f8415bfa5c396 Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 17 Jul 2023 22:22:41 +0530 Subject: [PATCH 121/155] refactoring app.go --- app/app.go | 68 +++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/app/app.go b/app/app.go index cf9488666..446ec7f1c 100644 --- a/app/app.go +++ b/app/app.go @@ -176,14 +176,14 @@ import ( liquiditytypes "github.com/comdex-official/comdex/x/liquidity/types" "github.com/comdex-official/comdex/x/liquidationsV2" - newliqclient "github.com/comdex-official/comdex/x/liquidationsV2/client" - newliqkeeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper" - newliqtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" + liquidationsV2client "github.com/comdex-official/comdex/x/liquidationsV2/client" + liquidationsV2keeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper" + liquidationsV2types "github.com/comdex-official/comdex/x/liquidationsV2/types" "github.com/comdex-official/comdex/x/auctionsV2" - newaucclient "github.com/comdex-official/comdex/x/auctionsV2/client" - newauckeeper "github.com/comdex-official/comdex/x/auctionsV2/keeper" - newauctypes "github.com/comdex-official/comdex/x/auctionsV2/types" + auctionsV2client "github.com/comdex-official/comdex/x/auctionsV2/client" + auctionsV2keeper "github.com/comdex-official/comdex/x/auctionsV2/keeper" + auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" icq "github.com/cosmos/ibc-apps/modules/async-icq/v4" icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v4/keeper" icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v4/types" @@ -239,8 +239,8 @@ func GetGovProposalHandlers() []govclient.ProposalHandler { proposalHandlers = append(proposalHandlers, wasmclient.ProposalHandlers...) proposalHandlers = append(proposalHandlers, assetclient.AddAssetsHandler...) proposalHandlers = append(proposalHandlers, liquidityclient.LiquidityProposalHandler...) - proposalHandlers = append(proposalHandlers, newliqclient.LiquidationsV2Handler...) - proposalHandlers = append(proposalHandlers, newaucclient.AuctionsV2Handler...) + proposalHandlers = append(proposalHandlers, liquidationsV2client.LiquidationsV2Handler...) + proposalHandlers = append(proposalHandlers, auctionsV2client.AuctionsV2Handler...) return proposalHandlers } @@ -375,8 +375,8 @@ type App struct { TokenmintKeeper tokenmintkeeper.Keeper LiquidityKeeper liquiditykeeper.Keeper Rewardskeeper rewardskeeper.Keeper - NewliqKeeper newliqkeeper.Keeper - NewaucKeeper newauckeeper.Keeper + NewliqKeeper liquidationsV2keeper.Keeper + NewaucKeeper auctionsV2keeper.Keeper // IBC modules // transfer module @@ -424,7 +424,7 @@ func New( markettypes.StoreKey, bandoraclemoduletypes.StoreKey, lockertypes.StoreKey, wasm.StoreKey, authzkeeper.StoreKey, auctiontypes.StoreKey, tokenminttypes.StoreKey, rewardstypes.StoreKey, feegrant.StoreKey, liquiditytypes.StoreKey, esmtypes.ModuleName, lendtypes.StoreKey, - newliqtypes.StoreKey, newauctypes.StoreKey, ibchookstypes.StoreKey, packetforwardtypes.StoreKey, icqtypes.StoreKey, + liquidationsV2types.StoreKey, auctionsV2types.StoreKey, ibchookstypes.StoreKey, packetforwardtypes.StoreKey, icqtypes.StoreKey, ) ) @@ -478,8 +478,8 @@ func New( app.ParamsKeeper.Subspace(tokenminttypes.ModuleName) app.ParamsKeeper.Subspace(liquiditytypes.ModuleName) app.ParamsKeeper.Subspace(rewardstypes.ModuleName) - app.ParamsKeeper.Subspace(newliqtypes.ModuleName) - app.ParamsKeeper.Subspace(newauctypes.ModuleName) + app.ParamsKeeper.Subspace(liquidationsV2types.ModuleName) + app.ParamsKeeper.Subspace(auctionsV2types.ModuleName) app.ParamsKeeper.Subspace(ibcratelimittypes.ModuleName) app.ParamsKeeper.Subspace(icqtypes.ModuleName) app.ParamsKeeper.Subspace(packetforwardtypes.ModuleName).WithKeyTable(packetforwardtypes.ParamKeyTable()) @@ -785,11 +785,11 @@ func New( &app.LendKeeper, ) - app.NewliqKeeper = newliqkeeper.NewKeeper( + app.NewliqKeeper = liquidationsV2keeper.NewKeeper( app.cdc, - app.keys[newliqtypes.StoreKey], - app.keys[newliqtypes.MemStoreKey], - app.GetSubspace(newliqtypes.ModuleName), + app.keys[liquidationsV2types.StoreKey], + app.keys[liquidationsV2types.MemStoreKey], + app.GetSubspace(liquidationsV2types.ModuleName), app.AccountKeeper, app.BankKeeper, &app.AssetKeeper, @@ -802,11 +802,11 @@ func New( &app.CollectorKeeper, ) - app.NewaucKeeper = newauckeeper.NewKeeper( + app.NewaucKeeper = auctionsV2keeper.NewKeeper( app.cdc, - app.keys[newauctypes.StoreKey], - app.keys[newauctypes.MemStoreKey], - app.GetSubspace(newauctypes.ModuleName), + app.keys[auctionsV2types.StoreKey], + app.keys[auctionsV2types.MemStoreKey], + app.GetSubspace(auctionsV2types.ModuleName), &app.NewliqKeeper, app.BankKeeper, &app.MarketKeeper, @@ -825,7 +825,7 @@ func New( app.IbcKeeper.ChannelKeeper, // may be replaced with middleware app.IbcKeeper.ChannelKeeper, &app.IbcKeeper.PortKeeper, - scopedICliQKeeper, + scopedICQKeeper, app.GRPCQueryRouter(), ) app.ICQKeeper = &icqKeeper @@ -881,8 +881,8 @@ func New( AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IbcKeeper.ClientKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IbcKeeper.ClientKeeper)). AddRoute(liquiditytypes.RouterKey, liquidity.NewLiquidityProposalHandler(app.LiquidityKeeper)). - AddRoute(newliqtypes.RouterKey, liquidationsV2.NewLiquidationsV2Handler(app.NewliqKeeper)). - AddRoute(newauctypes.RouterKey, auctionsV2.NewAuctionsV2Handler(app.NewaucKeeper)) + AddRoute(liquidationsV2types.RouterKey, liquidationsV2.NewLiquidationsV2Handler(app.NewliqKeeper)). + AddRoute(auctionsV2types.RouterKey, auctionsV2.NewAuctionsV2Handler(app.NewaucKeeper)) if len(wasmEnabledProposals) != 0 { govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, wasmEnabledProposals)) @@ -1011,8 +1011,8 @@ func New( liquiditytypes.ModuleName, lendtypes.ModuleName, esmtypes.ModuleName, - newliqtypes.ModuleName, - newauctypes.ModuleName, + liquidationsV2types.ModuleName, + auctionsV2types.ModuleName, ibcratelimittypes.ModuleName, ibchookstypes.ModuleName, icqtypes.ModuleName, @@ -1053,8 +1053,8 @@ func New( rewardstypes.ModuleName, liquiditytypes.ModuleName, esmtypes.ModuleName, - newliqtypes.ModuleName, - newauctypes.ModuleName, + liquidationsV2types.ModuleName, + auctionsV2types.ModuleName, ibcratelimittypes.ModuleName, ibchookstypes.ModuleName, icqtypes.ModuleName, @@ -1099,8 +1099,8 @@ func New( liquiditytypes.ModuleName, rewardstypes.ModuleName, crisistypes.ModuleName, - newliqtypes.ModuleName, - newauctypes.ModuleName, + liquidationsV2types.ModuleName, + auctionsV2types.ModuleName, ibcratelimittypes.ModuleName, ibchookstypes.ModuleName, icqtypes.ModuleName, @@ -1429,8 +1429,8 @@ func (a *App) ModuleAccountsPermissions() map[string][]string { wasm.ModuleName: {authtypes.Burner}, liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, rewardstypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - newliqtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - newauctypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + liquidationsV2types.ModuleName: {authtypes.Minter, authtypes.Burner}, + auctionsV2types.ModuleName: {authtypes.Minter, authtypes.Burner}, icatypes.ModuleName: nil, assettypes.ModuleName: nil, icqtypes.ModuleName: nil, @@ -1471,8 +1471,8 @@ func upgradeHandlers(upgradeInfo storetypes.UpgradeInfo, a *App, storeUpgrades * storeUpgrades = &storetypes.StoreUpgrades{ Added: []string{ icqtypes.StoreKey, - newliqtypes.ModuleName, - newauctypes.ModuleName, + liquidationsV2types.ModuleName, + auctionsV2types.ModuleName, }, } } From 57c7545d58c56267f7d08ecdd1f8775c78c10642 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 18:34:18 +0000 Subject: [PATCH 122/155] Bump github.com/CosmWasm/wasmvm from 1.2.1 to 1.3.0 Bumps [github.com/CosmWasm/wasmvm](https://github.com/CosmWasm/wasmvm) from 1.2.1 to 1.3.0. - [Release notes](https://github.com/CosmWasm/wasmvm/releases) - [Changelog](https://github.com/CosmWasm/wasmvm/blob/main/CHANGELOG.md) - [Commits](https://github.com/CosmWasm/wasmvm/compare/v1.2.1...v1.3.0) --- updated-dependencies: - dependency-name: github.com/CosmWasm/wasmvm dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1a350a3cf..44b787167 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/CosmWasm/wasmd v0.31.0 - github.com/CosmWasm/wasmvm v1.2.1 + github.com/CosmWasm/wasmvm v1.3.0 github.com/bandprotocol/bandchain-packet v0.0.3 github.com/cosmos/cosmos-sdk v0.46.11 github.com/cosmos/ibc-apps/modules/async-icq/v4 v4.0.0-20230524151648-c02fa46c2860 diff --git a/go.sum b/go.sum index 64c901a95..5f0a464a5 100644 --- a/go.sum +++ b/go.sum @@ -300,8 +300,8 @@ github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQ github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= github.com/CosmWasm/wasmd v0.31.0 h1:xACf6A/SkCeGWQWrKGsR4X9PQb5G4XYuNfnrl+HQ1mE= github.com/CosmWasm/wasmd v0.31.0/go.mod h1:VcyDGk/ISVlMUeW+1GGL0zdHWBS2FPwLEV2qZ86l7l8= -github.com/CosmWasm/wasmvm v1.2.1 h1:si0tRsRDdUShV0k51Wn6zRKlmj3/WWP9Yr4cLmDTf+8= -github.com/CosmWasm/wasmvm v1.2.1/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc= +github.com/CosmWasm/wasmvm v1.3.0 h1:x12X4bKlUPS7TT9QQP45+fJo2sp30GEbiSSgb9jsec8= +github.com/CosmWasm/wasmvm v1.3.0/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= From 8a36e85b61c0d696138c2c4c05be6042ff622e50 Mon Sep 17 00:00:00 2001 From: Dheeraj Dubey Date: Tue, 18 Jul 2023 15:47:19 +0530 Subject: [PATCH 123/155] refactor --- go.sum | 2 -- x/liquidationsV2/client/cli/parse.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/go.sum b/go.sum index 10c5d393e..31a1ab536 100644 --- a/go.sum +++ b/go.sum @@ -2369,8 +2369,6 @@ github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag github.com/strangelove-ventures/async-icq/v4 v4.0.0-rc0 h1:foE/5O2/XiqGsdTKx3R0BTfKgW9KnUYyQLZt0WFSesE= github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4 h1:8Tn4Gy/DAq7wzV1CxEGv80ujZ+nUvzgwwdCobO/Gj8Y= github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.4/go.mod h1:AG8F5pdk3x1h7PlRvPoMem3623W+w8HJHrWYkVJ51kk= -github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.6 h1:aY64yjKZyDyzlIbDOkGBPvVpR0ArzIjunpCRKqoIm7o= -github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.6/go.mod h1:4zAtg449/JISRmf+sbmqolqSLP+QJBh+EtWkWtt/AKE= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= diff --git a/x/liquidationsV2/client/cli/parse.go b/x/liquidationsV2/client/cli/parse.go index 12da0fd36..b86884fe2 100644 --- a/x/liquidationsV2/client/cli/parse.go +++ b/x/liquidationsV2/client/cli/parse.go @@ -22,7 +22,7 @@ func parseLiquidationWhitelistingFlags(fs *pflag.FlagSet) (*createWhitelistLiqui whitelistLiquidationFile, _ := fs.GetString(FlagWhitelistLiquidation) if whitelistLiquidationFile == "" { - return nil, fmt.Errorf("must pass in add asset mapping json using the --%s flag", whitelistLiquidationFile) + return nil, fmt.Errorf("must pass in whitelist liquidation file json using the --%s flag", whitelistLiquidationFile) } contents, err := os.ReadFile(whitelistLiquidationFile) From 06d8547cd41080d53fc9680891deaa338c5c308f Mon Sep 17 00:00:00 2001 From: Dheeraj Dubey Date: Tue, 18 Jul 2023 15:53:40 +0530 Subject: [PATCH 124/155] remove test comments --- x/tokenmint/keeper/mint.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/x/tokenmint/keeper/mint.go b/x/tokenmint/keeper/mint.go index e1b148a55..a25dd4c7a 100644 --- a/x/tokenmint/keeper/mint.go +++ b/x/tokenmint/keeper/mint.go @@ -1,7 +1,6 @@ package keeper import ( - "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/comdex-official/comdex/x/tokenmint/types" @@ -109,7 +108,6 @@ func (k Keeper) MintNewTokensForApp(ctx sdk.Context, appMappingID uint64, assetI func (k Keeper) BurnTokensForApp(ctx sdk.Context, appMappingID uint64, assetID uint64, amount sdk.Int) error { assetData, found := k.asset.GetAsset(ctx, assetID) - fmt.Println("assetID", assetID) if !found { return types.ErrorAssetDoesNotExist } From 7aa354e5242780026c388f0b2f6f240efef924e9 Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 21 Jul 2023 10:30:34 +0530 Subject: [PATCH 125/155] refactoring liquidate.go, bid.go --- x/auctionsV2/keeper/bid.go | 9 ++++++--- x/auctionsV2/module.go | 4 +++- x/liquidationsV2/expected/keeper.go | 3 +++ x/liquidationsV2/keeper/liquidate.go | 29 +++++++++++++++++++++++----- 4 files changed, 36 insertions(+), 9 deletions(-) diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index deed0cc31..4dcf5c8de 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -100,7 +100,8 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //Send rest tokens to the user OwnerLeftOverCapital := auctionData.CollateralToken.Amount.Sub(totalCollateralTokenQuanitity) if OwnerLeftOverCapital.GT(sdk.ZeroInt()) { - err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.Owner), sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, OwnerLeftOverCapital))) + ownerAddr, _ := sdk.AccAddressFromBech32(liquidationData.Owner) + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, ownerAddr, sdk.NewCoins(sdk.NewCoin(auctionData.CollateralToken.Denom, OwnerLeftOverCapital))) if err != nil { return bidId, err } @@ -122,7 +123,8 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s keeperIncentive := (liquidationWhitelistingAppData.KeeeperIncentive.Mul(sdk.NewDecFromInt(liquidationPenalty.Amount))).TruncateInt() if keeperIncentive.GT(sdk.ZeroInt()) { liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) - err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.InternalKeeperAddress), sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) + addr, _ := sdk.AccAddressFromBech32(liquidationData.InternalKeeperAddress) + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, addr, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) if err != nil { return bidId, err } @@ -160,7 +162,8 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s keeperIncentive := (liquidationWhitelistingAppData.KeeeperIncentive.Mul(sdk.NewDecFromInt(liquidationPenalty.Amount))).TruncateInt() if keeperIncentive.GT(sdk.ZeroInt()) { liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) - err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, sdk.AccAddress(liquidationData.InternalKeeperAddress), sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) + addr, _ := sdk.AccAddressFromBech32(liquidationData.InternalKeeperAddress) + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, addr, sdk.NewCoins(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive))) if err != nil { return bidId, err } diff --git a/x/auctionsV2/module.go b/x/auctionsV2/module.go index e20b3cd31..b2633a4d7 100644 --- a/x/auctionsV2/module.go +++ b/x/auctionsV2/module.go @@ -160,7 +160,9 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { + BeginBlocker(ctx, am.keeper) +} // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. diff --git a/x/liquidationsV2/expected/keeper.go b/x/liquidationsV2/expected/keeper.go index 1761e3c24..befd39057 100644 --- a/x/liquidationsV2/expected/keeper.go +++ b/x/liquidationsV2/expected/keeper.go @@ -90,6 +90,9 @@ type LendKeeper interface { SetAllReserveStatsByAssetID(ctx sdk.Context, allReserveStats lendtypes.AllReserveStats) GetAllReserveStatsByAssetID(ctx sdk.Context, id uint64) (allReserveStats lendtypes.AllReserveStats, found bool) MsgCalculateBorrowInterest(ctx sdk.Context, borrowerAddr string, borrowID uint64) error + UpdateLendStats(ctx sdk.Context, AssetID, PoolID uint64, amount sdk.Int, inc bool) + DeleteLendForAddressByAsset(ctx sdk.Context, address string, lendingID uint64) + DeleteLend(ctx sdk.Context, id uint64) } type RewardsKeeper interface { diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 956bb36e8..5665f867c 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -350,6 +350,7 @@ func (k Keeper) LiquidateIndividualBorrow(ctx sdk.Context, borrowID uint64, liqu } func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsset, owner string, appID uint64, currentCollateralizationRatio sdk.Dec, assetRatesStats lendtypes.AssetRatesParams, lendPair lendtypes.Extended_Pair, pool lendtypes.Pool, assetIn assettypes.Asset, liquidator string, isInternalkeeper bool) error { + lendPos, _ := k.lend.GetLend(ctx, borrow.LendingID) whitelistingData, found := k.GetLiquidationWhiteListing(ctx, appID) if !found { return fmt.Errorf("Liquidation not enabled for App ID %d", appID) @@ -357,6 +358,7 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsse borrow.IsLiquidated = true k.lend.SetBorrow(ctx, borrow) pair, _ := k.lend.GetLendPair(ctx, borrow.PairID) + cAsset, _ := k.asset.GetAsset(ctx, assetRatesStats.CAssetID) //Calculating Liquidation Fees feesToBeCollected := sdk.NewDecFromInt(borrow.AmountOut.Amount).Mul(assetRatesStats.LiquidationPenalty).TruncateInt() @@ -368,12 +370,28 @@ func (k Keeper) UpdateLockedBorrows(ctx sdk.Context, borrow lendtypes.BorrowAsse return err } + err = k.bank.BurnCoins(ctx, pool.ModuleName, sdk.NewCoins(sdk.NewCoin(cAsset.Denom, borrow.AmountIn.Amount))) + if err != nil { + return err + } + err = k.CreateLockedVault(ctx, borrow.ID, borrow.PairID, owner, sdk.NewCoin(assetIn.Denom, borrow.AmountIn.Amount), borrow.AmountOut, borrow.AmountIn, borrow.AmountOut, currentCollateralizationRatio, appID, isInternalkeeper, liquidator, "", feesToBeCollected, auctionBonusToBeGiven, "lend", whitelistingData.IsDutchActivated, false, pair.AssetIn, pair.AssetOut) if err != nil { return err } k.lend.UpdateBorrowStats(ctx, lendPair, borrow.IsStableBorrow, borrow.AmountOut.Amount, false) + lendPos.AmountIn.Amount = lendPos.AmountIn.Amount.Sub(borrow.AmountIn.Amount) + k.lend.UpdateLendStats(ctx, lendPos.AssetID, lendPos.PoolID, borrow.AmountIn.Amount, false) + if !lendPos.AmountIn.Amount.GT(sdk.ZeroInt()) { + // delete lend position + k.lend.DeleteLendForAddressByAsset(ctx, lendPos.Owner, lendPos.ID) + k.lend.DeleteIDFromAssetStatsMapping(ctx, lendPos.PoolID, lendPos.AssetID, borrow.LendingID, true) + k.lend.DeleteLend(ctx, lendPos.ID) + } else { + k.lend.SetLend(ctx, lendPos) + } + return nil } @@ -688,9 +706,11 @@ func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData t pair, _ := k.lend.GetLendPair(ctx, borrowPos.PairID) pool, _ := k.lend.GetPool(ctx, pair.AssetOutPoolID) poolAssetLBMappingData, _ := k.lend.GetAssetStatsByPoolIDAndAssetID(ctx, pair.AssetOutPoolID, pair.AssetOut) - amountToPool := liquidationData.DebtToken + amountToPool := liquidationData.TargetDebt assetOutStats, _ := k.lend.GetAssetRatesParams(ctx, pair.AssetOut) + assetInStats, _ := k.lend.GetAssetRatesParams(ctx, pair.AssetIn) cAsset, _ := k.asset.GetAsset(ctx, assetOutStats.CAssetID) + lend, _ := k.lend.GetLend(ctx, borrowPos.LendingID) // sending tokens debt tokens to the pool err := k.bank.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, pool.ModuleName, sdk.NewCoins(amountToPool)) @@ -707,9 +727,9 @@ func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData t } // sending liquidation penalty - liquidationPenalty := assetOutStats.LiquidationPenalty + liquidationPenalty := assetInStats.LiquidationPenalty if pair.IsEModeEnabled { - liquidationPenalty = assetOutStats.ELiquidationPenalty + liquidationPenalty = assetInStats.ELiquidationPenalty } liqPenaltyAmount := sdk.NewDecFromInt(borrowPos.AmountOut.Amount).Mul(liquidationPenalty).TruncateInt() err = k.lend.UpdateReserveBalances(ctx, pair.AssetOut, pool.ModuleName, sdk.NewCoin(borrowPos.AmountOut.Denom, liqPenaltyAmount), true) @@ -741,8 +761,8 @@ func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData t return err } allReserveStats.AmountInFromRepayments = allReserveStats.AmountInFromRepayments.Add(amount.Amount) - k.lend.SetAllReserveStatsByAssetID(ctx, allReserveStats) } + k.lend.SetAllReserveStatsByAssetID(ctx, allReserveStats) // amount minted in the debt pool amtToMint := (borrowPos.InterestAccumulated.Sub(amtToReservePool)).TruncateInt() if amtToMint.GT(sdk.ZeroInt()) { @@ -755,7 +775,6 @@ func (k Keeper) MsgCloseDutchAuctionForBorrow(ctx sdk.Context, liquidationData t } // if borrow position is having bridged asset then return to the initial pool if borrowPos.BridgedAssetAmount.Amount.GT(sdk.NewInt(0)) { - lend, _ := k.lend.GetLend(ctx, borrowPos.LendingID) assetInPool, _ := k.lend.GetPool(ctx, lend.PoolID) err = k.bank.SendCoinsFromModuleToModule(ctx, pool.ModuleName, assetInPool.ModuleName, sdk.NewCoins(borrowPos.BridgedAssetAmount)) if err != nil { From a27950d4bea53e70632d74ec633527fbb63cc4ba Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 24 Jul 2023 10:29:27 +0530 Subject: [PATCH 126/155] refactoring english auction --- scripts/comdex_local_setup/constants.py | 4 ++-- x/auctionsV2/expected/keeper.go | 3 +++ x/auctionsV2/keeper/auctions.go | 29 +++++++++++++++++++++---- x/liquidationsV2/keeper/liquidate.go | 21 +++++++++++++++--- 4 files changed, 48 insertions(+), 9 deletions(-) diff --git a/scripts/comdex_local_setup/constants.py b/scripts/comdex_local_setup/constants.py index 4744a5c82..74d0aa7e3 100644 --- a/scripts/comdex_local_setup/constants.py +++ b/scripts/comdex_local_setup/constants.py @@ -1,13 +1,13 @@ import os from pathlib import Path -HOME_DIR = Path.home() +HOME_DIR = Path.home() COMDEX_DIR_PATH = os.path.abspath(os.curdir) NODE_MONIKER = "testdev" CHAIN_ID = "test-1" GENESIS_ACCOUNT_NAME = "cooluser" -GENESIS_TOKENS = "1000000000000000000000stake,1000000000000000000000ucmst,100000000000000000000000000ucmdx,100000000000000000000000uosmo,100000000000000000000000000uatom,10000000000000000000000000000000000000000weth-wei,10000000000000000000000000000ucgold,1000000000000000000000000000usdc" +GENESIS_TOKENS = "1000000000000000000000stake,1000000000000000000000ucmst,100000000000000000000000000ucmdx,100000000000000000000000uosmo,100000000000000000000000000uatom,10000000000000000000000000000000000000000weth-wei,10000000000000000000000000000ucgold,1000000000000000000000000000usdc,1000000000000000000000000000ustatom,1000000000000000000000000000ustcmdx" VOTING_PERIOD_IN_SEC = 10 DEPOSIT_PERIOD_IN_SEC = 10 \ No newline at end of file diff --git a/x/auctionsV2/expected/keeper.go b/x/auctionsV2/expected/keeper.go index 9f2babe67..625e26421 100644 --- a/x/auctionsV2/expected/keeper.go +++ b/x/auctionsV2/expected/keeper.go @@ -3,6 +3,7 @@ package expected import ( assettypes "github.com/comdex-official/comdex/x/asset/types" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" + "github.com/comdex-official/comdex/x/collector/types" esmtypes "github.com/comdex-official/comdex/x/esm/types" liquidationsV2types "github.com/comdex-official/comdex/x/liquidationsV2/types" markettypes "github.com/comdex-official/comdex/x/market/types" @@ -59,6 +60,8 @@ type VaultKeeper interface { } type CollectorKeeper interface { SetNetFeeCollectedData(ctx sdk.Context, appID, assetID uint64, fee sdk.Int) error + GetAuctionMappingForApp(ctx sdk.Context, appID, assetID uint64) (collectorAuctionLookupTable types.AppAssetIdToAuctionLookupTable, found bool) + SetAuctionMappingForApp(ctx sdk.Context, records types.AppAssetIdToAuctionLookupTable) error } type TokenMintKeeper interface { diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 385f7c220..7ad4edb45 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,7 +1,6 @@ package keeper import ( - "fmt" "time" auctiontypes "github.com/comdex-official/comdex/x/auction/types" @@ -188,7 +187,7 @@ func (k Keeper) AuctionIterator(ctx sdk.Context) error { //Continue normal operation //DO update - //then check if to be restarred , then restart + //then check if to be restarted , then restart if ctx.BlockTime().After(auction.EndTime) { //Restart @@ -371,7 +370,7 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio // send collateral to user // send harbor to token mint to burn // set net fees data - err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, collectortypes.ModuleName, auctionsV2types.ModuleName, sdk.NewCoins(englishAuction.CollateralToken)) + err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, collectortypes.ModuleName, auctionsV2types.ModuleName, sdk.NewCoins(englishAuction.CollateralToken)) if err != nil { return err } @@ -382,7 +381,6 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio } err = k.tokenMint.BurnTokensForApp(ctx, englishAuction.AppId, englishAuction.DebtAssetId, englishAuction.DebtToken.Amount) - fmt.Println(err) if err != nil { return err } @@ -392,6 +390,17 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio return auctiontypes.ErrorUnableToSetNetFees } + auctionLookupTable, found := k.collector.GetAuctionMappingForApp(ctx, englishAuction.AppId, englishAuction.CollateralAssetId) + if !found { + return auctiontypes.ErrorInvalidAddress + } + + auctionLookupTable.IsAuctionActive = false + err = k.collector.SetAuctionMappingForApp(ctx, auctionLookupTable) + if err != nil { + return err + } + } else if liquidationData.InitiatorType == types.DebtAuctionInitiator { //Mint required collateral token from tokenmint //send newly minted token((collateral)) to the user @@ -411,6 +420,18 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio if err != nil { return auctiontypes.ErrorUnableToSetNetFees } + + auctionLookupTable, found := k.collector.GetAuctionMappingForApp(ctx, englishAuction.AppId, englishAuction.DebtAssetId) + if !found { + return auctiontypes.ErrorInvalidAddress + } + + auctionLookupTable.IsAuctionActive = false + err = k.collector.SetAuctionMappingForApp(ctx, auctionLookupTable) + if err != nil { + return err + } + } else { //External auction //TODO: diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 5665f867c..3fd746722 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -444,10 +444,14 @@ func (k Keeper) WhitelistLiquidation(ctx sdk.Context, msg types.LiquidationWhite func (k Keeper) LiquidateForSurplusAndDebt(ctx sdk.Context) error { auctionMapData, _ := k.collector.GetAllAuctionMappingForApp(ctx) for _, data := range auctionMapData { - err := k.CheckStatsForSurplusAndDebt(ctx, data.AppId, data.AssetId) - if err != nil { - return err + killSwitchParams, _ := k.esm.GetKillSwitchData(ctx, data.AppId) + if data.IsDebtAuction && data.IsSurplusAuction && !data.IsAuctionActive && !killSwitchParams.BreakerEnable { + err := k.CheckStatsForSurplusAndDebt(ctx, data.AppId, data.AssetId) + if err != nil { + return err + } } + } return nil @@ -458,6 +462,7 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint if !found { return nil } + auctionLookupTable, _ := k.collector.GetAuctionMappingForApp(ctx, appID, assetID) // coin denomination will be of 2 type: Auctioned Asset the asset which is being sold; i.e. Collateral Token // CMST // Asset required to bid on Collateral Asset; i.e. Debt Token // HARBOR @@ -478,6 +483,11 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint if err != nil { return err } + auctionLookupTable.IsAuctionActive = true + err1 := k.collector.SetAuctionMappingForApp(ctx, auctionLookupTable) + if err1 != nil { + return err1 + } } // for surplus auction @@ -495,6 +505,11 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint if err != nil { return err } + auctionLookupTable.IsAuctionActive = true + err1 := k.collector.SetAuctionMappingForApp(ctx, auctionLookupTable) + if err1 != nil { + return err1 + } } return nil From 3e75ba02963ba69b2b1eb9a5d8572a3249a0b587 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 26 Jul 2023 10:02:54 +0530 Subject: [PATCH 127/155] updating and adding queries --- proto/comdex/auctionsV2/v1beta1/auction.proto | 20 + proto/comdex/auctionsV2/v1beta1/query.proto | 28 +- x/auctionsV2/client/cli/query.go | 50 +- x/auctionsV2/keeper/bid.go | 32 + x/auctionsV2/keeper/grpc_query.go | 57 +- x/auctionsV2/keeper/utils.go | 51 ++ x/auctionsV2/types/auction.pb.go | 413 +++++++++-- x/auctionsV2/types/keys.go | 5 + x/auctionsV2/types/query.pb.go | 657 +++++++++++++++--- x/auctionsV2/types/query.pb.gw.go | 109 ++- x/liquidationsV2/client/cli/tx.go | 52 +- x/liquidationsV2/types/msg.go | 12 +- 12 files changed, 1321 insertions(+), 165 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index 6c328fb3a..f2e11c863 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -106,3 +106,23 @@ message Auction{ uint64 bid_id = 1; string bid_owner = 2; } + +message LimitBidProtocolData{ + uint64 collateral_asset_id = 1 [ + (gogoproto.moretags) = "yaml:\"collateral_asset_id\"" + ]; + uint64 debt_asset_id = 2 [ + (gogoproto.moretags) = "yaml:\"debt_asset_id\"" + ]; + string bid_value = 3 [ + (gogoproto.moretags) = "yaml:\"bid_value\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + ]; + + string max_discount = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"max_discount\"" + ]; +} \ No newline at end of file diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index ae2025cec..8aca8bd17 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -27,8 +27,9 @@ message QueryAuctionResponse { } message QueryAuctionsRequest { - bool history = 1; - cosmos.base.query.v1beta1.PageRequest pagination = 2 + uint64 auction_type = 1; + bool history = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3 [(gogoproto.moretags) = "yaml:\"pagination\""]; } @@ -110,11 +111,25 @@ message QueryLimitBidsRequest { } message QueryLimitBidsResponse { - repeated LimitOrderBid limit_order_bids = 2 [ + repeated LimitOrderBid limit_order_bids = 1 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"limit_order_bids\"" ]; - cosmos.base.query.v1beta1.PageResponse pagination = 3 + cosmos.base.query.v1beta1.PageResponse pagination = 2 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryLimitBidProtocolDataRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryLimitBidProtocolDataResponse { + repeated LimitBidProtocolData limit_bid_protocol_data = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"limit_bid_protocol_data\"" + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2 [(gogoproto.moretags) = "yaml:\"pagination\""]; } @@ -126,7 +141,7 @@ service Query { option (google.api.http).get = "/comdex/auctions/v2/auction/{auction_id}/{history}"; } rpc Auctions(QueryAuctionsRequest) returns (QueryAuctionsResponse) { - option (google.api.http).get = "/comdex/auctions/v2/auctions/{history}"; + option (google.api.http).get = "/comdex/auctions/v2/auctions/{auction_type}/{history}"; } rpc Bids(QueryBidsRequest) returns (QueryBidsResponse) { option (google.api.http).get = "/comdex/auctions/v2/bids/{bidder}/{history}"; @@ -143,4 +158,7 @@ service Query { rpc LimitBids(QueryLimitBidsRequest) returns (QueryLimitBidsResponse) { option (google.api.http).get = "/comdex/auctions/v2/limitorderbids/{collateral_token_id}/{debt_token_id}"; } + rpc LimitBidProtocolData(QueryLimitBidProtocolDataRequest) returns (QueryLimitBidProtocolDataResponse) { + option (google.api.http).get = "/comdex/auctions/v2/limit_bid_protocol_data"; + } } \ No newline at end of file diff --git a/x/auctionsV2/client/cli/query.go b/x/auctionsV2/client/cli/query.go index 72ff518e1..f69caa450 100644 --- a/x/auctionsV2/client/cli/query.go +++ b/x/auctionsV2/client/cli/query.go @@ -36,6 +36,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { queryAuctionParams(), queryUserLimitOrderBidsByAssetID(), queryLimitOrderBids(), + queryLimitBidProtocolData(), ) return cmd @@ -79,15 +80,19 @@ func queryAuction() *cobra.Command { func queryAuctions() *cobra.Command { cmd := &cobra.Command{ - Use: "auctions [history]", + Use: "auctions [type] [history]", Short: "Query all auctions", - Args: cobra.ExactArgs(1), + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { ctx, err := client.GetClientQueryContext(cmd) if err != nil { return err } - history, err := strconv.ParseBool(args[0]) + auctionType, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + history, err := strconv.ParseBool(args[1]) if err != nil { return err } @@ -99,8 +104,9 @@ func queryAuctions() *cobra.Command { res, err := queryClient.Auctions( context.Background(), &types.QueryAuctionsRequest{ - History: history, - Pagination: pagination, + AuctionType: auctionType, + History: history, + Pagination: pagination, }, ) if err != nil { @@ -312,4 +318,36 @@ func queryLimitOrderBids() *cobra.Command { flags.AddPaginationFlagsToCmd(cmd, "limit-order-bids") return cmd -} \ No newline at end of file +} + +func queryLimitBidProtocolData() *cobra.Command { + cmd := &cobra.Command{ + Use: "limit-bid-protocol-data", + Short: "Query Limit Bid Protocol Data", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + res, err := queryClient.LimitBidProtocolData( + context.Background(), + &types.QueryLimitBidProtocolDataRequest{ + Pagination: pagination, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "limit-bid-protocol-data") + + return cmd +} diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 4dcf5c8de..bf6acb7a5 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -540,6 +540,22 @@ func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, Collatera k.SetLimitAuctionBidID(ctx, userLimitBid.LimitOrderBiddingId) k.SetUserLimitBidData(ctx, userLimitBid, DebtTokenId, CollateralTokenId, PremiumDiscount) + protocolData, found := k.GetLimitBidProtocolDataByAssetID(ctx, DebtTokenId, CollateralTokenId) + if !found { + protocolData = types.LimitBidProtocolData{ + CollateralAssetId: CollateralTokenId, + DebtAssetId: DebtTokenId, + BidValue: amount.Amount, + MaxDiscount: sdk.Dec{}, + } + } else { + protocolData.BidValue = protocolData.BidValue.Add(amount.Amount) + } + err = k.SetLimitBidProtocolData(ctx, protocolData) + if err != nil { + return err + } + return nil } @@ -550,6 +566,7 @@ func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenI return types.ErrBidNotFound } auctionParams, _ := k.GetAuctionParams(ctx) + amount := userLimitBid.DebtToken.Amount bidderAddr, err := sdk.AccAddressFromBech32(bidder) if err != nil { @@ -583,6 +600,13 @@ func (k Keeper) CancelLimitAuctionBid(ctx sdk.Context, bidder string, DebtTokenI k.UpdateUserLimitBidDataForAddress(ctx, userLimitBid, false) k.DeleteUserLimitBidData(ctx, DebtTokenId, CollateralTokenId, PremiumDiscount, bidder) + protocolData, _ := k.GetLimitBidProtocolDataByAssetID(ctx, DebtTokenId, CollateralTokenId) + protocolData.BidValue = protocolData.BidValue.Sub(amount) + err = k.SetLimitBidProtocolData(ctx, protocolData) + if err != nil { + return err + } + return nil } @@ -632,6 +656,14 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(amount.Amount) k.SetUserLimitBidData(ctx, userLimitBid, DebtTokenId, CollateralTokenId, PremiumDiscount) + + protocolData, _ := k.GetLimitBidProtocolDataByAssetID(ctx, DebtTokenId, CollateralTokenId) + protocolData.BidValue = protocolData.BidValue.Sub(amount.Amount) + err = k.SetLimitBidProtocolData(ctx, protocolData) + if err != nil { + return err + } + return nil } diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index c3637f88c..e89afaa31 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -70,10 +70,23 @@ func (q QueryServer) Auctions(c context.Context, req *types.QueryAuctionsRequest return false, err } - if accumulate { - items = append(items, item) + if req.AuctionType == 1 { + if accumulate { + if item.AuctionType { + items = append(items, item) + } + } + } else if req.AuctionType == 2 { + lockedVault, _ := q.LiquidationsV2.GetLockedVault(ctx, item.AppId, item.LockedVaultId) + if !item.AuctionType && lockedVault.InitiatorType == "surplus" { + items = append(items, item) + } + } else if req.AuctionType == 3 { + lockedVault, _ := q.LiquidationsV2.GetLockedVault(ctx, item.AppId, item.LockedVaultId) + if !item.AuctionType && lockedVault.InitiatorType == "debt" { + items = append(items, item) + } } - return true, nil }, ) @@ -258,3 +271,41 @@ func (q QueryServer) LimitBids(c context.Context, req *types.QueryLimitBidsReque Pagination: pagination, }, nil } + +func (q QueryServer) LimitBidProtocolData(c context.Context, req *types.QueryLimitBidProtocolDataRequest) (*types.QueryLimitBidProtocolDataResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + items []types.LimitBidProtocolData + ctx = sdk.UnwrapSDKContext(c) + key []byte + ) + key = types.MarketBidProtocolKeyPrefix + + pagination, err := query.FilteredPaginate( + prefix.NewStore(q.Store(ctx), key), + req.Pagination, + func(_, value []byte, accumulate bool) (bool, error) { + var item types.LimitBidProtocolData + if err := q.cdc.Unmarshal(value, &item); err != nil { + return false, err + } + + if accumulate { + items = append(items, item) + } + + return true, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryLimitBidProtocolDataResponse{ + LimitBidProtocolData: items, + Pagination: pagination, + }, nil +} diff --git a/x/auctionsV2/keeper/utils.go b/x/auctionsV2/keeper/utils.go index d03b079a0..f01b5e630 100644 --- a/x/auctionsV2/keeper/utils.go +++ b/x/auctionsV2/keeper/utils.go @@ -19,6 +19,7 @@ func (k Keeper) SetAuctionID(ctx sdk.Context, id uint64) { ) store.Set(key, value) } + func (k Keeper) GetAuctionID(ctx sdk.Context) uint64 { var ( store = k.Store(ctx) @@ -295,6 +296,7 @@ func (k Keeper) SetAuctionLimitBidFeeDataExternal(ctx sdk.Context, feeData types store.Set(key, value) return nil } + func (k Keeper) GetAuctionLimitBidFeeDataExternal(ctx sdk.Context, assetId uint64) (feeData types.AuctionFeesCollectionFromLimitBidTx, found bool) { var ( store = k.Store(ctx) @@ -309,3 +311,52 @@ func (k Keeper) GetAuctionLimitBidFeeDataExternal(ctx sdk.Context, assetId uint6 k.cdc.MustUnmarshal(value, &feeData) return feeData, true } + +func (k Keeper) SetLimitBidProtocolData(ctx sdk.Context, data types.LimitBidProtocolData) error { + + var ( + store = k.Store(ctx) + key = types.MarketBidProtocolKey(data.DebtAssetId, data.CollateralAssetId) + value = k.cdc.MustMarshal(&data) + ) + + store.Set(key, value) + return nil +} + +func (k Keeper) GetAllLimitBidProtocolData(ctx sdk.Context) (bidData []types.LimitBidProtocolData) { + var ( + store = k.Store(ctx) + iter = sdk.KVStorePrefixIterator(store, types.MarketBidProtocolKeyPrefix) + ) + + defer func(iter sdk.Iterator) { + err := iter.Close() + if err != nil { + return + } + }(iter) + + for ; iter.Valid(); iter.Next() { + var data types.LimitBidProtocolData + k.cdc.MustUnmarshal(iter.Value(), &data) + bidData = append(bidData, data) + } + + return bidData +} + +func (k Keeper) GetLimitBidProtocolDataByAssetID(ctx sdk.Context, debtAssetID, collateralAssetID uint64) (data types.LimitBidProtocolData, found bool) { + var ( + store = k.Store(ctx) + key = types.MarketBidProtocolKey(debtAssetID, collateralAssetID) + value = store.Get(key) + ) + + if value == nil { + return data, false + } + + k.cdc.MustUnmarshal(value, &data) + return data, true +} diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index d302ec4f0..d8379ed31 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -280,10 +280,65 @@ func (m *BidOwnerMapping) GetBidOwner() string { return "" } +type LimitBidProtocolData struct { + CollateralAssetId uint64 `protobuf:"varint,1,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` + DebtAssetId uint64 `protobuf:"varint,2,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` + BidValue github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=bid_value,json=bidValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bid_value" yaml:"bid_value"` + MaxDiscount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=max_discount,json=maxDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_discount" yaml:"max_discount"` +} + +func (m *LimitBidProtocolData) Reset() { *m = LimitBidProtocolData{} } +func (m *LimitBidProtocolData) String() string { return proto.CompactTextString(m) } +func (*LimitBidProtocolData) ProtoMessage() {} +func (*LimitBidProtocolData) Descriptor() ([]byte, []int) { + return fileDescriptor_8ee47f5a405fa8ba, []int{3} +} +func (m *LimitBidProtocolData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LimitBidProtocolData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LimitBidProtocolData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LimitBidProtocolData) XXX_Merge(src proto.Message) { + xxx_messageInfo_LimitBidProtocolData.Merge(m, src) +} +func (m *LimitBidProtocolData) XXX_Size() int { + return m.Size() +} +func (m *LimitBidProtocolData) XXX_DiscardUnknown() { + xxx_messageInfo_LimitBidProtocolData.DiscardUnknown(m) +} + +var xxx_messageInfo_LimitBidProtocolData proto.InternalMessageInfo + +func (m *LimitBidProtocolData) GetCollateralAssetId() uint64 { + if m != nil { + return m.CollateralAssetId + } + return 0 +} + +func (m *LimitBidProtocolData) GetDebtAssetId() uint64 { + if m != nil { + return m.DebtAssetId + } + return 0 +} + func init() { proto.RegisterType((*AuctionHistorical)(nil), "comdex.auctionsV2.v1beta1.AuctionHistorical") proto.RegisterType((*Auction)(nil), "comdex.auctionsV2.v1beta1.Auction") proto.RegisterType((*BidOwnerMapping)(nil), "comdex.auctionsV2.v1beta1.bidOwnerMapping") + proto.RegisterType((*LimitBidProtocolData)(nil), "comdex.auctionsV2.v1beta1.LimitBidProtocolData") } func init() { @@ -291,68 +346,74 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 975 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0xce, 0x36, 0xcd, 0x87, 0xc7, 0x31, 0xae, 0xb7, 0x69, 0xb3, 0x71, 0x88, 0xd7, 0x1d, 0x89, - 0xd6, 0x42, 0xca, 0x5a, 0x2d, 0x3d, 0x21, 0x2e, 0x59, 0xa8, 0x54, 0x23, 0x68, 0xd1, 0x12, 0x15, - 0xc4, 0xc5, 0x9a, 0xdd, 0x19, 0x3b, 0xa3, 0xac, 0x77, 0x16, 0xef, 0x38, 0x25, 0x3f, 0x81, 0x0b, - 0xca, 0x09, 0x09, 0x89, 0x1b, 0x7f, 0xa6, 0xc7, 0x72, 0x43, 0x1c, 0x16, 0x94, 0xfc, 0x83, 0x3d, - 0x72, 0x42, 0xf3, 0xb1, 0xde, 0xf5, 0x07, 0x0a, 0xee, 0x29, 0x99, 0x77, 0xde, 0xf7, 0x79, 0x9f, - 0x79, 0xe7, 0x99, 0x67, 0x0d, 0x1e, 0x05, 0x6c, 0x84, 0xc9, 0x0f, 0x5d, 0x34, 0x09, 0x38, 0x65, - 0x51, 0xf2, 0xea, 0x49, 0xf7, 0xfc, 0xb1, 0x4f, 0x38, 0x7a, 0x9c, 0x87, 0x9c, 0x78, 0xcc, 0x38, - 0x33, 0xf7, 0x55, 0xa2, 0x53, 0x24, 0x3a, 0x3a, 0xb1, 0xb9, 0x3b, 0x64, 0x43, 0x26, 0xb3, 0xba, - 0xe2, 0x3f, 0x55, 0xd0, 0xb4, 0x87, 0x8c, 0x0d, 0x43, 0xd2, 0x95, 0x2b, 0x7f, 0x32, 0xe8, 0x72, - 0x3a, 0x22, 0x09, 0x47, 0xa3, 0x58, 0x27, 0xb4, 0x02, 0x96, 0x8c, 0x58, 0xd2, 0xf5, 0x51, 0x42, - 0xa6, 0x4d, 0x03, 0x46, 0x75, 0xc7, 0xe6, 0x91, 0xa6, 0x16, 0xd2, 0xef, 0x27, 0x14, 0xa3, 0x79, - 0x7a, 0x79, 0x98, 0xa8, 0x74, 0xf8, 0xdb, 0x2d, 0xd0, 0x38, 0x56, 0xe4, 0x9e, 0xd3, 0x84, 0xb3, - 0x31, 0x0d, 0x50, 0x68, 0x3e, 0x05, 0x40, 0x33, 0xee, 0x53, 0x6c, 0x19, 0x6d, 0xa3, 0x73, 0xdb, - 0xbd, 0x97, 0xa5, 0x76, 0xe3, 0x02, 0x8d, 0xc2, 0x8f, 0x61, 0xb1, 0x07, 0xbd, 0x8a, 0x5e, 0xf4, - 0xb0, 0x19, 0x03, 0x33, 0xdf, 0x39, 0x9d, 0x62, 0x59, 0xb7, 0xda, 0x46, 0xa7, 0xfa, 0x04, 0x3a, - 0xff, 0x39, 0x09, 0x47, 0xf7, 0x77, 0x0f, 0xb3, 0xd4, 0xde, 0x9f, 0xed, 0x50, 0xe0, 0x40, 0xaf, - 0x81, 0x16, 0x78, 0x0e, 0xc0, 0x4e, 0xc8, 0x82, 0x33, 0x82, 0xfb, 0xe7, 0x68, 0x12, 0x72, 0x6b, - 0x5d, 0xf6, 0xfa, 0x30, 0xef, 0x35, 0x3b, 0x83, 0x69, 0xbf, 0x2f, 0x64, 0xc9, 0x2b, 0x51, 0xe1, - 0xee, 0x65, 0xa9, 0x7d, 0x57, 0xf5, 0x2c, 0x23, 0x41, 0xaf, 0x1a, 0x16, 0x59, 0xf0, 0xf7, 0x1a, - 0xd8, 0xd2, 0x2c, 0xdf, 0x71, 0x36, 0x97, 0x06, 0xb8, 0x13, 0xb0, 0x30, 0x44, 0x9c, 0x8c, 0x51, - 0xd8, 0xe7, 0xec, 0x8c, 0x44, 0x7a, 0x34, 0xfb, 0x8e, 0xba, 0x52, 0x47, 0x5c, 0xe9, 0x94, 0xe4, - 0xa7, 0x8c, 0x46, 0xee, 0xe7, 0x6f, 0x52, 0x7b, 0x2d, 0x4b, 0xed, 0x3d, 0x85, 0x3d, 0x0f, 0x00, - 0xff, 0x49, 0xed, 0x47, 0x43, 0xca, 0x4f, 0x27, 0xbe, 0x38, 0x72, 0x57, 0x4b, 0x43, 0xfd, 0x39, - 0x4a, 0xf0, 0x59, 0x97, 0x5f, 0xc4, 0x24, 0x91, 0x58, 0x5e, 0xbd, 0xa8, 0x3e, 0x11, 0xc5, 0xe6, - 0x4f, 0x06, 0x00, 0x98, 0xf8, 0x5c, 0x93, 0x59, 0xbf, 0x89, 0xcc, 0x89, 0x26, 0xf3, 0x40, 0x91, - 0xa1, 0xd1, 0x20, 0x64, 0xaf, 0x55, 0x71, 0x9f, 0xa3, 0xf1, 0x90, 0xf0, 0x3e, 0x1a, 0xb1, 0x49, - 0xc4, 0x57, 0xa2, 0x55, 0x11, 0x14, 0x14, 0x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0x24, 0x2b, 0x4b, 0xed, 0x5d, 0x85, 0x34, 0xb3, 0x0d, 0xbd, 0xaa, 0x58, 0xe7, - 0xd5, 0xa7, 0x60, 0xc7, 0x67, 0xd1, 0x24, 0xd1, 0x5e, 0x65, 0x35, 0xa4, 0xe8, 0x9e, 0xad, 0x20, - 0xba, 0x5e, 0xc4, 0x8b, 0x73, 0x97, 0xb1, 0xa0, 0x57, 0x95, 0xcb, 0x63, 0xb9, 0x32, 0x7f, 0x5d, - 0xe6, 0x0f, 0x34, 0xa2, 0x9c, 0xa2, 0x50, 0x2b, 0xde, 0x94, 0xcd, 0xbf, 0x59, 0x59, 0xf1, 0x1f, - 0x2c, 0xff, 0x1e, 0xcc, 0xa2, 0x2f, 0x5a, 0x44, 0x4f, 0x6d, 0x4b, 0xf5, 0xc3, 0x67, 0xa0, 0x3e, - 0xe7, 0x7a, 0xe6, 0x3d, 0xb0, 0xe9, 0x53, 0x3c, 0xfd, 0xac, 0x79, 0x1b, 0x3e, 0xc5, 0x3d, 0x6c, - 0x1e, 0x80, 0x8a, 0x08, 0x33, 0x91, 0x2a, 0xbf, 0x59, 0x15, 0x6f, 0x3b, 0x2f, 0x75, 0x5f, 0xbc, - 0xb9, 0x6a, 0x19, 0x6f, 0xaf, 0x5a, 0xc6, 0xdf, 0x57, 0x2d, 0xe3, 0xf2, 0xba, 0xb5, 0xf6, 0xf6, - 0xba, 0xb5, 0xf6, 0xc7, 0x75, 0x6b, 0xed, 0xbb, 0xa7, 0x33, 0xc7, 0x11, 0xce, 0x7b, 0xc4, 0x06, - 0x03, 0x1a, 0x50, 0x14, 0xea, 0x75, 0x77, 0xe6, 0x17, 0x94, 0x3c, 0xa0, 0xbf, 0x29, 0xc5, 0xfd, - 0xd1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x34, 0x5b, 0x6b, 0x89, 0x63, 0x09, 0x00, 0x00, + // 1057 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00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, 0xd3, 0x3e, 0xe5, 0x0e, 0xc5, 0xaf, 0x84, 0x2e, 0x03, 0x16, 0x1e, + 0x22, 0x8e, 0xde, 0xd5, 0x76, 0xe3, 0x7f, 0x6b, 0xfb, 0xfc, 0x2c, 0x6d, 0xf7, 0xd4, 0x19, 0xce, + 0x51, 0x38, 0x24, 0xf2, 0xa9, 0xab, 0x38, 0xce, 0xcc, 0x3d, 0xdf, 0x18, 0xbd, 0x08, 0x0a, 0x08, + 0xca, 0x3a, 0x1c, 0x8b, 0x4f, 0xa1, 0xab, 0x3e, 0xba, 0xf0, 0x30, 0x4d, 0x02, 0xa9, 0xab, 0xc5, + 0x99, 0x75, 0xa5, 0x5a, 0xab, 0x75, 0x55, 0xc6, 0x82, 0x6e, 0xb5, 0x8f, 0x2e, 0x0e, 0xf5, 0xca, + 0x79, 0xf1, 0xe6, 0xba, 0x65, 0xbc, 0xbd, 0x6e, 0x19, 0x7f, 0x5e, 0xb7, 0x8c, 0xab, 0x9b, 0xd6, + 0xdc, 0xdb, 0x9b, 0xd6, 0xdc, 0x6f, 0x37, 0xad, 0xb9, 0x6f, 0x9f, 0x8c, 0x65, 0x11, 0x6f, 0xdd, + 0x3e, 0x3b, 0x39, 0xa1, 0x01, 0x45, 0xa1, 0x5e, 0x77, 0xc6, 0xfe, 0xb3, 0xca, 0xbc, 0xfe, 0xb2, + 0x1c, 0x27, 0x9f, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0x37, 0xe8, 0xec, 0xb5, 0xd5, 0x0a, 0x00, + 0x00, } func (m *AuctionHistorical) Marshal() (dAtA []byte, err error) { @@ -611,6 +672,59 @@ func (m *BidOwnerMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *LimitBidProtocolData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LimitBidProtocolData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LimitBidProtocolData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MaxDiscount.Size() + i -= size + if _, err := m.MaxDiscount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.BidValue.Size() + i -= size + if _, err := m.BidValue.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.DebtAssetId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.DebtAssetId)) + i-- + dAtA[i] = 0x10 + } + if m.CollateralAssetId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.CollateralAssetId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintAuction(dAtA []byte, offset int, v uint64) int { offset -= sovAuction(v) base := offset @@ -712,6 +826,25 @@ func (m *BidOwnerMapping) Size() (n int) { return n } +func (m *LimitBidProtocolData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CollateralAssetId != 0 { + n += 1 + sovAuction(uint64(m.CollateralAssetId)) + } + if m.DebtAssetId != 0 { + n += 1 + sovAuction(uint64(m.DebtAssetId)) + } + l = m.BidValue.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.MaxDiscount.Size() + n += 1 + l + sovAuction(uint64(l)) + return n +} + func sovAuction(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1480,6 +1613,162 @@ func (m *BidOwnerMapping) Unmarshal(dAtA []byte) error { } return nil } +func (m *LimitBidProtocolData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LimitBidProtocolData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LimitBidProtocolData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralAssetId", wireType) + } + m.CollateralAssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CollateralAssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtAssetId", wireType) + } + m.DebtAssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DebtAssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BidValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxDiscount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxDiscount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipAuction(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index 6bdf03ec8..1d1fd1b8a 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -41,6 +41,7 @@ var ( ExternalAuctionLimitBidFeeKeyPrefix = []byte{0x11} BidHistoricalKeyPrefix = []byte{0x12} UserBidHistoricalKeyPrefix = []byte{0x13} + MarketBidProtocolKeyPrefix = []byte{0x14} ) func AuctionKey(auctionID uint64) []byte { @@ -77,6 +78,10 @@ func UserLimitBidKey(debtTokenID, collateralTokenID uint64, premium sdk.Int, add return append(append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), sdk.Uint64ToBigEndian((premium.Uint64()))...), address...) } +func MarketBidProtocolKey(debtTokenID, collateralTokenID uint64) []byte { + return append(append(MarketBidProtocolKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...) +} + func UserLimitBidKeyForPremium(debtTokenID, collateralTokenID uint64, premium sdk.Int) []byte { return append(append(append(UserLimitBidMappingKeyPrefix, sdk.Uint64ToBigEndian(debtTokenID)...), sdk.Uint64ToBigEndian(collateralTokenID)...), sdk.Uint64ToBigEndian((premium.Uint64()))...) } diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index 3a557ee62..14dc5218d 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -207,8 +207,9 @@ func (m *QueryAuctionResponse) GetAuction() Auction { } type QueryAuctionsRequest struct { - History bool `protobuf:"varint,1,opt,name=history,proto3" json:"history,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` + AuctionType uint64 `protobuf:"varint,1,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty"` + History bool `protobuf:"varint,2,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` } func (m *QueryAuctionsRequest) Reset() { *m = QueryAuctionsRequest{} } @@ -244,6 +245,13 @@ func (m *QueryAuctionsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAuctionsRequest proto.InternalMessageInfo +func (m *QueryAuctionsRequest) GetAuctionType() uint64 { + if m != nil { + return m.AuctionType + } + return 0 +} + func (m *QueryAuctionsRequest) GetHistory() bool { if m != nil { return m.History @@ -795,8 +803,8 @@ func (m *QueryLimitBidsRequest) GetPagination() *query.PageRequest { } type QueryLimitBidsResponse struct { - LimitOrderBids []LimitOrderBid `protobuf:"bytes,2,rep,name=limit_order_bids,json=limitOrderBids,proto3" json:"limit_order_bids" yaml:"limit_order_bids"` - Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` + LimitOrderBids []LimitOrderBid `protobuf:"bytes,1,rep,name=limit_order_bids,json=limitOrderBids,proto3" json:"limit_order_bids" yaml:"limit_order_bids"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` } func (m *QueryLimitBidsResponse) Reset() { *m = QueryLimitBidsResponse{} } @@ -846,6 +854,102 @@ func (m *QueryLimitBidsResponse) GetPagination() *query.PageResponse { return nil } +type QueryLimitBidProtocolDataRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryLimitBidProtocolDataRequest) Reset() { *m = QueryLimitBidProtocolDataRequest{} } +func (m *QueryLimitBidProtocolDataRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLimitBidProtocolDataRequest) ProtoMessage() {} +func (*QueryLimitBidProtocolDataRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{16} +} +func (m *QueryLimitBidProtocolDataRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLimitBidProtocolDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLimitBidProtocolDataRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLimitBidProtocolDataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLimitBidProtocolDataRequest.Merge(m, src) +} +func (m *QueryLimitBidProtocolDataRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLimitBidProtocolDataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLimitBidProtocolDataRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLimitBidProtocolDataRequest proto.InternalMessageInfo + +func (m *QueryLimitBidProtocolDataRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryLimitBidProtocolDataResponse struct { + LimitBidProtocolData []LimitBidProtocolData `protobuf:"bytes,1,rep,name=limit_bid_protocol_data,json=limitBidProtocolData,proto3" json:"limit_bid_protocol_data" yaml:"limit_bid_protocol_data"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryLimitBidProtocolDataResponse) Reset() { *m = QueryLimitBidProtocolDataResponse{} } +func (m *QueryLimitBidProtocolDataResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLimitBidProtocolDataResponse) ProtoMessage() {} +func (*QueryLimitBidProtocolDataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{17} +} +func (m *QueryLimitBidProtocolDataResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLimitBidProtocolDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLimitBidProtocolDataResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLimitBidProtocolDataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLimitBidProtocolDataResponse.Merge(m, src) +} +func (m *QueryLimitBidProtocolDataResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLimitBidProtocolDataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLimitBidProtocolDataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLimitBidProtocolDataResponse proto.InternalMessageInfo + +func (m *QueryLimitBidProtocolDataResponse) GetLimitBidProtocolData() []LimitBidProtocolData { + if m != nil { + return m.LimitBidProtocolData + } + return nil +} + +func (m *QueryLimitBidProtocolDataResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryParamsResponse") @@ -863,6 +967,8 @@ func init() { proto.RegisterType((*QueryUserLimitBidsByAssetIDResponse)(nil), "comdex.auctionsV2.v1beta1.QueryUserLimitBidsByAssetIDResponse") proto.RegisterType((*QueryLimitBidsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidsRequest") proto.RegisterType((*QueryLimitBidsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidsResponse") + proto.RegisterType((*QueryLimitBidProtocolDataRequest)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidProtocolDataRequest") + proto.RegisterType((*QueryLimitBidProtocolDataResponse)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidProtocolDataResponse") } func init() { @@ -870,75 +976,83 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 1088 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x97, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0x33, 0x8e, 0xc9, 0x8f, 0xb1, 0x1c, 0x9a, 0xc9, 0x8f, 0xba, 0xa6, 0xb5, 0xc3, 0x14, - 0x52, 0xd3, 0x92, 0xdd, 0xc6, 0x0d, 0x42, 0xaa, 0x04, 0xa8, 0x2b, 0x04, 0x04, 0xa1, 0x52, 0x56, - 0xfd, 0x21, 0x21, 0x95, 0x68, 0xed, 0xdd, 0xba, 0x2b, 0x6c, 0x8f, 0xbb, 0xb3, 0xae, 0xb0, 0xac, - 0x5c, 0xb8, 0x82, 0x04, 0x02, 0x09, 0xc1, 0x81, 0x13, 0x02, 0xf1, 0x0f, 0xf0, 0x0f, 0x70, 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 0x29, 0x53, 0x7e, 0x56, 0x1b, 0x29, 0x97, 0x26, 0x5d, 0x8d, 0xf4, 0x93, - 0xfd, 0xe2, 0x94, 0x09, 0x6e, 0xf4, 0x26, 0xc4, 0xbd, 0x21, 0xed, 0x61, 0x3b, 0x72, 0x01, 0x63, - 0x88, 0xb0, 0xe3, 0xda, 0x22, 0x76, 0xda, 0x9c, 0x87, 0x95, 0x6d, 0x9b, 0xe4, 0xf0, 0xec, 0x43, - 0x97, 0xfb, 0xcc, 0xeb, 0xe4, 0x52, 0x6b, 0xa8, 0x34, 0x67, 0x86, 0xff, 0xd2, 0x3a, 0x5e, 0x56, - 0xe3, 0x01, 0xe8, 0x6d, 0x3c, 0x0b, 0xee, 0x40, 0x4a, 0xc7, 0x90, 0x82, 0xb3, 0xb1, 0x1a, 0xa0, - 0x1e, 0xed, 0x17, 0x17, 0x3a, 0x56, 0xa3, 0x7e, 0x9d, 0x82, 0x25, 0x35, 0xc3, 0x50, 0xf4, 0x33, - 0xa4, 0x6e, 0x17, 0xca, 0x35, 0x08, 0x88, 0x14, 0x40, 0x72, 0x1f, 0xe3, 0x7e, 0xa1, 0x05, 0x7d, - 0xa6, 0xbc, 0xae, 0xc9, 0xae, 0xd0, 0x82, 0xae, 0xd0, 0x64, 0xf7, 0xf5, 0x55, 0xab, 0x39, 0x10, - 0xd5, 0x58, 0x39, 0xda, 0x2f, 0x2e, 0x4a, 0x96, 0x7e, 0x0c, 0x6a, 0x0e, 0x04, 0xa4, 0x7b, 0x08, - 0xaf, 0x0c, 0x11, 0x81, 0x02, 0xf7, 0xf0, 0x5c, 0x98, 0x6a, 0x0e, 0xad, 0x4d, 0x27, 0x94, 0xe0, - 0x2c, 0x48, 0xf0, 0xb4, 0x22, 0x01, 0xa7, 0x66, 0x2f, 0x18, 0xf9, 0x20, 0x22, 0xa3, 0x4b, 0xb1, - 0x19, 0x49, 0xaa, 0x24, 0x29, 0x7d, 0x87, 0xf0, 0x19, 0x91, 0x92, 0xe1, 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2, 0xf3, 0xfd, 0x62, - 0xc5, 0x1e, 0xb2, 0x63, 0x85, 0xda, 0x9c, 0xc0, 0x03, 0x32, 0xba, 0x25, 0x32, 0x7a, 0x9b, 0xbc, - 0x15, 0x95, 0xd1, 0x70, 0x36, 0x49, 0x92, 0x30, 0x6e, 0x3e, 0x39, 0x28, 0xa0, 0xbd, 0x83, 0x02, - 0xfa, 0xfd, 0xa0, 0x80, 0x3e, 0x3f, 0x2c, 0x4c, 0xed, 0x1d, 0x16, 0xa6, 0x7e, 0x3b, 0x2c, 0x4c, - 0xbd, 0xbf, 0x55, 0x73, 0xfd, 0x87, 0xed, 0x4a, 0x00, 0x09, 0xbb, 0x6d, 0xb0, 0x07, 0x0f, 0xdc, - 0xaa, 0x6b, 0xd5, 0xc3, 0xdd, 0x95, 0xdf, 0xf2, 0x7e, 0xa7, 0xe5, 0xf0, 0xca, 0x8c, 0xf8, 0x19, - 0x7f, 0xed, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0x17, 0xa8, 0x3b, 0xe0, 0x10, 0x00, 0x00, + // 1208 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x38, 0x21, 0x3f, 0x5e, 0x9a, 0xd0, 0x4c, 0x7e, 0xb9, 0xa6, 0x75, 0x92, 0x29, 0xa4, + 0xa1, 0x25, 0xde, 0x26, 0x4d, 0x55, 0xa9, 0x50, 0x50, 0x57, 0x15, 0x10, 0x84, 0x4a, 0x58, 0xa5, + 0xad, 0x84, 0x14, 0xac, 0xb5, 0x77, 0xeb, 0xae, 0xd8, 0x78, 0xdd, 0xdd, 0x4d, 0x85, 0x65, 0xe5, + 0x00, 0x57, 0x10, 0x42, 0x80, 0x90, 0x38, 0x23, 0x10, 0x07, 0x4e, 0x48, 0xfc, 0x03, 0x1c, 0x50, + 0xc5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x84, 0x01, 0x97, 0x9d, 0xbb, 0x77, 0xad, 0xa2, 0xa5, 0xdb, 0xe1, 0x06, 0xd2, + 0x3f, 0x4c, 0x41, 0x73, 0xf3, 0x0a, 0x83, 0x3c, 0xfc, 0xa5, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x6a, 0xa0, 0x48, 0xf7, 0x76, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -961,6 +1075,7 @@ type QueryClient interface { UserLimitBids(ctx context.Context, in *QueryUserLimitBidsRequest, opts ...grpc.CallOption) (*QueryUserLimitBidsResponse, error) UserLimitBidsByAssetID(ctx context.Context, in *QueryUserLimitBidsByAssetIDRequest, opts ...grpc.CallOption) (*QueryUserLimitBidsByAssetIDResponse, error) LimitBids(ctx context.Context, in *QueryLimitBidsRequest, opts ...grpc.CallOption) (*QueryLimitBidsResponse, error) + LimitBidProtocolData(ctx context.Context, in *QueryLimitBidProtocolDataRequest, opts ...grpc.CallOption) (*QueryLimitBidProtocolDataResponse, error) } type queryClient struct { @@ -1043,6 +1158,15 @@ func (c *queryClient) LimitBids(ctx context.Context, in *QueryLimitBidsRequest, return out, nil } +func (c *queryClient) LimitBidProtocolData(ctx context.Context, in *QueryLimitBidProtocolDataRequest, opts ...grpc.CallOption) (*QueryLimitBidProtocolDataResponse, error) { + out := new(QueryLimitBidProtocolDataResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/LimitBidProtocolData", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) @@ -1053,6 +1177,7 @@ type QueryServer interface { UserLimitBids(context.Context, *QueryUserLimitBidsRequest) (*QueryUserLimitBidsResponse, error) UserLimitBidsByAssetID(context.Context, *QueryUserLimitBidsByAssetIDRequest) (*QueryUserLimitBidsByAssetIDResponse, error) LimitBids(context.Context, *QueryLimitBidsRequest) (*QueryLimitBidsResponse, error) + LimitBidProtocolData(context.Context, *QueryLimitBidProtocolDataRequest) (*QueryLimitBidProtocolDataResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1083,6 +1208,9 @@ func (*UnimplementedQueryServer) UserLimitBidsByAssetID(ctx context.Context, req func (*UnimplementedQueryServer) LimitBids(ctx context.Context, req *QueryLimitBidsRequest) (*QueryLimitBidsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LimitBids not implemented") } +func (*UnimplementedQueryServer) LimitBidProtocolData(ctx context.Context, req *QueryLimitBidProtocolDataRequest) (*QueryLimitBidProtocolDataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LimitBidProtocolData not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1232,6 +1360,24 @@ func _Query_LimitBids_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_LimitBidProtocolData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLimitBidProtocolDataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LimitBidProtocolData(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Query/LimitBidProtocolData", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LimitBidProtocolData(ctx, req.(*QueryLimitBidProtocolDataRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.auctionsV2.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -1268,6 +1414,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "LimitBids", Handler: _Query_LimitBids_Handler, }, + { + MethodName: "LimitBidProtocolData", + Handler: _Query_LimitBidProtocolData_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/auctionsV2/v1beta1/query.proto", @@ -1430,7 +1580,7 @@ func (m *QueryAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if m.History { i-- @@ -1440,6 +1590,11 @@ func (m *QueryAuctionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- + dAtA[i] = 0x10 + } + if m.AuctionType != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionType)) + i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil @@ -1916,7 +2071,7 @@ func (m *QueryLimitBidsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } if len(m.LimitOrderBids) > 0 { for iNdEx := len(m.LimitOrderBids) - 1; iNdEx >= 0; iNdEx-- { @@ -1929,7 +2084,91 @@ func (m *QueryLimitBidsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryLimitBidProtocolDataRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLimitBidProtocolDataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLimitBidProtocolDataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryLimitBidProtocolDataResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLimitBidProtocolDataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLimitBidProtocolDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.LimitBidProtocolData) > 0 { + for iNdEx := len(m.LimitBidProtocolData) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LimitBidProtocolData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } } return len(dAtA) - i, nil @@ -1998,6 +2237,9 @@ func (m *QueryAuctionsRequest) Size() (n int) { } var l int _ = l + if m.AuctionType != 0 { + n += 1 + sovQuery(uint64(m.AuctionType)) + } if m.History { n += 2 } @@ -2202,6 +2444,38 @@ func (m *QueryLimitBidsResponse) Size() (n int) { return n } +func (m *QueryLimitBidProtocolDataRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLimitBidProtocolDataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LimitBidProtocolData) > 0 { + for _, e := range m.LimitBidProtocolData { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2543,6 +2817,25 @@ func (m *QueryAuctionsRequest) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionType", wireType) + } + m.AuctionType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionType |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) } @@ -2562,7 +2855,7 @@ func (m *QueryAuctionsRequest) Unmarshal(dAtA []byte) error { } } m.History = bool(v != 0) - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } @@ -3824,7 +4117,7 @@ func (m *QueryLimitBidsResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: QueryLimitBidsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 2: + case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderBids", wireType) } @@ -3858,7 +4151,213 @@ func (m *QueryLimitBidsResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryLimitBidProtocolDataRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLimitBidProtocolDataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLimitBidProtocolDataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryLimitBidProtocolDataResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLimitBidProtocolDataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLimitBidProtocolDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitBidProtocolData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LimitBidProtocolData = append(m.LimitBidProtocolData, LimitBidProtocolData{}) + if err := m.LimitBidProtocolData[len(m.LimitBidProtocolData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } diff --git a/x/auctionsV2/types/query.pb.gw.go b/x/auctionsV2/types/query.pb.gw.go index d2c59fd97..b37f03584 100644 --- a/x/auctionsV2/types/query.pb.gw.go +++ b/x/auctionsV2/types/query.pb.gw.go @@ -128,7 +128,7 @@ func local_request_Query_Auction_0(ctx context.Context, marshaler runtime.Marsha } var ( - filter_Query_Auctions_0 = &utilities.DoubleArray{Encoding: map[string]int{"history": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} + filter_Query_Auctions_0 = &utilities.DoubleArray{Encoding: map[string]int{"auction_type": 0, "history": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) func request_Query_Auctions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -142,6 +142,17 @@ func request_Query_Auctions_0(ctx context.Context, marshaler runtime.Marshaler, _ = err ) + val, ok = pathParams["auction_type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_type") + } + + protoReq.AuctionType, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_type", err) + } + val, ok = pathParams["history"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") @@ -176,6 +187,17 @@ func local_request_Query_Auctions_0(ctx context.Context, marshaler runtime.Marsh _ = err ) + val, ok = pathParams["auction_type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_type") + } + + protoReq.AuctionType, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_type", err) + } + val, ok = pathParams["history"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") @@ -593,6 +615,42 @@ func local_request_Query_LimitBids_0(ctx context.Context, marshaler runtime.Mars } +var ( + filter_Query_LimitBidProtocolData_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_LimitBidProtocolData_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLimitBidProtocolDataRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LimitBidProtocolData_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.LimitBidProtocolData(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_LimitBidProtocolData_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLimitBidProtocolDataRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LimitBidProtocolData_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.LimitBidProtocolData(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -783,6 +841,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_LimitBidProtocolData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_LimitBidProtocolData_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_LimitBidProtocolData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -984,6 +1065,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_LimitBidProtocolData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_LimitBidProtocolData_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_LimitBidProtocolData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -992,7 +1093,7 @@ var ( pattern_Query_Auction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auctions", "v2", "auction", "auction_id", "history"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Auctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 1, 0, 4, 1, 5, 3}, []string{"comdex", "auctions", "v2", "history"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Auctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "auctions", "v2", "auction_type", "history"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Bids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auctions", "v2", "bids", "bidder", "history"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1003,6 +1104,8 @@ var ( pattern_Query_UserLimitBidsByAssetID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auctions", "v2", "userlimitorderbids", "bidder", "collateral_token_id", "debt_token_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_LimitBids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auctions", "v2", "limitorderbids", "collateral_token_id", "debt_token_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_LimitBidProtocolData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "auctions", "v2", "limit_bid_protocol_data"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1021,4 +1124,6 @@ var ( forward_Query_UserLimitBidsByAssetID_0 = runtime.ForwardResponseMessage forward_Query_LimitBids_0 = runtime.ForwardResponseMessage + + forward_Query_LimitBidProtocolData_0 = runtime.ForwardResponseMessage ) diff --git a/x/liquidationsV2/client/cli/tx.go b/x/liquidationsV2/client/cli/tx.go index 8947c7f1c..903fe7851 100644 --- a/x/liquidationsV2/client/cli/tx.go +++ b/x/liquidationsV2/client/cli/tx.go @@ -39,6 +39,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand( txLiquidateInternalKeeper(), + txLiquidateExternalKeeper(), txAppReserveFunds(), ) return cmd @@ -46,7 +47,7 @@ func GetTxCmd() *cobra.Command { func txLiquidateInternalKeeper() *cobra.Command { cmd := &cobra.Command{ - Use: "liquidate_internal_keeper [type] [id]", + Use: "liquidate-internal-keeper [type] [id]", Short: "liquidate faulty positions", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { @@ -119,6 +120,55 @@ func txAppReserveFunds() *cobra.Command { return cmd } +func txLiquidateExternalKeeper() *cobra.Command { + cmd := &cobra.Command{ + Use: "liquidate-external-keeper [app-id] [owner] [collateral-token] [debt-token] [collateral-asset-id] [debt-asset-id] [is-debt-cmst]", + Short: "liquidate faulty positions - external apps", + Args: cobra.ExactArgs(7), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + AppId, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + Owner := args[1] + CollateralToken, err := sdk.ParseCoinNormalized(args[2]) + if err != nil { + return err + } + DebtToken, err := sdk.ParseCoinNormalized(args[3]) + if err != nil { + return err + } + CollateralAssetId, err := strconv.ParseUint(args[4], 10, 64) + if err != nil { + return err + } + DebtAssetId, err := strconv.ParseUint(args[5], 10, 64) + if err != nil { + return err + } + IsDebtCmst := ParseBoolFromString(args[6]) + + msg := types.NewMsgLiquidateExternalKeeperRequest(ctx.FromAddress, AppId, Owner, CollateralToken, DebtToken, CollateralAssetId, DebtAssetId, IsDebtCmst) + + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(ctx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd + +} + func NewCmdSubmitWhitelistingLiquidationProposal() *cobra.Command { cmd := &cobra.Command{ Use: "add-liquidation-whitelisting [flags]", diff --git a/x/liquidationsV2/types/msg.go b/x/liquidationsV2/types/msg.go index 5ec54ca2c..44d806138 100644 --- a/x/liquidationsV2/types/msg.go +++ b/x/liquidationsV2/types/msg.go @@ -88,17 +88,15 @@ func NewMsgLiquidateExternalKeeperRequest( appId uint64, owner string, collateralToken, debtToken sdk.Coin, - feeToBeCollected, bonusToBeGiven sdk.Dec, - auctionType bool, collateralAssetId, debtAssetId uint64, isDebtCmst bool, ) *MsgLiquidateExternalKeeperRequest { return &MsgLiquidateExternalKeeperRequest{ - From: from.String(), - AppId: appId, - Owner: owner, - CollateralToken: collateralToken, - DebtToken: debtToken, + From: from.String(), + AppId: appId, + Owner: owner, + CollateralToken: collateralToken, + DebtToken: debtToken, CollateralAssetId: collateralAssetId, DebtAssetId: debtAssetId, IsDebtCmst: isDebtCmst, From c18661e02d4f8e86e6625e4437be92f105309ef9 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 26 Jul 2023 10:40:18 +0530 Subject: [PATCH 128/155] max premium discount condition added --- x/auctionsV2/keeper/bid.go | 6 +++++- x/auctionsV2/types/errors.go | 25 +++++++++++++------------ x/auctionsV2/types/keys.go | 1 + 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index bf6acb7a5..747bc505b 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -497,6 +497,10 @@ func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, Collatera return nil } + if PremiumDiscount.GT(sdk.NewIntFromUint64(types.MaxPremiumDiscount)) { + return types.ErrorDiscountGreaterThanMaxDiscount + } + _, found := k.asset.GetAsset(ctx, CollateralTokenId) if !found { return assettypes.ErrorAssetDoesNotExist @@ -546,7 +550,7 @@ func (k Keeper) DepositLimitAuctionBid(ctx sdk.Context, bidder string, Collatera CollateralAssetId: CollateralTokenId, DebtAssetId: DebtTokenId, BidValue: amount.Amount, - MaxDiscount: sdk.Dec{}, + MaxDiscount: sdk.NewDecFromInt(sdk.NewIntFromUint64(types.MaxPremiumDiscount)), } } else { protocolData.BidValue = protocolData.BidValue.Add(amount.Amount) diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index b0b785780..f176020db 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -8,16 +8,17 @@ import ( // x/auctions module sentinel errors var ( - ErrDutchAuctionDisabled = sdkerrors.Register(ModuleName, 701, "Dutch auction not enabled for the app") - ErrEnglishAuctionDisabled = sdkerrors.Register(ModuleName, 702, "English auction not enabled for the app") - ErrCannotLeaveDebtLessThanDust = sdkerrors.Register(ModuleName, 703, "You need to leave debt atleast equal to dust value or greater. Try making a full bid, or a smaller bid. Your current bid is just short of the dust value , hence it fails.") - ErrorPriceNotFound = sdkerrors.Register(ModuleName, 704, "price not found") - ErrBidCannotBeZero = sdkerrors.Register(ModuleName, 705, "Bid amount can't be Zero") - ErrorLowBidAmount = sdkerrors.Register(ModuleName, 706, "bidding amount is lower than expected") - ErrorMaxBidAmount = sdkerrors.Register(ModuleName, 707, "bidding amount is greater than maximum bidding amount") - ErrLiquidationNotFound = sdkerrors.Register(ModuleName, 708, "Liquidation data not found for the auction") - ErrBidNotFound = sdkerrors.Register(ModuleName, 709, "There exists no active bid for the user with given params") - ErrAuctionParamsNotFound = sdkerrors.Register(ModuleName, 710, "There exists no auction params") - ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 711, "unknown proposal type") - ErrorUnknownDebtToken = sdkerrors.Register(ModuleName, 712, "Bid token is not the debt token") + ErrDutchAuctionDisabled = sdkerrors.Register(ModuleName, 701, "Dutch auction not enabled for the app") + ErrEnglishAuctionDisabled = sdkerrors.Register(ModuleName, 702, "English auction not enabled for the app") + ErrCannotLeaveDebtLessThanDust = sdkerrors.Register(ModuleName, 703, "You need to leave debt atleast equal to dust value or greater. Try making a full bid, or a smaller bid. Your current bid is just short of the dust value , hence it fails.") + ErrorPriceNotFound = sdkerrors.Register(ModuleName, 704, "price not found") + ErrBidCannotBeZero = sdkerrors.Register(ModuleName, 705, "Bid amount can't be Zero") + ErrorLowBidAmount = sdkerrors.Register(ModuleName, 706, "bidding amount is lower than expected") + ErrorMaxBidAmount = sdkerrors.Register(ModuleName, 707, "bidding amount is greater than maximum bidding amount") + ErrLiquidationNotFound = sdkerrors.Register(ModuleName, 708, "Liquidation data not found for the auction") + ErrBidNotFound = sdkerrors.Register(ModuleName, 709, "There exists no active bid for the user with given params") + ErrAuctionParamsNotFound = sdkerrors.Register(ModuleName, 710, "There exists no auction params") + ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 711, "unknown proposal type") + ErrorUnknownDebtToken = sdkerrors.Register(ModuleName, 712, "Bid token is not the debt token") + ErrorDiscountGreaterThanMaxDiscount = sdkerrors.Register(ModuleName, 713, "Premium discount entered is greater than max discount") ) diff --git a/x/auctionsV2/types/keys.go b/x/auctionsV2/types/keys.go index 1d1fd1b8a..e93dd6b33 100644 --- a/x/auctionsV2/types/keys.go +++ b/x/auctionsV2/types/keys.go @@ -21,6 +21,7 @@ const ( MemStoreKey = "mem_newauc" SurplusAuctionInitiator = "surplus" DebtAuctionInitiator = "debt" + MaxPremiumDiscount = 30 ) var ( From 28beab9a0895f92a87e24b4c96fdfc2d8df7226a Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 26 Jul 2023 13:37:27 +0530 Subject: [PATCH 129/155] refactoring Testcases --- go.mod | 2 +- x/collector/keeper/collector.go | 5 +---- x/liquidationsV2/keeper/liquidate.go | 6 +++--- x/liquidationsV2/keeper/msg_server_test.go | 8 ++++---- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 8dbe39328..96200b29f 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/CosmWasm/wasmd v0.31.0 github.com/CosmWasm/wasmvm v1.2.1 github.com/bandprotocol/bandchain-packet v0.0.3 - github.com/cosmos/cosmos-sdk v0.46.13 + github.com/cosmos/cosmos-sdk v0.46.11 github.com/cosmos/ibc-apps/modules/async-icq/v4 v4.0.0-20230524151648-c02fa46c2860 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.3 diff --git a/x/collector/keeper/collector.go b/x/collector/keeper/collector.go index e7db7ba4a..564e217be 100644 --- a/x/collector/keeper/collector.go +++ b/x/collector/keeper/collector.go @@ -352,10 +352,7 @@ func (k Keeper) SetAuctionMappingForApp(ctx sdk.Context, record types.AppAssetId if !found { return types.ErrorAppDoesNotExist } - _, found1 := k.auction.GetAuctionParams(ctx, record.AppId) - if !found1 { - return types.ErrorAuctionParamsNotSet - } + _, found2 := k.asset.GetAsset(ctx, record.AssetId) if !found2 { return types.ErrorAssetDoesNotExist diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index 3fd746722..e61aa4e51 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -445,7 +445,7 @@ func (k Keeper) LiquidateForSurplusAndDebt(ctx sdk.Context) error { auctionMapData, _ := k.collector.GetAllAuctionMappingForApp(ctx) for _, data := range auctionMapData { killSwitchParams, _ := k.esm.GetKillSwitchData(ctx, data.AppId) - if data.IsDebtAuction && data.IsSurplusAuction && !data.IsAuctionActive && !killSwitchParams.BreakerEnable { + if !data.IsAuctionActive && !killSwitchParams.BreakerEnable { err := k.CheckStatsForSurplusAndDebt(ctx, data.AppId, data.AssetId) if err != nil { return err @@ -476,7 +476,7 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint debtAssetID := collector.SecondaryAssetId //harbor // for debt Auction - if netFeeCollectedData.NetFeesCollected.LTE(collector.DebtThreshold.Sub(collector.LotSize)) { + if netFeeCollectedData.NetFeesCollected.LTE(collector.DebtThreshold.Sub(collector.LotSize)) && auctionLookupTable.IsDebtAuction { // net = 200 debtThreshold = 500 , lotSize = 100 collateralToken, debtToken := k.DebtTokenAmount(ctx, collateralAssetID, debtAssetID, collector.LotSize, collector.DebtLotSize) err := k.CreateLockedVault(ctx, 0, 0, "", collateralToken, debtToken, collateralToken, debtToken, sdk.ZeroDec(), appID, false, "", "", sdk.ZeroInt(), sdk.ZeroInt(), "debt", false, true, collateralAssetID, debtAssetID) @@ -491,7 +491,7 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint } // for surplus auction - if netFeeCollectedData.NetFeesCollected.GTE(collector.SurplusThreshold.Add(collector.LotSize)) { + if netFeeCollectedData.NetFeesCollected.GTE(collector.SurplusThreshold.Add(collector.LotSize)) && auctionLookupTable.IsSurplusAuction { // net = 900 surplusThreshold = 500 , lotSize = 100 amount := collector.LotSize collateralToken, debtToken := k.SurplusTokenAmount(ctx, collateralAssetID, debtAssetID, amount) diff --git a/x/liquidationsV2/keeper/msg_server_test.go b/x/liquidationsV2/keeper/msg_server_test.go index 05f69661f..33046f327 100644 --- a/x/liquidationsV2/keeper/msg_server_test.go +++ b/x/liquidationsV2/keeper/msg_server_test.go @@ -348,7 +348,7 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { s.Require().Equal(len(assetStatsLend.LendIds), 2) s.Require().Equal(len(assetStatsLend.BorrowIds), 0) s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) - s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(13000000000)) + s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(11900000000)) assetStatsBorrow, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 2) s.Require().Equal(len(assetStatsBorrow.LendIds), 1) @@ -544,7 +544,7 @@ func (s *KeeperTestSuite) TestLiquidateInternalKeeperForBorrow() { s.Require().Equal(len(assetStatsLend.LendIds), 2) s.Require().Equal(len(assetStatsLend.BorrowIds), 0) s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) - s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(13000000000)) + s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(12900000000)) assetStatsBorrow, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(s.ctx, 1, 2) s.Require().Equal(len(assetStatsBorrow.LendIds), 1) @@ -650,13 +650,13 @@ func (s *KeeperTestSuite) TestLiquidateExternal() { }{ { Name: "asset does not exist", - Msg: *types.NewMsgLiquidateExternalKeeperRequest(addr, 3, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", sdk.NewCoin("uasset1", sdk.NewInt(100000000)), sdk.NewCoin("uasset2", sdk.NewInt(100000000)), sdk.NewDecFromInt(sdk.NewInt(0)), sdk.NewDecFromInt(sdk.NewInt(0)), true, 10, 2, false), + Msg: *types.NewMsgLiquidateExternalKeeperRequest(addr, 3, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", sdk.NewCoin("uasset1", sdk.NewInt(100000000)), sdk.NewCoin("uasset2", sdk.NewInt(100000000)), 10, 2, false), ExpErr: assetTypes.ErrorAssetDoesNotExist, ExpResp: nil, }, { Name: "success valid case", - Msg: *types.NewMsgLiquidateExternalKeeperRequest(addr, 3, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", sdk.NewCoin("uasset1", sdk.NewInt(100000000)), sdk.NewCoin("uasset2", sdk.NewInt(100000000)), sdk.NewDecFromInt(sdk.NewInt(0)), sdk.NewDecFromInt(sdk.NewInt(0)), true, 1, 2, false), + Msg: *types.NewMsgLiquidateExternalKeeperRequest(addr, 3, "cosmos1hm7w7dnvdnra78pz9qxysy7u4tuhc3fnpjmyj7", sdk.NewCoin("uasset1", sdk.NewInt(100000000)), sdk.NewCoin("uasset2", sdk.NewInt(100000000)), 1, 2, false), ExpErr: nil, ExpResp: &types.MsgLiquidateExternalKeeperResponse{}, }, From 3e06623d843dab4ef09c36adb77af234a2d55a21 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 26 Jul 2023 14:07:36 +0530 Subject: [PATCH 130/155] refactoring Testcases --- x/auctionsV2/keeper/msg_server_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auctionsV2/keeper/msg_server_test.go b/x/auctionsV2/keeper/msg_server_test.go index 6b67e1531..d63736f1e 100644 --- a/x/auctionsV2/keeper/msg_server_test.go +++ b/x/auctionsV2/keeper/msg_server_test.go @@ -374,7 +374,7 @@ func (s *KeeperTestSuite) TestLiquidateBorrows() { s.Require().Equal(len(assetStatsLend.LendIds), 2) s.Require().Equal(len(assetStatsLend.BorrowIds), 0) s.Require().Equal(assetStatsLend.TotalBorrowed, sdk.NewInt(0)) - s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(13000000000)) + s.Require().Equal(assetStatsLend.TotalLend, sdk.NewInt(11900000000)) assetStatsBorrow, _ = s.lendKeeper.GetAssetStatsByPoolIDAndAssetID(*ctx, 1, 2) s.Require().Equal(len(assetStatsBorrow.LendIds), 1) From a2c92cfdd3f534a0d37ef74dfc3abc79b28b1fb2 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 26 Jul 2023 19:14:19 +0530 Subject: [PATCH 131/155] refactoring auction queries --- proto/comdex/auctionsV2/v1beta1/query.proto | 16 - x/auctionsV2/client/cli/query.go | 60 +- x/auctionsV2/keeper/auctions.go | 19 +- x/auctionsV2/keeper/grpc_query.go | 20 - x/auctionsV2/types/query.pb.go | 600 +++----------------- x/auctionsV2/types/query.pb.gw.go | 119 ---- 6 files changed, 104 insertions(+), 730 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index 8aca8bd17..ebaba5de6 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -70,19 +70,6 @@ message QueryAuctionParamsResponse { ]; } -message QueryUserLimitBidsRequest { - string bidder = 1; - cosmos.base.query.v1beta1.PageRequest pagination = 2 - [(gogoproto.moretags) = "yaml:\"pagination\""]; -} - -message QueryUserLimitBidsResponse { - LimitOrderBidsForUser limit_order_bids = 1 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"limit_order_bids\"" - ]; -} - message QueryUserLimitBidsByAssetIDRequest { string bidder = 1; uint64 collateral_token_id = 2; @@ -149,9 +136,6 @@ service Query { rpc AuctionParams(QueryAuctionParamsRequest) returns (QueryAuctionParamsResponse) { option (google.api.http).get = "/comdex/auctions/v2/auction_params"; } - rpc UserLimitBids(QueryUserLimitBidsRequest) returns (QueryUserLimitBidsResponse) { - option (google.api.http).get = "/comdex/auctions/v2/userlimitorderbids/{bidder}"; - } rpc UserLimitBidsByAssetID(QueryUserLimitBidsByAssetIDRequest) returns (QueryUserLimitBidsByAssetIDResponse) { option (google.api.http).get = "/comdex/auctions/v2/userlimitorderbids/{bidder}/{collateral_token_id}/{debt_token_id}"; } diff --git a/x/auctionsV2/client/cli/query.go b/x/auctionsV2/client/cli/query.go index f69caa450..befe8fa39 100644 --- a/x/auctionsV2/client/cli/query.go +++ b/x/auctionsV2/client/cli/query.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "github.com/cosmos/cosmos-sdk/client/flags" - sdk "github.com/cosmos/cosmos-sdk/types" "strconv" // "strings" @@ -32,7 +31,6 @@ func GetQueryCmd(queryRoute string) *cobra.Command { queryAuction(), queryAuctions(), queryBids(), - queryUserLimitOrderBids(), queryAuctionParams(), queryUserLimitOrderBidsByAssetID(), queryLimitOrderBids(), @@ -134,10 +132,8 @@ func queryBids() *cobra.Command { if err != nil { return err } - bidder, err := sdk.AccAddressFromBech32(args[0]) - if err != nil { - return err - } + bidder := args[0] + history, err := strconv.ParseBool(args[1]) if err != nil { return err @@ -146,7 +142,7 @@ func queryBids() *cobra.Command { res, err := queryClient.Bids( context.Background(), &types.QueryBidsRequest{ - Bidder: bidder.String(), + Bidder: bidder, History: history, Pagination: pagination, }, @@ -163,45 +159,6 @@ func queryBids() *cobra.Command { return cmd } -func queryUserLimitOrderBids() *cobra.Command { - cmd := &cobra.Command{ - Use: "user-limit-order-bids [bidder]", - Short: "Query limit order bids by bidder address", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - pagination, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - ctx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - bidder, err := sdk.AccAddressFromBech32(args[0]) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(ctx) - res, err := queryClient.UserLimitBids( - context.Background(), - &types.QueryUserLimitBidsRequest{ - Bidder: bidder.String(), - Pagination: pagination, - }, - ) - if err != nil { - return err - } - return ctx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "user-limit-order-bids") - - return cmd -} - func queryAuctionParams() *cobra.Command { cmd := &cobra.Command{ Use: "auction-params", @@ -243,10 +200,7 @@ func queryUserLimitOrderBidsByAssetID() *cobra.Command { if err != nil { return err } - bidder, err := sdk.AccAddressFromBech32(args[0]) - if err != nil { - return err - } + bidder := args[0] collateralID, err := strconv.ParseUint(args[1], 10, 64) if err != nil { return err @@ -259,7 +213,7 @@ func queryUserLimitOrderBidsByAssetID() *cobra.Command { res, err := queryClient.UserLimitBidsByAssetID( context.Background(), &types.QueryUserLimitBidsByAssetIDRequest{ - Bidder: bidder.String(), + Bidder: bidder, CollateralTokenId: collateralID, DebtTokenId: debtID, Pagination: pagination, @@ -291,11 +245,11 @@ func queryLimitOrderBids() *cobra.Command { if err != nil { return err } - collateralID, err := strconv.ParseUint(args[1], 10, 64) + collateralID, err := strconv.ParseUint(args[0], 10, 64) if err != nil { return err } - debtID, err := strconv.ParseUint(args[2], 10, 64) + debtID, err := strconv.ParseUint(args[1], 10, 64) if err != nil { return err } diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 7ad4edb45..838cc8386 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -543,14 +543,31 @@ func (k Keeper) LimitOrderBid(ctx sdk.Context) error { individualBids.DebtToken.Amount = individualBids.DebtToken.Amount.Sub(auction.DebtToken.Amount) individualBids.BiddingId = append(individualBids.BiddingId, biddingId) k.SetUserLimitBidData(ctx, individualBids, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt()) + // subtract auction.DebtToken.Amount from protocol data + protocolData, _ := k.GetLimitBidProtocolDataByAssetID(ctx, auction.DebtAssetId, auction.CollateralAssetId) + protocolData.BidValue = protocolData.BidValue.Sub(auction.DebtToken.Amount) + err = k.SetLimitBidProtocolData(ctx, protocolData) + if err != nil { + return err + } } else { biddingId, err := k.PlaceDutchAuctionBid(ctx, auction.AuctionId, addr.String(), individualBids.DebtToken, auction, true) if err != nil { return err } - individualBids.DebtToken.Amount = individualBids.DebtToken.Amount.Sub(auction.DebtToken.Amount) + individualBids.DebtToken.Amount = sdk.ZeroInt() individualBids.BiddingId = append(individualBids.BiddingId, biddingId) k.SetUserLimitBidData(ctx, individualBids, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt()) + // delete limit order bid + k.UpdateUserLimitBidDataForAddress(ctx, individualBids, false) + k.DeleteUserLimitBidData(ctx, auction.DebtAssetId, auction.CollateralAssetId, individualBids.PremiumDiscount, individualBids.BidderAddress) + // subtract auction.DebtToken.Amount from protocol data + protocolData, _ := k.GetLimitBidProtocolDataByAssetID(ctx, auction.DebtAssetId, auction.CollateralAssetId) + protocolData.BidValue = protocolData.BidValue.Sub(individualBids.DebtToken.Amount) + err = k.SetLimitBidProtocolData(ctx, protocolData) + if err != nil { + return err + } } } diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index e89afaa31..1032324c8 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -172,26 +172,6 @@ func (q QueryServer) Params(c context.Context, req *types.QueryParamsRequest) (* return &types.QueryParamsResponse{Params: q.GetParams(ctx)}, nil } -func (q QueryServer) UserLimitBids(c context.Context, req *types.QueryUserLimitBidsRequest) (*types.QueryUserLimitBidsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "request cannot be empty") - } - - var ( - item types.LimitOrderBidsForUser - ctx = sdk.UnwrapSDKContext(c) - ) - - item, found := q.GetUserLimitBidDataByAddress(ctx, req.Bidder) - if !found { - return nil, nil - } - - return &types.QueryUserLimitBidsResponse{ - LimitOrderBids: item, - }, nil -} - func (q QueryServer) UserLimitBidsByAssetID(c context.Context, req *types.QueryUserLimitBidsByAssetIDRequest) (*types.QueryUserLimitBidsByAssetIDResponse, error) { if req == nil { diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index 14dc5218d..7717ac39c 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -518,102 +518,6 @@ func (m *QueryAuctionParamsResponse) GetAuctionParams() AuctionParams { return AuctionParams{} } -type QueryUserLimitBidsRequest struct { - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryUserLimitBidsRequest) Reset() { *m = QueryUserLimitBidsRequest{} } -func (m *QueryUserLimitBidsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryUserLimitBidsRequest) ProtoMessage() {} -func (*QueryUserLimitBidsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{10} -} -func (m *QueryUserLimitBidsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryUserLimitBidsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryUserLimitBidsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryUserLimitBidsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryUserLimitBidsRequest.Merge(m, src) -} -func (m *QueryUserLimitBidsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryUserLimitBidsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryUserLimitBidsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryUserLimitBidsRequest proto.InternalMessageInfo - -func (m *QueryUserLimitBidsRequest) GetBidder() string { - if m != nil { - return m.Bidder - } - return "" -} - -func (m *QueryUserLimitBidsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryUserLimitBidsResponse struct { - LimitOrderBids LimitOrderBidsForUser `protobuf:"bytes,1,opt,name=limit_order_bids,json=limitOrderBids,proto3" json:"limit_order_bids" yaml:"limit_order_bids"` -} - -func (m *QueryUserLimitBidsResponse) Reset() { *m = QueryUserLimitBidsResponse{} } -func (m *QueryUserLimitBidsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryUserLimitBidsResponse) ProtoMessage() {} -func (*QueryUserLimitBidsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{11} -} -func (m *QueryUserLimitBidsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryUserLimitBidsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryUserLimitBidsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryUserLimitBidsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryUserLimitBidsResponse.Merge(m, src) -} -func (m *QueryUserLimitBidsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryUserLimitBidsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryUserLimitBidsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryUserLimitBidsResponse proto.InternalMessageInfo - -func (m *QueryUserLimitBidsResponse) GetLimitOrderBids() LimitOrderBidsForUser { - if m != nil { - return m.LimitOrderBids - } - return LimitOrderBidsForUser{} -} - type QueryUserLimitBidsByAssetIDRequest struct { Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` CollateralTokenId uint64 `protobuf:"varint,2,opt,name=collateral_token_id,json=collateralTokenId,proto3" json:"collateral_token_id,omitempty"` @@ -625,7 +529,7 @@ func (m *QueryUserLimitBidsByAssetIDRequest) Reset() { *m = QueryUserLim func (m *QueryUserLimitBidsByAssetIDRequest) String() string { return proto.CompactTextString(m) } func (*QueryUserLimitBidsByAssetIDRequest) ProtoMessage() {} func (*QueryUserLimitBidsByAssetIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{12} + return fileDescriptor_5270c3f1c79728ac, []int{10} } func (m *QueryUserLimitBidsByAssetIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -692,7 +596,7 @@ func (m *QueryUserLimitBidsByAssetIDResponse) Reset() { *m = QueryUserLi func (m *QueryUserLimitBidsByAssetIDResponse) String() string { return proto.CompactTextString(m) } func (*QueryUserLimitBidsByAssetIDResponse) ProtoMessage() {} func (*QueryUserLimitBidsByAssetIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{13} + return fileDescriptor_5270c3f1c79728ac, []int{11} } func (m *QueryUserLimitBidsByAssetIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -752,7 +656,7 @@ func (m *QueryLimitBidsRequest) Reset() { *m = QueryLimitBidsRequest{} } func (m *QueryLimitBidsRequest) String() string { return proto.CompactTextString(m) } func (*QueryLimitBidsRequest) ProtoMessage() {} func (*QueryLimitBidsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{14} + return fileDescriptor_5270c3f1c79728ac, []int{12} } func (m *QueryLimitBidsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -811,7 +715,7 @@ func (m *QueryLimitBidsResponse) Reset() { *m = QueryLimitBidsResponse{} func (m *QueryLimitBidsResponse) String() string { return proto.CompactTextString(m) } func (*QueryLimitBidsResponse) ProtoMessage() {} func (*QueryLimitBidsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{15} + return fileDescriptor_5270c3f1c79728ac, []int{13} } func (m *QueryLimitBidsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -862,7 +766,7 @@ func (m *QueryLimitBidProtocolDataRequest) Reset() { *m = QueryLimitBidP func (m *QueryLimitBidProtocolDataRequest) String() string { return proto.CompactTextString(m) } func (*QueryLimitBidProtocolDataRequest) ProtoMessage() {} func (*QueryLimitBidProtocolDataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{16} + return fileDescriptor_5270c3f1c79728ac, []int{14} } func (m *QueryLimitBidProtocolDataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -907,7 +811,7 @@ func (m *QueryLimitBidProtocolDataResponse) Reset() { *m = QueryLimitBid func (m *QueryLimitBidProtocolDataResponse) String() string { return proto.CompactTextString(m) } func (*QueryLimitBidProtocolDataResponse) ProtoMessage() {} func (*QueryLimitBidProtocolDataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5270c3f1c79728ac, []int{17} + return fileDescriptor_5270c3f1c79728ac, []int{15} } func (m *QueryLimitBidProtocolDataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -961,8 +865,6 @@ func init() { proto.RegisterType((*QueryBidsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryBidsResponse") proto.RegisterType((*QueryAuctionParamsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionParamsRequest") proto.RegisterType((*QueryAuctionParamsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionParamsResponse") - proto.RegisterType((*QueryUserLimitBidsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryUserLimitBidsRequest") - proto.RegisterType((*QueryUserLimitBidsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryUserLimitBidsResponse") proto.RegisterType((*QueryUserLimitBidsByAssetIDRequest)(nil), "comdex.auctionsV2.v1beta1.QueryUserLimitBidsByAssetIDRequest") proto.RegisterType((*QueryUserLimitBidsByAssetIDResponse)(nil), "comdex.auctionsV2.v1beta1.QueryUserLimitBidsByAssetIDResponse") proto.RegisterType((*QueryLimitBidsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidsRequest") @@ -976,83 +878,79 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 1208 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0x38, 0x21, 0x3f, 0x5e, 0x9a, 0xd0, 0x4c, 0x7e, 0xb9, 0xa6, 0x75, 0x92, 0x29, 0xa4, - 0xa1, 0x25, 0xde, 0x26, 0x4d, 0x55, 0xa9, 0x50, 0x50, 0x57, 0x15, 0x10, 0x84, 0x4a, 0x58, 0xa5, - 0xad, 0x84, 0x14, 0xac, 0xb5, 0x77, 0xeb, 0xae, 0xd8, 0x78, 0xdd, 0xdd, 0x4d, 0x85, 0x65, 0xe5, - 0x00, 0x57, 0x10, 0x42, 0x80, 0x90, 0x38, 0x23, 0x10, 0x07, 0x4e, 0x48, 0xfc, 0x03, 0x1c, 0x50, - 0xc5, 0x29, 0x12, 0x17, 0x4e, 0x11, 0x4a, 0x90, 0x38, 0x21, 0x50, 0x0e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, 0x06, 0xd2, - 0x3f, 0x4c, 0x41, 0x73, 0xf3, 0x0a, 0x83, 0x3c, 0xfc, 0xa5, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x6a, 0xa0, 0x48, 0xf7, 0x76, 0x13, 0x00, 0x00, + // 1143 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcf, 0x6f, 0xdb, 0x64, + 0x18, 0xee, 0x97, 0x96, 0xfe, 0x78, 0x4b, 0xcb, 0xfa, 0x35, 0x6d, 0x33, 0xb3, 0x25, 0xed, 0x37, + 0xe8, 0xca, 0x46, 0x6d, 0x9a, 0x75, 0x42, 0x1a, 0x0c, 0x34, 0x6b, 0x12, 0x14, 0xa1, 0x51, 0xac, + 0x6e, 0x93, 0x90, 0x46, 0xe4, 0xc4, 0x5e, 0x66, 0xe1, 0xc4, 0x99, 0xed, 0x4c, 0x44, 0x55, 0x0f, + 0x70, 0x05, 0x21, 0x24, 0x10, 0xff, 0x00, 0x02, 0x71, 0xe0, 0xc4, 0x89, 0x33, 0x07, 0x34, 0x71, + 0xaa, 0xc4, 0x85, 0x53, 0x85, 0x5a, 0x24, 0x4e, 0x08, 0xa9, 0x07, 0xce, 0xc8, 0xdf, 0xf7, 0x3a, + 0xb1, 0x33, 0x27, 0x71, 0xa7, 0x0c, 0x6e, 0xf1, 0xe7, 0xf7, 0xc7, 0xf3, 0x3e, 0xcf, 0xeb, 0xf7, + 0x7b, 0x15, 0x78, 0xbe, 0xe2, 0xd4, 0x0c, 0xf3, 0x43, 0x45, 0x6f, 0x56, 0x7c, 0xcb, 0xa9, 0x7b, + 0xb7, 0x8a, 0xca, 0x83, 0x8d, 0xb2, 0xe9, 0xeb, 0x1b, 0xca, 0xfd, 0xa6, 0xe9, 0xb6, 0xe4, 0x86, + 0xeb, 0xf8, 0x0e, 0x3d, 0x2d, 0xcc, 0xe4, 0x8e, 0x99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 0x2f, 0xe9, 0xd5, 0xc7, 0x73, 0x4e, 0xf3, 0xc5, 0xf4, 0xb8, 0x31, + 0xd4, 0x1b, 0x0f, 0x0f, 0xf3, 0x64, 0xff, 0x30, 0x4f, 0x7e, 0x3f, 0xcc, 0x93, 0xcf, 0x8f, 0xf2, + 0x23, 0xfb, 0x47, 0xf9, 0x91, 0xdf, 0x8e, 0xf2, 0x23, 0xef, 0x6d, 0x56, 0x2d, 0xff, 0x5e, 0xb3, + 0x1c, 0x40, 0xc2, 0x80, 0xeb, 0xce, 0xdd, 0xbb, 0x56, 0xc5, 0xd2, 0xed, 0x30, 0x41, 0xec, 0x8f, + 0x87, 0x60, 0x48, 0x78, 0xe5, 0x71, 0x1e, 0xfe, 0xd2, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x50, + 0x06, 0xf7, 0xd0, 0x8d, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1072,7 +970,6 @@ type QueryClient interface { Auctions(ctx context.Context, in *QueryAuctionsRequest, opts ...grpc.CallOption) (*QueryAuctionsResponse, error) Bids(ctx context.Context, in *QueryBidsRequest, opts ...grpc.CallOption) (*QueryBidsResponse, error) AuctionParams(ctx context.Context, in *QueryAuctionParamsRequest, opts ...grpc.CallOption) (*QueryAuctionParamsResponse, error) - UserLimitBids(ctx context.Context, in *QueryUserLimitBidsRequest, opts ...grpc.CallOption) (*QueryUserLimitBidsResponse, error) UserLimitBidsByAssetID(ctx context.Context, in *QueryUserLimitBidsByAssetIDRequest, opts ...grpc.CallOption) (*QueryUserLimitBidsByAssetIDResponse, error) LimitBids(ctx context.Context, in *QueryLimitBidsRequest, opts ...grpc.CallOption) (*QueryLimitBidsResponse, error) LimitBidProtocolData(ctx context.Context, in *QueryLimitBidProtocolDataRequest, opts ...grpc.CallOption) (*QueryLimitBidProtocolDataResponse, error) @@ -1131,15 +1028,6 @@ func (c *queryClient) AuctionParams(ctx context.Context, in *QueryAuctionParamsR return out, nil } -func (c *queryClient) UserLimitBids(ctx context.Context, in *QueryUserLimitBidsRequest, opts ...grpc.CallOption) (*QueryUserLimitBidsResponse, error) { - out := new(QueryUserLimitBidsResponse) - err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/UserLimitBids", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) UserLimitBidsByAssetID(ctx context.Context, in *QueryUserLimitBidsByAssetIDRequest, opts ...grpc.CallOption) (*QueryUserLimitBidsByAssetIDResponse, error) { out := new(QueryUserLimitBidsByAssetIDResponse) err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/UserLimitBidsByAssetID", in, out, opts...) @@ -1174,7 +1062,6 @@ type QueryServer interface { Auctions(context.Context, *QueryAuctionsRequest) (*QueryAuctionsResponse, error) Bids(context.Context, *QueryBidsRequest) (*QueryBidsResponse, error) AuctionParams(context.Context, *QueryAuctionParamsRequest) (*QueryAuctionParamsResponse, error) - UserLimitBids(context.Context, *QueryUserLimitBidsRequest) (*QueryUserLimitBidsResponse, error) UserLimitBidsByAssetID(context.Context, *QueryUserLimitBidsByAssetIDRequest) (*QueryUserLimitBidsByAssetIDResponse, error) LimitBids(context.Context, *QueryLimitBidsRequest) (*QueryLimitBidsResponse, error) LimitBidProtocolData(context.Context, *QueryLimitBidProtocolDataRequest) (*QueryLimitBidProtocolDataResponse, error) @@ -1199,9 +1086,6 @@ func (*UnimplementedQueryServer) Bids(ctx context.Context, req *QueryBidsRequest func (*UnimplementedQueryServer) AuctionParams(ctx context.Context, req *QueryAuctionParamsRequest) (*QueryAuctionParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AuctionParams not implemented") } -func (*UnimplementedQueryServer) UserLimitBids(ctx context.Context, req *QueryUserLimitBidsRequest) (*QueryUserLimitBidsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserLimitBids not implemented") -} func (*UnimplementedQueryServer) UserLimitBidsByAssetID(ctx context.Context, req *QueryUserLimitBidsByAssetIDRequest) (*QueryUserLimitBidsByAssetIDResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UserLimitBidsByAssetID not implemented") } @@ -1306,24 +1190,6 @@ func _Query_AuctionParams_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } -func _Query_UserLimitBids_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryUserLimitBidsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).UserLimitBids(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.auctionsV2.v1beta1.Query/UserLimitBids", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).UserLimitBids(ctx, req.(*QueryUserLimitBidsRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_UserLimitBidsByAssetID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryUserLimitBidsByAssetIDRequest) if err := dec(in); err != nil { @@ -1402,10 +1268,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AuctionParams", Handler: _Query_AuctionParams_Handler, }, - { - MethodName: "UserLimitBids", - Handler: _Query_UserLimitBids_Handler, - }, { MethodName: "UserLimitBidsByAssetID", Handler: _Query_UserLimitBidsByAssetID_Handler, @@ -1813,81 +1675,6 @@ func (m *QueryAuctionParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *QueryUserLimitBidsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryUserLimitBidsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryUserLimitBidsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Bidder) > 0 { - i -= len(m.Bidder) - copy(dAtA[i:], m.Bidder) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryUserLimitBidsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryUserLimitBidsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryUserLimitBidsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.LimitOrderBids.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *QueryUserLimitBidsByAssetIDRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2332,34 +2119,6 @@ func (m *QueryAuctionParamsResponse) Size() (n int) { return n } -func (m *QueryUserLimitBidsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Bidder) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryUserLimitBidsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.LimitOrderBids.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - func (m *QueryUserLimitBidsByAssetIDRequest) Size() (n int) { if m == nil { return 0 @@ -3455,207 +3214,6 @@ func (m *QueryAuctionParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryUserLimitBidsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryUserLimitBidsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryUserLimitBidsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bidder = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryUserLimitBidsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryUserLimitBidsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryUserLimitBidsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderBids", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LimitOrderBids.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *QueryUserLimitBidsByAssetIDRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/auctionsV2/types/query.pb.gw.go b/x/auctionsV2/types/query.pb.gw.go index b37f03584..883a69f0f 100644 --- a/x/auctionsV2/types/query.pb.gw.go +++ b/x/auctionsV2/types/query.pb.gw.go @@ -333,78 +333,6 @@ func local_request_Query_AuctionParams_0(ctx context.Context, marshaler runtime. } -var ( - filter_Query_UserLimitBids_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_UserLimitBids_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryUserLimitBidsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["bidder"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") - } - - protoReq.Bidder, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_UserLimitBids_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UserLimitBids(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_UserLimitBids_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryUserLimitBidsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["bidder"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") - } - - protoReq.Bidder, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_UserLimitBids_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UserLimitBids(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_Query_UserLimitBidsByAssetID_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "collateral_token_id": 1, "debt_token_id": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} ) @@ -772,29 +700,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_UserLimitBids_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_UserLimitBids_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_UserLimitBids_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_UserLimitBidsByAssetID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1005,26 +910,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_UserLimitBids_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_UserLimitBids_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_UserLimitBids_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_UserLimitBidsByAssetID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1099,8 +984,6 @@ var ( pattern_Query_AuctionParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "auctions", "v2", "auction_params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_UserLimitBids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "auctions", "v2", "userlimitorderbids", "bidder"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_UserLimitBidsByAssetID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auctions", "v2", "userlimitorderbids", "bidder", "collateral_token_id", "debt_token_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_LimitBids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auctions", "v2", "limitorderbids", "collateral_token_id", "debt_token_id"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1119,8 +1002,6 @@ var ( forward_Query_AuctionParams_0 = runtime.ForwardResponseMessage - forward_Query_UserLimitBids_0 = runtime.ForwardResponseMessage - forward_Query_UserLimitBidsByAssetID_0 = runtime.ForwardResponseMessage forward_Query_LimitBids_0 = runtime.ForwardResponseMessage From bce31e800371e112ee09d15260c966ca4e16ea9b Mon Sep 17 00:00:00 2001 From: Subham <39151404+Subham2804@users.noreply.github.com> Date: Mon, 31 Jul 2023 14:02:02 +0530 Subject: [PATCH 132/155] refund commit --- app/upgrades/mainnet/v12/upgrades.go | 121 ++++++++++++++++++++++++++- 1 file changed, 120 insertions(+), 1 deletion(-) diff --git a/app/upgrades/mainnet/v12/upgrades.go b/app/upgrades/mainnet/v12/upgrades.go index bfa650e6b..c4f978558 100644 --- a/app/upgrades/mainnet/v12/upgrades.go +++ b/app/upgrades/mainnet/v12/upgrades.go @@ -10,6 +10,15 @@ import ( upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v4/keeper" icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v4/types" + collectortypes "github.com/comdex-official/comdex/x/collector/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + collectorkeeper "github.com/comdex-official/comdex/x/collector/keeper" + + + + "fmt" + + ) // An error occurred during the creation of the CMST/STJUNO pair, as it was mistakenly created in the Harbor app (ID-2) instead of the cSwap app (ID-1). @@ -24,6 +33,8 @@ func CreateUpgradeHandlerV12( icqkeeper *icqkeeper.Keeper, liquidationKeeper liquidationkeeper.Keeper, auctionKeeper auctionkeeper.Keeper, + bankKeeper bankkeeper.Keeper, + collectorKeeper collectorkeeper.Keeper, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info("Applying main net upgrade - v.12.0.0") @@ -36,7 +47,7 @@ func CreateUpgradeHandlerV12( if err != nil { return nil, err } - InitializeStates(ctx, liquidationKeeper, auctionKeeper) + InitializeStates(ctx, liquidationKeeper, auctionKeeper,bankKeeper,collectorKeeper) return vm, err } } @@ -45,6 +56,9 @@ func InitializeStates( ctx sdk.Context, liquidationKeeper liquidationkeeper.Keeper, auctionKeeper auctionkeeper.Keeper, + bankKeeper bankkeeper.Keeper, + collectorKeeper collectorkeeper.Keeper, + ) { dutchAuctionParams := liquidationtypes.DutchAuctionParam{ Premium: newDec("1.2"), @@ -104,6 +118,111 @@ func InitializeStates( auctionKeeper.SetParams(ctx, auctionsV2types.Params{}) auctionKeeper.SetAuctionID(ctx, 0) auctionKeeper.SetUserBidID(ctx, 0) + + + ////// refund CMST to vault owner//////// + + type refundStruct struct { + vaultOwner string + amount int64 + } + + refundData := []refundStruct{ + { + vaultOwner: "comdex1x22fak2s8a6m9gysx7y4d5794dgds0jy6jch3t", + amount: 27380000, + }, + { + vaultOwner: "comdex12jhse8d8uxgkqgrvfcv5j46wqu08yru7z3ze8z", + amount: 1142650000, + }, + { + vaultOwner: "comdex1w5lep3d53p5dtkg37gerq6qxdlagykyryta989", + amount: 4363010000, + }, + { + vaultOwner: "comdex122esu76xehp8sq9t88kcn666ejjum5g5ynxu0k", + amount: 32460000, + }, + { + vaultOwner: "comdex1reeycz4d4pu4fddzqafzsyh6vvjp3nflp84xpp", + amount: 44960000, + }, + { + vaultOwner: "comdex12q0708jnrd6d5ud7ap5lz4tgu3yshppfwd9x28", + amount: 808240000, + }, + { + vaultOwner: "comdex120t6ntph3za6a7trw3zegseefkyf5u8gu3q4yu", + amount: 29310000, + }, + { + vaultOwner: "comdex1qmklnue6z90vlljx04ll2v0elqjnzr3fswxm2u", + amount: 10249670000, + }, + { + vaultOwner: "comdex13mm0ua6c20f8jup3q2g0uuw2k5n54cgkrw3lqs", + amount: 664440000, + }, + { + vaultOwner: "comdex1wk25umx7ldgnca290dlg09yssusujhfek3l38l", + amount: 2520920000, + }, + { + vaultOwner: "comdex1z2cmdk7atwfefl4a3had7a2tsamxrwgucmhutx", + amount: 24300000, + }, + { + vaultOwner: "comdex1snezfskvsvdav5z9rsg5pgdrwnrg77kfjrc25f", + amount: 23090000, + }, + { + vaultOwner: "comdex15xvnvwffhmy5wx8y7a9rchxe4zys9pa4gv8k8r", + amount: 23650000, + }, + { + vaultOwner: "comdex1dwhhjyl6luv949ekpkplwc0zhqxa2jmhv6yl2w", + amount: 19930000, + }, + { + vaultOwner: "comdex1nwtwhhs3d8rjl6c3clmcxlf3qdpv8n6rc9u9uy", + amount: 18550000, + }, + { + vaultOwner: "comdex15gp4hjqf79zeggxteewzu2n0qde2zzfkkgec3z", + amount: 79060000, + }, + { + vaultOwner: "comdex1v3truxzuz0j7896tumz77unla4sltqlgxwzhxy", + amount: 45560000, + }, + { + vaultOwner: "comdex1850jsqvx54zl0urkav9tvee20j8r5fqj98zq9p", + amount: 21940000, + }, + { + vaultOwner: "comdex1qx46s5gen6c88yaauh9jfttmfgdxnxxshzhahu", + amount: 24400000, + }, + + } + + for i:=0; i Date: Mon, 31 Jul 2023 14:46:45 +0530 Subject: [PATCH 133/155] fixed keepers --- app/app.go | 2 +- app/upgrades/mainnet/v12/upgrades.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 446ec7f1c..9fd9e1d2a 100644 --- a/app/app.go +++ b/app/app.go @@ -1450,7 +1450,7 @@ func (a *App) registerUpgradeHandlers() { case upgradeInfo.Name == mv12.UpgradeName: a.UpgradeKeeper.SetUpgradeHandler( mv12.UpgradeName, - mv12.CreateUpgradeHandlerV12(a.mm, a.configurator, a.ICQKeeper, a.NewliqKeeper, a.NewaucKeeper), + mv12.CreateUpgradeHandlerV12(a.mm, a.configurator, a.ICQKeeper, a.NewliqKeeper, a.NewaucKeeper,a.BankKeeper,a.CollectorKeeper), ) } diff --git a/app/upgrades/mainnet/v12/upgrades.go b/app/upgrades/mainnet/v12/upgrades.go index c4f978558..e72c2409c 100644 --- a/app/upgrades/mainnet/v12/upgrades.go +++ b/app/upgrades/mainnet/v12/upgrades.go @@ -221,6 +221,11 @@ func InitializeStates( } + err := collectorKeeper.DecreaseNetFeeCollectedData(ctx, 2, 3,sdk.NewInt(20163520000)) + if err != nil { + fmt.Println("error in recreasing net fee collected", err) + } + } From cc5401d8845662b525e3de71067bb37f0c022e53 Mon Sep 17 00:00:00 2001 From: Subham <39151404+Subham2804@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:34:05 +0530 Subject: [PATCH 134/155] fix review comments --- app/upgrades/mainnet/v12/refund.go | 134 +++++++++++++++++++++++++++ app/upgrades/mainnet/v12/upgrades.go | 117 +---------------------- x/collector/expected/keeper.go | 1 + x/collector/keeper/keeper.go | 5 + 4 files changed, 141 insertions(+), 116 deletions(-) create mode 100644 app/upgrades/mainnet/v12/refund.go diff --git a/app/upgrades/mainnet/v12/refund.go b/app/upgrades/mainnet/v12/refund.go new file mode 100644 index 000000000..a1578c6d3 --- /dev/null +++ b/app/upgrades/mainnet/v12/refund.go @@ -0,0 +1,134 @@ +package v12 + +import ( + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" + collectortypes "github.com/comdex-official/comdex/x/collector/types" + collectorkeeper "github.com/comdex-official/comdex/x/collector/keeper" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + +) + +func Refund ( + ctx sdk.Context, + bankKeeper bankkeeper.Keeper, + collectorKeeper collectorkeeper.Keeper, +) { + ////// refund CMST to vault owner//////// + + type refundStruct struct { + vaultOwner string + amount int64 + } + + refundData := []refundStruct{ + { + vaultOwner: "comdex1x22fak2s8a6m9gysx7y4d5794dgds0jy6jch3t", + amount: 27380000, + }, + { + vaultOwner: "comdex12jhse8d8uxgkqgrvfcv5j46wqu08yru7z3ze8z", + amount: 1142650000, + }, + { + vaultOwner: "comdex1w5lep3d53p5dtkg37gerq6qxdlagykyryta989", + amount: 4363010000, + }, + { + vaultOwner: "comdex122esu76xehp8sq9t88kcn666ejjum5g5ynxu0k", + amount: 32460000, + }, + { + vaultOwner: "comdex1reeycz4d4pu4fddzqafzsyh6vvjp3nflp84xpp", + amount: 44960000, + }, + { + vaultOwner: "comdex12q0708jnrd6d5ud7ap5lz4tgu3yshppfwd9x28", + amount: 808240000, + }, + { + vaultOwner: "comdex120t6ntph3za6a7trw3zegseefkyf5u8gu3q4yu", + amount: 29310000, + }, + { + vaultOwner: "comdex1qmklnue6z90vlljx04ll2v0elqjnzr3fswxm2u", + amount: 10249670000, + }, + { + vaultOwner: "comdex13mm0ua6c20f8jup3q2g0uuw2k5n54cgkrw3lqs", + amount: 664440000, + }, + { + vaultOwner: "comdex1wk25umx7ldgnca290dlg09yssusujhfek3l38l", + amount: 2520920000, + }, + { + vaultOwner: "comdex1z2cmdk7atwfefl4a3had7a2tsamxrwgucmhutx", + amount: 24300000, + }, + { + vaultOwner: "comdex1snezfskvsvdav5z9rsg5pgdrwnrg77kfjrc25f", + amount: 23090000, + }, + { + vaultOwner: "comdex15xvnvwffhmy5wx8y7a9rchxe4zys9pa4gv8k8r", + amount: 23650000, + }, + { + vaultOwner: "comdex1dwhhjyl6luv949ekpkplwc0zhqxa2jmhv6yl2w", + amount: 19930000, + }, + { + vaultOwner: "comdex1nwtwhhs3d8rjl6c3clmcxlf3qdpv8n6rc9u9uy", + amount: 18550000, + }, + { + vaultOwner: "comdex15gp4hjqf79zeggxteewzu2n0qde2zzfkkgec3z", + amount: 79060000, + }, + { + vaultOwner: "comdex1v3truxzuz0j7896tumz77unla4sltqlgxwzhxy", + amount: 45560000, + }, + { + vaultOwner: "comdex1850jsqvx54zl0urkav9tvee20j8r5fqj98zq9p", + amount: 21940000, + }, + { + vaultOwner: "comdex1qx46s5gen6c88yaauh9jfttmfgdxnxxshzhahu", + amount: 24400000, + }, + + } + + // check if collector module account has enough balance to refund + macc := collectorKeeper.ModuleBalance(ctx, collectortypes.ModuleName, "ucmst") + // Check if sufficient balance exists + + if macc.Int64() < 20163520000 { + fmt.Println("collector module account does not have enough balance to refund") + return + } else { + for i:=0; i Date: Mon, 31 Jul 2023 17:15:12 +0530 Subject: [PATCH 135/155] adding auction queries and minor refactor --- app/app.go | 4 + proto/comdex/auctionsV2/v1beta1/query.proto | 17 + x/auctionsV2/client/cli/query.go | 33 ++ x/auctionsV2/client/cli/tx.go | 4 +- x/auctionsV2/keeper/auctions.go | 5 +- x/auctionsV2/keeper/bid.go | 8 +- x/auctionsV2/keeper/grpc_query.go | 38 ++ x/auctionsV2/types/codec.go | 5 + x/auctionsV2/types/query.pb.go | 617 +++++++++++++++++--- x/auctionsV2/types/query.pb.gw.go | 83 +++ x/lend/types/keys.go | 18 +- x/liquidationsV2/client/cli/tx.go | 2 +- x/liquidationsV2/types/codec.go | 5 + 13 files changed, 750 insertions(+), 89 deletions(-) diff --git a/app/app.go b/app/app.go index 446ec7f1c..110399cab 100644 --- a/app/app.go +++ b/app/app.go @@ -1422,6 +1422,10 @@ func (a *App) ModuleAccountsPermissions() map[string][]string { lendtypes.ModuleAcc5: {authtypes.Minter, authtypes.Burner}, lendtypes.ModuleAcc6: {authtypes.Minter, authtypes.Burner}, lendtypes.ModuleAcc7: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc8: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc9: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc10: {authtypes.Minter, authtypes.Burner}, + lendtypes.ModuleAcc11: {authtypes.Minter, authtypes.Burner}, liquidationtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, auctiontypes.ModuleName: {authtypes.Minter, authtypes.Burner}, lockertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index ebaba5de6..8cc663b21 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -120,6 +120,20 @@ message QueryLimitBidProtocolDataResponse { [(gogoproto.moretags) = "yaml:\"pagination\""]; } +message QueryAuctionFeesCollectionFromLimitBidTxRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryAuctionFeesCollectionFromLimitBidTxResponse { + repeated AuctionFeesCollectionFromLimitBidTx auction_fees_collection_from_limit_bid_tx = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"auction_fees_collection_from_limit_bid_tx\"" + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/comdex/auctions/v2/params"; @@ -145,4 +159,7 @@ service Query { rpc LimitBidProtocolData(QueryLimitBidProtocolDataRequest) returns (QueryLimitBidProtocolDataResponse) { option (google.api.http).get = "/comdex/auctions/v2/limit_bid_protocol_data"; } + rpc AuctionFeesCollectionData(QueryAuctionFeesCollectionFromLimitBidTxRequest) returns (QueryAuctionFeesCollectionFromLimitBidTxResponse) { + option (google.api.http).get = "/comdex/auctions/v2/auction_fees_collection_from_limit_bid_tx"; + } } \ No newline at end of file diff --git a/x/auctionsV2/client/cli/query.go b/x/auctionsV2/client/cli/query.go index befe8fa39..ee0ac2010 100644 --- a/x/auctionsV2/client/cli/query.go +++ b/x/auctionsV2/client/cli/query.go @@ -35,6 +35,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { queryUserLimitOrderBidsByAssetID(), queryLimitOrderBids(), queryLimitBidProtocolData(), + queryAuctionFeesCollectionData(), ) return cmd @@ -305,3 +306,35 @@ func queryLimitBidProtocolData() *cobra.Command { return cmd } + +func queryAuctionFeesCollectionData() *cobra.Command { + cmd := &cobra.Command{ + Use: "auction-fees-collection-data", + Short: "Query Auction Fees Collection Data", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + res, err := queryClient.AuctionFeesCollectionData( + context.Background(), + &types.QueryAuctionFeesCollectionFromLimitBidTxRequest{ + Pagination: pagination, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "auction-fees-collection-data") + + return cmd +} diff --git a/x/auctionsV2/client/cli/tx.go b/x/auctionsV2/client/cli/tx.go index c86df2492..33c5c29b5 100644 --- a/x/auctionsV2/client/cli/tx.go +++ b/x/auctionsV2/client/cli/tx.go @@ -203,7 +203,7 @@ func txWithdrawLimitDutchBid() *cobra.Command { func NewAddAuctionParamsProposal() *cobra.Command { cmd := &cobra.Command{ - Use: "add-auction-params [flags]", + Use: "add-auctions-params [flags]", Args: cobra.ExactArgs(0), Short: "Submit auction params", Long: `Must provide path to a add auction params in JSON file (--add-auction-params)`, @@ -233,7 +233,7 @@ func NewAddAuctionParamsProposal() *cobra.Command { func AddAuctionParams(clientCtx client.Context, txf tx.Factory, fs *flag.FlagSet) (tx.Factory, sdk.Msg, error) { auctionParams, err := parseAuctionParamsFlags(fs) if err != nil { - return txf, nil, fmt.Errorf("failed to parse liquidationWhitelisting: %w", err) + return txf, nil, fmt.Errorf("failed to parse add auctionsV2 params: %w", err) } from := clientCtx.GetFromAddress() diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 838cc8386..9d8a3b975 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -274,7 +274,7 @@ func (k Keeper) RestartDutchAuction(ctx sdk.Context, dutchAuction types.Auction) dutchAuction.CollateralTokenInitialPrice = CollateralTokenInitialPrice dutchAuction.CollateralTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataCollateral.Twa))) dutchAuction.DebtTokenOraclePrice = sdk.NewDecFromInt(sdk.NewInt(int64(twaDataDebt.Twa))) - // dutchAuction.StartTime = ctx.BlockTime() + dutchAuction.StartTime = ctx.BlockTime() dutchAuction.EndTime = ctx.BlockTime().Add(time.Second * time.Duration(auctionParams.AuctionDurationSeconds)) err := k.SetAuction(ctx, dutchAuction) @@ -555,6 +555,7 @@ func (k Keeper) LimitOrderBid(ctx sdk.Context) error { if err != nil { return err } + debtAmount := individualBids.DebtToken.Amount individualBids.DebtToken.Amount = sdk.ZeroInt() individualBids.BiddingId = append(individualBids.BiddingId, biddingId) k.SetUserLimitBidData(ctx, individualBids, auction.DebtAssetId, auction.CollateralAssetId, premiumPerc.TruncateInt()) @@ -563,7 +564,7 @@ func (k Keeper) LimitOrderBid(ctx sdk.Context) error { k.DeleteUserLimitBidData(ctx, auction.DebtAssetId, auction.CollateralAssetId, individualBids.PremiumDiscount, individualBids.BidderAddress) // subtract auction.DebtToken.Amount from protocol data protocolData, _ := k.GetLimitBidProtocolDataByAssetID(ctx, auction.DebtAssetId, auction.CollateralAssetId) - protocolData.BidValue = protocolData.BidValue.Sub(individualBids.DebtToken.Amount) + protocolData.BidValue = protocolData.BidValue.Sub(debtAmount) err = k.SetLimitBidProtocolData(ctx, protocolData) if err != nil { return err diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 747bc505b..5486ad657 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -58,7 +58,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s //So we call the module account to give funds to compensate the user. debtGettingLeft := auctionData.DebtToken.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, debtTokenAgainstLeftOverCollateral)) //Calling reserve account for debt adjustment : debtGettingLeft - //Updating the protocol was in loss stuct + //Updating the protocol was in loss struct err := k.LiquidationsV2.WithdrawAppReserveFundsFn(ctx, auctionData.AppId, auctionData.DebtAssetId, debtGettingLeft) if err != nil { return bidId, err @@ -119,7 +119,7 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, auctionID uint64, bidder s if liquidationData.InitiatorType == "external" { //Send Liquidation penalty to the comdex protocol -- create a kv store like SetAuctionLimitBidFeeData with name SetAuctionExternalFeeData //Send debt to the initiator address of the auction - finalDebtToInitiator := liquidationData.DebtToken.Sub(liquidationPenalty) + finalDebtToInitiator := liquidationData.TargetDebt.Sub(liquidationPenalty) keeperIncentive := (liquidationWhitelistingAppData.KeeeperIncentive.Mul(sdk.NewDecFromInt(liquidationPenalty.Amount))).TruncateInt() if keeperIncentive.GT(sdk.ZeroInt()) { liquidationPenalty = liquidationPenalty.Sub(sdk.NewCoin(auctionData.DebtToken.Denom, keeperIncentive)) @@ -637,9 +637,9 @@ func (k Keeper) WithdrawLimitAuctionBid(ctx sdk.Context, bidder string, Collater // return all the tokens back to the user if userLimitBid.DebtToken.Amount.GT(sdk.ZeroInt()) { feesToBeCollected := auctionParams.WithdrawalFee.Mul(sdk.NewDecFromInt(amount.Amount)).TruncateInt() - userLimitBid.DebtToken.Amount = userLimitBid.DebtToken.Amount.Sub(feesToBeCollected) + updatedAmount := amount.Amount.Sub(feesToBeCollected) - err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, sdk.NewCoins(amount)) + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, bidderAddr, sdk.NewCoins(sdk.NewCoin(amount.Denom, updatedAmount))) if err != nil { return err } diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index 1032324c8..2d8fdb7ca 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -289,3 +289,41 @@ func (q QueryServer) LimitBidProtocolData(c context.Context, req *types.QueryLim Pagination: pagination, }, nil } + +func (q QueryServer) AuctionFeesCollectionData(c context.Context, req *types.QueryAuctionFeesCollectionFromLimitBidTxRequest) (*types.QueryAuctionFeesCollectionFromLimitBidTxResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + items []types.AuctionFeesCollectionFromLimitBidTx + ctx = sdk.UnwrapSDKContext(c) + key []byte + ) + key = types.ExternalAuctionLimitBidFeeKeyPrefix + + pagination, err := query.FilteredPaginate( + prefix.NewStore(q.Store(ctx), key), + req.Pagination, + func(_, value []byte, accumulate bool) (bool, error) { + var item types.AuctionFeesCollectionFromLimitBidTx + if err := q.cdc.Unmarshal(value, &item); err != nil { + return false, err + } + + if accumulate { + items = append(items, item) + } + + return true, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAuctionFeesCollectionFromLimitBidTxResponse{ + AuctionFeesCollectionFromLimitBidTx: items, + Pagination: pagination, + }, nil +} diff --git a/x/auctionsV2/types/codec.go b/x/auctionsV2/types/codec.go index 34ca95c8a..462523b7e 100644 --- a/x/auctionsV2/types/codec.go +++ b/x/auctionsV2/types/codec.go @@ -6,6 +6,7 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { @@ -16,6 +17,10 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*govtypes.Content)(nil), + &DutchAutoBidParamsProposal{}, + ) registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgPlaceMarketBidRequest{}, diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index 7717ac39c..dc266ef10 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -854,6 +854,110 @@ func (m *QueryLimitBidProtocolDataResponse) GetPagination() *query.PageResponse return nil } +type QueryAuctionFeesCollectionFromLimitBidTxRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) Reset() { + *m = QueryAuctionFeesCollectionFromLimitBidTxRequest{} +} +func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) String() string { + return proto.CompactTextString(m) +} +func (*QueryAuctionFeesCollectionFromLimitBidTxRequest) ProtoMessage() {} +func (*QueryAuctionFeesCollectionFromLimitBidTxRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{16} +} +func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAuctionFeesCollectionFromLimitBidTxRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAuctionFeesCollectionFromLimitBidTxRequest.Merge(m, src) +} +func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAuctionFeesCollectionFromLimitBidTxRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAuctionFeesCollectionFromLimitBidTxRequest proto.InternalMessageInfo + +func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAuctionFeesCollectionFromLimitBidTxResponse struct { + AuctionFeesCollectionFromLimitBidTx []AuctionFeesCollectionFromLimitBidTx `protobuf:"bytes,1,rep,name=auction_fees_collection_from_limit_bid_tx,json=auctionFeesCollectionFromLimitBidTx,proto3" json:"auction_fees_collection_from_limit_bid_tx" yaml:"auction_fees_collection_from_limit_bid_tx"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) Reset() { + *m = QueryAuctionFeesCollectionFromLimitBidTxResponse{} +} +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryAuctionFeesCollectionFromLimitBidTxResponse) ProtoMessage() {} +func (*QueryAuctionFeesCollectionFromLimitBidTxResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{17} +} +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAuctionFeesCollectionFromLimitBidTxResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAuctionFeesCollectionFromLimitBidTxResponse.Merge(m, src) +} +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAuctionFeesCollectionFromLimitBidTxResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAuctionFeesCollectionFromLimitBidTxResponse proto.InternalMessageInfo + +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) GetAuctionFeesCollectionFromLimitBidTx() []AuctionFeesCollectionFromLimitBidTx { + if m != nil { + return m.AuctionFeesCollectionFromLimitBidTx + } + return nil +} + +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryParamsResponse") @@ -871,6 +975,8 @@ func init() { proto.RegisterType((*QueryLimitBidsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidsResponse") proto.RegisterType((*QueryLimitBidProtocolDataRequest)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidProtocolDataRequest") proto.RegisterType((*QueryLimitBidProtocolDataResponse)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidProtocolDataResponse") + proto.RegisterType((*QueryAuctionFeesCollectionFromLimitBidTxRequest)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionFeesCollectionFromLimitBidTxRequest") + proto.RegisterType((*QueryAuctionFeesCollectionFromLimitBidTxResponse)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionFeesCollectionFromLimitBidTxResponse") } func init() { @@ -878,79 +984,86 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 1143 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcf, 0x6f, 0xdb, 0x64, - 0x18, 0xee, 0x97, 0x96, 0xfe, 0x78, 0x4b, 0xcb, 0xfa, 0x35, 0x6d, 0x33, 0xb3, 0x25, 0xed, 0x37, - 0xe8, 0xca, 0x46, 0x6d, 0x9a, 0x75, 0x42, 0x1a, 0x0c, 0x34, 0x6b, 0x12, 0x14, 0xa1, 0x51, 0xac, - 0x6e, 0x93, 0x90, 0x46, 0xe4, 0xc4, 0x5e, 0x66, 0xe1, 0xc4, 0x99, 0xed, 0x4c, 0x44, 0x55, 0x0f, - 0x70, 0x05, 0x21, 0x24, 0x10, 0xff, 0x00, 0x02, 0x71, 0xe0, 0xc4, 0x89, 0x33, 0x07, 0x34, 0x71, - 0xaa, 0xc4, 0x85, 0x53, 0x85, 0x5a, 0x24, 0x4e, 0x08, 0xa9, 0x07, 0xce, 0xc8, 0xdf, 0xf7, 0x3a, - 0xb1, 0x33, 0x27, 0x71, 0xa7, 0x0c, 0x6e, 0xf1, 0xe7, 0xf7, 0xc7, 0xf3, 0x3e, 0xcf, 0xeb, 0xf7, - 0x7b, 0x15, 0x78, 0xbe, 0xe2, 0xd4, 0x0c, 0xf3, 0x43, 0x45, 0x6f, 0x56, 0x7c, 0xcb, 0xa9, 0x7b, - 0xb7, 0x8a, 0xca, 0x83, 0x8d, 0xb2, 0xe9, 0xeb, 0x1b, 0xca, 0xfd, 0xa6, 0xe9, 0xb6, 0xe4, 0x86, - 0xeb, 0xf8, 0x0e, 0x3d, 0x2d, 0xcc, 0xe4, 0x8e, 0x99, 0x8c, 0x66, 0x52, 0xb6, 0xea, 0x54, 0x1d, - 0x6e, 0xa5, 0x04, 0xbf, 0x84, 0x83, 0x74, 0xa6, 0xea, 0x38, 0x55, 0xdb, 0x54, 0xf4, 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0x7e, 0x3f, 0xcc, 0x93, 0xcf, 0x8f, 0xf2, - 0x23, 0xfb, 0x47, 0xf9, 0x91, 0xdf, 0x8e, 0xf2, 0x23, 0xef, 0x6d, 0x56, 0x2d, 0xff, 0x5e, 0xb3, - 0x1c, 0x40, 0xc2, 0x80, 0xeb, 0xce, 0xdd, 0xbb, 0x56, 0xc5, 0xd2, 0xed, 0x30, 0x41, 0xec, 0x8f, - 0x87, 0x60, 0x48, 0x78, 0xe5, 0x71, 0x1e, 0xfe, 0xd2, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x50, - 0x06, 0xf7, 0xd0, 0x8d, 0x11, 0x00, 0x00, + // 1262 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x4d, 0x6f, 0xdc, 0x54, + 0x17, 0xce, 0x9d, 0xe4, 0x4d, 0x9b, 0x93, 0x37, 0xa1, 0xb9, 0xf9, 0x9a, 0x0c, 0xed, 0x24, 0xb9, + 0x81, 0x34, 0x6d, 0xc9, 0x38, 0x49, 0x53, 0x81, 0x0a, 0x69, 0xd5, 0xa1, 0x7c, 0xa4, 0xa0, 0x12, + 0xac, 0xb4, 0x95, 0x90, 0xca, 0xc8, 0x33, 0xbe, 0x99, 0x5a, 0x78, 0xc6, 0x53, 0xdb, 0xa9, 0x32, + 0x8a, 0xb2, 0x80, 0x2d, 0x08, 0x55, 0x02, 0xf1, 0x07, 0x10, 0x88, 0x05, 0x2b, 0x16, 0xfc, 0x00, + 0x16, 0xa8, 0x62, 0x15, 0x89, 0x0d, 0xab, 0x08, 0x25, 0x20, 0x56, 0x08, 0x29, 0x0b, 0x36, 0x6c, + 0x90, 0xaf, 0x8f, 0x67, 0xec, 0xa9, 0xc7, 0x76, 0xaa, 0x49, 0xd9, 0x65, 0xec, 0xf3, 0xf1, 0x9c, + 0xe7, 0x39, 0xbe, 0xe7, 0xdc, 0xc0, 0x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1e, 0x64, 0xbb, 0x7e, 0x39, 0xc8, 0x76, + 0xbd, 0xb7, 0x5c, 0xd6, 0xec, 0x7b, 0x9b, 0x45, 0x07, 0x33, 0xa6, 0x98, 0x37, 0x36, 0x36, 0xb4, + 0x92, 0xa6, 0xe8, 0x5e, 0xca, 0xc0, 0x7f, 0xdc, 0x9c, 0x23, 0xd2, 0x2a, 0xf6, 0x0a, 0x72, 0x2f, + 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x30, 0xd5, 0x2a, 0xb0, 0x86, 0x14, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -973,6 +1086,7 @@ type QueryClient interface { UserLimitBidsByAssetID(ctx context.Context, in *QueryUserLimitBidsByAssetIDRequest, opts ...grpc.CallOption) (*QueryUserLimitBidsByAssetIDResponse, error) LimitBids(ctx context.Context, in *QueryLimitBidsRequest, opts ...grpc.CallOption) (*QueryLimitBidsResponse, error) LimitBidProtocolData(ctx context.Context, in *QueryLimitBidProtocolDataRequest, opts ...grpc.CallOption) (*QueryLimitBidProtocolDataResponse, error) + AuctionFeesCollectionData(ctx context.Context, in *QueryAuctionFeesCollectionFromLimitBidTxRequest, opts ...grpc.CallOption) (*QueryAuctionFeesCollectionFromLimitBidTxResponse, error) } type queryClient struct { @@ -1055,6 +1169,15 @@ func (c *queryClient) LimitBidProtocolData(ctx context.Context, in *QueryLimitBi return out, nil } +func (c *queryClient) AuctionFeesCollectionData(ctx context.Context, in *QueryAuctionFeesCollectionFromLimitBidTxRequest, opts ...grpc.CallOption) (*QueryAuctionFeesCollectionFromLimitBidTxResponse, error) { + out := new(QueryAuctionFeesCollectionFromLimitBidTxResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/AuctionFeesCollectionData", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) @@ -1065,6 +1188,7 @@ type QueryServer interface { UserLimitBidsByAssetID(context.Context, *QueryUserLimitBidsByAssetIDRequest) (*QueryUserLimitBidsByAssetIDResponse, error) LimitBids(context.Context, *QueryLimitBidsRequest) (*QueryLimitBidsResponse, error) LimitBidProtocolData(context.Context, *QueryLimitBidProtocolDataRequest) (*QueryLimitBidProtocolDataResponse, error) + AuctionFeesCollectionData(context.Context, *QueryAuctionFeesCollectionFromLimitBidTxRequest) (*QueryAuctionFeesCollectionFromLimitBidTxResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1095,6 +1219,9 @@ func (*UnimplementedQueryServer) LimitBids(ctx context.Context, req *QueryLimitB func (*UnimplementedQueryServer) LimitBidProtocolData(ctx context.Context, req *QueryLimitBidProtocolDataRequest) (*QueryLimitBidProtocolDataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LimitBidProtocolData not implemented") } +func (*UnimplementedQueryServer) AuctionFeesCollectionData(ctx context.Context, req *QueryAuctionFeesCollectionFromLimitBidTxRequest) (*QueryAuctionFeesCollectionFromLimitBidTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AuctionFeesCollectionData not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1244,6 +1371,24 @@ func _Query_LimitBidProtocolData_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +func _Query_AuctionFeesCollectionData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAuctionFeesCollectionFromLimitBidTxRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AuctionFeesCollectionData(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Query/AuctionFeesCollectionData", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AuctionFeesCollectionData(ctx, req.(*QueryAuctionFeesCollectionFromLimitBidTxRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.auctionsV2.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -1280,6 +1425,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "LimitBidProtocolData", Handler: _Query_LimitBidProtocolData_Handler, }, + { + MethodName: "AuctionFeesCollectionData", + Handler: _Query_AuctionFeesCollectionData_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/auctionsV2/v1beta1/query.proto", @@ -1961,6 +2110,90 @@ func (m *QueryLimitBidProtocolDataResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } +func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.AuctionFeesCollectionFromLimitBidTx) > 0 { + for iNdEx := len(m.AuctionFeesCollectionFromLimitBidTx) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AuctionFeesCollectionFromLimitBidTx[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2235,6 +2468,38 @@ func (m *QueryLimitBidProtocolDataResponse) Size() (n int) { return n } +func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AuctionFeesCollectionFromLimitBidTx) > 0 { + for _, e := range m.AuctionFeesCollectionFromLimitBidTx { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3972,6 +4237,212 @@ func (m *QueryLimitBidProtocolDataResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryAuctionFeesCollectionFromLimitBidTxRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAuctionFeesCollectionFromLimitBidTxRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAuctionFeesCollectionFromLimitBidTxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAuctionFeesCollectionFromLimitBidTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAuctionFeesCollectionFromLimitBidTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionFeesCollectionFromLimitBidTx", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuctionFeesCollectionFromLimitBidTx = append(m.AuctionFeesCollectionFromLimitBidTx, AuctionFeesCollectionFromLimitBidTx{}) + if err := m.AuctionFeesCollectionFromLimitBidTx[len(m.AuctionFeesCollectionFromLimitBidTx)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auctionsV2/types/query.pb.gw.go b/x/auctionsV2/types/query.pb.gw.go index 883a69f0f..da5cc0813 100644 --- a/x/auctionsV2/types/query.pb.gw.go +++ b/x/auctionsV2/types/query.pb.gw.go @@ -579,6 +579,42 @@ func local_request_Query_LimitBidProtocolData_0(ctx context.Context, marshaler r } +var ( + filter_Query_AuctionFeesCollectionData_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AuctionFeesCollectionData_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAuctionFeesCollectionFromLimitBidTxRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AuctionFeesCollectionData_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AuctionFeesCollectionData(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AuctionFeesCollectionData_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAuctionFeesCollectionFromLimitBidTxRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AuctionFeesCollectionData_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AuctionFeesCollectionData(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -769,6 +805,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_AuctionFeesCollectionData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AuctionFeesCollectionData_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AuctionFeesCollectionData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -970,6 +1029,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_AuctionFeesCollectionData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AuctionFeesCollectionData_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AuctionFeesCollectionData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -989,6 +1068,8 @@ var ( pattern_Query_LimitBids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auctions", "v2", "limitorderbids", "collateral_token_id", "debt_token_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_LimitBidProtocolData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "auctions", "v2", "limit_bid_protocol_data"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AuctionFeesCollectionData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "auctions", "v2", "auction_fees_collection_from_limit_bid_tx"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1007,4 +1088,6 @@ var ( forward_Query_LimitBids_0 = runtime.ForwardResponseMessage forward_Query_LimitBidProtocolData_0 = runtime.ForwardResponseMessage + + forward_Query_AuctionFeesCollectionData_0 = runtime.ForwardResponseMessage ) diff --git a/x/lend/types/keys.go b/x/lend/types/keys.go index 462366c74..e6dda043a 100644 --- a/x/lend/types/keys.go +++ b/x/lend/types/keys.go @@ -9,13 +9,17 @@ const ( ModuleName = "lendV2" // ModuleAcc1 , ModuleAcc2 & ModuleAcc3 defines different module accounts to store selected pairs of asset. - ModuleAcc1 = "cmdx" - ModuleAcc2 = "atom" - ModuleAcc3 = "osmo" - ModuleAcc4 = "axlusdc" - ModuleAcc5 = "statom" - ModuleAcc6 = "evmos" - ModuleAcc7 = "gusdc" + ModuleAcc1 = "cmdx" + ModuleAcc2 = "atom" + ModuleAcc3 = "osmo" + ModuleAcc4 = "axlusdc" + ModuleAcc5 = "statom" + ModuleAcc6 = "evmos" + ModuleAcc7 = "gusdc" + ModuleAcc8 = "dai" + ModuleAcc9 = "weth" + ModuleAcc10 = "stcmdx" + ModuleAcc11 = "cmdxnew" // StoreKey defines the primary module store key. StoreKey = ModuleName diff --git a/x/liquidationsV2/client/cli/tx.go b/x/liquidationsV2/client/cli/tx.go index 903fe7851..21c37721e 100644 --- a/x/liquidationsV2/client/cli/tx.go +++ b/x/liquidationsV2/client/cli/tx.go @@ -84,7 +84,7 @@ func txAppReserveFunds() *cobra.Command { cmd := &cobra.Command{ Use: "app-reserve-funds [app-id] [asset-id] [amount]", Short: "app reserve funds", - Args: cobra.ExactArgs(4), + Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { ctx, err := client.GetClientTxContext(cmd) if err != nil { diff --git a/x/liquidationsV2/types/codec.go b/x/liquidationsV2/types/codec.go index 44b043da0..1671938a1 100644 --- a/x/liquidationsV2/types/codec.go +++ b/x/liquidationsV2/types/codec.go @@ -5,6 +5,7 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" // this line is used by starport scaffolding # 1 "github.com/cosmos/cosmos-sdk/types/msgservice" @@ -17,6 +18,10 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*govtypes.Content)(nil), + &WhitelistLiquidationProposal{}, + ) registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgLiquidateInternalKeeperRequest{}, From e14cf8af717acd081f25dfa26cebaf39ce2521de Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 1 Aug 2023 10:32:03 +0530 Subject: [PATCH 136/155] updating query --- app/upgrades/mainnet/v12/constants.go | 2 +- go.mod | 2 +- go.sum | 2 + proto/comdex/auctionsV2/v1beta1/query.proto | 9 +- x/auctionsV2/keeper/grpc_query.go | 9 +- x/auctionsV2/types/query.pb.go | 225 ++++++++++++-------- 6 files changed, 156 insertions(+), 93 deletions(-) diff --git a/app/upgrades/mainnet/v12/constants.go b/app/upgrades/mainnet/v12/constants.go index 38e9eb4a1..1d759edc1 100644 --- a/app/upgrades/mainnet/v12/constants.go +++ b/app/upgrades/mainnet/v12/constants.go @@ -1,7 +1,7 @@ package v12 const ( - UpgradeName = "v12.rc1" + UpgradeName = "v12.rc2" UpgradeHeight = "" UpgradeInfo = `'{ "binaries": { diff --git a/go.mod b/go.mod index 96200b29f..47372653f 100644 --- a/go.mod +++ b/go.mod @@ -287,7 +287,7 @@ require ( replace ( github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/cosmos/cosmos-sdk => github.com/comdex-official/cosmos-sdk v0.45.9-comdex.4 + github.com/cosmos/cosmos-sdk => github.com/comdex-official/cosmos-sdk v0.45.9-comdex.5 //breaking changes github.com/cosmos/iavl v0.19.5 => github.com/cosmos/iavl v0.19.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 diff --git a/go.sum b/go.sum index 31a1ab536..51efe1f66 100644 --- a/go.sum +++ b/go.sum @@ -627,6 +627,8 @@ github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZ github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= github.com/comdex-official/cosmos-sdk v0.45.9-comdex.4 h1:HamsRfrxsCvkwcHbMT8TDW3u013MmixXqbcCt/doxLo= github.com/comdex-official/cosmos-sdk v0.45.9-comdex.4/go.mod h1:Z5M4TX7PsHNHlF/1XanI2DIpORQ+Q/st7oaeufEjnvU= +github.com/comdex-official/cosmos-sdk v0.45.9-comdex.5 h1:RnRxY6M1baLuV39F5mxHoH8mMh5Y6ZQH92Jp60kROSU= +github.com/comdex-official/cosmos-sdk v0.45.9-comdex.5/go.mod h1:Z5M4TX7PsHNHlF/1XanI2DIpORQ+Q/st7oaeufEjnvU= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index 8cc663b21..ea1b6ce59 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -82,11 +82,16 @@ message QueryUserLimitBidsByAssetIDResponse { string bidder = 1 [ (gogoproto.moretags) = "yaml:\"bidder\"" ]; - repeated LimitOrderBid limit_order_bids = 2 [ + string total_amount = 2 [ + (gogoproto.moretags) = "yaml:\"total_amount\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + ]; + repeated LimitOrderBid limit_order_bids = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"limit_order_bids\"" ]; - cosmos.base.query.v1beta1.PageResponse pagination = 3 + cosmos.base.query.v1beta1.PageResponse pagination = 4 [(gogoproto.moretags) = "yaml:\"pagination\""]; } diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index 2d8fdb7ca..78672658c 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -179,9 +179,10 @@ func (q QueryServer) UserLimitBidsByAssetID(c context.Context, req *types.QueryU } var ( - items []types.LimitOrderBid - ctx = sdk.UnwrapSDKContext(c) - key []byte + items []types.LimitOrderBid + ctx = sdk.UnwrapSDKContext(c) + key []byte + amount = sdk.NewInt(0) ) key = types.LimitBidKeyForAssetID(req.DebtTokenId, req.CollateralTokenId) @@ -196,6 +197,7 @@ func (q QueryServer) UserLimitBidsByAssetID(c context.Context, req *types.QueryU if accumulate { if item.BidderAddress == req.Bidder { + amount = amount.Add(item.DebtToken.Amount) items = append(items, item) } } @@ -209,6 +211,7 @@ func (q QueryServer) UserLimitBidsByAssetID(c context.Context, req *types.QueryU return &types.QueryUserLimitBidsByAssetIDResponse{ Bidder: req.Bidder, + TotalAmount: amount, LimitOrderBids: items, Pagination: pagination, }, nil diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index dc266ef10..90f3dd8c4 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -587,9 +588,10 @@ func (m *QueryUserLimitBidsByAssetIDRequest) GetPagination() *query.PageRequest } type QueryUserLimitBidsByAssetIDResponse struct { - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` - LimitOrderBids []LimitOrderBid `protobuf:"bytes,2,rep,name=limit_order_bids,json=limitOrderBids,proto3" json:"limit_order_bids" yaml:"limit_order_bids"` - Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` + TotalAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=total_amount,json=totalAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_amount" yaml:"total_amount"` + LimitOrderBids []LimitOrderBid `protobuf:"bytes,3,rep,name=limit_order_bids,json=limitOrderBids,proto3" json:"limit_order_bids" yaml:"limit_order_bids"` + Pagination *query.PageResponse `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` } func (m *QueryUserLimitBidsByAssetIDResponse) Reset() { *m = QueryUserLimitBidsByAssetIDResponse{} } @@ -984,86 +986,91 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 1262 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x4d, 0x6f, 0xdc, 0x54, - 0x17, 0xce, 0x9d, 0xe4, 0x4d, 0x9b, 0x93, 0x37, 0xa1, 0xb9, 0xf9, 0x9a, 0x0c, 0xed, 0x24, 0xb9, - 0x81, 0x34, 0x6d, 0xc9, 0x38, 0x49, 0x53, 0x81, 0x0a, 0x69, 0xd5, 0xa1, 0x7c, 0xa4, 0xa0, 0x12, - 0xac, 0xb4, 0x95, 0x90, 0xca, 0xc8, 0x33, 0xbe, 0x99, 0x5a, 0x78, 0xc6, 0x53, 0xdb, 0xa9, 0x32, - 0x8a, 0xb2, 0x80, 0x2d, 0x08, 0x55, 0x02, 0xf1, 0x07, 0x10, 0x88, 0x05, 0x2b, 0x16, 0xfc, 0x00, - 0x16, 0xa8, 0x62, 0x15, 0x89, 0x0d, 0xab, 0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5a, 0x5f, 0x13, 0xb5, 0x5e, - 0xa5, 0x2b, 0x51, 0x5f, 0x5a, 0xec, 0xf8, 0xcc, 0xdf, 0x7c, 0xb4, 0x9f, 0x25, 0xbb, 0xfb, 0x59, - 0xf2, 0xeb, 0x7e, 0x96, 0x3c, 0x3c, 0xc8, 0x76, 0xed, 0x1e, 0x64, 0xbb, 0x7e, 0x39, 0xc8, 0x76, - 0xbd, 0xb7, 0x5c, 0xd6, 0xec, 0x7b, 0x9b, 0x45, 0x07, 0x33, 0xa6, 0x98, 0x37, 0x36, 0x36, 0xb4, - 0x92, 0xa6, 0xe8, 0x5e, 0xca, 0xc0, 0x7f, 0xdc, 0x9c, 0x23, 0xd2, 0x2a, 0xf6, 0x0a, 0x72, 0x2f, - 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x30, 0xd5, 0x2a, 0xb0, 0x86, 0x14, 0x00, 0x00, + // 1329 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0xd8, 0xfe, 0xa6, 0xcd, 0xa4, 0xe9, 0xb7, 0x99, 0xfc, 0x72, 0x4c, 0x6b, 0x27, 0x13, + 0x48, 0xd3, 0x96, 0x78, 0x93, 0x34, 0x15, 0xa8, 0x90, 0x56, 0x59, 0x5a, 0x20, 0x05, 0x95, 0xb0, + 0x4a, 0x5b, 0x09, 0xa9, 0x58, 0x6b, 0xef, 0xc4, 0x59, 0x75, 0xed, 0x71, 0x77, 0xd7, 0x55, 0xac, + 0x28, 0x07, 0xb8, 0x82, 0xa0, 0x12, 0x88, 0x7f, 0x00, 0x09, 0x71, 0xe0, 0xc4, 0x81, 0x3f, 0x80, + 0x03, 0xaa, 0x38, 0x45, 0xe2, 0x82, 0x38, 0x58, 0x28, 0x01, 0x71, 0x42, 0x48, 0x39, 0x70, 0xe1, + 0x82, 0x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 0xa7, 0x80, 0x1b, 0xbd, 0x09, 0x71, 0x57, 0x5d, 0x7b, + 0x48, 0x47, 0xce, 0x60, 0x0c, 0x11, 0x72, 0xba, 0x26, 0x62, 0x27, 0x94, 0x01, 0x78, 0xb3, 0xa6, + 0x91, 0x24, 0x3e, 0xb6, 0xa5, 0x5b, 0x36, 0x37, 0x6b, 0xc9, 0xd8, 0x14, 0x9a, 0x3b, 0xae, 0x78, + 0x8f, 0xd4, 0xc0, 0xa3, 0xfe, 0x78, 0x00, 0x74, 0x03, 0x1f, 0x03, 0x77, 0x40, 0x4a, 0xbb, 0x20, + 0x05, 0x67, 0x79, 0xdc, 0x81, 0x7a, 0x58, 0xcf, 0x9c, 0xac, 0xa9, 0x25, 0xe3, 0x32, 0x05, 0x4b, + 0xaa, 0x78, 0xa1, 0xe8, 0xb7, 0xc8, 0x9f, 0xce, 0x2b, 0x17, 0x99, 0xc6, 0x27, 0x3c, 0xfc, 0x76, + 0xad, 0xc2, 0x80, 0xc1, 0x20, 0xbc, 0xdb, 0xa8, 0x55, 0x58, 0x67, 0x0e, 0xe4, 0x2e, 0xc6, 0xcd, + 0x5e, 0x48, 0xc6, 0x05, 0xdc, 0xd9, 0xac, 0xdb, 0x38, 0x59, 0xa7, 0x71, 0xb2, 0x6e, 0x83, 0x36, + 0x0b, 0x5b, 0x64, 0x90, 0x58, 0x1e, 0x3b, 0xac, 0x67, 0x86, 0x5d, 0xb8, 0xcd, 0x18, 0x54, 0x69, + 0x09, 0x48, 0xf7, 0x10, 0x1e, 0x6b, 0x03, 0x0d, 0x45, 0xba, 0x83, 0x8f, 0x7b, 0xd5, 0x48, 0xa2, + 0xa9, 0x78, 0xc4, 0x2a, 0x4d, 0x40, 0x95, 0xfe, 0xef, 0xab, 0x92, 0x45, 0x95, 0x46, 0x30, 0xf2, + 0xbe, 0x8f, 0x51, 0x4c, 0x30, 0x3a, 0x1b, 0xca, 0xc8, 0x45, 0x15, 0x85, 0xd2, 0x97, 0x08, 0x9f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x00, 0xa3, 0x75, 0xc1, 0xe8, 0x06, 0x79, + 0x33, 0x88, 0x51, 0x3b, 0x9b, 0x48, 0x24, 0x7e, 0x40, 0x78, 0x34, 0xe8, 0x8c, 0x26, 0xaf, 0x44, + 0x45, 0x17, 0x30, 0xb8, 0xa4, 0x5e, 0x7d, 0x32, 0xe7, 0x28, 0x2b, 0xa6, 0xc3, 0xb0, 0x40, 0xfe, + 0x41, 0x78, 0x32, 0xf0, 0x84, 0x12, 0x6c, 0x6e, 0x44, 0x5c, 0x07, 0x11, 0xce, 0xfa, 0xd4, 0x5b, + 0x3d, 0x89, 0x05, 0x5c, 0xaf, 0x0b, 0xae, 0x57, 0xc9, 0x4a, 0xb7, 0x95, 0x16, 0x7a, 0x7c, 0xca, + 0x37, 0x1f, 0xed, 0xa7, 0xd1, 0xde, 0x7e, 0x1a, 0xfd, 0xba, 0x9f, 0x46, 0x0f, 0x0f, 0xd2, 0x7d, + 0x7b, 0x07, 0xe9, 0xbe, 0x9f, 0x0f, 0xd2, 0x7d, 0xef, 0x2d, 0xfb, 0xae, 0x51, 0x4e, 0x8a, 0x79, + 0xbe, 0xb9, 0xa9, 0x17, 0x74, 0xd5, 0xf0, 0x52, 0xfa, 0xfe, 0xb7, 0x27, 0x2e, 0x56, 0xf9, 0x7e, + 0x51, 0xdc, 0x8b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xce, 0x30, 0x6a, 0xe6, 0xf0, 0x14, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1906,7 +1913,7 @@ func (m *QueryUserLimitBidsByAssetIDResponse) MarshalToSizedBuffer(dAtA []byte) i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } if len(m.LimitOrderBids) > 0 { for iNdEx := len(m.LimitOrderBids) - 1; iNdEx >= 0; iNdEx-- { @@ -1919,9 +1926,19 @@ func (m *QueryUserLimitBidsByAssetIDResponse) MarshalToSizedBuffer(dAtA []byte) i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a + } + } + { + size := m.TotalAmount.Size() + i -= size + if _, err := m.TotalAmount.MarshalTo(dAtA[i:]); err != nil { + return 0, err } + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 if len(m.Bidder) > 0 { i -= len(m.Bidder) copy(dAtA[i:], m.Bidder) @@ -2385,6 +2402,8 @@ func (m *QueryUserLimitBidsByAssetIDResponse) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + l = m.TotalAmount.Size() + n += 1 + l + sovQuery(uint64(l)) if len(m.LimitOrderBids) > 0 { for _, e := range m.LimitOrderBids { l = e.Size() @@ -3697,6 +3716,40 @@ func (m *QueryUserLimitBidsByAssetIDResponse) Unmarshal(dAtA []byte) error { m.Bidder = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LimitOrderBids", wireType) } @@ -3730,7 +3783,7 @@ func (m *QueryUserLimitBidsByAssetIDResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } From a58d3caecbe1866c5d923583791673c6bf2085f3 Mon Sep 17 00:00:00 2001 From: Chandragupta Singh Date: Wed, 2 Aug 2023 02:15:37 +0530 Subject: [PATCH 137/155] minor refactor --- app/upgrades/mainnet/v12/refund.go | 2 +- app/upgrades/mainnet/v12/upgrades.go | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/upgrades/mainnet/v12/refund.go b/app/upgrades/mainnet/v12/refund.go index a1578c6d3..16e7368fc 100644 --- a/app/upgrades/mainnet/v12/refund.go +++ b/app/upgrades/mainnet/v12/refund.go @@ -128,7 +128,7 @@ func Refund ( // decrease net fee collected err := collectorKeeper.DecreaseNetFeeCollectedData(ctx, 2, 3,sdk.NewInt(20163520000)) if err != nil { - panic("error in recreasing net fee collected") + panic("error in decreasing net fee collected") } } } \ No newline at end of file diff --git a/app/upgrades/mainnet/v12/upgrades.go b/app/upgrades/mainnet/v12/upgrades.go index 278bf402a..93d20d485 100644 --- a/app/upgrades/mainnet/v12/upgrades.go +++ b/app/upgrades/mainnet/v12/upgrades.go @@ -40,7 +40,7 @@ func CreateUpgradeHandlerV12( if err != nil { return nil, err } - InitializeStates(ctx, liquidationKeeper, auctionKeeper,bankKeeper,collectorKeeper) + InitializeStates(ctx, liquidationKeeper, auctionKeeper) Refund(ctx, bankKeeper, collectorKeeper) return vm, err } @@ -50,9 +50,6 @@ func InitializeStates( ctx sdk.Context, liquidationKeeper liquidationkeeper.Keeper, auctionKeeper auctionkeeper.Keeper, - bankKeeper bankkeeper.Keeper, - collectorKeeper collectorkeeper.Keeper, - ) { dutchAuctionParams := liquidationtypes.DutchAuctionParam{ Premium: newDec("1.2"), From 1c07cc777a686f825dac5782a2c2d1df81836bc9 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 2 Aug 2023 23:12:51 +0530 Subject: [PATCH 138/155] updating query --- proto/comdex/auctionsV2/v1beta1/auction.proto | 26 + proto/comdex/auctionsV2/v1beta1/query.proto | 2 +- x/auctionsV2/keeper/grpc_query.go | 15 +- x/auctionsV2/types/auction.pb.go | 525 +++++++++++++++--- x/auctionsV2/types/query.pb.go | 176 +++--- 5 files changed, 585 insertions(+), 159 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index f2e11c863..f2748eb04 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -125,4 +125,30 @@ message LimitBidProtocolData{ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"max_discount\"" ]; +} + +message LimitBidProtocolDataForQuery{ + uint64 collateral_asset_id = 1 [ + (gogoproto.moretags) = "yaml:\"collateral_asset_id\"" + ]; + uint64 debt_asset_id = 2 [ + (gogoproto.moretags) = "yaml:\"debt_asset_id\"" + ]; + string bid_value = 3 [ + (gogoproto.moretags) = "yaml:\"bid_value\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + ]; + + string max_discount = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"max_discount\"" + ]; + string collateral_asset_denom = 5 [ + (gogoproto.moretags) = "yaml:\"collateral_asset_denom\"" + ]; + string debt_asset_denom = 6 [ + (gogoproto.moretags) = "yaml:\"debt_asset_denom\"" + ]; } \ No newline at end of file diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index ea1b6ce59..c45787dd3 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -117,7 +117,7 @@ message QueryLimitBidProtocolDataRequest { } message QueryLimitBidProtocolDataResponse { - repeated LimitBidProtocolData limit_bid_protocol_data = 1 [ + repeated LimitBidProtocolDataForQuery limit_bid_protocol_data = 1 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"limit_bid_protocol_data\"" ]; diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index 78672658c..aa0d1245e 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -261,7 +261,7 @@ func (q QueryServer) LimitBidProtocolData(c context.Context, req *types.QueryLim } var ( - items []types.LimitBidProtocolData + items []types.LimitBidProtocolDataForQuery ctx = sdk.UnwrapSDKContext(c) key []byte ) @@ -272,12 +272,23 @@ func (q QueryServer) LimitBidProtocolData(c context.Context, req *types.QueryLim req.Pagination, func(_, value []byte, accumulate bool) (bool, error) { var item types.LimitBidProtocolData + var data types.LimitBidProtocolDataForQuery if err := q.cdc.Unmarshal(value, &item); err != nil { return false, err } if accumulate { - items = append(items, item) + collateralAsset, _ := q.asset.GetAsset(ctx, item.CollateralAssetId) + debtAsset, _ := q.asset.GetAsset(ctx, item.DebtAssetId) + data = types.LimitBidProtocolDataForQuery{ + CollateralAssetId: item.CollateralAssetId, + DebtAssetId: item.DebtAssetId, + BidValue: item.BidValue, + MaxDiscount: item.MaxDiscount, + CollateralAssetDenom: collateralAsset.Denom, + DebtAssetDenom: debtAsset.Denom, + } + items = append(items, data) } return true, nil diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index d8379ed31..8e6739943 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -334,11 +334,82 @@ func (m *LimitBidProtocolData) GetDebtAssetId() uint64 { return 0 } +type LimitBidProtocolDataForQuery struct { + CollateralAssetId uint64 `protobuf:"varint,1,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` + DebtAssetId uint64 `protobuf:"varint,2,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` + BidValue github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=bid_value,json=bidValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bid_value" yaml:"bid_value"` + MaxDiscount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=max_discount,json=maxDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_discount" yaml:"max_discount"` + CollateralAssetDenom string `protobuf:"bytes,5,opt,name=collateral_asset_denom,json=collateralAssetDenom,proto3" json:"collateral_asset_denom,omitempty" yaml:"collateral_asset_denom"` + DebtAssetDenom string `protobuf:"bytes,6,opt,name=debt_asset_denom,json=debtAssetDenom,proto3" json:"debt_asset_denom,omitempty" yaml:"debt_asset_denom"` +} + +func (m *LimitBidProtocolDataForQuery) Reset() { *m = LimitBidProtocolDataForQuery{} } +func (m *LimitBidProtocolDataForQuery) String() string { return proto.CompactTextString(m) } +func (*LimitBidProtocolDataForQuery) ProtoMessage() {} +func (*LimitBidProtocolDataForQuery) Descriptor() ([]byte, []int) { + return fileDescriptor_8ee47f5a405fa8ba, []int{4} +} +func (m *LimitBidProtocolDataForQuery) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LimitBidProtocolDataForQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LimitBidProtocolDataForQuery.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LimitBidProtocolDataForQuery) XXX_Merge(src proto.Message) { + xxx_messageInfo_LimitBidProtocolDataForQuery.Merge(m, src) +} +func (m *LimitBidProtocolDataForQuery) XXX_Size() int { + return m.Size() +} +func (m *LimitBidProtocolDataForQuery) XXX_DiscardUnknown() { + xxx_messageInfo_LimitBidProtocolDataForQuery.DiscardUnknown(m) +} + +var xxx_messageInfo_LimitBidProtocolDataForQuery proto.InternalMessageInfo + +func (m *LimitBidProtocolDataForQuery) GetCollateralAssetId() uint64 { + if m != nil { + return m.CollateralAssetId + } + return 0 +} + +func (m *LimitBidProtocolDataForQuery) GetDebtAssetId() uint64 { + if m != nil { + return m.DebtAssetId + } + return 0 +} + +func (m *LimitBidProtocolDataForQuery) GetCollateralAssetDenom() string { + if m != nil { + return m.CollateralAssetDenom + } + return "" +} + +func (m *LimitBidProtocolDataForQuery) GetDebtAssetDenom() string { + if m != nil { + return m.DebtAssetDenom + } + return "" +} + func init() { proto.RegisterType((*AuctionHistorical)(nil), "comdex.auctionsV2.v1beta1.AuctionHistorical") proto.RegisterType((*Auction)(nil), "comdex.auctionsV2.v1beta1.Auction") proto.RegisterType((*BidOwnerMapping)(nil), "comdex.auctionsV2.v1beta1.bidOwnerMapping") proto.RegisterType((*LimitBidProtocolData)(nil), "comdex.auctionsV2.v1beta1.LimitBidProtocolData") + proto.RegisterType((*LimitBidProtocolDataForQuery)(nil), "comdex.auctionsV2.v1beta1.LimitBidProtocolDataForQuery") } func init() { @@ -346,74 +417,78 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 1057 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x36, 0xfd, 0xaf, 0x95, 0x5d, 0x59, 0x8c, 0x13, 0xcb, 0x72, 0x2d, 0x2a, 0x0b, 0x34, 0x31, - 0x0a, 0x98, 0x42, 0xd2, 0x9c, 0x8a, 0x5e, 0xcc, 0x3a, 0x40, 0x54, 0xa4, 0x49, 0xc0, 0x1a, 0x6e, - 0xd1, 0x0b, 0xb1, 0xe4, 0xae, 0xe5, 0x85, 0x29, 0x2e, 0x2b, 0xae, 0x1c, 0xfb, 0x11, 0x7a, 0x29, - 0x7c, 0x2a, 0x50, 0xa0, 0xb7, 0xbe, 0x4c, 0x8e, 0xe9, 0xad, 0xe8, 0x81, 0x2d, 0xec, 0x07, 0x28, - 0xc0,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79, 0xf1, 0xe6, 0xba, 0x65, 0xbc, 0xbd, 0x6e, 0x19, 0x7f, 0x5e, 0xb7, 0x8c, 0xab, 0x9b, 0xd6, - 0xdc, 0xdb, 0x9b, 0xd6, 0xdc, 0x6f, 0x37, 0xad, 0xb9, 0x6f, 0x9f, 0x8c, 0x65, 0x11, 0x6f, 0xdd, - 0x3e, 0x3b, 0x39, 0xa1, 0x01, 0x45, 0xa1, 0x5e, 0x77, 0xc6, 0xfe, 0xb3, 0xca, 0xbc, 0xfe, 0xb2, - 0x1c, 0x27, 0x9f, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0x37, 0xe8, 0xec, 0xb5, 0xd5, 0x0a, 0x00, - 0x00, + // 1133 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0xcf, 0x4f, 0x1b, 0x47, + 0x14, 0x66, 0x09, 0x10, 0x3c, 0x86, 0x18, 0x6f, 0x08, 0x18, 0x13, 0xbc, 0x66, 0xa4, 0x26, 0xa8, + 0x12, 0xb6, 0x92, 0xe6, 0x54, 0xf5, 0xc2, 0x16, 0xaa, 0xb8, 0x4a, 0x93, 0x74, 0x8b, 0x48, 0xd5, + 0x8b, 0x35, 0xbb, 0x33, 0x98, 0x11, 0xeb, 0x9d, 0xad, 0x77, 0x4c, 0xe0, 0x4f, 0xe8, 0xa5, 0xe2, + 0xd4, 0xaa, 0x52, 0x6f, 0xfd, 0x67, 0x72, 0x4c, 0x6f, 0x55, 0x0f, 0xdb, 0x0a, 0xfe, 0x80, 0x4a, + 0x7b, 0xec, 0xa9, 0x9a, 0x1f, 0xeb, 0x5d, 0xff, 0x40, 0xa9, 0xab, 0xf6, 0xd6, 0x13, 0x9e, 0x99, + 0xf7, 0xbe, 0xf7, 0xed, 0xf7, 0xbe, 0x7d, 0xb3, 0x80, 0x87, 0x1e, 0xeb, 0x62, 0x72, 0xde, 0x44, + 0x7d, 0x8f, 0x53, 0x16, 0x44, 0x47, 0x8f, 0x9b, 0x67, 0x8f, 0x5c, 0xc2, 0xd1, 0xa3, 0x74, 0xab, + 0x11, 0xf6, 0x18, 0x67, 0xe6, 0x86, 0x0a, 0x6c, 0x64, 0x81, 0x0d, 0x1d, 0x58, 0x5d, 0xed, 0xb0, + 0x0e, 0x93, 0x51, 0x4d, 0xf1, 0x4b, 0x25, 0x54, 0xad, 0x0e, 0x63, 0x1d, 0x9f, 0x34, 0xe5, 0xca, + 0xed, 0x1f, 0x37, 0x39, 0xed, 0x92, 0x88, 0xa3, 0x6e, 0xa8, 0x03, 0x6a, 0x1e, 0x8b, 0xba, 0x2c, + 0x6a, 0xba, 0x28, 0x22, 0x83, 0xa2, 0x1e, 0xa3, 0xba, 0x62, 0x75, 0x57, 0x53, 0xf3, 0xe9, 0xd7, + 0x7d, 0x8a, 0xd1, 0x28, 0xbd, 0x74, 0x9b, 0xa8, 0x70, 0xf8, 0xd3, 0x2c, 0x28, 0xef, 0x29, 0x72, + 0x4f, 0x69, 0xc4, 0x59, 0x8f, 0x7a, 0xc8, 0x37, 0x9f, 0x00, 0xa0, 0x19, 0xb7, 0x29, 0xae, 0x18, + 0x75, 0x63, 0x67, 0xce, 0xbe, 0x97, 0xc4, 0x56, 0xf9, 0x02, 0x75, 0xfd, 0x0f, 0x61, 0x76, 0x06, + 0x9d, 0x82, 0x5e, 0xb4, 0xb0, 0x19, 0x02, 0x33, 0x3d, 0x39, 0x19, 0x60, 0x55, 0x66, 0xeb, 0xc6, + 0x4e, 0xf1, 0x31, 0x6c, 0xdc, 0xa8, 0x44, 0x43, 0xd7, 0xb7, 0xb7, 0x92, 0xd8, 0xda, 0x18, 0xae, + 0x90, 0xe1, 0x40, 0xa7, 0x8c, 0xc6, 0x78, 0x1e, 0x83, 0x25, 0x9f, 0x79, 0xa7, 0x04, 0xb7, 0xcf, + 0x50, 0xdf, 0xe7, 0x95, 0x5b, 0xb2, 0xd6, 0xfb, 0x69, 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0xe6, 0x65, 0xcd, 0xed, 0x24, 0xb6, 0xb6, 0x6e, 0xd0, 0x56, 0xc6, 0x41, 0x67, 0x75, + 0x44, 0xde, 0x7d, 0xb1, 0x6d, 0x1e, 0x80, 0x95, 0x9c, 0x84, 0x0a, 0x72, 0x41, 0x42, 0x6e, 0x66, + 0x5f, 0x7f, 0xa3, 0x11, 0xd0, 0xb9, 0x33, 0xd0, 0x59, 0xc2, 0xd8, 0xcf, 0xdf, 0x5c, 0xd5, 0x8c, + 0xb7, 0x57, 0x35, 0xe3, 0xf7, 0xab, 0x9a, 0x71, 0x79, 0x5d, 0x9b, 0x79, 0x7b, 0x5d, 0x9b, 0xf9, + 0xe5, 0xba, 0x36, 0xf3, 0xd5, 0x93, 0x21, 0x15, 0xc4, 0x57, 0xd0, 0x2e, 0x3b, 0x3e, 0xa6, 0x1e, + 0x45, 0xbe, 0x5e, 0x37, 0x87, 0xfe, 0x9b, 0x91, 0xba, 0xb8, 0x0b, 0xf2, 0xa2, 0xf9, 0xe0, 0xaf, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x1a, 0x6b, 0xfb, 0xef, 0x0c, 0x00, 0x00, } func (m *AuctionHistorical) Marshal() (dAtA []byte, err error) { @@ -725,6 +800,73 @@ func (m *LimitBidProtocolData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *LimitBidProtocolDataForQuery) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LimitBidProtocolDataForQuery) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LimitBidProtocolDataForQuery) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DebtAssetDenom) > 0 { + i -= len(m.DebtAssetDenom) + copy(dAtA[i:], m.DebtAssetDenom) + i = encodeVarintAuction(dAtA, i, uint64(len(m.DebtAssetDenom))) + i-- + dAtA[i] = 0x32 + } + if len(m.CollateralAssetDenom) > 0 { + i -= len(m.CollateralAssetDenom) + copy(dAtA[i:], m.CollateralAssetDenom) + i = encodeVarintAuction(dAtA, i, uint64(len(m.CollateralAssetDenom))) + i-- + dAtA[i] = 0x2a + } + { + size := m.MaxDiscount.Size() + i -= size + if _, err := m.MaxDiscount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.BidValue.Size() + i -= size + if _, err := m.BidValue.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.DebtAssetId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.DebtAssetId)) + i-- + dAtA[i] = 0x10 + } + if m.CollateralAssetId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.CollateralAssetId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintAuction(dAtA []byte, offset int, v uint64) int { offset -= sovAuction(v) base := offset @@ -845,6 +987,33 @@ func (m *LimitBidProtocolData) Size() (n int) { return n } +func (m *LimitBidProtocolDataForQuery) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CollateralAssetId != 0 { + n += 1 + sovAuction(uint64(m.CollateralAssetId)) + } + if m.DebtAssetId != 0 { + n += 1 + sovAuction(uint64(m.DebtAssetId)) + } + l = m.BidValue.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.MaxDiscount.Size() + n += 1 + l + sovAuction(uint64(l)) + l = len(m.CollateralAssetDenom) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + l = len(m.DebtAssetDenom) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + return n +} + func sovAuction(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1769,6 +1938,226 @@ func (m *LimitBidProtocolData) Unmarshal(dAtA []byte) error { } return nil } +func (m *LimitBidProtocolDataForQuery) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LimitBidProtocolDataForQuery: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LimitBidProtocolDataForQuery: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralAssetId", wireType) + } + m.CollateralAssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CollateralAssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtAssetId", wireType) + } + m.DebtAssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DebtAssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BidValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxDiscount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxDiscount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralAssetDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CollateralAssetDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtAssetDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DebtAssetDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipAuction(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index 90f3dd8c4..2517f34f1 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -805,8 +805,8 @@ func (m *QueryLimitBidProtocolDataRequest) GetPagination() *query.PageRequest { } type QueryLimitBidProtocolDataResponse struct { - LimitBidProtocolData []LimitBidProtocolData `protobuf:"bytes,1,rep,name=limit_bid_protocol_data,json=limitBidProtocolData,proto3" json:"limit_bid_protocol_data" yaml:"limit_bid_protocol_data"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` + LimitBidProtocolData []LimitBidProtocolDataForQuery `protobuf:"bytes,1,rep,name=limit_bid_protocol_data,json=limitBidProtocolData,proto3" json:"limit_bid_protocol_data" yaml:"limit_bid_protocol_data"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` } func (m *QueryLimitBidProtocolDataResponse) Reset() { *m = QueryLimitBidProtocolDataResponse{} } @@ -842,7 +842,7 @@ func (m *QueryLimitBidProtocolDataResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryLimitBidProtocolDataResponse proto.InternalMessageInfo -func (m *QueryLimitBidProtocolDataResponse) GetLimitBidProtocolData() []LimitBidProtocolData { +func (m *QueryLimitBidProtocolDataResponse) GetLimitBidProtocolData() []LimitBidProtocolDataForQuery { if m != nil { return m.LimitBidProtocolData } @@ -986,91 +986,91 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 1329 bytes of a gzipped FileDescriptorProto + // 1335 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xcf, 0xd8, 0xfe, 0xa6, 0xcd, 0xa4, 0xe9, 0xb7, 0x99, 0xfc, 0x72, 0x4c, 0x6b, 0x27, 0x13, - 0x48, 0xd3, 0x96, 0x78, 0x93, 0x34, 0x15, 0xa8, 0x90, 0x56, 0x59, 0x5a, 0x20, 0x05, 0x95, 0xb0, - 0x4a, 0x5b, 0x09, 0xa9, 0x58, 0x6b, 0xef, 0xc4, 0x59, 0x75, 0xed, 0x71, 0x77, 0xd7, 0x55, 0xac, - 0x28, 0x07, 0xb8, 0x82, 0xa0, 0x12, 0x88, 0x7f, 0x00, 0x09, 0x71, 0xe0, 0xc4, 0x81, 0x3f, 0x80, - 0x03, 0xaa, 0x38, 0x45, 0xe2, 0x82, 0x38, 0x58, 0x28, 0x01, 0x71, 0x42, 0x48, 0x39, 0x70, 0xe1, - 0x82, 0x76, 0xf6, 0xad, 0xed, 0x75, 0xd7, 0xde, 0x4d, 0xe5, 0x96, 0x53, 0xbc, 0xbb, 0xef, 0xc7, - 0xe7, 0xf3, 0x3e, 0x6f, 0x66, 0xde, 0x04, 0xbf, 0x50, 0xe0, 0x25, 0x8d, 0x6d, 0x4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 0xa5, 0x5b, 0x36, 0x37, 0x6b, 0xc9, 0xd8, 0x14, 0x9a, 0x3b, 0xae, 0x78, - 0x8f, 0xd4, 0xc0, 0xa3, 0xfe, 0x78, 0x00, 0x74, 0x03, 0x1f, 0x03, 0x77, 0x40, 0x4a, 0xbb, 0x20, - 0x05, 0x67, 0x79, 0xdc, 0x81, 0x7a, 0x58, 0xcf, 0x9c, 0xac, 0xa9, 0x25, 0xe3, 0x32, 0x05, 0x4b, - 0xaa, 0x78, 0xa1, 0xe8, 0xb7, 0xc8, 0x9f, 0xce, 0x2b, 0x17, 0x99, 0xc6, 0x27, 0x3c, 0xfc, 0x76, - 0xad, 0xc2, 0x80, 0xc1, 0x20, 0xbc, 0xdb, 0xa8, 0x55, 0x58, 0x67, 0x0e, 0xe4, 0x2e, 0xc6, 0xcd, - 0x5e, 0x48, 0xc6, 0x05, 0xdc, 0xd9, 0xac, 0xdb, 0x38, 0x59, 0xa7, 0x71, 0xb2, 0x6e, 0x83, 0x36, - 0x0b, 0x5b, 0x64, 0x90, 0x58, 0x1e, 0x3b, 0xac, 0x67, 0x86, 0x5d, 0xb8, 0xcd, 0x18, 0x54, 0x69, - 0x09, 0x48, 0xf7, 0x10, 0x1e, 0x6b, 0x03, 0x0d, 0x45, 0xba, 0x83, 0x8f, 0x7b, 0xd5, 0x48, 0xa2, - 0xa9, 0x78, 0xc4, 0x2a, 0x4d, 0x40, 0x95, 0xfe, 0xef, 0xab, 0x92, 0x45, 0x95, 0x46, 0x30, 0xf2, - 0xbe, 0x8f, 0x51, 0x4c, 0x30, 0x3a, 0x1b, 0xca, 0xc8, 0x45, 0x15, 0x85, 0xd2, 0x97, 0x08, 0x9f, - 0x12, 0x94, 0x64, 0x5d, 0x6b, 0x68, 0x30, 0x8e, 0xfb, 0xf3, 0xba, 0xa6, 0x31, 0x53, 0x54, 0x7f, - 0x40, 0x81, 0xa7, 0xff, 0xae, 0xf0, 0x7f, 0x20, 0x3c, 0xdc, 0x82, 0x12, 0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 0x7d, 0x32, 0xe7, 0x28, 0x2b, 0xa6, 0xc3, 0xb0, 0x40, 0xfe, - 0x41, 0x78, 0x32, 0xf0, 0x84, 0x12, 0x6c, 0x6e, 0x44, 0x5c, 0x07, 0x11, 0xce, 0xfa, 0xd4, 0x5b, - 0x3d, 0x89, 0x05, 0x5c, 0xaf, 0x0b, 0xae, 0x57, 0xc9, 0x4a, 0xb7, 0x95, 0x16, 0x7a, 0x7c, 0xca, - 0x37, 0x1f, 0xed, 0xa7, 0xd1, 0xde, 0x7e, 0x1a, 0xfd, 0xba, 0x9f, 0x46, 0x0f, 0x0f, 0xd2, 0x7d, - 0x7b, 0x07, 0xe9, 0xbe, 0x9f, 0x0f, 0xd2, 0x7d, 0xef, 0x2d, 0xfb, 0xae, 0x51, 0x4e, 0x8a, 0x79, - 0xbe, 0xb9, 0xa9, 0x17, 0x74, 0xd5, 0xf0, 0x52, 0xfa, 0xfe, 0xb7, 0x27, 0x2e, 0x56, 0xf9, 0x7e, - 0x51, 0xdc, 0x8b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xce, 0x30, 0x6a, 0xe6, 0xf0, 0x14, 0x00, - 0x00, + 0x17, 0xcf, 0xd8, 0xfe, 0xe6, 0xc7, 0xa4, 0xc9, 0xb7, 0x99, 0xfc, 0x72, 0x4c, 0x6b, 0x27, 0x13, + 0x48, 0xd3, 0x96, 0x78, 0x93, 0x34, 0x55, 0x51, 0x21, 0xad, 0x62, 0xda, 0x42, 0x0a, 0x2a, 0x61, + 0x95, 0xb6, 0x12, 0x52, 0xb1, 0xd6, 0xde, 0x89, 0xb3, 0xea, 0xda, 0xe3, 0xee, 0xae, 0xab, 0x58, + 0x51, 0x0e, 0x70, 0x05, 0x89, 0x4a, 0x48, 0x3d, 0x71, 0x43, 0x42, 0x1c, 0x38, 0x71, 0xe0, 0x0f, + 0xe0, 0x80, 0x2a, 0x4e, 0x91, 0xb8, 0x20, 0x0e, 0x16, 0x4a, 0x40, 0x9c, 0x10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, 0x41, 0x15, 0x86, 0xd2, 0x97, + 0x08, 0x9f, 0x14, 0x94, 0x32, 0x9a, 0x5a, 0xd7, 0x60, 0x02, 0xf7, 0xe6, 0x34, 0x55, 0x65, 0x86, + 0xc8, 0xfe, 0x80, 0x0c, 0x4f, 0xff, 0x5d, 0xe2, 0xff, 0x40, 0x78, 0xa4, 0x09, 0x25, 0x24, 0xfd, + 0xac, 0x17, 0x66, 0x66, 0xe4, 0xa8, 0x96, 0x1a, 0x72, 0x1c, 0x39, 0xef, 0x69, 0x1d, 0xf9, 0x5b, + 0x38, 0x96, 0xd3, 0x54, 0x33, 0x1e, 0x11, 0xda, 0x24, 0x3b, 0x68, 0x93, 0xd1, 0xd4, 0xcc, 0x28, + 0xe8, 0x32, 0x58, 0x77, 0x66, 0x52, 0x59, 0x38, 0x68, 0xd1, 0x23, 0xda, 0x75, 0x3d, 0x5e, 0xc2, + 0x53, 0xcd, 0x15, 0xe6, 0x3d, 0x4a, 0x3e, 0x45, 0x38, 0xe1, 0xf7, 0x15, 0xf2, 0x51, 0xc2, 0xc3, + 0xee, 0xd6, 0xf1, 0x1c, 0x2d, 0xf3, 0xc1, 0xa5, 0x08, 0x27, 0xcc, 0x69, 0x20, 0x3e, 0xee, 0x29, + 0x48, 0xf0, 0x46, 0xe5, 0x21, 0xa5, 0xd9, 0x9a, 0xfe, 0x85, 0x30, 0x15, 0x70, 0x6e, 0x9b, 0xcc, + 0x78, 0x57, 0x2b, 0x6a, 0x96, 0x2d, 0x4f, 0xa6, 0xba, 0x66, 0x9a, 0xcc, 0x5a, 0xbf, 0x16, 0x54, + 0x4d, 0x69, 0x3c, 0x9a, 0xe7, 0xba, 0xae, 0x58, 0xcc, 0x50, 0xf4, 0xac, 0xc5, 0xef, 0x33, 0x71, + 0x64, 0x45, 0xc4, 0x86, 0x1f, 0x69, 0x7c, 0xda, 0xb4, 0xbf, 0xac, 0xab, 0x84, 0xe2, 0x21, 0x95, + 0xe5, 0xac, 0x86, 0x65, 0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60, 0xed, 0xb6, 0x4e, 0x6b, 0x89, 0xa5, 0x63, 0xac, 0x00, + 0x46, 0x1b, 0x82, 0xd1, 0x4d, 0xf2, 0xb6, 0x1f, 0xa3, 0x56, 0x36, 0xa1, 0x48, 0xfc, 0x80, 0xf0, + 0x98, 0x5f, 0xaf, 0x26, 0xaf, 0x87, 0x45, 0xe7, 0x33, 0xc0, 0x24, 0xde, 0x78, 0xb6, 0xc5, 0x61, + 0x76, 0x4c, 0x9b, 0x61, 0x81, 0xfc, 0x83, 0xf0, 0x94, 0x6f, 0x87, 0x12, 0x6c, 0x6e, 0x86, 0xdc, + 0x07, 0x21, 0x7a, 0x7d, 0xe2, 0x9d, 0xae, 0xf8, 0x02, 0xae, 0xd7, 0x05, 0xd7, 0xab, 0x64, 0xb5, + 0xd3, 0x4e, 0x0b, 0x6c, 0x9f, 0x99, 0x5b, 0x4f, 0x0e, 0x92, 0x68, 0xff, 0x20, 0x89, 0x7e, 0x3d, + 0x48, 0xa2, 0x47, 0x87, 0xc9, 0x9e, 0xfd, 0xc3, 0x64, 0xcf, 0xcf, 0x87, 0xc9, 0x9e, 0x0f, 0x56, + 0x3c, 0xd7, 0x29, 0x3b, 0xc4, 0x02, 0xdf, 0xda, 0xd2, 0xf2, 0x9a, 0xa2, 0xbb, 0x21, 0x3d, 0xff, + 0xe3, 0x13, 0x17, 0xac, 0x5c, 0xaf, 0x48, 0xee, 0x85, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x65, + 0x7d, 0x8a, 0x3d, 0xf8, 0x14, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -4228,7 +4228,7 @@ func (m *QueryLimitBidProtocolDataResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.LimitBidProtocolData = append(m.LimitBidProtocolData, LimitBidProtocolData{}) + m.LimitBidProtocolData = append(m.LimitBidProtocolData, LimitBidProtocolDataForQuery{}) if err := m.LimitBidProtocolData[len(m.LimitBidProtocolData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } From a605ef73f5cd70f68fb99c9b0fc760aac5cf9486 Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 4 Aug 2023 06:28:43 +0530 Subject: [PATCH 139/155] added query for auctionsV2 --- proto/comdex/auctionsV2/v1beta1/auction.proto | 31 + proto/comdex/auctionsV2/v1beta1/query.proto | 18 + x/auctionsV2/client/cli/query.go | 36 + x/auctionsV2/keeper/bid.go | 25 + x/auctionsV2/keeper/grpc_query.go | 54 ++ x/auctionsV2/types/auction.pb.go | 579 +++++++++++++-- x/auctionsV2/types/query.pb.go | 690 +++++++++++++++--- x/auctionsV2/types/query.pb.gw.go | 119 +++ 8 files changed, 1395 insertions(+), 157 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/auction.proto b/proto/comdex/auctionsV2/v1beta1/auction.proto index f2748eb04..29958468e 100644 --- a/proto/comdex/auctionsV2/v1beta1/auction.proto +++ b/proto/comdex/auctionsV2/v1beta1/auction.proto @@ -151,4 +151,35 @@ message LimitBidProtocolDataForQuery{ string debt_asset_denom = 6 [ (gogoproto.moretags) = "yaml:\"debt_asset_denom\"" ]; +} + +message LimitBidProtocolDataWithUserForQuery{ + uint64 collateral_asset_id = 1 [ + (gogoproto.moretags) = "yaml:\"collateral_asset_id\"" + ]; + uint64 debt_asset_id = 2 [ + (gogoproto.moretags) = "yaml:\"debt_asset_id\"" + ]; + string bid_value = 3 [ + (gogoproto.moretags) = "yaml:\"bid_value\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + ]; + + string max_discount = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"max_discount\"" + ]; + string collateral_asset_denom = 5 [ + (gogoproto.moretags) = "yaml:\"collateral_asset_denom\"" + ]; + string debt_asset_denom = 6 [ + (gogoproto.moretags) = "yaml:\"debt_asset_denom\"" + ]; + string user_bid_value = 7 [ + (gogoproto.moretags) = "yaml:\"user_bid_value\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int" + ]; } \ No newline at end of file diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index c45787dd3..c727f6297 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -139,6 +139,21 @@ message QueryAuctionFeesCollectionFromLimitBidTxResponse { [(gogoproto.moretags) = "yaml:\"pagination\""]; } +message QueryLimitBidProtocolDataWithUserRequest { + string bidder = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryLimitBidProtocolDataWithUserResponse { + repeated LimitBidProtocolDataWithUserForQuery limit_bid_protocol_data_with_user = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"limit_bid_protocol_data_with_user\"" + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/comdex/auctions/v2/params"; @@ -167,4 +182,7 @@ service Query { rpc AuctionFeesCollectionData(QueryAuctionFeesCollectionFromLimitBidTxRequest) returns (QueryAuctionFeesCollectionFromLimitBidTxResponse) { option (google.api.http).get = "/comdex/auctions/v2/auction_fees_collection_from_limit_bid_tx"; } + rpc LimitBidProtocolDataWithUser(QueryLimitBidProtocolDataWithUserRequest) returns (QueryLimitBidProtocolDataWithUserResponse) { + option (google.api.http).get = "/comdex/auctions/v2/limit_bid_protocol_data_with_user/{bidder}"; + } } \ No newline at end of file diff --git a/x/auctionsV2/client/cli/query.go b/x/auctionsV2/client/cli/query.go index ee0ac2010..c5195251a 100644 --- a/x/auctionsV2/client/cli/query.go +++ b/x/auctionsV2/client/cli/query.go @@ -36,6 +36,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { queryLimitOrderBids(), queryLimitBidProtocolData(), queryAuctionFeesCollectionData(), + queryLimitBidProtocolDataWithAddress(), ) return cmd @@ -338,3 +339,38 @@ func queryAuctionFeesCollectionData() *cobra.Command { return cmd } + +func queryLimitBidProtocolDataWithAddress() *cobra.Command { + cmd := &cobra.Command{ + Use: "limit-bid-protocol-data-with-user [bidder]", + Short: "Query Limit Bid Protocol Data with bidder address", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + bidder := args[0] + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + res, err := queryClient.LimitBidProtocolDataWithUser( + context.Background(), + &types.QueryLimitBidProtocolDataWithUserRequest{ + Bidder: bidder, + Pagination: pagination, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "limit-bid-protocol-data-with-user") + + return cmd +} diff --git a/x/auctionsV2/keeper/bid.go b/x/auctionsV2/keeper/bid.go index 5486ad657..1fdcecd58 100644 --- a/x/auctionsV2/keeper/bid.go +++ b/x/auctionsV2/keeper/bid.go @@ -730,3 +730,28 @@ func (k Keeper) GetUserLimitBidDataByAddress(ctx sdk.Context, address string) (m k.cdc.MustUnmarshal(value, &mappingData) return mappingData, true } + +func (k Keeper) GetUserLimitBidsByAssetID(ctx sdk.Context, address string, debtAssetId, collateralAssetId uint64) (sdk.Int, bool) { + var ( + store = k.Store(ctx) + key = types.LimitBidKeyForAssetID(debtAssetId, collateralAssetId) + iter = sdk.KVStorePrefixIterator(store, key) + amount = sdk.ZeroInt() + ) + + defer func(iter sdk.Iterator) { + err := iter.Close() + if err != nil { + return + } + }(iter) + + for ; iter.Valid(); iter.Next() { + var item types.LimitOrderBid + k.cdc.MustUnmarshal(iter.Value(), &item) + if item.BidderAddress == address { + amount = amount.Add(item.DebtToken.Amount) + } + } + return amount, true +} diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index aa0d1245e..a4b5d6c13 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -341,3 +341,57 @@ func (q QueryServer) AuctionFeesCollectionData(c context.Context, req *types.Que Pagination: pagination, }, nil } + +func (q QueryServer) LimitBidProtocolDataWithUser(c context.Context, req *types.QueryLimitBidProtocolDataWithUserRequest) (*types.QueryLimitBidProtocolDataWithUserResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + items []types.LimitBidProtocolDataWithUserForQuery + ctx = sdk.UnwrapSDKContext(c) + key []byte + ) + key = types.MarketBidProtocolKeyPrefix + + pagination, err := query.FilteredPaginate( + prefix.NewStore(q.Store(ctx), key), + req.Pagination, + func(_, value []byte, accumulate bool) (bool, error) { + var item types.LimitBidProtocolData + var data types.LimitBidProtocolDataWithUserForQuery + if err := q.cdc.Unmarshal(value, &item); err != nil { + return false, err + } + + if accumulate { + collateralAsset, _ := q.asset.GetAsset(ctx, item.CollateralAssetId) + debtAsset, _ := q.asset.GetAsset(ctx, item.DebtAssetId) + userBidValue, found := q.GetUserLimitBidsByAssetID(ctx, req.Bidder, item.DebtAssetId, item.CollateralAssetId) + if !found { + userBidValue = sdk.ZeroInt() + } + data = types.LimitBidProtocolDataWithUserForQuery{ + CollateralAssetId: item.CollateralAssetId, + DebtAssetId: item.DebtAssetId, + BidValue: item.BidValue, + MaxDiscount: item.MaxDiscount, + CollateralAssetDenom: collateralAsset.Denom, + DebtAssetDenom: debtAsset.Denom, + UserBidValue: userBidValue, + } + items = append(items, data) + } + + return true, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryLimitBidProtocolDataWithUserResponse{ + LimitBidProtocolDataWithUser: items, + Pagination: pagination, + }, nil +} diff --git a/x/auctionsV2/types/auction.pb.go b/x/auctionsV2/types/auction.pb.go index 8e6739943..5666c6dd9 100644 --- a/x/auctionsV2/types/auction.pb.go +++ b/x/auctionsV2/types/auction.pb.go @@ -404,12 +404,84 @@ func (m *LimitBidProtocolDataForQuery) GetDebtAssetDenom() string { return "" } +type LimitBidProtocolDataWithUserForQuery struct { + CollateralAssetId uint64 `protobuf:"varint,1,opt,name=collateral_asset_id,json=collateralAssetId,proto3" json:"collateral_asset_id,omitempty" yaml:"collateral_asset_id"` + DebtAssetId uint64 `protobuf:"varint,2,opt,name=debt_asset_id,json=debtAssetId,proto3" json:"debt_asset_id,omitempty" yaml:"debt_asset_id"` + BidValue github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=bid_value,json=bidValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bid_value" yaml:"bid_value"` + MaxDiscount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=max_discount,json=maxDiscount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_discount" yaml:"max_discount"` + CollateralAssetDenom string `protobuf:"bytes,5,opt,name=collateral_asset_denom,json=collateralAssetDenom,proto3" json:"collateral_asset_denom,omitempty" yaml:"collateral_asset_denom"` + DebtAssetDenom string `protobuf:"bytes,6,opt,name=debt_asset_denom,json=debtAssetDenom,proto3" json:"debt_asset_denom,omitempty" yaml:"debt_asset_denom"` + UserBidValue github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=user_bid_value,json=userBidValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"user_bid_value" yaml:"user_bid_value"` +} + +func (m *LimitBidProtocolDataWithUserForQuery) Reset() { *m = LimitBidProtocolDataWithUserForQuery{} } +func (m *LimitBidProtocolDataWithUserForQuery) String() string { return proto.CompactTextString(m) } +func (*LimitBidProtocolDataWithUserForQuery) ProtoMessage() {} +func (*LimitBidProtocolDataWithUserForQuery) Descriptor() ([]byte, []int) { + return fileDescriptor_8ee47f5a405fa8ba, []int{5} +} +func (m *LimitBidProtocolDataWithUserForQuery) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LimitBidProtocolDataWithUserForQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LimitBidProtocolDataWithUserForQuery.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LimitBidProtocolDataWithUserForQuery) XXX_Merge(src proto.Message) { + xxx_messageInfo_LimitBidProtocolDataWithUserForQuery.Merge(m, src) +} +func (m *LimitBidProtocolDataWithUserForQuery) XXX_Size() int { + return m.Size() +} +func (m *LimitBidProtocolDataWithUserForQuery) XXX_DiscardUnknown() { + xxx_messageInfo_LimitBidProtocolDataWithUserForQuery.DiscardUnknown(m) +} + +var xxx_messageInfo_LimitBidProtocolDataWithUserForQuery proto.InternalMessageInfo + +func (m *LimitBidProtocolDataWithUserForQuery) GetCollateralAssetId() uint64 { + if m != nil { + return m.CollateralAssetId + } + return 0 +} + +func (m *LimitBidProtocolDataWithUserForQuery) GetDebtAssetId() uint64 { + if m != nil { + return m.DebtAssetId + } + return 0 +} + +func (m *LimitBidProtocolDataWithUserForQuery) GetCollateralAssetDenom() string { + if m != nil { + return m.CollateralAssetDenom + } + return "" +} + +func (m *LimitBidProtocolDataWithUserForQuery) GetDebtAssetDenom() string { + if m != nil { + return m.DebtAssetDenom + } + return "" +} + func init() { proto.RegisterType((*AuctionHistorical)(nil), "comdex.auctionsV2.v1beta1.AuctionHistorical") proto.RegisterType((*Auction)(nil), "comdex.auctionsV2.v1beta1.Auction") proto.RegisterType((*BidOwnerMapping)(nil), "comdex.auctionsV2.v1beta1.bidOwnerMapping") proto.RegisterType((*LimitBidProtocolData)(nil), "comdex.auctionsV2.v1beta1.LimitBidProtocolData") proto.RegisterType((*LimitBidProtocolDataForQuery)(nil), "comdex.auctionsV2.v1beta1.LimitBidProtocolDataForQuery") + proto.RegisterType((*LimitBidProtocolDataWithUserForQuery)(nil), "comdex.auctionsV2.v1beta1.LimitBidProtocolDataWithUserForQuery") } func init() { @@ -417,78 +489,81 @@ func init() { } var fileDescriptor_8ee47f5a405fa8ba = []byte{ - // 1133 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0xcf, 0x4f, 0x1b, 0x47, - 0x14, 0x66, 0x09, 0x10, 0x3c, 0x86, 0x18, 0x6f, 0x08, 0x18, 0x13, 0xbc, 0x66, 0xa4, 0x26, 0xa8, - 0x12, 0xb6, 0x92, 0xe6, 0x54, 0xf5, 0xc2, 0x16, 0xaa, 0xb8, 0x4a, 0x93, 0x74, 0x8b, 0x48, 0xd5, - 0x8b, 0x35, 0xbb, 0x33, 0x98, 0x11, 0xeb, 0x9d, 0xad, 0x77, 0x4c, 0xe0, 0x4f, 0xe8, 0xa5, 0xe2, - 0xd4, 0xaa, 0x52, 0x6f, 0xfd, 0x67, 0x72, 0x4c, 0x6f, 0x55, 0x0f, 0xdb, 0x0a, 0xfe, 0x80, 0x4a, - 0x7b, 0xec, 0xa9, 0x9a, 0x1f, 0xeb, 0x5d, 0xff, 0x40, 0xa9, 0xab, 0xf6, 0xd6, 0x13, 0x9e, 0x99, - 0xf7, 0xbe, 0xf7, 0xed, 0xf7, 0xbe, 0x7d, 0xb3, 0x80, 0x87, 0x1e, 0xeb, 0x62, 0x72, 0xde, 0x44, - 0x7d, 0x8f, 0x53, 0x16, 0x44, 0x47, 0x8f, 0x9b, 0x67, 0x8f, 0x5c, 0xc2, 0xd1, 0xa3, 0x74, 0xab, - 0x11, 0xf6, 0x18, 0x67, 0xe6, 0x86, 0x0a, 0x6c, 0x64, 0x81, 0x0d, 0x1d, 0x58, 0x5d, 0xed, 0xb0, - 0x0e, 0x93, 0x51, 0x4d, 0xf1, 0x4b, 0x25, 0x54, 0xad, 0x0e, 0x63, 0x1d, 0x9f, 0x34, 0xe5, 0xca, - 0xed, 0x1f, 0x37, 0x39, 0xed, 0x92, 0x88, 0xa3, 0x6e, 0xa8, 0x03, 0x6a, 0x1e, 0x8b, 0xba, 0x2c, - 0x6a, 0xba, 0x28, 0x22, 0x83, 0xa2, 0x1e, 0xa3, 0xba, 0x62, 0x75, 0x57, 0x53, 0xf3, 0xe9, 0xd7, - 0x7d, 0x8a, 0xd1, 0x28, 0xbd, 0x74, 0x9b, 0xa8, 0x70, 0xf8, 0xd3, 0x2c, 0x28, 0xef, 0x29, 0x72, - 0x4f, 0x69, 0xc4, 0x59, 0x8f, 0x7a, 0xc8, 0x37, 0x9f, 0x00, 0xa0, 0x19, 0xb7, 0x29, 0xae, 0x18, - 0x75, 0x63, 0x67, 0xce, 0xbe, 0x97, 0xc4, 0x56, 0xf9, 0x02, 0x75, 0xfd, 0x0f, 0x61, 0x76, 0x06, - 0x9d, 0x82, 0x5e, 0xb4, 0xb0, 0x19, 0x02, 0x33, 0x3d, 0x39, 0x19, 0x60, 0x55, 0x66, 0xeb, 0xc6, - 0x4e, 0xf1, 0x31, 0x6c, 0xdc, 0xa8, 0x44, 0x43, 0xd7, 0xb7, 0xb7, 0x92, 0xd8, 0xda, 0x18, 0xae, - 0x90, 0xe1, 0x40, 0xa7, 0x8c, 0xc6, 0x78, 0x1e, 0x83, 0x25, 0x9f, 0x79, 0xa7, 0x04, 0xb7, 0xcf, - 0x50, 0xdf, 0xe7, 0x95, 0x5b, 0xb2, 0xd6, 0xfb, 0x69, 0xad, 0x61, 0x0d, 0x06, 0xf5, 0x9e, 0xc9, - 0x94, 0x23, 0x91, 0x61, 0xaf, 0x27, 0xb1, 0x75, 0x57, 0xd5, 0xcc, 0x23, 0x41, 0xa7, 0xe8, 0x67, - 0x51, 0xf0, 0xe7, 0x65, 0x70, 0x5b, 0xb3, 0xfc, 0x87, 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 0xa3, 0x11, 0xd0, 0xb9, 0x33, 0xd0, 0x59, 0xc2, 0xd8, 0xcf, 0xdf, 0x5c, 0xd5, 0x8c, - 0xb7, 0x57, 0x35, 0xe3, 0xf7, 0xab, 0x9a, 0x71, 0x79, 0x5d, 0x9b, 0x79, 0x7b, 0x5d, 0x9b, 0xf9, - 0xe5, 0xba, 0x36, 0xf3, 0xd5, 0x93, 0x21, 0x15, 0xc4, 0x57, 0xd0, 0x2e, 0x3b, 0x3e, 0xa6, 0x1e, - 0x45, 0xbe, 0x5e, 0x37, 0x87, 0xfe, 0x9b, 0x91, 0xba, 0xb8, 0x0b, 0xf2, 0xa2, 0xf9, 0xe0, 0xaf, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x1a, 0x6b, 0xfb, 0xef, 0x0c, 0x00, 0x00, + // 1180 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0x8e, 0xd3, 0x24, 0xcd, 0xce, 0x26, 0xdd, 0xac, 0x9b, 0x26, 0x9b, 0x4d, 0xb3, 0xde, 0x8c, + 0xa0, 0x8d, 0x90, 0xb2, 0xab, 0x96, 0x9e, 0x10, 0x97, 0x98, 0x04, 0xba, 0xa8, 0xb4, 0xc5, 0x84, + 0x04, 0x71, 0x59, 0x8d, 0xed, 0xc9, 0x66, 0x14, 0xaf, 0xc7, 0xd8, 0xb3, 0x69, 0xf2, 0x27, 0x70, + 0xa9, 0x72, 0x02, 0x21, 0x71, 0xe3, 0x9f, 0xe9, 0xb1, 0xdc, 0x10, 0x07, 0x83, 0x92, 0x3f, 0x00, + 0xc9, 0x47, 0x4e, 0x68, 0x7e, 0x78, 0xed, 0xfd, 0x11, 0x95, 0x45, 0x70, 0xa2, 0xa7, 0xec, 0xbc, + 0x79, 0xf3, 0xbd, 0xcf, 0xdf, 0xfb, 0xfc, 0xc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0xfa, 0x57, 0x00, 0x44, 0x0c, 0x85, 0xac, + 0xcd, 0xe7, 0x74, 0xa5, 0x28, 0xde, 0xa1, 0x6a, 0x43, 0x0e, 0xf1, 0x46, 0x3a, 0xc4, 0x1b, 0xfb, + 0xe9, 0x10, 0x37, 0x37, 0xd4, 0x4b, 0xa4, 0xa6, 0x45, 0x76, 0x16, 0x5e, 0xfc, 0x66, 0x68, 0x56, + 0x41, 0x04, 0x78, 0xba, 0x6e, 0x81, 0x79, 0xec, 0xbb, 0x12, 0x77, 0xe1, 0x8d, 0xb8, 0xeb, 0x0a, + 0xb7, 0x24, 0x71, 0xd3, 0x93, 0x12, 0xf5, 0x26, 0xf6, 0x5d, 0x81, 0xb9, 0x05, 0xe6, 0x50, 0x10, + 0xf0, 0x07, 0x5d, 0x14, 0x0f, 0x5a, 0x4e, 0x62, 0x63, 0x51, 0xbd, 0x56, 0x22, 0x0e, 0xad, 0x59, + 0x14, 0x04, 0x2d, 0x57, 0x6f, 0x81, 0x85, 0xd4, 0x6f, 0x5c, 0xea, 0xca, 0xad, 0xba, 0xb6, 0x35, + 0x6f, 0xde, 0xbb, 0x8c, 0x8d, 0xa2, 0x32, 0xda, 0xfe, 0x79, 0x80, 0xb3, 0xe1, 0x99, 0x4f, 0x86, + 0x56, 0x11, 0x65, 0x39, 0xfa, 0x53, 0x70, 0x3b, 0x67, 0x45, 0x14, 0x45, 0x58, 0x48, 0x5d, 0x12, + 0x0c, 0x6a, 0x49, 0x6c, 0x54, 0x47, 0xa6, 0x5b, 0x9a, 0x04, 0xad, 0x72, 0x16, 0xdd, 0xe1, 0xc1, + 0x96, 0xab, 0x7f, 0x08, 0x16, 0x85, 0x83, 0xfa, 0x48, 0x4b, 0x02, 0xa9, 0x92, 0xc4, 0xc6, 0xb2, + 0x44, 0x1a, 0xd8, 0x86, 0x56, 0x91, 0xaf, 0xd3, 0xd3, 0xc7, 0x60, 0xc1, 0xa6, 0x7e, 0x2f, 0x52, + 0xb3, 0xaa, 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 0xeb, 0x87, 0x60, 0x65, 0x44, 0x33, 0x17, + 0xfb, 0xb4, 0x5b, 0x99, 0x15, 0x35, 0x37, 0x93, 0xd8, 0xd8, 0xb8, 0x46, 0x5b, 0x91, 0x07, 0xad, + 0xe5, 0x21, 0x79, 0x77, 0x79, 0x58, 0xdf, 0x03, 0x4b, 0x39, 0x09, 0x25, 0xe4, 0x9c, 0x80, 0x5c, + 0xcf, 0xbe, 0xfe, 0x86, 0x33, 0xa0, 0x75, 0xab, 0xaf, 0xb3, 0x80, 0x81, 0x2f, 0x67, 0xc1, 0x3b, + 0xe3, 0x9c, 0x71, 0x48, 0xd8, 0xf1, 0x97, 0x11, 0x0e, 0xdf, 0x3a, 0xe4, 0x7f, 0xee, 0x10, 0xbd, + 0x0b, 0x6e, 0xf5, 0x22, 0x1c, 0xb6, 0x33, 0xbd, 0xe5, 0x27, 0xea, 0x27, 0x13, 0xeb, 0x7d, 0x47, + 0x96, 0x1c, 0x44, 0x83, 0xd6, 0x02, 0x0f, 0x98, 0x4a, 0x78, 0xf3, 0xe9, 0xab, 0xcb, 0x9a, 0xf6, + 0xfa, 0xb2, 0xa6, 0xfd, 0x7e, 0x59, 0xd3, 0x2e, 0xae, 0x6a, 0x53, 0xaf, 0xaf, 0x6a, 0x53, 0xbf, + 0x5c, 0xd5, 0xa6, 0xbe, 0x7e, 0x34, 0x50, 0x88, 0x7f, 0x96, 0x6f, 0xd3, 0xa3, 0x23, 0xe2, 0x10, + 0xe4, 0xa9, 0x75, 0x73, 0xe0, 0xdf, 0x6b, 0x51, 0xda, 0x9e, 0x13, 0x5f, 0x3e, 0xef, 0xff, 0x15, + 0x00, 0x00, 0xff, 0xff, 0xf2, 0xe9, 0x68, 0x5d, 0x80, 0x0f, 0x00, 0x00, } func (m *AuctionHistorical) Marshal() (dAtA []byte, err error) { @@ -867,6 +942,83 @@ func (m *LimitBidProtocolDataForQuery) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *LimitBidProtocolDataWithUserForQuery) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LimitBidProtocolDataWithUserForQuery) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LimitBidProtocolDataWithUserForQuery) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.UserBidValue.Size() + i -= size + if _, err := m.UserBidValue.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.DebtAssetDenom) > 0 { + i -= len(m.DebtAssetDenom) + copy(dAtA[i:], m.DebtAssetDenom) + i = encodeVarintAuction(dAtA, i, uint64(len(m.DebtAssetDenom))) + i-- + dAtA[i] = 0x32 + } + if len(m.CollateralAssetDenom) > 0 { + i -= len(m.CollateralAssetDenom) + copy(dAtA[i:], m.CollateralAssetDenom) + i = encodeVarintAuction(dAtA, i, uint64(len(m.CollateralAssetDenom))) + i-- + dAtA[i] = 0x2a + } + { + size := m.MaxDiscount.Size() + i -= size + if _, err := m.MaxDiscount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.BidValue.Size() + i -= size + if _, err := m.BidValue.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.DebtAssetId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.DebtAssetId)) + i-- + dAtA[i] = 0x10 + } + if m.CollateralAssetId != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.CollateralAssetId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintAuction(dAtA []byte, offset int, v uint64) int { offset -= sovAuction(v) base := offset @@ -1014,6 +1166,35 @@ func (m *LimitBidProtocolDataForQuery) Size() (n int) { return n } +func (m *LimitBidProtocolDataWithUserForQuery) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CollateralAssetId != 0 { + n += 1 + sovAuction(uint64(m.CollateralAssetId)) + } + if m.DebtAssetId != 0 { + n += 1 + sovAuction(uint64(m.DebtAssetId)) + } + l = m.BidValue.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.MaxDiscount.Size() + n += 1 + l + sovAuction(uint64(l)) + l = len(m.CollateralAssetDenom) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + l = len(m.DebtAssetDenom) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } + l = m.UserBidValue.Size() + n += 1 + l + sovAuction(uint64(l)) + return n +} + func sovAuction(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2158,6 +2339,260 @@ func (m *LimitBidProtocolDataForQuery) Unmarshal(dAtA []byte) error { } return nil } +func (m *LimitBidProtocolDataWithUserForQuery) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LimitBidProtocolDataWithUserForQuery: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LimitBidProtocolDataWithUserForQuery: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralAssetId", wireType) + } + m.CollateralAssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CollateralAssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtAssetId", wireType) + } + m.DebtAssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DebtAssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BidValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxDiscount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxDiscount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralAssetDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CollateralAssetDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebtAssetDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DebtAssetDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UserBidValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + 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 ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.UserBidValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipAuction(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index 2517f34f1..a2cef7e84 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -960,6 +960,116 @@ func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) GetPagination() *quer return nil } +type QueryLimitBidProtocolDataWithUserRequest struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryLimitBidProtocolDataWithUserRequest) Reset() { + *m = QueryLimitBidProtocolDataWithUserRequest{} +} +func (m *QueryLimitBidProtocolDataWithUserRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLimitBidProtocolDataWithUserRequest) ProtoMessage() {} +func (*QueryLimitBidProtocolDataWithUserRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{18} +} +func (m *QueryLimitBidProtocolDataWithUserRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLimitBidProtocolDataWithUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLimitBidProtocolDataWithUserRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLimitBidProtocolDataWithUserRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLimitBidProtocolDataWithUserRequest.Merge(m, src) +} +func (m *QueryLimitBidProtocolDataWithUserRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLimitBidProtocolDataWithUserRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLimitBidProtocolDataWithUserRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLimitBidProtocolDataWithUserRequest proto.InternalMessageInfo + +func (m *QueryLimitBidProtocolDataWithUserRequest) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *QueryLimitBidProtocolDataWithUserRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryLimitBidProtocolDataWithUserResponse struct { + LimitBidProtocolDataWithUser []LimitBidProtocolDataWithUserForQuery `protobuf:"bytes,1,rep,name=limit_bid_protocol_data_with_user,json=limitBidProtocolDataWithUser,proto3" json:"limit_bid_protocol_data_with_user" yaml:"limit_bid_protocol_data_with_user"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryLimitBidProtocolDataWithUserResponse) Reset() { + *m = QueryLimitBidProtocolDataWithUserResponse{} +} +func (m *QueryLimitBidProtocolDataWithUserResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryLimitBidProtocolDataWithUserResponse) ProtoMessage() {} +func (*QueryLimitBidProtocolDataWithUserResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{19} +} +func (m *QueryLimitBidProtocolDataWithUserResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLimitBidProtocolDataWithUserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLimitBidProtocolDataWithUserResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryLimitBidProtocolDataWithUserResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLimitBidProtocolDataWithUserResponse.Merge(m, src) +} +func (m *QueryLimitBidProtocolDataWithUserResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLimitBidProtocolDataWithUserResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLimitBidProtocolDataWithUserResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLimitBidProtocolDataWithUserResponse proto.InternalMessageInfo + +func (m *QueryLimitBidProtocolDataWithUserResponse) GetLimitBidProtocolDataWithUser() []LimitBidProtocolDataWithUserForQuery { + if m != nil { + return m.LimitBidProtocolDataWithUser + } + return nil +} + +func (m *QueryLimitBidProtocolDataWithUserResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryParamsResponse") @@ -979,6 +1089,8 @@ func init() { proto.RegisterType((*QueryLimitBidProtocolDataResponse)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidProtocolDataResponse") proto.RegisterType((*QueryAuctionFeesCollectionFromLimitBidTxRequest)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionFeesCollectionFromLimitBidTxRequest") proto.RegisterType((*QueryAuctionFeesCollectionFromLimitBidTxResponse)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionFeesCollectionFromLimitBidTxResponse") + proto.RegisterType((*QueryLimitBidProtocolDataWithUserRequest)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidProtocolDataWithUserRequest") + proto.RegisterType((*QueryLimitBidProtocolDataWithUserResponse)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidProtocolDataWithUserResponse") } func init() { @@ -986,91 +1098,98 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 1335 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xcf, 0xd8, 0xfe, 0xe6, 0xc7, 0xa4, 0xc9, 0xb7, 0x99, 0xfc, 0x72, 0x4c, 0x6b, 0x27, 0x13, - 0x48, 0xd3, 0x96, 0x78, 0x93, 0x34, 0x55, 0x51, 0x21, 0xad, 0x62, 0xda, 0x42, 0x0a, 0x2a, 0x61, - 0x95, 0xb6, 0x12, 0x52, 0xb1, 0xd6, 0xde, 0x89, 0xb3, 0xea, 0xda, 0xe3, 0xee, 0xae, 0xab, 0x58, - 0x51, 0x0e, 0x70, 0x05, 0x89, 0x4a, 0x48, 0x3d, 0x71, 0x43, 0x42, 0x1c, 0x38, 0x71, 0xe0, 0x0f, - 0xe0, 0x80, 0x2a, 0x4e, 0x91, 0xb8, 0x20, 0x0e, 0x16, 0x4a, 0x40, 0x9c, 0x10, 0x52, 0x0e, 0x5c, - 0xb8, 0xa0, 0x9d, 0x7d, 0x6b, 0x7b, 0xdd, 0xb5, 0x77, 0x53, 0xb9, 0xe5, 0x14, 0xef, 0xee, 0x9b, - 0xf7, 0x3e, 0x9f, 0xf7, 0x79, 0x33, 0xef, 0x4d, 0xf0, 0x2b, 0x79, 0x5e, 0x54, 0xd9, 0x8e, 0xa4, - 0x54, 0xf2, 0x96, 0xc6, 0x4b, 0xe6, 0x9d, 0x65, 0xe9, 0xe1, 0x52, 0x8e, 0x59, 0xca, 0x92, 0xf4, - 0xa0, 0xc2, 0x8c, 0x6a, 0xba, 0x6c, 0x70, 0x8b, 0x93, 0x29, 0xc7, 0x2c, 0xdd, 0x30, 0x4b, 0x83, - 0x59, 0x62, 0xac, 0xc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ae, 0x2a, 0x45, 0xfd, 0x32, - 0x05, 0x4b, 0x2a, 0xbb, 0xae, 0xe8, 0xb7, 0xc8, 0x1b, 0xce, 0x4d, 0x17, 0x99, 0xc1, 0x27, 0x5c, - 0xfc, 0x56, 0xb5, 0xcc, 0x80, 0xc1, 0x20, 0xbc, 0xdb, 0xac, 0x96, 0x59, 0x7b, 0x0e, 0xe4, 0x1e, - 0xc6, 0x8d, 0x5a, 0x88, 0x47, 0x05, 0xdc, 0xb9, 0xb4, 0x53, 0x38, 0x69, 0xbb, 0x70, 0xd2, 0x4e, - 0x81, 0x36, 0x12, 0x5b, 0x60, 0x10, 0x38, 0x33, 0x7e, 0x54, 0x4b, 0x8d, 0x38, 0x70, 0x1b, 0x3e, - 0xa8, 0xdc, 0xe4, 0x90, 0xee, 0x23, 0x3c, 0xde, 0x02, 0x1a, 0x92, 0x74, 0x17, 0xf7, 0xbb, 0xd9, - 0x88, 0xa3, 0xe9, 0x68, 0xc8, 0x2c, 0x4d, 0x42, 0x96, 0xfe, 0xef, 0xc9, 0x92, 0x49, 0xe5, 0xba, - 0x33, 0xf2, 0xa1, 0x87, 0x51, 0x44, 0x30, 0x3a, 0x13, 0xc8, 0xc8, 0x41, 0x15, 0x86, 0xd2, 0x97, - 0x08, 0x9f, 0x14, 0x94, 0x32, 0x9a, 0x5a, 0xd7, 0x60, 0x02, 0xf7, 0xe6, 0x34, 0x55, 0x65, 0x86, - 0xc8, 0xfe, 0x80, 0x0c, 0x4f, 0xff, 0x5d, 0xe2, 0xff, 0x40, 0x78, 0xa4, 0x09, 0x25, 0x24, 0xfd, - 0xac, 0x17, 0x66, 0x66, 0xe4, 0xa8, 0x96, 0x1a, 0x72, 0x1c, 0x39, 0xef, 0x69, 0x1d, 0xf9, 0x5b, - 0x38, 0x96, 0xd3, 0x54, 0x33, 0x1e, 0x11, 0xda, 0x24, 0x3b, 0x68, 0x93, 0xd1, 0xd4, 0xcc, 0x28, - 0xe8, 0x32, 0x58, 0x77, 0x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0xb5, - 0xd3, 0x4e, 0x0b, 0x6c, 0x9f, 0x99, 0x5b, 0x4f, 0x0e, 0x92, 0x68, 0xff, 0x20, 0x89, 0x7e, 0x3d, - 0x48, 0xa2, 0x47, 0x87, 0xc9, 0x9e, 0xfd, 0xc3, 0x64, 0xcf, 0xcf, 0x87, 0xc9, 0x9e, 0x0f, 0x56, - 0x3c, 0xd7, 0x29, 0x3b, 0xc4, 0x02, 0xdf, 0xda, 0xd2, 0xf2, 0x9a, 0xa2, 0xbb, 0x21, 0x3d, 0xff, - 0xe3, 0x13, 0x17, 0xac, 0x5c, 0xaf, 0x48, 0xee, 0x85, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x65, - 0x7d, 0x8a, 0x3d, 0xf8, 0x14, 0x00, 0x00, + // 1442 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x4f, 0x6c, 0xdc, 0xc4, + 0x17, 0xce, 0x6c, 0xf2, 0x4b, 0x9b, 0x97, 0xa6, 0x6d, 0x26, 0x69, 0x9a, 0xfa, 0x97, 0xee, 0x26, + 0x53, 0x48, 0xd3, 0x96, 0xac, 0xd3, 0xb4, 0x55, 0x51, 0xa1, 0x2d, 0xdd, 0xfe, 0x81, 0x14, 0x54, + 0x8a, 0x95, 0xb6, 0x12, 0x52, 0xb1, 0xbc, 0x6b, 0x67, 0x63, 0xd5, 0xbb, 0xb3, 0xb5, 0x9d, 0xd2, + 0x28, 0xca, 0x01, 0xae, 0x20, 0x51, 0x09, 0xa9, 0x27, 0x2e, 0x08, 0x09, 0x21, 0xc4, 0x89, 0x23, + 0x47, 0x0e, 0xa8, 0xe2, 0x14, 0x89, 0x0b, 0xe2, 0xb0, 0x42, 0x2d, 0x88, 0x13, 0x42, 0xe4, 0xc0, + 0x85, 0x0b, 0xf2, 0xf8, 0x79, 0x77, 0xbd, 0xf5, 0xda, 0x4e, 0xd9, 0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0xb2, 0xf1, 0x30, 0x4b, 0x7e, 0x7e, 0x98, 0x25, 0xf7, 0x1e, 0x65, 0x7b, + 0x36, 0x1e, 0x65, 0x7b, 0x7e, 0x7c, 0x94, 0xed, 0x79, 0xfb, 0x78, 0xe8, 0x17, 0x03, 0x2f, 0xc6, + 0x2c, 0x5f, 0x5a, 0x32, 0x4b, 0xa6, 0x66, 0x05, 0x31, 0x43, 0x3f, 0x63, 0x8b, 0xdf, 0x10, 0x8a, + 0xfd, 0x22, 0xe2, 0xb1, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x96, 0x76, 0x79, 0xdb, 0x17, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1094,6 +1213,7 @@ type QueryClient interface { LimitBids(ctx context.Context, in *QueryLimitBidsRequest, opts ...grpc.CallOption) (*QueryLimitBidsResponse, error) LimitBidProtocolData(ctx context.Context, in *QueryLimitBidProtocolDataRequest, opts ...grpc.CallOption) (*QueryLimitBidProtocolDataResponse, error) AuctionFeesCollectionData(ctx context.Context, in *QueryAuctionFeesCollectionFromLimitBidTxRequest, opts ...grpc.CallOption) (*QueryAuctionFeesCollectionFromLimitBidTxResponse, error) + LimitBidProtocolDataWithUser(ctx context.Context, in *QueryLimitBidProtocolDataWithUserRequest, opts ...grpc.CallOption) (*QueryLimitBidProtocolDataWithUserResponse, error) } type queryClient struct { @@ -1185,6 +1305,15 @@ func (c *queryClient) AuctionFeesCollectionData(ctx context.Context, in *QueryAu return out, nil } +func (c *queryClient) LimitBidProtocolDataWithUser(ctx context.Context, in *QueryLimitBidProtocolDataWithUserRequest, opts ...grpc.CallOption) (*QueryLimitBidProtocolDataWithUserResponse, error) { + out := new(QueryLimitBidProtocolDataWithUserResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/LimitBidProtocolDataWithUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) @@ -1196,6 +1325,7 @@ type QueryServer interface { LimitBids(context.Context, *QueryLimitBidsRequest) (*QueryLimitBidsResponse, error) LimitBidProtocolData(context.Context, *QueryLimitBidProtocolDataRequest) (*QueryLimitBidProtocolDataResponse, error) AuctionFeesCollectionData(context.Context, *QueryAuctionFeesCollectionFromLimitBidTxRequest) (*QueryAuctionFeesCollectionFromLimitBidTxResponse, error) + LimitBidProtocolDataWithUser(context.Context, *QueryLimitBidProtocolDataWithUserRequest) (*QueryLimitBidProtocolDataWithUserResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1229,6 +1359,9 @@ func (*UnimplementedQueryServer) LimitBidProtocolData(ctx context.Context, req * func (*UnimplementedQueryServer) AuctionFeesCollectionData(ctx context.Context, req *QueryAuctionFeesCollectionFromLimitBidTxRequest) (*QueryAuctionFeesCollectionFromLimitBidTxResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AuctionFeesCollectionData not implemented") } +func (*UnimplementedQueryServer) LimitBidProtocolDataWithUser(ctx context.Context, req *QueryLimitBidProtocolDataWithUserRequest) (*QueryLimitBidProtocolDataWithUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LimitBidProtocolDataWithUser not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1396,6 +1529,24 @@ func _Query_AuctionFeesCollectionData_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _Query_LimitBidProtocolDataWithUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLimitBidProtocolDataWithUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LimitBidProtocolDataWithUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Query/LimitBidProtocolDataWithUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LimitBidProtocolDataWithUser(ctx, req.(*QueryLimitBidProtocolDataWithUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.auctionsV2.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -1436,6 +1587,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AuctionFeesCollectionData", Handler: _Query_AuctionFeesCollectionData_Handler, }, + { + MethodName: "LimitBidProtocolDataWithUser", + Handler: _Query_LimitBidProtocolDataWithUser_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/auctionsV2/v1beta1/query.proto", @@ -2211,6 +2366,97 @@ func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) MarshalToSizedBuffer( return len(dAtA) - i, nil } +func (m *QueryLimitBidProtocolDataWithUserRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLimitBidProtocolDataWithUserRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLimitBidProtocolDataWithUserRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryLimitBidProtocolDataWithUserResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryLimitBidProtocolDataWithUserResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLimitBidProtocolDataWithUserResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.LimitBidProtocolDataWithUser) > 0 { + for iNdEx := len(m.LimitBidProtocolDataWithUser) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LimitBidProtocolDataWithUser[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2519,6 +2765,42 @@ func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) Size() (n int) { return n } +func (m *QueryLimitBidProtocolDataWithUserRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLimitBidProtocolDataWithUserResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LimitBidProtocolDataWithUser) > 0 { + for _, e := range m.LimitBidProtocolDataWithUser { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4496,6 +4778,244 @@ func (m *QueryAuctionFeesCollectionFromLimitBidTxResponse) Unmarshal(dAtA []byte } return nil } +func (m *QueryLimitBidProtocolDataWithUserRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLimitBidProtocolDataWithUserRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLimitBidProtocolDataWithUserRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryLimitBidProtocolDataWithUserResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryLimitBidProtocolDataWithUserResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLimitBidProtocolDataWithUserResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitBidProtocolDataWithUser", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LimitBidProtocolDataWithUser = append(m.LimitBidProtocolDataWithUser, LimitBidProtocolDataWithUserForQuery{}) + if err := m.LimitBidProtocolDataWithUser[len(m.LimitBidProtocolDataWithUser)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auctionsV2/types/query.pb.gw.go b/x/auctionsV2/types/query.pb.gw.go index da5cc0813..8f26fbfdf 100644 --- a/x/auctionsV2/types/query.pb.gw.go +++ b/x/auctionsV2/types/query.pb.gw.go @@ -615,6 +615,78 @@ func local_request_Query_AuctionFeesCollectionData_0(ctx context.Context, marsha } +var ( + filter_Query_LimitBidProtocolDataWithUser_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_LimitBidProtocolDataWithUser_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLimitBidProtocolDataWithUserRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LimitBidProtocolDataWithUser_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.LimitBidProtocolDataWithUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_LimitBidProtocolDataWithUser_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLimitBidProtocolDataWithUserRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LimitBidProtocolDataWithUser_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.LimitBidProtocolDataWithUser(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -828,6 +900,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_LimitBidProtocolDataWithUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_LimitBidProtocolDataWithUser_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_LimitBidProtocolDataWithUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1049,6 +1144,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_LimitBidProtocolDataWithUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_LimitBidProtocolDataWithUser_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_LimitBidProtocolDataWithUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1070,6 +1185,8 @@ var ( pattern_Query_LimitBidProtocolData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "auctions", "v2", "limit_bid_protocol_data"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AuctionFeesCollectionData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "auctions", "v2", "auction_fees_collection_from_limit_bid_tx"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_LimitBidProtocolDataWithUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "auctions", "v2", "limit_bid_protocol_data_with_user", "bidder"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1090,4 +1207,6 @@ var ( forward_Query_LimitBidProtocolData_0 = runtime.ForwardResponseMessage forward_Query_AuctionFeesCollectionData_0 = runtime.ForwardResponseMessage + + forward_Query_LimitBidProtocolDataWithUser_0 = runtime.ForwardResponseMessage ) From 57ec7e0bf61b59259616e7c9d15cec28491d4ef9 Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 4 Aug 2023 10:46:00 +0530 Subject: [PATCH 140/155] remove faulty auctions for commodo added --- app/app.go | 2 +- app/upgrades/mainnet/v12/upgrades.go | 69 ++++++++++++++++++++++++++-- x/lend/keeper/borrow.go | 17 +++++++ 3 files changed, 84 insertions(+), 4 deletions(-) diff --git a/app/app.go b/app/app.go index 874e9663c..3ceec3de0 100644 --- a/app/app.go +++ b/app/app.go @@ -1454,7 +1454,7 @@ func (a *App) registerUpgradeHandlers() { case upgradeInfo.Name == mv12.UpgradeName: a.UpgradeKeeper.SetUpgradeHandler( mv12.UpgradeName, - mv12.CreateUpgradeHandlerV12(a.mm, a.configurator, a.ICQKeeper, a.NewliqKeeper, a.NewaucKeeper,a.BankKeeper,a.CollectorKeeper), + mv12.CreateUpgradeHandlerV12(a.mm, a.configurator, a.ICQKeeper, a.NewliqKeeper, a.NewaucKeeper, a.BankKeeper, a.CollectorKeeper, a.LendKeeper, a.AuctionKeeper, a.LiquidationKeeper), ) } diff --git a/app/upgrades/mainnet/v12/upgrades.go b/app/upgrades/mainnet/v12/upgrades.go index 93d20d485..9413c42ce 100644 --- a/app/upgrades/mainnet/v12/upgrades.go +++ b/app/upgrades/mainnet/v12/upgrades.go @@ -1,17 +1,23 @@ package v12 import ( + "fmt" + auctionkeeperold "github.com/comdex-official/comdex/x/auction/keeper" + auctiontypes "github.com/comdex-official/comdex/x/auction/types" auctionkeeper "github.com/comdex-official/comdex/x/auctionsV2/keeper" auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types" + collectorkeeper "github.com/comdex-official/comdex/x/collector/keeper" + lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" + lendtypes "github.com/comdex-official/comdex/x/lend/types" + liquidationkeeperold "github.com/comdex-official/comdex/x/liquidation/keeper" liquidationkeeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper" liquidationtypes "github.com/comdex-official/comdex/x/liquidationsV2/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v4/keeper" icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v4/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - collectorkeeper "github.com/comdex-official/comdex/x/collector/keeper" ) // An error occurred during the creation of the CMST/STJUNO pair, as it was mistakenly created in the Harbor app (ID-2) instead of the cSwap app (ID-1). @@ -28,6 +34,9 @@ func CreateUpgradeHandlerV12( auctionKeeper auctionkeeper.Keeper, bankKeeper bankkeeper.Keeper, collectorKeeper collectorkeeper.Keeper, + lendKeeper lendkeeper.Keeper, + auctionKeeperOld auctionkeeperold.Keeper, + liquidationKeeperOld liquidationkeeperold.Keeper, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info("Applying main net upgrade - v.12.0.0") @@ -42,6 +51,7 @@ func CreateUpgradeHandlerV12( } InitializeStates(ctx, liquidationKeeper, auctionKeeper) Refund(ctx, bankKeeper, collectorKeeper) + ClearFaultyAuctions(ctx, lendKeeper, auctionKeeperOld, liquidationKeeperOld, bankKeeper) return vm, err } } @@ -112,7 +122,60 @@ func InitializeStates( } +func ClearFaultyAuctions( + ctx sdk.Context, + lendKeeper lendkeeper.Keeper, + auctionKeeper auctionkeeperold.Keeper, + liquidationKeeper liquidationkeeperold.Keeper, + bankKeeper bankkeeper.Keeper, +) { + //Send Inflow_token_target_amount to the pool + //Subtract Inflow_token_target_amount from borrow Position + //Add the Borrowed amount in poolLBMapping + //Delete Auction + //Update BorrowPosition Is liquidated -> false + + // get all the current auctions + dutchAuctions := auctionKeeper.GetDutchLendAuctions(ctx, 3) + for _, dutchAuction := range dutchAuctions { + cPoolModuleName := lendtypes.ModuleAcc1 + reserveModuleName := lendtypes.ModuleName + //send debt from reserve to the pool + err := bankKeeper.SendCoinsFromModuleToModule(ctx, reserveModuleName, cPoolModuleName, sdk.NewCoins(dutchAuction.InflowTokenTargetAmount)) + if err != nil { + fmt.Println(err) + } + //send collateral to the reserve from auction module outflow_token_current_amount + err = bankKeeper.SendCoinsFromModuleToModule(ctx, auctiontypes.ModuleName, reserveModuleName, sdk.NewCoins(dutchAuction.OutflowTokenCurrentAmount)) + if err != nil { + fmt.Println(err) + } + + borrowPos := lendKeeper.GetBorrowByUserAndAssetID(ctx, dutchAuction.VaultOwner.String(), dutchAuction.InflowTokenTargetAmount.Denom, dutchAuction.AssetOutId) + borrowPos.AmountOut.Amount = borrowPos.AmountOut.Amount.Sub(dutchAuction.InflowTokenTargetAmount.Amount) + borrowPos.IsLiquidated = false + lendKeeper.SetBorrow(ctx, borrowPos) + + poolAssetLBMappingData, _ := lendKeeper.GetAssetStatsByPoolIDAndAssetID(ctx, 1, dutchAuction.AssetInId) + + poolAssetLBMappingData.TotalBorrowed = poolAssetLBMappingData.TotalBorrowed.Add(borrowPos.AmountOut.Amount) + lendKeeper.SetAssetStatsByPoolIDAndAssetID(ctx, poolAssetLBMappingData) + lockedVault, found := liquidationKeeper.GetLockedVault(ctx, 3, dutchAuction.LockedVaultId) + if found { + liquidationKeeper.DeleteLockedVault(ctx, lockedVault.AppId, lockedVault.LockedVaultId) + } + err = auctionKeeper.SetHistoryDutchLendAuction(ctx, dutchAuction) + if err != nil { + fmt.Println(err) + } + err = auctionKeeper.DeleteDutchLendAuction(ctx, dutchAuction) + if err != nil { + fmt.Println(err) + } + } +} + func newDec(i string) sdk.Dec { dec, _ := sdk.NewDecFromStr(i) return dec -} \ No newline at end of file +} diff --git a/x/lend/keeper/borrow.go b/x/lend/keeper/borrow.go index 27288cb07..14288e855 100644 --- a/x/lend/keeper/borrow.go +++ b/x/lend/keeper/borrow.go @@ -180,3 +180,20 @@ func (k Keeper) DeleteBorrowInterestTracker(ctx sdk.Context, ID uint64) { store.Delete(key) } + +func (k Keeper) GetBorrowByUserAndAssetID(ctx sdk.Context, owner, debtDenom string, assetIn uint64) types.BorrowAsset { + var borrowAsset types.BorrowAsset + mappingData := k.GetUserTotalMappingData(ctx, owner) + for _, data := range mappingData { + lend, _ := k.GetLend(ctx, data.LendId) + if lend.AssetID == assetIn { + for _, borrowID := range data.BorrowId { + borrow, _ := k.GetBorrow(ctx, borrowID) + if borrow.AmountOut.Denom == debtDenom { + borrowAsset = borrow + } + } + } + } + return borrowAsset +} From 919bbc458ec2026c72a5530956f77f5884a23998 Mon Sep 17 00:00:00 2001 From: Pratik Date: Fri, 4 Aug 2023 10:46:29 +0530 Subject: [PATCH 141/155] remove faulty auctions for commodo added --- app/upgrades/mainnet/v12/upgrades.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/upgrades/mainnet/v12/upgrades.go b/app/upgrades/mainnet/v12/upgrades.go index 9413c42ce..bb40350d6 100644 --- a/app/upgrades/mainnet/v12/upgrades.go +++ b/app/upgrades/mainnet/v12/upgrades.go @@ -51,7 +51,7 @@ func CreateUpgradeHandlerV12( } InitializeStates(ctx, liquidationKeeper, auctionKeeper) Refund(ctx, bankKeeper, collectorKeeper) - ClearFaultyAuctions(ctx, lendKeeper, auctionKeeperOld, liquidationKeeperOld, bankKeeper) + RemoveFaultyAuctions(ctx, lendKeeper, auctionKeeperOld, liquidationKeeperOld, bankKeeper) return vm, err } } @@ -122,7 +122,7 @@ func InitializeStates( } -func ClearFaultyAuctions( +func RemoveFaultyAuctions( ctx sdk.Context, lendKeeper lendkeeper.Keeper, auctionKeeper auctionkeeperold.Keeper, From c9925abc302454225d3967a0db385c6a9695a11c Mon Sep 17 00:00:00 2001 From: Chandragupta Singh Date: Fri, 4 Aug 2023 21:28:50 +0530 Subject: [PATCH 142/155] go sum updated --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index 0150bcd9a..79a0866ac 100644 --- a/go.sum +++ b/go.sum @@ -625,8 +625,6 @@ github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmx github.com/coinbase/rosetta-sdk-go v0.7.0/go.mod h1:7nD3oBPIiHqhRprqvMgPoGxe/nyq3yftRmpsy29coWE= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/comdex-official/cosmos-sdk v0.45.9-comdex.4 h1:HamsRfrxsCvkwcHbMT8TDW3u013MmixXqbcCt/doxLo= -github.com/comdex-official/cosmos-sdk v0.45.9-comdex.4/go.mod h1:Z5M4TX7PsHNHlF/1XanI2DIpORQ+Q/st7oaeufEjnvU= github.com/comdex-official/cosmos-sdk v0.45.9-comdex.5 h1:RnRxY6M1baLuV39F5mxHoH8mMh5Y6ZQH92Jp60kROSU= github.com/comdex-official/cosmos-sdk v0.45.9-comdex.5/go.mod h1:Z5M4TX7PsHNHlF/1XanI2DIpORQ+Q/st7oaeufEjnvU= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= From 9fdde5e9033df72f1ca7a1da51418b17c2c6a1e8 Mon Sep 17 00:00:00 2001 From: Pratik Date: Sun, 6 Aug 2023 21:17:29 +0530 Subject: [PATCH 143/155] updating codec typeUrl --- x/auctionsV2/types/codec.go | 8 ++++---- x/liquidationsV2/types/codec.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x/auctionsV2/types/codec.go b/x/auctionsV2/types/codec.go index 462523b7e..35b9c52d6 100644 --- a/x/auctionsV2/types/codec.go +++ b/x/auctionsV2/types/codec.go @@ -10,10 +10,10 @@ import ( ) func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgPlaceMarketBidRequest{}, "comdex/auctions/MsgPlaceMarketBidRequest", nil) - cdc.RegisterConcrete(&MsgDepositLimitBidRequest{}, "comdex/auctions/MsgPlaceLimitBidRequest", nil) - cdc.RegisterConcrete(&MsgCancelLimitBidRequest{}, "comdex/auctions/MsgCancelLimitBidRequest", nil) - cdc.RegisterConcrete(&MsgWithdrawLimitBidRequest{}, "comdex/auctions/MsgWithdrawLimitBidRequest", nil) + cdc.RegisterConcrete(&MsgPlaceMarketBidRequest{}, "comdex/auctionsV2/MsgPlaceMarketBidRequest", nil) + cdc.RegisterConcrete(&MsgDepositLimitBidRequest{}, "comdex/auctionsV2/MsgDepositLimitBidRequest", nil) + cdc.RegisterConcrete(&MsgCancelLimitBidRequest{}, "comdex/auctionsV2/MsgCancelLimitBidRequest", nil) + cdc.RegisterConcrete(&MsgWithdrawLimitBidRequest{}, "comdex/auctionsV2/MsgWithdrawLimitBidRequest", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { diff --git a/x/liquidationsV2/types/codec.go b/x/liquidationsV2/types/codec.go index 1671938a1..493ba95f1 100644 --- a/x/liquidationsV2/types/codec.go +++ b/x/liquidationsV2/types/codec.go @@ -12,9 +12,9 @@ import ( ) func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgLiquidateInternalKeeperRequest{}, "comdex/liquidation/MsgLiquidateInternalKeeperRequest", nil) - cdc.RegisterConcrete(&MsgAppReserveFundsRequest{}, "comdex/liquidation/MsgAppReserveFundsRequest", nil) - cdc.RegisterConcrete(&MsgLiquidateExternalKeeperRequest{}, "comdex/liquidation/MsgLiquidateExternalKeeperRequest", nil) + cdc.RegisterConcrete(&MsgLiquidateInternalKeeperRequest{}, "comdex/liquidationsV2/MsgLiquidateInternalKeeperRequest", nil) + cdc.RegisterConcrete(&MsgAppReserveFundsRequest{}, "comdex/liquidationsV2/MsgAppReserveFundsRequest", nil) + cdc.RegisterConcrete(&MsgLiquidateExternalKeeperRequest{}, "comdex/liquidationsV2/MsgLiquidateExternalKeeperRequest", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { From 0f4531121cab03f16f22ae113bcf5fc314d2482b Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 8 Aug 2023 16:32:03 +0530 Subject: [PATCH 144/155] updating bids query --- proto/comdex/auctionsV2/v1beta1/query.proto | 5 +- x/auctionsV2/client/cli/query.go | 12 +- x/auctionsV2/keeper/grpc_query.go | 15 +- x/auctionsV2/types/query.pb.go | 227 +++++++++++--------- 4 files changed, 152 insertions(+), 107 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index c727f6297..3863cdcd8 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -44,8 +44,9 @@ message QueryAuctionsResponse { message QueryBidsRequest { string bidder = 1; - bool history = 2; - cosmos.base.query.v1beta1.PageRequest pagination = 3 + uint64 bid_type = 2; + bool history = 3; + cosmos.base.query.v1beta1.PageRequest pagination = 4 [(gogoproto.moretags) = "yaml:\"pagination\""]; } diff --git a/x/auctionsV2/client/cli/query.go b/x/auctionsV2/client/cli/query.go index c5195251a..3d537db19 100644 --- a/x/auctionsV2/client/cli/query.go +++ b/x/auctionsV2/client/cli/query.go @@ -122,9 +122,9 @@ func queryAuctions() *cobra.Command { func queryBids() *cobra.Command { cmd := &cobra.Command{ - Use: "bids [bidder] [history]", + Use: "bids [bidder] [bid-type] [history]", Short: "Query bids by bidder address", - Args: cobra.ExactArgs(2), + Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { pagination, err := client.ReadPageRequest(cmd.Flags()) if err != nil { @@ -135,8 +135,11 @@ func queryBids() *cobra.Command { return err } bidder := args[0] - - history, err := strconv.ParseBool(args[1]) + bidType, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + history, err := strconv.ParseBool(args[2]) if err != nil { return err } @@ -145,6 +148,7 @@ func queryBids() *cobra.Command { context.Background(), &types.QueryBidsRequest{ Bidder: bidder, + BidType: bidType, History: history, Pagination: pagination, }, diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index a4b5d6c13..059764a34 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -78,12 +78,12 @@ func (q QueryServer) Auctions(c context.Context, req *types.QueryAuctionsRequest } } else if req.AuctionType == 2 { lockedVault, _ := q.LiquidationsV2.GetLockedVault(ctx, item.AppId, item.LockedVaultId) - if !item.AuctionType && lockedVault.InitiatorType == "surplus" { + if accumulate && !item.AuctionType && lockedVault.InitiatorType == "surplus" { items = append(items, item) } } else if req.AuctionType == 3 { lockedVault, _ := q.LiquidationsV2.GetLockedVault(ctx, item.AppId, item.LockedVaultId) - if !item.AuctionType && lockedVault.InitiatorType == "debt" { + if accumulate && !item.AuctionType && lockedVault.InitiatorType == "debt" { items = append(items, item) } } @@ -124,9 +124,14 @@ func (q QueryServer) Bids(c context.Context, req *types.QueryBidsRequest) (*type if err := q.cdc.Unmarshal(value, &item); err != nil { return false, err } - - if accumulate { - items = append(items, item) + if req.BidType == 1 { + if accumulate && item.BidType == "dutch" { + items = append(items, item) + } + } else if req.BidType == 2 { + if accumulate && item.BidType == "english" { + items = append(items, item) + } } return true, nil diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index a2cef7e84..efb8af505 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -321,8 +321,9 @@ func (m *QueryAuctionsResponse) GetPagination() *query.PageResponse { type QueryBidsRequest struct { Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` - History bool `protobuf:"varint,2,opt,name=history,proto3" json:"history,omitempty"` - Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` + BidType uint64 `protobuf:"varint,2,opt,name=bid_type,json=bidType,proto3" json:"bid_type,omitempty"` + History bool `protobuf:"varint,3,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` } func (m *QueryBidsRequest) Reset() { *m = QueryBidsRequest{} } @@ -365,6 +366,13 @@ func (m *QueryBidsRequest) GetBidder() string { return "" } +func (m *QueryBidsRequest) GetBidType() uint64 { + if m != nil { + return m.BidType + } + return 0 +} + func (m *QueryBidsRequest) GetHistory() bool { if m != nil { return m.History @@ -1098,98 +1106,98 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 1442 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x4f, 0x6c, 0xdc, 0xc4, - 0x17, 0xce, 0x6c, 0xf2, 0x4b, 0x9b, 0x97, 0xa6, 0x6d, 0x26, 0x69, 0x9a, 0xfa, 0x97, 0xee, 0x26, - 0x53, 0x48, 0xd3, 0x96, 0xac, 0xd3, 0xb4, 0x55, 0x51, 0xa1, 0x2d, 0xdd, 0xfe, 0x81, 0x14, 0x54, - 0x8a, 0x95, 0xb6, 0x12, 0x52, 0xb1, 0xbc, 0x6b, 0x67, 0x63, 0xd5, 0xbb, 0xb3, 0xb5, 0x9d, 0xd2, - 0x28, 0xca, 0x01, 0xae, 0x20, 0x51, 0x09, 0xa9, 0x27, 0x2e, 0x08, 0x09, 0x21, 0xc4, 0x89, 0x23, - 0x47, 0x0e, 0xa8, 0xe2, 0x14, 0x89, 0x0b, 0xe2, 0xb0, 0x42, 0x2d, 0x88, 0x13, 0x42, 0xe4, 0xc0, - 0x85, 0x0b, 0xf2, 0xf8, 0x79, 0x77, 0xbd, 0xf5, 0xda, 0x4e, 0xd9, 0x96, 0x53, 0x62, 0xfb, 0xcd, - 0x7b, 0xdf, 0xf7, 0xbe, 0xf7, 0x66, 0xde, 0x2c, 0x3c, 0x5f, 0xe2, 0x15, 0xdd, 0xb8, 0x2b, 0x6b, - 0x2b, 0x25, 0xd7, 0xe4, 0x55, 0xe7, 0xfa, 0xbc, 0x7c, 0xe7, 0x68, 0xd1, 0x70, 0xb5, 0xa3, 0xf2, - 0xed, 0x15, 0xc3, 0x5e, 0xcd, 0xd7,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 0xfd, 0x22, 0xe2, 0xb1, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x96, 0x76, 0x79, 0xdb, 0x17, - 0x00, 0x00, + // 1455 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4d, 0x6c, 0x1b, 0x45, + 0x14, 0xce, 0xd8, 0x21, 0x3f, 0x2f, 0x4d, 0xdb, 0x4c, 0xd2, 0x34, 0x31, 0xa9, 0x9d, 0x4c, 0x21, + 0x4d, 0x5b, 0xe2, 0x4d, 0xd3, 0x56, 0x45, 0x85, 0xb6, 0xd4, 0xfd, 0x81, 0x14, 0x54, 0xca, 0x2a, + 0x6d, 0x25, 0xa4, 0x62, 0xad, 0xbd, 0x1b, 0x67, 0xd5, 0xb5, 0xc7, 0xf5, 0x6e, 0x4a, 0xa3, 0x28, + 0x07, 0xb8, 0x82, 0x44, 0x25, 0xa4, 0x9e, 0xb8, 0x70, 0x41, 0x08, 0x71, 0xe2, 0xc8, 0x81, 0x03, + 0x07, 0x54, 0x71, 0x8a, 0xc4, 0x05, 0x71, 0x88, 0x50, 0x0b, 0xe2, 0x84, 0x10, 0x39, 0x70, 0xe1, + 0x82, 0x76, 0xe6, 0xad, 0xed, 0x75, 0xd7, 0xbb, 0x9b, 0xe2, 0xf4, 0x94, 0xec, 0xee, 0x9b, 0xf7, + 0xbe, 0xef, 0x7d, 0xef, 0xcd, 0xbc, 0x31, 0xbc, 0x58, 0xe4, 0x65, 0xdd, 0xb8, 0xa7, 0x68, 0x2b, + 0x45, 0xc7, 0xe4, 0x15, 0xfb, 0xc6, 0xbc, 0x72, 0xf7, 0x58, 0xc1, 0x70, 0xb4, 0x63, 0xca, 0x9d, + 0x15, 0xa3, 0xb6, 0x9a, 0xad, 0xd6, 0xb8, 0xc3, 0xe9, 0xb8, 0x34, 0xcb, 0x36, 0xcc, 0xb2, 0x68, + 0x96, 0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, 0x17, 0xea, 0xd6, 0x66, 0x66, 0xf7, 0xaa, 0x56, 0xb6, 0x4e, + 0x33, 0xb4, 0x64, 0xaa, 0xe7, 0x8a, 0x7d, 0x43, 0xfc, 0xe1, 0xbc, 0x74, 0xd1, 0x29, 0xd8, 0xe5, + 0xe1, 0x77, 0x56, 0xab, 0x06, 0x32, 0x18, 0xc0, 0x77, 0x8b, 0xab, 0x55, 0xa3, 0x3d, 0x07, 0x7a, + 0x0b, 0xa0, 0x51, 0x0b, 0x63, 0x49, 0x01, 0x77, 0x3a, 0x2b, 0x0b, 0x27, 0xeb, 0x16, 0x4e, 0x56, + 0x16, 0x68, 0x23, 0xb1, 0x25, 0x03, 0x03, 0xe7, 0xf6, 0x6d, 0x6d, 0x66, 0x86, 0x24, 0xdc, 0x86, + 0x0f, 0xa6, 0x36, 0x39, 0x64, 0x1b, 0x04, 0xf6, 0xb5, 0x80, 0xc6, 0x24, 0xdd, 0x84, 0x3e, 0x2f, + 0x1b, 0x63, 0x64, 0x32, 0x19, 0x33, 0x4b, 0xfb, 0x31, 0x4b, 0x7b, 0x7c, 0x59, 0xb2, 0x99, 0x5a, + 0x77, 0x46, 0xdf, 0xf3, 0x31, 0x4a, 0x08, 0x46, 0x87, 0x22, 0x19, 0x49, 0x54, 0x71, 0x28, 0x7d, + 0x47, 0x60, 0xaf, 0xa0, 0x94, 0x33, 0xf5, 0xba, 0x06, 0xa3, 0xd0, 0x53, 0x30, 0x75, 0xdd, 0xa8, + 0x89, 0xec, 0xf7, 0xab, 0xf8, 0x44, 0xc7, 0xa1, 0xaf, 0x60, 0xea, 0x52, 0x97, 0x84, 0xd0, 0xa5, + 0xb7, 0x60, 0xea, 0xad, 0x9a, 0x24, 0xc3, 0x34, 0xe9, 0xee, 0xb4, 0x26, 0x7f, 0x10, 0x18, 0x6a, + 0x22, 0x80, 0x7a, 0x1c, 0xf6, 0x33, 0xc8, 0x0d, 0x6d, 0x6d, 0x66, 0x06, 0xa5, 0x23, 0xf9,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x10, 0x0a, 0x3d, 0x22, 0xe2, + 0xf1, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xef, 0xcd, 0x69, 0x7f, 0xf6, 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1852,7 +1860,7 @@ func (m *QueryBidsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } if m.History { i-- @@ -1862,6 +1870,11 @@ func (m *QueryBidsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- + dAtA[i] = 0x18 + } + if m.BidType != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BidType)) + i-- dAtA[i] = 0x10 } if len(m.Bidder) > 0 { @@ -2562,6 +2575,9 @@ func (m *QueryBidsRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.BidType != 0 { + n += 1 + sovQuery(uint64(m.BidType)) + } if m.History { n += 2 } @@ -3419,6 +3435,25 @@ func (m *QueryBidsRequest) Unmarshal(dAtA []byte) error { m.Bidder = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BidType", wireType) + } + m.BidType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BidType |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) } @@ -3438,7 +3473,7 @@ func (m *QueryBidsRequest) Unmarshal(dAtA []byte) error { } } m.History = bool(v != 0) - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } From e0b7994755672bc2f80328bf254a437710edf29f Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 8 Aug 2023 18:52:39 +0530 Subject: [PATCH 145/155] updating bids query --- proto/comdex/auctionsV2/v1beta1/query.proto | 2 +- x/auctionsV2/types/query.pb.go | 181 ++++++++++---------- x/auctionsV2/types/query.pb.gw.go | 26 ++- 3 files changed, 116 insertions(+), 93 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index 3863cdcd8..2079c8948 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -166,7 +166,7 @@ service Query { option (google.api.http).get = "/comdex/auctions/v2/auctions/{auction_type}/{history}"; } rpc Bids(QueryBidsRequest) returns (QueryBidsResponse) { - option (google.api.http).get = "/comdex/auctions/v2/bids/{bidder}/{history}"; + option (google.api.http).get = "/comdex/auctions/v2/bids/{bidder}/{bid_type}/{history}"; } rpc AuctionParams(QueryAuctionParamsRequest) returns (QueryAuctionParamsResponse) { option (google.api.http).get = "/comdex/auctions/v2/auction_params"; diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index efb8af505..d856f08b5 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -1106,98 +1106,99 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 1455 bytes of a gzipped FileDescriptorProto + // 1466 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4d, 0x6c, 0x1b, 0x45, 0x14, 0xce, 0xd8, 0x21, 0x3f, 0x2f, 0x4d, 0xdb, 0x4c, 0xd2, 0x34, 0x31, 0xa9, 0x9d, 0x4c, 0x21, - 0x4d, 0x5b, 0xe2, 0x4d, 0xd3, 0x56, 0x45, 0x85, 0xb6, 0xd4, 0xfd, 0x81, 0x14, 0x54, 0xca, 0x2a, - 0x6d, 0x25, 0xa4, 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x86, - 0x0f, 0xa6, 0x36, 0x39, 0x64, 0x1b, 0x04, 0xf6, 0xb5, 0x80, 0xc6, 0x24, 0xdd, 0x84, 0x3e, 0x2f, - 0x1b, 0x63, 0x64, 0x32, 0x19, 0x33, 0x4b, 0xfb, 0x31, 0x4b, 0x7b, 0x7c, 0x59, 0xb2, 0x99, 0x5a, - 0x77, 0x46, 0xdf, 0xf3, 0x31, 0x4a, 0x08, 0x46, 0x87, 0x22, 0x19, 0x49, 0x54, 0x71, 0x28, 0x7d, - 0x47, 0x60, 0xaf, 0xa0, 0x94, 0x33, 0xf5, 0xba, 0x06, 0xa3, 0xd0, 0x53, 0x30, 0x75, 0xdd, 0xa8, - 0x89, 0xec, 0xf7, 0xab, 0xf8, 0x44, 0xc7, 0xa1, 0xaf, 0x60, 0xea, 0x52, 0x97, 0x84, 0xd0, 0xa5, - 0xb7, 0x60, 0xea, 0xad, 0x9a, 0x24, 0xc3, 0x34, 0xe9, 0xee, 0xb4, 0x26, 0x7f, 0x10, 0x18, 0x6a, - 0x22, 0x80, 0x7a, 0x1c, 0xf6, 0x33, 0xc8, 0x0d, 0x6d, 0x6d, 0x66, 0x06, 0xa5, 0x23, 0xf9, 0x9e, - 0xd5, 0x49, 0xbd, 0x0e, 0xdd, 0x05, 0x53, 0xb7, 0xc7, 0x12, 0x42, 0xb6, 0x74, 0x88, 0x6c, 0x39, - 0x53, 0xcf, 0x0d, 0xa3, 0x64, 0x03, 0x75, 0x67, 0x36, 0x53, 0x85, 0x83, 0x16, 0xa9, 0x92, 0x1d, - 0x97, 0xea, 0x79, 0x18, 0x6f, 0x2e, 0x3e, 0xff, 0x2e, 0xf3, 0x31, 0x81, 0x54, 0xd0, 0x57, 0xcc, - 0x47, 0x05, 0x76, 0x7b, 0x5d, 0xe5, 0xdb, 0x75, 0x66, 0xa2, 0xab, 0x14, 0x37, 0x9f, 0x03, 0x48, - 0x7c, 0x9f, 0xaf, 0x56, 0xd1, 0x1b, 0x53, 0x07, 0xb5,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, 0x1e, 0x38, 0x90, - 0x08, 0x36, 0x57, 0x62, 0xf6, 0x41, 0x8c, 0xd1, 0x2e, 0xf5, 0x66, 0x47, 0x7c, 0x21, 0xd7, 0x4b, - 0x82, 0xeb, 0x39, 0x7a, 0x26, 0xac, 0xd3, 0x22, 0xa7, 0x25, 0xfa, 0x37, 0x81, 0x89, 0xb0, 0x13, - 0x99, 0x5e, 0x78, 0x1a, 0x45, 0x5a, 0x06, 0x9c, 0xd4, 0xc5, 0xff, 0xe7, 0x04, 0x29, 0x5f, 0x16, - 0x94, 0x5f, 0xa3, 0x67, 0xb7, 0x21, 0x6f, 0x63, 0x44, 0xa8, 0x77, 0x69, 0xee, 0xea, 0xc3, 0x47, - 0x69, 0xb2, 0xf1, 0x28, 0x4d, 0x7e, 0x7d, 0x94, 0x26, 0xf7, 0x1f, 0xa7, 0xbb, 0x36, 0x1e, 0xa7, - 0xbb, 0x7e, 0x7e, 0x9c, 0xee, 0x7a, 0xf7, 0x84, 0xef, 0x17, 0x03, 0x37, 0xc6, 0x2c, 0x5f, 0x5a, - 0x32, 0x8b, 0xa6, 0x66, 0x79, 0x31, 0x7d, 0xbf, 0x70, 0x8b, 0xdf, 0x10, 0x0a, 0x3d, 0x22, 0xe2, - 0xf1, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xef, 0xcd, 0x69, 0x7f, 0xf6, 0x17, 0x00, 0x00, + 0x4d, 0x5b, 0xe2, 0x4d, 0xd3, 0x96, 0x56, 0x85, 0xa6, 0xd4, 0xfd, 0x81, 0x14, 0x54, 0xca, 0x2a, + 0x6d, 0x25, 0xa4, 0x62, 0xad, 0xbd, 0x1b, 0x67, 0xd5, 0xb5, 0xd7, 0xf5, 0x6e, 0x4a, 0xa3, 0x28, + 0x07, 0xb8, 0x82, 0x44, 0x25, 0x24, 0x4e, 0x5c, 0x7a, 0x41, 0x1c, 0x38, 0x21, 0x71, 0xe1, 0xc0, + 0x81, 0x03, 0xaa, 0x38, 0x45, 0xe2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0x87, 0x75, 0x5a, 0xe4, 0xe0, 0x44, 0xff, 0x26, 0x30, 0x16, 0x76, 0x38, 0xd3, 0x4b, 0x3b, 0x51, + 0xc4, 0x37, 0xeb, 0xa4, 0x2e, 0xff, 0x3f, 0x27, 0x48, 0xf9, 0x2a, 0xa7, 0xfc, 0x1a, 0x9d, 0xdb, + 0x86, 0xbc, 0x8d, 0x69, 0xa1, 0xde, 0xa5, 0xb9, 0xeb, 0x8f, 0x9f, 0xa4, 0xc9, 0xfa, 0x93, 0x34, + 0xf9, 0xf5, 0x49, 0x9a, 0x3c, 0x7c, 0x9a, 0xee, 0x58, 0x7f, 0x9a, 0xee, 0xf8, 0xf9, 0x69, 0xba, + 0xe3, 0xdd, 0x53, 0x9e, 0x1f, 0x0f, 0x9c, 0x18, 0xd3, 0xe6, 0xe2, 0xa2, 0x5e, 0xd4, 0x15, 0xc3, + 0x8d, 0xe9, 0xf9, 0xb1, 0x9b, 0xff, 0x9c, 0x50, 0xe8, 0xe2, 0x11, 0x4f, 0xfe, 0x17, 0x00, 0x00, + 0xff, 0xff, 0xc0, 0x7d, 0x93, 0xfb, 0x01, 0x18, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/auctionsV2/types/query.pb.gw.go b/x/auctionsV2/types/query.pb.gw.go index 8f26fbfdf..8051bd7ba 100644 --- a/x/auctionsV2/types/query.pb.gw.go +++ b/x/auctionsV2/types/query.pb.gw.go @@ -222,7 +222,7 @@ func local_request_Query_Auctions_0(ctx context.Context, marshaler runtime.Marsh } var ( - filter_Query_Bids_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "history": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_Query_Bids_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "bid_type": 1, "history": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} ) func request_Query_Bids_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -247,6 +247,17 @@ func request_Query_Bids_0(ctx context.Context, marshaler runtime.Marshaler, clie return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) } + val, ok = pathParams["bid_type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bid_type") + } + + protoReq.BidType, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bid_type", err) + } + val, ok = pathParams["history"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") @@ -292,6 +303,17 @@ func local_request_Query_Bids_0(ctx context.Context, marshaler runtime.Marshaler return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) } + val, ok = pathParams["bid_type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bid_type") + } + + protoReq.BidType, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bid_type", err) + } + val, ok = pathParams["history"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") @@ -1174,7 +1196,7 @@ var ( pattern_Query_Auctions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "auctions", "v2", "auction_type", "history"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Bids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "auctions", "v2", "bids", "bidder", "history"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Bids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auctions", "v2", "bids", "bidder", "bid_type", "history"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AuctionParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "auctions", "v2", "auction_params"}, "", runtime.AssumeColonVerbOpt(false))) From faef20ce1fc267231346b5cfb03aa2cda586b98f Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 8 Aug 2023 19:38:06 +0530 Subject: [PATCH 146/155] minor refactor --- x/liquidationsV2/keeper/liquidate.go | 8 ++++++++ x/liquidationsV2/types/errors.go | 1 + 2 files changed, 9 insertions(+) diff --git a/x/liquidationsV2/keeper/liquidate.go b/x/liquidationsV2/keeper/liquidate.go index e61aa4e51..68e5bf800 100644 --- a/x/liquidationsV2/keeper/liquidate.go +++ b/x/liquidationsV2/keeper/liquidate.go @@ -206,6 +206,14 @@ func (k Keeper) CreateLockedVault(ctx sdk.Context, OriginalVaultId, ExtendedPair //will this be enough to make sure auction does not get bid due to collateral not being able to cover the debt? //can a case occur in which liquidation penalty and auction bonus are still not enough? + // if english auction check if it is enabled or not + if !value.AuctionType { + liquidationWhitelistingAppData, found := k.GetLiquidationWhiteListing(ctx, appID) + if !found || !liquidationWhitelistingAppData.IsEnglishActivated { + return fmt.Errorf("Auction could not be initiated for %s ", types.ErrEnglishAuctionDisabled) + } + } + k.SetLockedVault(ctx, value) k.SetLockedVaultID(ctx, value.LockedVaultId) //Call auction activator diff --git a/x/liquidationsV2/types/errors.go b/x/liquidationsV2/types/errors.go index 0f4cd5be5..cd6b77c20 100644 --- a/x/liquidationsV2/types/errors.go +++ b/x/liquidationsV2/types/errors.go @@ -12,4 +12,5 @@ var ( ErrorUnknownMsgType = sdkerrors.Register(ModuleName, 1502, "Unknown msg type") ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 1503, "unknown proposal type") ErrorInvalidAppOrAssetData = sdkerrors.Register(ModuleName, 1504, "Invalid data of app , or asset has not been added to the app , or low funds") + ErrEnglishAuctionDisabled = sdkerrors.Register(ModuleName, 1505, "English auction not enabled for the app") ) From 2d41a166f73ab8d112371c22f5b13e49a595a6f6 Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 8 Aug 2023 20:52:48 +0530 Subject: [PATCH 147/155] updating module.go --- x/auctionsV2/module.go | 5 +++-- x/liquidationsV2/module.go | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/x/auctionsV2/module.go b/x/auctionsV2/module.go index b2633a4d7..f068e909c 100644 --- a/x/auctionsV2/module.go +++ b/x/auctionsV2/module.go @@ -1,6 +1,7 @@ package auctionsV2 import ( + "context" "encoding/json" "fmt" // this line is used by starport scaffolding # 1 @@ -73,8 +74,8 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - // this line is used by starport scaffolding # 2 +func (AppModuleBasic) RegisterGRPCGatewayRoutes(ctx client.Context, mux *runtime.ServeMux) { + _ = types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(ctx)) } // GetTxCmd returns the capability module's root tx command. diff --git a/x/liquidationsV2/module.go b/x/liquidationsV2/module.go index 8939ff159..cbab44915 100644 --- a/x/liquidationsV2/module.go +++ b/x/liquidationsV2/module.go @@ -1,6 +1,7 @@ package liquidationsV2 import ( + "context" "encoding/json" "fmt" // this line is used by starport scaffolding # 1 @@ -72,8 +73,8 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - // this line is used by starport scaffolding # 2 +func (AppModuleBasic) RegisterGRPCGatewayRoutes(ctx client.Context, mux *runtime.ServeMux) { + _ = types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(ctx)) } // GetTxCmd returns the capability module's root tx command. From 410bdcd660c4c16576927e4d7fe26fe461961877 Mon Sep 17 00:00:00 2001 From: Pratik Date: Tue, 8 Aug 2023 22:04:06 +0530 Subject: [PATCH 148/155] adding query --- proto/comdex/auctionsV2/v1beta1/query.proto | 23 + x/auctionsV2/client/cli/query.go | 46 ++ x/auctionsV2/keeper/grpc_query.go | 48 ++ x/auctionsV2/types/query.pb.go | 855 +++++++++++++++++--- x/auctionsV2/types/query.pb.gw.go | 163 ++++ 5 files changed, 1026 insertions(+), 109 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index 2079c8948..02305ace6 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -155,6 +155,26 @@ message QueryLimitBidProtocolDataWithUserResponse { [(gogoproto.moretags) = "yaml:\"pagination\""]; } +message QueryBidsFilterRequest { + string bidder = 1; + uint64 bid_type = 2; + bool history = 3; + cosmos.base.query.v1beta1.PageRequest pagination = 4 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryBidsFilterResponse { + string bidder = 1 [ + (gogoproto.moretags) = "yaml:\"bidder\"" + ]; + repeated Bid bids = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"bids\"" + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 3 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/comdex/auctions/v2/params"; @@ -186,4 +206,7 @@ service Query { rpc LimitBidProtocolDataWithUser(QueryLimitBidProtocolDataWithUserRequest) returns (QueryLimitBidProtocolDataWithUserResponse) { option (google.api.http).get = "/comdex/auctions/v2/limit_bid_protocol_data_with_user/{bidder}"; } + rpc BidsFilter(QueryBidsFilterRequest) returns (QueryBidsFilterResponse) { + option (google.api.http).get = "/comdex/auctions/v2/bids_filter/{bidder}/{bid_type}/{history}"; + } } \ No newline at end of file diff --git a/x/auctionsV2/client/cli/query.go b/x/auctionsV2/client/cli/query.go index 3d537db19..3a0ed0223 100644 --- a/x/auctionsV2/client/cli/query.go +++ b/x/auctionsV2/client/cli/query.go @@ -37,6 +37,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { queryLimitBidProtocolData(), queryAuctionFeesCollectionData(), queryLimitBidProtocolDataWithAddress(), + queryBidsFilter(), ) return cmd @@ -378,3 +379,48 @@ func queryLimitBidProtocolDataWithAddress() *cobra.Command { return cmd } + +func queryBidsFilter() *cobra.Command { + cmd := &cobra.Command{ + Use: "bids-filter [bidder] [bid-type] [history]", + Short: "Query bids by bidder address", + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + bidder := args[0] + bidType, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + history, err := strconv.ParseBool(args[2]) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.Bids( + context.Background(), + &types.QueryBidsRequest{ + Bidder: bidder, + BidType: bidType, + History: history, + Pagination: pagination, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "bids") + + return cmd +} diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index 059764a34..d03ed8b40 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -400,3 +400,51 @@ func (q QueryServer) LimitBidProtocolDataWithUser(c context.Context, req *types. Pagination: pagination, }, nil } + +func (q QueryServer) BidsFilter(c context.Context, req *types.QueryBidsFilterRequest) (*types.QueryBidsFilterResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + ctx = sdk.UnwrapSDKContext(c) + key []byte + items []types.Bid + ) + if req.History { + key = types.GetBidHistoricalKey(req.Bidder) + } else { + key = types.GetUserBidHistoricalKey(req.Bidder) + } + + pagination, err := query.FilteredPaginate( + prefix.NewStore(q.Store(ctx), key), + req.Pagination, + func(_, value []byte, accumulate bool) (bool, error) { + var item types.Bid + if err := q.cdc.Unmarshal(value, &item); err != nil { + return false, err + } + if req.BidType == 1 { + if accumulate && item.BidType == "dutch" { + items = append(items, item) + } + } else if req.BidType == 2 { + if accumulate && item.BidType == "english" { + items = append(items, item) + } + } + + return true, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryBidsFilterResponse{ + Bidder: req.Bidder, + Bids: items, + Pagination: pagination, + }, nil +} diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index d856f08b5..b5657ef1f 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -1078,6 +1078,134 @@ func (m *QueryLimitBidProtocolDataWithUserResponse) GetPagination() *query.PageR return nil } +type QueryBidsFilterRequest struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + BidType uint64 `protobuf:"varint,2,opt,name=bid_type,json=bidType,proto3" json:"bid_type,omitempty"` + History bool `protobuf:"varint,3,opt,name=history,proto3" json:"history,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryBidsFilterRequest) Reset() { *m = QueryBidsFilterRequest{} } +func (m *QueryBidsFilterRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBidsFilterRequest) ProtoMessage() {} +func (*QueryBidsFilterRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{20} +} +func (m *QueryBidsFilterRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBidsFilterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBidsFilterRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBidsFilterRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBidsFilterRequest.Merge(m, src) +} +func (m *QueryBidsFilterRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBidsFilterRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBidsFilterRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBidsFilterRequest proto.InternalMessageInfo + +func (m *QueryBidsFilterRequest) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *QueryBidsFilterRequest) GetBidType() uint64 { + if m != nil { + return m.BidType + } + return 0 +} + +func (m *QueryBidsFilterRequest) GetHistory() bool { + if m != nil { + return m.History + } + return false +} + +func (m *QueryBidsFilterRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryBidsFilterResponse struct { + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty" yaml:"bidder"` + Bids []Bid `protobuf:"bytes,2,rep,name=bids,proto3" json:"bids" yaml:"bids"` + Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryBidsFilterResponse) Reset() { *m = QueryBidsFilterResponse{} } +func (m *QueryBidsFilterResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBidsFilterResponse) ProtoMessage() {} +func (*QueryBidsFilterResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{21} +} +func (m *QueryBidsFilterResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBidsFilterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBidsFilterResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryBidsFilterResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBidsFilterResponse.Merge(m, src) +} +func (m *QueryBidsFilterResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBidsFilterResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBidsFilterResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBidsFilterResponse proto.InternalMessageInfo + +func (m *QueryBidsFilterResponse) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *QueryBidsFilterResponse) GetBids() []Bid { + if m != nil { + return m.Bids + } + return nil +} + +func (m *QueryBidsFilterResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryParamsResponse") @@ -1099,6 +1227,8 @@ func init() { proto.RegisterType((*QueryAuctionFeesCollectionFromLimitBidTxResponse)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionFeesCollectionFromLimitBidTxResponse") proto.RegisterType((*QueryLimitBidProtocolDataWithUserRequest)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidProtocolDataWithUserRequest") proto.RegisterType((*QueryLimitBidProtocolDataWithUserResponse)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidProtocolDataWithUserResponse") + proto.RegisterType((*QueryBidsFilterRequest)(nil), "comdex.auctionsV2.v1beta1.QueryBidsFilterRequest") + proto.RegisterType((*QueryBidsFilterResponse)(nil), "comdex.auctionsV2.v1beta1.QueryBidsFilterResponse") } func init() { @@ -1106,99 +1236,102 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 1466 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4d, 0x6c, 0x1b, 0x45, - 0x14, 0xce, 0xd8, 0x21, 0x3f, 0x2f, 0x4d, 0xdb, 0x4c, 0xd2, 0x34, 0x31, 0xa9, 0x9d, 0x4c, 0x21, - 0x4d, 0x5b, 0xe2, 0x4d, 0xd3, 0x96, 0x56, 0x85, 0xa6, 0xd4, 0xfd, 0x81, 0x14, 0x54, 0xca, 0x2a, - 0x6d, 0x25, 0xa4, 0x62, 0xad, 0xbd, 0x1b, 0x67, 0xd5, 0xb5, 0xd7, 0xf5, 0x6e, 0x4a, 0xa3, 0x28, - 0x07, 0xb8, 0x82, 0x44, 0x25, 0x24, 0x4e, 0x5c, 0x7a, 0x41, 0x1c, 0x38, 0x21, 0x71, 0xe1, 0xc0, - 0x81, 0x03, 0xaa, 0x38, 0x45, 0xe2, 0x82, 0x38, 0x44, 0xa8, 0x05, 0x71, 0x42, 0x88, 0x1c, 0xb8, - 0x70, 0x41, 0x3b, 0xf3, 0xd6, 0xf6, 0x6e, 0xd6, 0xbb, 0x9b, 0xe0, 0xf4, 0x94, 0xec, 0xee, 0x9b, - 0xf7, 0xbe, 0xef, 0x7d, 0xef, 0xcd, 0xbc, 0x31, 0xbc, 0x58, 0x34, 0xcb, 0xaa, 0xf6, 0x40, 0x52, - 0x96, 0x8b, 0xb6, 0x6e, 0x56, 0xac, 0x5b, 0xb3, 0xd2, 0xfd, 0x13, 0x05, 0xcd, 0x56, 0x4e, 0x48, - 0xf7, 0x96, 0xb5, 0xda, 0x4a, 0xb6, 0x5a, 0x33, 0x6d, 0x93, 0x8e,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f, 0x0f, 0x9c, 0x18, 0xd3, 0xe6, 0xe2, 0xa2, 0x5e, 0xd4, 0x15, 0xc3, - 0x8d, 0xe9, 0xf9, 0xb1, 0x9b, 0xff, 0x9c, 0x50, 0xe8, 0xe2, 0x11, 0x4f, 0xfe, 0x17, 0x00, 0x00, - 0xff, 0xff, 0xc0, 0x7d, 0x93, 0xfb, 0x01, 0x18, 0x00, 0x00, + // 1520 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4d, 0x6c, 0x1b, 0x55, + 0x10, 0xce, 0xb3, 0x43, 0x7e, 0x26, 0x4d, 0x69, 0x5e, 0xd2, 0xfc, 0x98, 0xd4, 0x4e, 0x5e, 0x21, + 0x4d, 0x5b, 0xe2, 0x4d, 0xd2, 0x96, 0x56, 0x85, 0xa6, 0xd4, 0x6d, 0x03, 0x29, 0xa8, 0x94, 0x55, + 0xda, 0x4a, 0x48, 0xc5, 0x5a, 0x7b, 0x37, 0xce, 0xaa, 0x6b, 0xaf, 0xeb, 0xdd, 0x94, 0x46, 0x51, + 0x0e, 0x70, 0x05, 0x89, 0x4a, 0x48, 0x9c, 0xb8, 0xf4, 0x82, 0x38, 0x70, 0xe2, 0xc8, 0x81, 0x03, + 0x42, 0xa8, 0xe2, 0x14, 0x89, 0x0b, 0xe2, 0x10, 0xa1, 0x16, 0xc4, 0xa9, 0x42, 0xe4, 0xc0, 0x85, + 0x0b, 0xda, 0xf7, 0x66, 0x6d, 0xaf, 0xb3, 0xde, 0xdd, 0x04, 0xa7, 0x42, 0x9c, 0xe2, 0xdd, 0x9d, + 0x37, 0xf3, 0x7d, 0xf3, 0xcd, 0xbc, 0xbf, 0xc0, 0x0b, 0x79, 0xb3, 0xa8, 0x6a, 0xf7, 0x24, 0x65, + 0x25, 0x6f, 0xeb, 0x66, 0xc9, 0xba, 0x31, 0x2b, 0xdd, 0x9d, 0xc9, 0x69, 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 0x67, 0xea, 0x9f, 0xd7, + 0x0d, 0x3b, 0x5c, 0xdc, 0xff, 0xe2, 0x51, 0xe1, 0x09, 0x81, 0xa1, 0x6d, 0x34, 0xfe, 0xbf, 0x07, + 0x86, 0xd9, 0xad, 0x03, 0xf0, 0x0c, 0xe7, 0x4b, 0x3f, 0x24, 0xd0, 0x21, 0x76, 0xe6, 0x74, 0x2a, + 0x00, 0xef, 0xf6, 0xdb, 0x8b, 0x44, 0x3a, 0xaa, 0xb9, 0x80, 0xc5, 0xd8, 0x07, 0x3f, 0xfe, 0xfa, + 0x49, 0x6c, 0x94, 0x26, 0xa4, 0x86, 0x1b, 0x13, 0xe9, 0xee, 0x2c, 0xde, 0xbd, 0xd0, 0xcf, 0x09, + 0x74, 0xe2, 0x24, 0x49, 0x43, 0xfd, 0x7b, 0xaf, 0x37, 0x12, 0x52, 0x64, 0x7b, 0x04, 0x74, 0x96, + 0x03, 0x3a, 0x49, 0x67, 0xfd, 0x00, 0xe1, 0x6f, 0x69, 0xad, 0x76, 0x65, 0xb2, 0x2e, 0xad, 0x61, + 0x39, 0xae, 0xd3, 0x2f, 0x09, 0x74, 0xb9, 0x47, 0x7d, 0x1a, 0x35, 0x72, 0x35, 0x75, 0xd3, 0xd1, + 0x07, 0x20, 0xd6, 0x73, 0x1c, 0xeb, 0x69, 0x7a, 0x2a, 0x00, 0xab, 0x55, 0x03, 0xeb, 0x34, 0x57, + 0x3d, 0xdc, 0x07, 0x04, 0xda, 0xf9, 0xe6, 0xec, 0x78, 0x58, 0xe4, 0xba, 0xcd, 0x70, 0xe2, 0xc5, + 0x68, 0xc6, 0x08, 0x71, 0x8e, 0x43, 0x3c, 0x43, 0x5f, 0xf2, 0x83, 0xe8, 0x54, 0xb5, 0xb4, 0x26, + 0xda, 0x64, 0x9d, 0xff, 0xd8, 0x86, 0xf1, 0x0b, 0x02, 0xbd, 0x9e, 0x83, 0x25, 0x3d, 0x19, 0x31, + 0x4d, 0xde, 0xba, 0x3c, 0x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x6d, 0xf2, 0xaa, 0x5d, + 0xea, 0xec, 0x45, 0xa1, 0xb6, 0x45, 0xa1, 0x33, 0x51, 0x26, 0x68, 0xcf, 0xae, 0x2c, 0x31, 0xbb, + 0x93, 0x21, 0x51, 0x04, 0x73, 0x1a, 0x2f, 0xbb, 0xc4, 0x07, 0x04, 0x4f, 0xf0, 0x99, 0xab, 0x0f, + 0x1f, 0x25, 0xc9, 0xc6, 0xa3, 0x24, 0xf9, 0xe5, 0x51, 0x92, 0xdc, 0x7f, 0x9c, 0x6c, 0xdb, 0x78, + 0x9c, 0x6c, 0xfb, 0xe9, 0x71, 0xb2, 0xed, 0x9d, 0x93, 0x9e, 0x0b, 0x2b, 0x27, 0xc4, 0x94, 0xb9, + 0xb4, 0xa4, 0xe7, 0x75, 0xc5, 0x70, 0x43, 0x7a, 0xfe, 0xc1, 0xc2, 0xaf, 0xb0, 0x72, 0x1d, 0x3c, + 0x5d, 0x27, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x6a, 0xcb, 0x68, 0xab, 0x75, 0x1a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1223,6 +1356,7 @@ type QueryClient interface { LimitBidProtocolData(ctx context.Context, in *QueryLimitBidProtocolDataRequest, opts ...grpc.CallOption) (*QueryLimitBidProtocolDataResponse, error) AuctionFeesCollectionData(ctx context.Context, in *QueryAuctionFeesCollectionFromLimitBidTxRequest, opts ...grpc.CallOption) (*QueryAuctionFeesCollectionFromLimitBidTxResponse, error) LimitBidProtocolDataWithUser(ctx context.Context, in *QueryLimitBidProtocolDataWithUserRequest, opts ...grpc.CallOption) (*QueryLimitBidProtocolDataWithUserResponse, error) + BidsFilter(ctx context.Context, in *QueryBidsFilterRequest, opts ...grpc.CallOption) (*QueryBidsFilterResponse, error) } type queryClient struct { @@ -1323,6 +1457,15 @@ func (c *queryClient) LimitBidProtocolDataWithUser(ctx context.Context, in *Quer return out, nil } +func (c *queryClient) BidsFilter(ctx context.Context, in *QueryBidsFilterRequest, opts ...grpc.CallOption) (*QueryBidsFilterResponse, error) { + out := new(QueryBidsFilterResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/BidsFilter", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) @@ -1335,6 +1478,7 @@ type QueryServer interface { LimitBidProtocolData(context.Context, *QueryLimitBidProtocolDataRequest) (*QueryLimitBidProtocolDataResponse, error) AuctionFeesCollectionData(context.Context, *QueryAuctionFeesCollectionFromLimitBidTxRequest) (*QueryAuctionFeesCollectionFromLimitBidTxResponse, error) LimitBidProtocolDataWithUser(context.Context, *QueryLimitBidProtocolDataWithUserRequest) (*QueryLimitBidProtocolDataWithUserResponse, error) + BidsFilter(context.Context, *QueryBidsFilterRequest) (*QueryBidsFilterResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1371,6 +1515,9 @@ func (*UnimplementedQueryServer) AuctionFeesCollectionData(ctx context.Context, func (*UnimplementedQueryServer) LimitBidProtocolDataWithUser(ctx context.Context, req *QueryLimitBidProtocolDataWithUserRequest) (*QueryLimitBidProtocolDataWithUserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LimitBidProtocolDataWithUser not implemented") } +func (*UnimplementedQueryServer) BidsFilter(ctx context.Context, req *QueryBidsFilterRequest) (*QueryBidsFilterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BidsFilter not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1556,6 +1703,24 @@ func _Query_LimitBidProtocolDataWithUser_Handler(srv interface{}, ctx context.Co return interceptor(ctx, in, info, handler) } +func _Query_BidsFilter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBidsFilterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BidsFilter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Query/BidsFilter", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BidsFilter(ctx, req.(*QueryBidsFilterRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.auctionsV2.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -1600,6 +1765,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "LimitBidProtocolDataWithUser", Handler: _Query_LimitBidProtocolDataWithUser_Handler, }, + { + MethodName: "BidsFilter", + Handler: _Query_BidsFilter_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/auctionsV2/v1beta1/query.proto", @@ -2471,6 +2640,119 @@ func (m *QueryLimitBidProtocolDataWithUserResponse) MarshalToSizedBuffer(dAtA [] return len(dAtA) - i, nil } +func (m *QueryBidsFilterRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBidsFilterRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBidsFilterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.History { + i-- + if m.History { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.BidType != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BidType)) + i-- + dAtA[i] = 0x10 + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBidsFilterResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryBidsFilterResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBidsFilterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Bids) > 0 { + for iNdEx := len(m.Bids) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Bids[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2818,23 +3100,69 @@ func (m *QueryLimitBidProtocolDataWithUserResponse) Size() (n int) { return n } -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func (m *QueryBidsFilterRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.BidType != 0 { + n += 1 + sovQuery(uint64(m.BidType)) + } + if m.History { + n += 2 + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { + +func (m *QueryBidsFilterResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Bids) > 0 { + for _, e := range m.Bids { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] @@ -5052,6 +5380,315 @@ func (m *QueryLimitBidProtocolDataWithUserResponse) Unmarshal(dAtA []byte) error } return nil } +func (m *QueryBidsFilterRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBidsFilterRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBidsFilterRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BidType", wireType) + } + m.BidType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BidType |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.History = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBidsFilterResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBidsFilterResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBidsFilterResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bids", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bids = append(m.Bids, Bid{}) + if err := m.Bids[len(m.Bids)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auctionsV2/types/query.pb.gw.go b/x/auctionsV2/types/query.pb.gw.go index 8051bd7ba..fb9dda46d 100644 --- a/x/auctionsV2/types/query.pb.gw.go +++ b/x/auctionsV2/types/query.pb.gw.go @@ -709,6 +709,122 @@ func local_request_Query_LimitBidProtocolDataWithUser_0(ctx context.Context, mar } +var ( + filter_Query_BidsFilter_0 = &utilities.DoubleArray{Encoding: map[string]int{"bidder": 0, "bid_type": 1, "history": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} +) + +func request_Query_BidsFilter_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBidsFilterRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["bid_type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bid_type") + } + + protoReq.BidType, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bid_type", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BidsFilter_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.BidsFilter(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_BidsFilter_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBidsFilterRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["bidder"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bidder") + } + + protoReq.Bidder, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bidder", err) + } + + val, ok = pathParams["bid_type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "bid_type") + } + + protoReq.BidType, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "bid_type", err) + } + + val, ok = pathParams["history"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "history") + } + + protoReq.History, err = runtime.Bool(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "history", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BidsFilter_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.BidsFilter(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -945,6 +1061,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_BidsFilter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_BidsFilter_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_BidsFilter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1186,6 +1325,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_BidsFilter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_BidsFilter_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_BidsFilter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1209,6 +1368,8 @@ var ( pattern_Query_AuctionFeesCollectionData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "auctions", "v2", "auction_fees_collection_from_limit_bid_tx"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_LimitBidProtocolDataWithUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "auctions", "v2", "limit_bid_protocol_data_with_user", "bidder"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_BidsFilter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auctions", "v2", "bids_filter", "bidder", "bid_type", "history"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1231,4 +1392,6 @@ var ( forward_Query_AuctionFeesCollectionData_0 = runtime.ForwardResponseMessage forward_Query_LimitBidProtocolDataWithUser_0 = runtime.ForwardResponseMessage + + forward_Query_BidsFilter_0 = runtime.ForwardResponseMessage ) From 24209d189d871cfeebb0cb217088d0f6023d670f Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 9 Aug 2023 15:02:08 +0530 Subject: [PATCH 149/155] adding lend query --- proto/comdex/lend/v1beta1/query.proto | 19 + x/lend/client/cli/query.go | 41 ++ x/lend/keeper/grpc_query.go | 35 ++ x/lend/types/query.pb.go | 809 +++++++++++++++++++++----- x/lend/types/query.pb.gw.go | 141 +++++ 5 files changed, 898 insertions(+), 147 deletions(-) diff --git a/proto/comdex/lend/v1beta1/query.proto b/proto/comdex/lend/v1beta1/query.proto index 8cb77c16e..ccc922ee8 100644 --- a/proto/comdex/lend/v1beta1/query.proto +++ b/proto/comdex/lend/v1beta1/query.proto @@ -317,6 +317,21 @@ message QueryBorrowInterestResponse { ]; } +message QueryAllBorrowByOwnerAndDebtPoolRequest { + string owner = 1 [(gogoproto.moretags) = "yaml:\"owner\""]; + uint64 pool_id = 2 [(gogoproto.moretags) = "yaml:\"pool_id\""]; + cosmos.base.query.v1beta1.PageRequest pagination = 3 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryAllBorrowByOwnerAndDebtPoolResponse { + repeated BorrowAsset borrows = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"borrows\""]; + cosmos.base.query.v1beta1.PageResponse pagination = 2 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + service Query { rpc QueryLends(QueryLendsRequest) returns (QueryLendsResponse) { option (google.api.http).get = "/comdex/lend/v1beta1/lends"; @@ -418,5 +433,9 @@ service Query { rpc QueryBorrowInterest(QueryBorrowInterestRequest) returns (QueryBorrowInterestResponse) { option (google.api.http).get = "/comdex/lend/v1beta1/borrow_interest"; }; + + rpc QueryAllBorrowByOwnerAndDebtPool(QueryAllBorrowByOwnerAndDebtPoolRequest) returns (QueryAllBorrowByOwnerAndDebtPoolResponse) { + option (google.api.http).get = "/comdex/lend/v1beta1/borrows_by_owner_debt_pool/{owner}/{pool_id}"; + } } diff --git a/x/lend/client/cli/query.go b/x/lend/client/cli/query.go index 25f82c916..72e0f7f90 100644 --- a/x/lend/client/cli/query.go +++ b/x/lend/client/cli/query.go @@ -52,6 +52,7 @@ func GetQueryCmd() *cobra.Command { QueryFundModBalByAssetPool(), queryLendInterest(), queryBorrowInterest(), + QueryAllBorrowsByOwnerAndDebtPoolID(), ) return cmd @@ -967,3 +968,43 @@ func queryBorrowInterest() *cobra.Command { return cmd } + +func QueryAllBorrowsByOwnerAndDebtPoolID() *cobra.Command { + cmd := &cobra.Command{ + Use: "borrows-by-owner-debt-pool [owner] [pool-id]", + Short: "borrows list for a owner for a debt pool", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + + poolID, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + + res, err := queryClient.QueryAllBorrowByOwnerAndDebtPool(cmd.Context(), &types.QueryAllBorrowByOwnerAndDebtPoolRequest{ + Owner: args[0], + PoolId: poolID, + Pagination: pagination, + }) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "borrows-by-owner-debt-pool") + + return cmd +} diff --git a/x/lend/keeper/grpc_query.go b/x/lend/keeper/grpc_query.go index 1da2ecc2c..ae36f68bd 100644 --- a/x/lend/keeper/grpc_query.go +++ b/x/lend/keeper/grpc_query.go @@ -617,3 +617,38 @@ func (q QueryServer) QueryBorrowInterest(c context.Context, req *types.QueryBorr borrowInterest, _ := q.IterateBorrowsForQuery(ctx) return &types.QueryBorrowInterestResponse{PoolInterest: borrowInterest}, nil } + +func (q QueryServer) QueryAllBorrowByOwnerAndDebtPool(c context.Context, req *types.QueryAllBorrowByOwnerAndDebtPoolRequest) (*types.QueryAllBorrowByOwnerAndDebtPoolResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + var ( + ctx = sdk.UnwrapSDKContext(c) + borrowIds []uint64 + borrows []types.BorrowAsset + ) + + _, err := sdk.AccAddressFromBech32(req.Owner) + if err != nil { + return nil, status.Errorf(codes.NotFound, "Address is not correct") + } + + mappingData := q.GetUserTotalMappingData(ctx, req.Owner) + for _, data := range mappingData { + borrowIds = append(borrowIds, data.BorrowId...) + } + for _, borrowID := range borrowIds { + borrow, _ := q.GetBorrow(ctx, borrowID) + pair, _ := q.GetLendPair(ctx, borrow.PairID) + if req.PoolId == pair.AssetOutPoolID { + borrows = append(borrows, borrow) + } + } + if len(borrowIds) == 0 { + return &types.QueryAllBorrowByOwnerAndDebtPoolResponse{}, nil + } + + return &types.QueryAllBorrowByOwnerAndDebtPoolResponse{ + Borrows: borrows, + }, nil +} diff --git a/x/lend/types/query.pb.go b/x/lend/types/query.pb.go index 42a896abb..f0c53dcc4 100644 --- a/x/lend/types/query.pb.go +++ b/x/lend/types/query.pb.go @@ -2047,6 +2047,87 @@ func (m *QueryBorrowInterestResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryBorrowInterestResponse proto.InternalMessageInfo +type QueryAllBorrowByOwnerAndDebtPoolRequest struct { + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` + PoolId uint64 `protobuf:"varint,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAllBorrowByOwnerAndDebtPoolRequest) Reset() { + *m = QueryAllBorrowByOwnerAndDebtPoolRequest{} +} +func (m *QueryAllBorrowByOwnerAndDebtPoolRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllBorrowByOwnerAndDebtPoolRequest) ProtoMessage() {} +func (*QueryAllBorrowByOwnerAndDebtPoolRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_462bf3f1a3eff175, []int{54} +} +func (m *QueryAllBorrowByOwnerAndDebtPoolRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllBorrowByOwnerAndDebtPoolRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllBorrowByOwnerAndDebtPoolRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllBorrowByOwnerAndDebtPoolRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBorrowByOwnerAndDebtPoolRequest.Merge(m, src) +} +func (m *QueryAllBorrowByOwnerAndDebtPoolRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllBorrowByOwnerAndDebtPoolRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBorrowByOwnerAndDebtPoolRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllBorrowByOwnerAndDebtPoolRequest proto.InternalMessageInfo + +type QueryAllBorrowByOwnerAndDebtPoolResponse struct { + Borrows []BorrowAsset `protobuf:"bytes,1,rep,name=borrows,proto3" json:"borrows" yaml:"borrows"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAllBorrowByOwnerAndDebtPoolResponse) Reset() { + *m = QueryAllBorrowByOwnerAndDebtPoolResponse{} +} +func (m *QueryAllBorrowByOwnerAndDebtPoolResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllBorrowByOwnerAndDebtPoolResponse) ProtoMessage() {} +func (*QueryAllBorrowByOwnerAndDebtPoolResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_462bf3f1a3eff175, []int{55} +} +func (m *QueryAllBorrowByOwnerAndDebtPoolResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllBorrowByOwnerAndDebtPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllBorrowByOwnerAndDebtPoolResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllBorrowByOwnerAndDebtPoolResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBorrowByOwnerAndDebtPoolResponse.Merge(m, src) +} +func (m *QueryAllBorrowByOwnerAndDebtPoolResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllBorrowByOwnerAndDebtPoolResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBorrowByOwnerAndDebtPoolResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllBorrowByOwnerAndDebtPoolResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "comdex.lend.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "comdex.lend.v1beta1.QueryParamsResponse") @@ -2102,158 +2183,164 @@ func init() { proto.RegisterType((*QueryLendInterestResponse)(nil), "comdex.lend.v1beta1.QueryLendInterestResponse") proto.RegisterType((*QueryBorrowInterestRequest)(nil), "comdex.lend.v1beta1.QueryBorrowInterestRequest") proto.RegisterType((*QueryBorrowInterestResponse)(nil), "comdex.lend.v1beta1.QueryBorrowInterestResponse") + proto.RegisterType((*QueryAllBorrowByOwnerAndDebtPoolRequest)(nil), "comdex.lend.v1beta1.QueryAllBorrowByOwnerAndDebtPoolRequest") + proto.RegisterType((*QueryAllBorrowByOwnerAndDebtPoolResponse)(nil), "comdex.lend.v1beta1.QueryAllBorrowByOwnerAndDebtPoolResponse") } func init() { proto.RegisterFile("comdex/lend/v1beta1/query.proto", fileDescriptor_462bf3f1a3eff175) } var fileDescriptor_462bf3f1a3eff175 = []byte{ - // 2336 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x5a, 0xdd, 0x6f, 0x1d, 0x47, - 0x15, 0xf7, 0xba, 0xb6, 0x4b, 0x27, 0x9f, 0x1d, 0xdb, 0x4d, 0xb2, 0x76, 0xee, 0xb5, 0x27, 0xfe, - 0x88, 0x9b, 0xf8, 0x6e, 0x9c, 0xb4, 0x40, 0xaa, 0x0a, 0x92, 0x25, 0x69, 0x1b, 0x14, 0xab, 0x66, - 0x41, 0x42, 0x42, 0xc0, 0xd5, 0x5e, 0xef, 0xc6, 0x5c, 0x75, 0xbd, 0x7b, 0x7b, 0x77, 0xdd, 0xd6, - 0xb2, 0x2c, 0x52, 0x68, 0x1f, 0x10, 0x2f, 0x45, 0xe5, 0x05, 0x21, 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0x47, 0x63, 0xe8, 0x9d, 0x7b, 0x8d, 0xa1, 0x3b, 0xf7, - 0x1a, 0xda, 0xdd, 0x7b, 0x0d, 0xed, 0xef, 0xf7, 0x1a, 0xda, 0x5b, 0xf7, 0x1b, 0x43, 0x77, 0xef, - 0x37, 0x86, 0xfe, 0x7c, 0xbf, 0x31, 0xf4, 0x85, 0x56, 0x46, 0x9a, 0xa3, 0x1e, 0x97, 0x83, 0x5b, - 0xb7, 0xba, 0xeb, 0x5d, 0xdb, 0x13, 0x23, 0xc0, 0x18, 0x4c, 0xa6, 0xeb, 0x8c, 0xb1, 0x3f, 0xba, - 0xbe, 0xf4, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x36, 0x5e, 0x88, 0x6e, 0x2e, 0x00, 0x00, + // 2399 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x5b, 0x5d, 0x6c, 0x1d, 0x47, + 0x15, 0xf6, 0xb8, 0xb1, 0x43, 0x27, 0xbf, 0x1d, 0xdb, 0x4d, 0xb2, 0x76, 0xee, 0xb5, 0x27, 0xfe, + 0x6d, 0xe2, 0xbb, 0x71, 0xd2, 0x02, 0xa9, 0x02, 0xc4, 0xdb, 0xa4, 0xad, 0x51, 0xac, 0x9a, 0x05, + 0x09, 0x09, 0x01, 0x57, 0x7b, 0xbd, 0x1b, 0x73, 0xd5, 0xeb, 0xbb, 0xb7, 0x77, 0xf7, 0xb6, 0xb5, + 0x2c, 0x8b, 0x14, 0xda, 0x07, 0xc4, 0x4b, 0x51, 0x79, 0x41, 0x48, 0x08, 0x09, 0x81, 0x2a, 0x01, + 0x82, 0x17, 0x78, 0x00, 0x1e, 0x78, 0x8c, 0x10, 0xa0, 0xa0, 0x3e, 0x94, 0x82, 0x6a, 0x41, 0xc2, + 0x13, 0x12, 0x2f, 0x91, 0x78, 0xe1, 0x09, 0xed, 0xcc, 0x99, 0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x0f, 0x69, 0xdf, 0x65, 0x69, 0xb0, 0xbe, 0x09, 0x46, 0xa9, 0x29, 0x9b, 0x6a, 0xcf, 0xe3, + 0x60, 0x07, 0x57, 0x72, 0xdc, 0x20, 0x16, 0xa2, 0x86, 0x3f, 0xc2, 0x11, 0x8b, 0xd8, 0x30, 0x46, + 0xa2, 0x32, 0x4e, 0x8c, 0x50, 0xf3, 0x30, 0xfb, 0xb9, 0x62, 0xf7, 0x55, 0x1a, 0xd1, 0xef, 0xe7, + 0x47, 0x42, 0xb8, 0x0a, 0x3b, 0x98, 0x64, 0x47, 0x21, 0x22, 0x4a, 0xaf, 0xc1, 0x34, 0xac, 0xc1, + 0x84, 0x62, 0x0d, 0xa8, 0x29, 0x99, 0x88, 0xfa, 0x70, 0x71, 0x33, 0xdc, 0x6e, 0xd7, 0x7d, 0x65, + 0xbf, 0xe2, 0xf3, 0x77, 0x08, 0x8f, 0x26, 0xa7, 0x05, 0x6f, 0x98, 0xf8, 0x70, 0x83, 0x7f, 0x82, + 0x30, 0x9c, 0x94, 0xba, 0x80, 0xab, 0xf1, 0x52, 0xee, 0x71, 0xe0, 0x0e, 0x8b, 0x00, 0xea, 0xd4, + 0x14, 0x86, 0xf6, 0x3c, 0xc8, 0xa6, 0x21, 0x53, 0x72, 0x50, 0x79, 0xe9, 0xe6, 0x56, 0xc2, 0xd1, + 0x21, 0xe1, 0x17, 0xf0, 0x30, 0xc7, 0x09, 0x4e, 0x2e, 0xe6, 0x3b, 0x06, 0x7c, 0x8f, 0xc5, 0xf9, + 0x52, 0x13, 0xcc, 0xd0, 0x1f, 0x86, 0x67, 0x58, 0xab, 0xc5, 0xd5, 0xfe, 0x3f, 0x2f, 0x60, 0xef, + 0x84, 0x25, 0x49, 0x06, 0xe7, 0x01, 0x8e, 0x85, 0xf7, 0x10, 0x3e, 0x27, 0x65, 0xf5, 0x21, 0xb8, + 0x89, 0xfd, 0x05, 0xe1, 0x69, 0x35, 0xb7, 0x03, 0xbc, 0x70,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0x15, 0x31, 0x4a, 0x0c, 0x28, 0x19, 0x25, 0x24, 0xd3, 0x8c, 0x36, 0xd9, 0x60, 0xbd, 0xc1, 0x47, + 0xa9, 0x99, 0xb4, 0x4b, 0x4f, 0xe3, 0xc7, 0x19, 0x8c, 0x67, 0x7b, 0x6d, 0x7b, 0xd5, 0xb5, 0x0d, + 0x4b, 0xe4, 0x55, 0xfa, 0x55, 0x7c, 0x2a, 0x33, 0x12, 0x5e, 0xf4, 0x8f, 0x47, 0x5f, 0x63, 0xf0, + 0xc6, 0xf3, 0xe0, 0x19, 0x56, 0xcb, 0xa8, 0x02, 0xae, 0x53, 0x1c, 0xd7, 0xad, 0x5e, 0xdb, 0xae, + 0x6f, 0xba, 0x76, 0x84, 0x2c, 0x65, 0x93, 0x4e, 0x80, 0x87, 0x82, 0xcf, 0x22, 0x94, 0x22, 0x78, + 0x6f, 0x89, 0xae, 0x63, 0x7a, 0x38, 0xbc, 0x5f, 0x92, 0xe4, 0x48, 0x0c, 0x67, 0x55, 0x19, 0xf2, + 0x56, 0xcb, 0x38, 0x07, 0x58, 0xc7, 0x63, 0x58, 0xc3, 0x50, 0x17, 0x78, 0x25, 0xf6, 0xe9, 0x6a, + 0xd4, 0x0a, 0x85, 0x91, 0xcf, 0xfa, 0x96, 0xef, 0x3d, 0x64, 0xe2, 0xa3, 0x6f, 0xc6, 0x2a, 0x90, + 0xa4, 0x3d, 0x60, 0xd9, 0xc1, 0x27, 0x52, 0x43, 0x40, 0x71, 0x5a, 0x1e, 0xfb, 0x49, 0x59, 0x63, + 0x12, 0x78, 0x9e, 0x06, 0x04, 0xad, 0x56, 0x48, 0xd3, 0x0b, 0x04, 0xa8, 0x99, 0x36, 0x1f, 0x5c, + 0xc9, 0xa6, 0x52, 0x71, 0x61, 0xf0, 0xa2, 0x3c, 0x7e, 0x28, 0xef, 0x69, 0x86, 0xff, 0x8e, 0xe8, + 0x63, 0xe6, 0x40, 0x00, 0xdf, 0x78, 0x78, 0xd8, 0xda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 0x71, 0x91, 0xab, 0x7d, 0x1d, 0xeb, 0xa9, 0xd6, 0x9f, 0xf6, 0x89, + 0x87, 0xd4, 0x06, 0x3e, 0x2b, 0x8c, 0xcf, 0x33, 0x64, 0xb9, 0x5c, 0x61, 0x60, 0x3b, 0x0d, 0x3f, + 0xa7, 0x3a, 0x30, 0xd6, 0xee, 0xfc, 0xbd, 0x32, 0xf0, 0xf6, 0xbd, 0xca, 0xc0, 0x9d, 0x7b, 0x15, + 0x74, 0xf7, 0x5e, 0x05, 0xfd, 0xed, 0x5e, 0x05, 0xbd, 0x79, 0xbf, 0x32, 0x70, 0xf7, 0x7e, 0x65, + 0xe0, 0xcf, 0xf7, 0x2b, 0x03, 0x5f, 0xa8, 0x25, 0x1a, 0xc9, 0xc1, 0x74, 0x8b, 0xee, 0xad, 0x5b, + 0xcd, 0xf5, 0xa6, 0xd5, 0x12, 0xd3, 0x03, 0x00, 0xd6, 0x54, 0x6e, 0x0c, 0xb3, 0xff, 0x45, 0xe0, + 0xf2, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xed, 0x31, 0x0d, 0xd8, 0x1c, 0x31, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2295,6 +2382,7 @@ type QueryClient interface { QueryFundModBalByAssetPool(ctx context.Context, in *QueryFundModBalByAssetPoolRequest, opts ...grpc.CallOption) (*QueryFundModBalByAssetPoolResponse, error) QueryLendInterest(ctx context.Context, in *QueryLendInterestRequest, opts ...grpc.CallOption) (*QueryLendInterestResponse, error) QueryBorrowInterest(ctx context.Context, in *QueryBorrowInterestRequest, opts ...grpc.CallOption) (*QueryBorrowInterestResponse, error) + QueryAllBorrowByOwnerAndDebtPool(ctx context.Context, in *QueryAllBorrowByOwnerAndDebtPoolRequest, opts ...grpc.CallOption) (*QueryAllBorrowByOwnerAndDebtPoolResponse, error) } type queryClient struct { @@ -2548,6 +2636,15 @@ func (c *queryClient) QueryBorrowInterest(ctx context.Context, in *QueryBorrowIn return out, nil } +func (c *queryClient) QueryAllBorrowByOwnerAndDebtPool(ctx context.Context, in *QueryAllBorrowByOwnerAndDebtPoolRequest, opts ...grpc.CallOption) (*QueryAllBorrowByOwnerAndDebtPoolResponse, error) { + out := new(QueryAllBorrowByOwnerAndDebtPoolResponse) + err := c.cc.Invoke(ctx, "/comdex.lend.v1beta1.Query/QueryAllBorrowByOwnerAndDebtPool", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { QueryLends(context.Context, *QueryLendsRequest) (*QueryLendsResponse, error) @@ -2577,6 +2674,7 @@ type QueryServer interface { QueryFundModBalByAssetPool(context.Context, *QueryFundModBalByAssetPoolRequest) (*QueryFundModBalByAssetPoolResponse, error) QueryLendInterest(context.Context, *QueryLendInterestRequest) (*QueryLendInterestResponse, error) QueryBorrowInterest(context.Context, *QueryBorrowInterestRequest) (*QueryBorrowInterestResponse, error) + QueryAllBorrowByOwnerAndDebtPool(context.Context, *QueryAllBorrowByOwnerAndDebtPoolRequest) (*QueryAllBorrowByOwnerAndDebtPoolResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -2664,6 +2762,9 @@ func (*UnimplementedQueryServer) QueryLendInterest(ctx context.Context, req *Que func (*UnimplementedQueryServer) QueryBorrowInterest(ctx context.Context, req *QueryBorrowInterestRequest) (*QueryBorrowInterestResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryBorrowInterest not implemented") } +func (*UnimplementedQueryServer) QueryAllBorrowByOwnerAndDebtPool(ctx context.Context, req *QueryAllBorrowByOwnerAndDebtPoolRequest) (*QueryAllBorrowByOwnerAndDebtPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAllBorrowByOwnerAndDebtPool not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -3155,6 +3256,24 @@ func _Query_QueryBorrowInterest_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _Query_QueryAllBorrowByOwnerAndDebtPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllBorrowByOwnerAndDebtPoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAllBorrowByOwnerAndDebtPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.lend.v1beta1.Query/QueryAllBorrowByOwnerAndDebtPool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAllBorrowByOwnerAndDebtPool(ctx, req.(*QueryAllBorrowByOwnerAndDebtPoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.lend.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -3267,6 +3386,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryBorrowInterest", Handler: _Query_QueryBorrowInterest_Handler, }, + { + MethodName: "QueryAllBorrowByOwnerAndDebtPool", + Handler: _Query_QueryAllBorrowByOwnerAndDebtPool_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/lend/v1beta1/query.proto", @@ -5185,6 +5308,102 @@ func (m *QueryBorrowInterestResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } +func (m *QueryAllBorrowByOwnerAndDebtPoolRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllBorrowByOwnerAndDebtPoolRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllBorrowByOwnerAndDebtPoolRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.PoolId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllBorrowByOwnerAndDebtPoolResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllBorrowByOwnerAndDebtPoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllBorrowByOwnerAndDebtPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Borrows) > 0 { + for iNdEx := len(m.Borrows) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Borrows[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -5931,6 +6150,45 @@ func (m *QueryBorrowInterestResponse) Size() (n int) { return n } +func (m *QueryAllBorrowByOwnerAndDebtPoolRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.PoolId != 0 { + n += 1 + sovQuery(uint64(m.PoolId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllBorrowByOwnerAndDebtPoolResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Borrows) > 0 { + for _, e := range m.Borrows { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -10711,6 +10969,263 @@ func (m *QueryBorrowInterestResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryAllBorrowByOwnerAndDebtPoolRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllBorrowByOwnerAndDebtPoolRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllBorrowByOwnerAndDebtPoolRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) + } + m.PoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllBorrowByOwnerAndDebtPoolResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllBorrowByOwnerAndDebtPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllBorrowByOwnerAndDebtPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Borrows", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Borrows = append(m.Borrows, BorrowAsset{}) + if err := m.Borrows[len(m.Borrows)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/lend/types/query.pb.gw.go b/x/lend/types/query.pb.gw.go index c461af7b3..9beb9221d 100644 --- a/x/lend/types/query.pb.gw.go +++ b/x/lend/types/query.pb.gw.go @@ -1385,6 +1385,100 @@ func local_request_Query_QueryBorrowInterest_0(ctx context.Context, marshaler ru } +var ( + filter_Query_QueryAllBorrowByOwnerAndDebtPool_0 = &utilities.DoubleArray{Encoding: map[string]int{"owner": 0, "pool_id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_Query_QueryAllBorrowByOwnerAndDebtPool_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBorrowByOwnerAndDebtPoolRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["owner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") + } + + protoReq.Owner, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) + } + + val, ok = pathParams["pool_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") + } + + protoReq.PoolId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllBorrowByOwnerAndDebtPool_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryAllBorrowByOwnerAndDebtPool(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAllBorrowByOwnerAndDebtPool_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBorrowByOwnerAndDebtPoolRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["owner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") + } + + protoReq.Owner, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) + } + + val, ok = pathParams["pool_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") + } + + protoReq.PoolId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllBorrowByOwnerAndDebtPool_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryAllBorrowByOwnerAndDebtPool(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -2012,6 +2106,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryAllBorrowByOwnerAndDebtPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryAllBorrowByOwnerAndDebtPool_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAllBorrowByOwnerAndDebtPool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -2593,6 +2710,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryAllBorrowByOwnerAndDebtPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryAllBorrowByOwnerAndDebtPool_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAllBorrowByOwnerAndDebtPool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -2650,6 +2787,8 @@ var ( pattern_Query_QueryLendInterest_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "lend", "v1beta1", "lend_interest"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryBorrowInterest_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "lend", "v1beta1", "borrow_interest"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAllBorrowByOwnerAndDebtPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "lend", "v1beta1", "borrows_by_owner_debt_pool", "owner", "pool_id"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -2706,4 +2845,6 @@ var ( forward_Query_QueryLendInterest_0 = runtime.ForwardResponseMessage forward_Query_QueryBorrowInterest_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAllBorrowByOwnerAndDebtPool_0 = runtime.ForwardResponseMessage ) From fc9a0b2972916e8ead659149850aa916eebe9821 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 9 Aug 2023 15:41:09 +0530 Subject: [PATCH 150/155] make endpoints consistent --- .../comdex/liquidationsV2/v1beta1/query.proto | 14 +- x/liquidationsV2/types/query.pb.go | 120 +++++++++--------- x/liquidationsV2/types/query.pb.gw.go | 14 +- 3 files changed, 74 insertions(+), 74 deletions(-) diff --git a/proto/comdex/liquidationsV2/v1beta1/query.proto b/proto/comdex/liquidationsV2/v1beta1/query.proto index c0031f214..f66384117 100644 --- a/proto/comdex/liquidationsV2/v1beta1/query.proto +++ b/proto/comdex/liquidationsV2/v1beta1/query.proto @@ -93,24 +93,24 @@ message QueryAppReserveFundsTxDataResponse { service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/comdex-official/comdex/liquidationsV2/params"; + option (google.api.http).get = "/comdex/liquidations/v2/params"; } rpc QueryLockedVault(QueryLockedVaultRequest) returns (QueryLockedVaultResponse) { - option (google.api.http).get = "/comdex/liquidationsV2/v1beta1/locked_vault/{app_id}/{id}"; + option (google.api.http).get = "/comdex/liquidations/v2/locked_vault/{app_id}/{id}"; } rpc QueryLockedVaults(QueryLockedVaultsRequest) returns (QueryLockedVaultsResponse) { - option (google.api.http).get = "/comdex/liquidationsV2/v1beta1/locked_vaults"; + option (google.api.http).get = "/comdex/liquidations/v2/locked_vaults"; } rpc QueryLiquidationWhiteListing(QueryLiquidationWhiteListingRequest) returns (QueryLiquidationWhiteListingResponse) { - option (google.api.http).get = "/comdex/liquidationsV2/v1beta1/liquidation_whiteListing/{app_id}"; + option (google.api.http).get = "/comdex/liquidations/v2/liquidation_whiteListing/{app_id}"; } rpc QueryLiquidationWhiteListings(QueryLiquidationWhiteListingsRequest) returns (QueryLiquidationWhiteListingsResponse) { - option (google.api.http).get = "/comdex/liquidationsV2/v1beta1/liquidation_whiteListings"; + option (google.api.http).get = "/comdex/liquidations/v2/liquidation_whiteListings"; } rpc QueryLockedVaultsHistory(QueryLockedVaultsHistoryRequest) returns (QueryLockedVaultsHistoryResponse) { - option (google.api.http).get = "/comdex/liquidationsV2/v1beta1/locked_vaults_history"; + option (google.api.http).get = "/comdex/liquidations/v2/locked_vaults_history"; } rpc QueryAppReserveFundsTxData(QueryAppReserveFundsTxDataRequest) returns (QueryAppReserveFundsTxDataResponse) { - option (google.api.http).get = "/comdex/liquidationsV2/v1beta1/app_reserve_funds_tx_data/{app_id}"; + option (google.api.http).get = "/comdex/liquidations/v2/app_reserve_funds_tx_data/{app_id}"; } } diff --git a/x/liquidationsV2/types/query.pb.go b/x/liquidationsV2/types/query.pb.go index 7e9adfb2f..7873ee24e 100644 --- a/x/liquidationsV2/types/query.pb.go +++ b/x/liquidationsV2/types/query.pb.go @@ -692,67 +692,67 @@ func init() { } var fileDescriptor_5ed3babcdef7f922 = []byte{ - // 954 bytes of a gzipped FileDescriptorProto + // 950 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0x98, 0x36, 0x87, 0x49, 0x41, 0x74, 0x92, 0xa8, 0xce, 0x92, 0xda, 0x61, 0x68, 0x69, - 0xa9, 0xc8, 0xae, 0x12, 0x42, 0x08, 0xa1, 0x02, 0xdb, 0xa9, 0x50, 0x2b, 0xf5, 0x00, 0x2b, 0x54, - 0xa4, 0x4a, 0x60, 0x8d, 0xbd, 0x93, 0xcd, 0xc0, 0xda, 0xbb, 0xf1, 0xac, 0x43, 0xac, 0xaa, 0x12, - 0x42, 0x80, 0xc4, 0x0d, 0x89, 0x0b, 0x42, 0xe2, 0x0a, 0xff, 0x04, 0x12, 0x07, 0x24, 0xd4, 0x63, - 0x25, 0x2e, 0x70, 0x89, 0x50, 0x82, 0x38, 0x20, 0x2e, 0xf4, 0x2f, 0x40, 0x3b, 0x33, 0xb6, 0xd7, - 0xd9, 0x5f, 0x5e, 0x5b, 0xed, 0x2d, 0x9a, 0xbc, 0xf7, 0xbd, 0xef, 0xfb, 0xde, 0xdb, 0x37, 0x63, - 0xf8, 0x52, 0xd3, 0x6d, 0x59, 0xf4, 0xd0, 0x70, 0xd8, 0x7e, 0x97, 0x59, 0xc4, 0x67, 0x6e, 0x9b, - 0xdf, 0x59, 0x37, 0x0e, 0xd6, 0x1a, 0xd4, 0x27, 0x6b, 0xc6, 0x7e, 0x97, 0x76, 0x7a, 0xba, 0xd7, - 0x71, 0x7d, 0x17, 0x5d, 0x94, 0xa1, 0xfa, 0x68, 0xa8, 0xae, 0x42, 0xb5, 0x05, 0xdb, 0xb5, 0x5d, - 0x11, 0x69, 0x04, 0x7f, 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 0xb4, 0xed, 0x05, + 0x10, 0x94, 0xb4, 0x86, 0x90, 0x76, 0x1d, 0xd5, 0x93, 0xa4, 0x25, 0x5e, 0xdf, 0xe3, 0x21, 0x6d, + 0x98, 0x0f, 0x0f, 0x8b, 0xe0, 0xd1, 0x61, 0x11, 0xfc, 0x73, 0x58, 0x04, 0xdf, 0x1f, 0x15, 0x97, + 0x1e, 0x1d, 0x15, 0x97, 0xfe, 0x3e, 0x2a, 0x2e, 0xdd, 0xbd, 0x6a, 0x33, 0x7f, 0xb7, 0xdf, 0x0a, + 0x68, 0x2a, 0xfc, 0x8a, 0xbb, 0xb3, 0xc3, 0xda, 0x8c, 0x38, 0xa3, 0x7a, 0x91, 0x5f, 0x7f, 0xfe, + 0xd0, 0xa3, 0xbc, 0xb5, 0x2c, 0x7e, 0xf2, 0x5d, 0xfa, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x10, 0xd9, + 0x33, 0x9d, 0xf9, 0x0e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/liquidationsV2/types/query.pb.gw.go b/x/liquidationsV2/types/query.pb.gw.go index c3dbe1a9a..5f0e18709 100644 --- a/x/liquidationsV2/types/query.pb.gw.go +++ b/x/liquidationsV2/types/query.pb.gw.go @@ -695,19 +695,19 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex-official", "comdex", "liquidationsV2", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "liquidations", "v2", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryLockedVault_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "liquidationsV2", "v1beta1", "locked_vault", "app_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryLockedVault_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"comdex", "liquidations", "v2", "locked_vault", "app_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryLockedVaults_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "liquidationsV2", "v1beta1", "locked_vaults"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryLockedVaults_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "liquidations", "v2", "locked_vaults"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryLiquidationWhiteListing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "liquidationsV2", "v1beta1", "liquidation_whiteListing", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryLiquidationWhiteListing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "liquidations", "v2", "liquidation_whiteListing", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryLiquidationWhiteListings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "liquidationsV2", "v1beta1", "liquidation_whiteListings"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryLiquidationWhiteListings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "liquidations", "v2", "liquidation_whiteListings"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryLockedVaultsHistory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "liquidationsV2", "v1beta1", "locked_vaults_history"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryLockedVaultsHistory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "liquidations", "v2", "locked_vaults_history"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryAppReserveFundsTxData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "liquidationsV2", "v1beta1", "app_reserve_funds_tx_data", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryAppReserveFundsTxData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "liquidations", "v2", "app_reserve_funds_tx_data", "app_id"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( From 093ee8a8f5ff5607a9e929dfa5525288cfacd9a2 Mon Sep 17 00:00:00 2001 From: Pratik Date: Wed, 9 Aug 2023 22:32:29 +0530 Subject: [PATCH 151/155] add historical bid for english auction --- x/auctionsV2/keeper/auctions.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 9d8a3b975..0a4a52003 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -1,6 +1,7 @@ package keeper import ( + tokenminttypes "github.com/comdex-official/comdex/x/tokenmint/types" "time" auctiontypes "github.com/comdex-official/comdex/x/auction/types" @@ -380,6 +381,12 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio return err } + // send debt token to tokenMint module + err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, tokenminttypes.ModuleName, sdk.NewCoins(englishAuction.DebtToken)) + if err != nil { + return err + } + err = k.tokenMint.BurnTokensForApp(ctx, englishAuction.AppId, englishAuction.DebtAssetId, englishAuction.DebtToken.Amount) if err != nil { return err @@ -411,6 +418,16 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio return err } + err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, tokenminttypes.ModuleName, auctionsV2types.ModuleName, sdk.NewCoins(englishAuction.CollateralToken)) + if err != nil { + return err + } + + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(englishAuction.CollateralToken)) + if err != nil { + return err + } + err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(englishAuction.DebtToken)) if err != nil { return err @@ -451,6 +468,14 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio } } + err = k.DeleteIndividualUserBid(ctx, bidding) + if err != nil { + return err + } + err = k.SetBidHistorical(ctx, bidding) + if err != nil { + return err + } err = k.DeleteAuction(ctx, englishAuction) if err != nil { return err From d4aca47e694df4149d4095cdc2f965f46adc4077 Mon Sep 17 00:00:00 2001 From: Pratik Date: Thu, 10 Aug 2023 05:55:20 +0530 Subject: [PATCH 152/155] minor refactor --- x/auctionsV2/keeper/auctions.go | 37 +++++++++++++++++---------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index 0a4a52003..c7c899786 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -413,27 +413,17 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio //send newly minted token((collateral)) to the user // send debt to collector to get added //set net fees data - err = k.tokenMint.MintNewTokensForApp(ctx, englishAuction.AppId, englishAuction.CollateralAssetId, bidding.BidderAddress, englishAuction.CollateralToken.Amount) + err = k.tokenMint.MintNewTokensForApp(ctx, englishAuction.AppId, englishAuction.DebtAssetId, bidding.BidderAddress, englishAuction.DebtToken.Amount) if err != nil { return err } - err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, tokenminttypes.ModuleName, auctionsV2types.ModuleName, sdk.NewCoins(englishAuction.CollateralToken)) + err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(englishAuction.CollateralToken)) if err != nil { return err } - err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctionsV2types.ModuleName, bidder, sdk.NewCoins(englishAuction.CollateralToken)) - if err != nil { - return err - } - - err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(englishAuction.DebtToken)) - if err != nil { - return err - } - - err = k.collector.SetNetFeeCollectedData(ctx, englishAuction.AppId, englishAuction.DebtAssetId, englishAuction.DebtToken.Amount) + err = k.collector.SetNetFeeCollectedData(ctx, englishAuction.AppId, englishAuction.CollateralAssetId, englishAuction.CollateralToken.Amount) if err != nil { return auctiontypes.ErrorUnableToSetNetFees } @@ -468,18 +458,29 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio } } - err = k.DeleteIndividualUserBid(ctx, bidding) - if err != nil { - return err + for _, v := range englishAuction.BiddingIds { + bid, _ := k.GetUserBid(ctx, v.BidId) + err = k.DeleteIndividualUserBid(ctx, bid) + if err != nil { + return err + } + err = k.SetBidHistorical(ctx, bid) + if err != nil { + return err + } } - err = k.SetBidHistorical(ctx, bidding) + + err = k.DeleteAuction(ctx, englishAuction) if err != nil { return err } - err = k.DeleteAuction(ctx, englishAuction) + + auctionHistoricalData := auctionsV2types.AuctionHistorical{AuctionId: englishAuction.AuctionId, AuctionHistorical: &englishAuction, LockedVault: &liquidationData} + err = k.SetAuctionHistorical(ctx, auctionHistoricalData) if err != nil { return err } + k.LiquidationsV2.DeleteLockedVault(ctx, englishAuction.AppId, liquidationData.LockedVaultId) return nil From babf76ef97c9a4fc95db80836953e746f3f16521 Mon Sep 17 00:00:00 2001 From: Pratik Date: Thu, 10 Aug 2023 06:08:19 +0530 Subject: [PATCH 153/155] updating error --- x/auctionsV2/keeper/auctions.go | 12 +++++------- x/auctionsV2/types/errors.go | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x/auctionsV2/keeper/auctions.go b/x/auctionsV2/keeper/auctions.go index c7c899786..6eedb19db 100644 --- a/x/auctionsV2/keeper/auctions.go +++ b/x/auctionsV2/keeper/auctions.go @@ -4,8 +4,6 @@ import ( tokenminttypes "github.com/comdex-official/comdex/x/tokenmint/types" "time" - auctiontypes "github.com/comdex-official/comdex/x/auction/types" - utils "github.com/comdex-official/comdex/types" "github.com/comdex-official/comdex/x/auctionsV2/types" @@ -394,12 +392,12 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio err = k.collector.SetNetFeeCollectedData(ctx, englishAuction.AppId, englishAuction.CollateralAssetId, englishAuction.CollateralToken.Amount) if err != nil { - return auctiontypes.ErrorUnableToSetNetFees + return types.ErrorUnableToSetNetFees } auctionLookupTable, found := k.collector.GetAuctionMappingForApp(ctx, englishAuction.AppId, englishAuction.CollateralAssetId) if !found { - return auctiontypes.ErrorInvalidAddress + return types.ErrAuctionLookupTableNotFound } auctionLookupTable.IsAuctionActive = false @@ -425,12 +423,12 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio err = k.collector.SetNetFeeCollectedData(ctx, englishAuction.AppId, englishAuction.CollateralAssetId, englishAuction.CollateralToken.Amount) if err != nil { - return auctiontypes.ErrorUnableToSetNetFees + return types.ErrorUnableToSetNetFees } - auctionLookupTable, found := k.collector.GetAuctionMappingForApp(ctx, englishAuction.AppId, englishAuction.DebtAssetId) + auctionLookupTable, found := k.collector.GetAuctionMappingForApp(ctx, englishAuction.AppId, englishAuction.CollateralAssetId) if !found { - return auctiontypes.ErrorInvalidAddress + return types.ErrAuctionLookupTableNotFound } auctionLookupTable.IsAuctionActive = false diff --git a/x/auctionsV2/types/errors.go b/x/auctionsV2/types/errors.go index f176020db..8cfad6775 100644 --- a/x/auctionsV2/types/errors.go +++ b/x/auctionsV2/types/errors.go @@ -21,4 +21,6 @@ var ( ErrorUnknownProposalType = sdkerrors.Register(ModuleName, 711, "unknown proposal type") ErrorUnknownDebtToken = sdkerrors.Register(ModuleName, 712, "Bid token is not the debt token") ErrorDiscountGreaterThanMaxDiscount = sdkerrors.Register(ModuleName, 713, "Premium discount entered is greater than max discount") + ErrAuctionLookupTableNotFound = sdkerrors.Register(ModuleName, 714, "auctionLookupTable not found") + ErrorUnableToSetNetFees = sdkerrors.Register(ModuleName, 715, "Unable To set net fees collected after auction closed") ) From 921c2ccd1aa247137c2ebef9577c6f8d58197235 Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 14 Aug 2023 07:45:19 +0530 Subject: [PATCH 154/155] adding stATOM params for testnet upgrade --- app/app.go | 2 +- app/upgrades/mainnet/v12/constants.go | 2 +- app/upgrades/mainnet/v12/upgrades.go | 84 ++++++++++++++++++++++++--- 3 files changed, 79 insertions(+), 9 deletions(-) diff --git a/app/app.go b/app/app.go index 3ceec3de0..482bef673 100644 --- a/app/app.go +++ b/app/app.go @@ -1454,7 +1454,7 @@ func (a *App) registerUpgradeHandlers() { case upgradeInfo.Name == mv12.UpgradeName: a.UpgradeKeeper.SetUpgradeHandler( mv12.UpgradeName, - mv12.CreateUpgradeHandlerV12(a.mm, a.configurator, a.ICQKeeper, a.NewliqKeeper, a.NewaucKeeper, a.BankKeeper, a.CollectorKeeper, a.LendKeeper, a.AuctionKeeper, a.LiquidationKeeper), + mv12.CreateUpgradeHandlerV12(a.mm, a.configurator, a.ICQKeeper, a.NewliqKeeper, a.NewaucKeeper, a.BankKeeper, a.CollectorKeeper, a.LendKeeper, a.AuctionKeeper, a.LiquidationKeeper, a.AssetKeeper), ) } diff --git a/app/upgrades/mainnet/v12/constants.go b/app/upgrades/mainnet/v12/constants.go index 1d759edc1..5f2335d07 100644 --- a/app/upgrades/mainnet/v12/constants.go +++ b/app/upgrades/mainnet/v12/constants.go @@ -1,7 +1,7 @@ package v12 const ( - UpgradeName = "v12.rc2" + UpgradeName = "v12.rc3" UpgradeHeight = "" UpgradeInfo = `'{ "binaries": { diff --git a/app/upgrades/mainnet/v12/upgrades.go b/app/upgrades/mainnet/v12/upgrades.go index bb40350d6..7261c3f3c 100644 --- a/app/upgrades/mainnet/v12/upgrades.go +++ b/app/upgrades/mainnet/v12/upgrades.go @@ -2,6 +2,8 @@ package v12 import ( "fmt" + assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" + assettypes "github.com/comdex-official/comdex/x/asset/types" auctionkeeperold "github.com/comdex-official/comdex/x/auction/keeper" auctiontypes "github.com/comdex-official/comdex/x/auction/types" auctionkeeper "github.com/comdex-official/comdex/x/auctionsV2/keeper" @@ -37,6 +39,7 @@ func CreateUpgradeHandlerV12( lendKeeper lendkeeper.Keeper, auctionKeeperOld auctionkeeperold.Keeper, liquidationKeeperOld liquidationkeeperold.Keeper, + assetKeeper assetkeeper.Keeper, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info("Applying main net upgrade - v.12.0.0") @@ -49,6 +52,7 @@ func CreateUpgradeHandlerV12( if err != nil { return nil, err } + UpdateLendParams(ctx, lendKeeper, assetKeeper) InitializeStates(ctx, liquidationKeeper, auctionKeeper) Refund(ctx, bankKeeper, collectorKeeper) RemoveFaultyAuctions(ctx, lendKeeper, auctionKeeperOld, liquidationKeeperOld, bankKeeper) @@ -56,13 +60,79 @@ func CreateUpgradeHandlerV12( } } +func dec(num string) sdk.Dec { + decVal, _ := sdk.NewDecFromStr(num) + return decVal +} + +func UpdateLendParams( + ctx sdk.Context, + lendKeeper lendkeeper.Keeper, + assetKeeper assetkeeper.Keeper, +) { + + cSTATOM := assettypes.Asset{ + Name: "CSTATOM", + Denom: "ucstatom", + Decimals: sdk.NewInt(1000000), + IsOnChain: true, + IsOraclePriceRequired: false, + IsCdpMintable: true, + } + err := assetKeeper.AddAssetRecords(ctx, cSTATOM) + if err != nil { + fmt.Println(err) + } + assetID := assetKeeper.GetAssetID(ctx) + + assetRatesParamsSTAtom := lendtypes.AssetRatesParams{ + AssetID: 14, + UOptimal: dec("0.75"), + Base: dec("0.002"), + Slope1: dec("0.07"), + Slope2: dec("1.25"), + EnableStableBorrow: false, + Ltv: dec("0.7"), + LiquidationThreshold: dec("0.75"), + LiquidationPenalty: dec("0.05"), + LiquidationBonus: dec("0.05"), + ReserveFactor: dec("0.2"), + CAssetID: assetID, + IsIsolated: false, + } + lendKeeper.SetAssetRatesParams(ctx, assetRatesParamsSTAtom) + + assetRatesParamsCmdx, _ := lendKeeper.GetAssetRatesParams(ctx, 2) + assetRatesParamsCmdx.LiquidationPenalty = dec("0.075") + assetRatesParamsCmdx.LiquidationBonus = dec("0.075") + lendKeeper.SetAssetRatesParams(ctx, assetRatesParamsCmdx) + + assetRatesParamsCmst, _ := lendKeeper.GetAssetRatesParams(ctx, 3) + assetRatesParamsCmst.LiquidationPenalty = dec("0.05") + assetRatesParamsCmst.LiquidationBonus = dec("0.05") + lendKeeper.SetAssetRatesParams(ctx, assetRatesParamsCmst) + + cAXLUSDC := assettypes.Asset{ + Name: "CAXLUSDC", + Denom: "ucaxlusdc", + Decimals: sdk.NewInt(1000000), + IsOnChain: true, + IsOraclePriceRequired: false, + IsCdpMintable: true, + } + err = assetKeeper.AddAssetRecords(ctx, cAXLUSDC) + if err != nil { + fmt.Println(err) + } +} + func InitializeStates( ctx sdk.Context, liquidationKeeper liquidationkeeper.Keeper, auctionKeeper auctionkeeper.Keeper, ) { dutchAuctionParams := liquidationtypes.DutchAuctionParam{ - Premium: newDec("1.2"), + Premium: newDec("1.15"), Discount: newDec("0.7"), DecrementFactor: sdk.NewInt(1), } @@ -70,17 +140,17 @@ func InitializeStates( harborParams := liquidationtypes.LiquidationWhiteListing{ AppId: 2, - Initiator: false, + Initiator: true, IsDutchActivated: true, DutchAuctionParam: &dutchAuctionParams, - IsEnglishActivated: false, + IsEnglishActivated: true, EnglishAuctionParam: &englishAuctionParams, KeeeperIncentive: sdk.ZeroDec(), } commodoParams := liquidationtypes.LiquidationWhiteListing{ AppId: 3, - Initiator: false, + Initiator: true, IsDutchActivated: true, DutchAuctionParam: &dutchAuctionParams, IsEnglishActivated: false, @@ -108,10 +178,10 @@ func InitializeStates( auctionParams := auctionsV2types.AuctionParams{ AuctionDurationSeconds: 18000, Step: newDec("0.1"), - WithdrawalFee: newDec("0.0"), - ClosingFee: newDec("0.0"), + WithdrawalFee: newDec("0.0005"), + ClosingFee: newDec("0.0005"), MinUsdValueLeft: 100000, - BidFactor: newDec("0.1"), + BidFactor: newDec("0.01"), LiquidationPenalty: newDec("0.1"), AuctionBonus: newDec("0.0"), } From dcafebd55b5c3de48ae58791c3c33f82d4ed100b Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 14 Aug 2023 08:05:49 +0530 Subject: [PATCH 155/155] adding auctions historical query --- proto/comdex/auctionsV2/v1beta1/query.proto | 18 + x/auctionsV2/client/cli/query.go | 39 ++ x/auctionsV2/keeper/grpc_query.go | 49 ++ x/auctionsV2/types/query.pb.go | 688 +++++++++++++++++--- x/auctionsV2/types/query.pb.gw.go | 119 ++++ 5 files changed, 817 insertions(+), 96 deletions(-) diff --git a/proto/comdex/auctionsV2/v1beta1/query.proto b/proto/comdex/auctionsV2/v1beta1/query.proto index 02305ace6..16382ca10 100644 --- a/proto/comdex/auctionsV2/v1beta1/query.proto +++ b/proto/comdex/auctionsV2/v1beta1/query.proto @@ -175,6 +175,21 @@ message QueryBidsFilterResponse { [(gogoproto.moretags) = "yaml:\"pagination\""]; } +message QueryAuctionsHistoryRequest { + uint64 auction_type = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + +message QueryAuctionsHistoryResponse { + repeated AuctionHistorical auctions = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"auctions\"" + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2 + [(gogoproto.moretags) = "yaml:\"pagination\""]; +} + service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/comdex/auctions/v2/params"; @@ -209,4 +224,7 @@ service Query { rpc BidsFilter(QueryBidsFilterRequest) returns (QueryBidsFilterResponse) { option (google.api.http).get = "/comdex/auctions/v2/bids_filter/{bidder}/{bid_type}/{history}"; } + rpc AuctionsHistory(QueryAuctionsHistoryRequest) returns (QueryAuctionsHistoryResponse) { + option (google.api.http).get = "/comdex/auctions/v2/auctions_history/{auction_type}"; + } } \ No newline at end of file diff --git a/x/auctionsV2/client/cli/query.go b/x/auctionsV2/client/cli/query.go index 3a0ed0223..6860d4205 100644 --- a/x/auctionsV2/client/cli/query.go +++ b/x/auctionsV2/client/cli/query.go @@ -38,6 +38,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { queryAuctionFeesCollectionData(), queryLimitBidProtocolDataWithAddress(), queryBidsFilter(), + queryAuctionsHistory(), ) return cmd @@ -424,3 +425,41 @@ func queryBidsFilter() *cobra.Command { return cmd } + +func queryAuctionsHistory() *cobra.Command { + cmd := &cobra.Command{ + Use: "auctions-history [type]", + Short: "Query all auctions history", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + auctionType, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + queryClient := types.NewQueryClient(ctx) + res, err := queryClient.AuctionsHistory( + context.Background(), + &types.QueryAuctionsHistoryRequest{ + AuctionType: auctionType, + Pagination: pagination, + }, + ) + if err != nil { + return err + } + return ctx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "auctions-history") + return cmd +} diff --git a/x/auctionsV2/keeper/grpc_query.go b/x/auctionsV2/keeper/grpc_query.go index d03ed8b40..a73917637 100644 --- a/x/auctionsV2/keeper/grpc_query.go +++ b/x/auctionsV2/keeper/grpc_query.go @@ -448,3 +448,52 @@ func (q QueryServer) BidsFilter(c context.Context, req *types.QueryBidsFilterReq Pagination: pagination, }, nil } + +func (q QueryServer) AuctionsHistory(c context.Context, req *types.QueryAuctionsHistoryRequest) (*types.QueryAuctionsHistoryResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + + var ( + items []types.AuctionHistorical + ctx = sdk.UnwrapSDKContext(c) + key []byte + ) + key = types.AuctionHistoricalKeyPrefix + + pagination, err := query.FilteredPaginate( + prefix.NewStore(q.Store(ctx), key), + req.Pagination, + func(_, value []byte, accumulate bool) (bool, error) { + var item types.AuctionHistorical + if err := q.cdc.Unmarshal(value, &item); err != nil { + return false, err + } + + if req.AuctionType == 1 { + if accumulate { + if item.AuctionHistorical.AuctionType { + items = append(items, item) + } + } + } else if req.AuctionType == 2 { + if accumulate && !item.AuctionHistorical.AuctionType && item.LockedVault.InitiatorType == "surplus" { + items = append(items, item) + } + } else if req.AuctionType == 3 { + if accumulate && !item.AuctionHistorical.AuctionType && item.LockedVault.InitiatorType == "debt" { + items = append(items, item) + } + } + return true, nil + }, + ) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAuctionsHistoryResponse{ + Auctions: items, + Pagination: pagination, + }, nil +} diff --git a/x/auctionsV2/types/query.pb.go b/x/auctionsV2/types/query.pb.go index b5657ef1f..90249ce88 100644 --- a/x/auctionsV2/types/query.pb.go +++ b/x/auctionsV2/types/query.pb.go @@ -1206,6 +1206,110 @@ func (m *QueryBidsFilterResponse) GetPagination() *query.PageResponse { return nil } +type QueryAuctionsHistoryRequest struct { + AuctionType uint64 `protobuf:"varint,1,opt,name=auction_type,json=auctionType,proto3" json:"auction_type,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAuctionsHistoryRequest) Reset() { *m = QueryAuctionsHistoryRequest{} } +func (m *QueryAuctionsHistoryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAuctionsHistoryRequest) ProtoMessage() {} +func (*QueryAuctionsHistoryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{22} +} +func (m *QueryAuctionsHistoryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAuctionsHistoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAuctionsHistoryRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAuctionsHistoryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAuctionsHistoryRequest.Merge(m, src) +} +func (m *QueryAuctionsHistoryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAuctionsHistoryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAuctionsHistoryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAuctionsHistoryRequest proto.InternalMessageInfo + +func (m *QueryAuctionsHistoryRequest) GetAuctionType() uint64 { + if m != nil { + return m.AuctionType + } + return 0 +} + +func (m *QueryAuctionsHistoryRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAuctionsHistoryResponse struct { + Auctions []AuctionHistorical `protobuf:"bytes,1,rep,name=auctions,proto3" json:"auctions" yaml:"auctions"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` +} + +func (m *QueryAuctionsHistoryResponse) Reset() { *m = QueryAuctionsHistoryResponse{} } +func (m *QueryAuctionsHistoryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAuctionsHistoryResponse) ProtoMessage() {} +func (*QueryAuctionsHistoryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5270c3f1c79728ac, []int{23} +} +func (m *QueryAuctionsHistoryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAuctionsHistoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAuctionsHistoryResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAuctionsHistoryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAuctionsHistoryResponse.Merge(m, src) +} +func (m *QueryAuctionsHistoryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAuctionsHistoryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAuctionsHistoryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAuctionsHistoryResponse proto.InternalMessageInfo + +func (m *QueryAuctionsHistoryResponse) GetAuctions() []AuctionHistorical { + if m != nil { + return m.Auctions + } + return nil +} + +func (m *QueryAuctionsHistoryResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "comdex.auctionsV2.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "comdex.auctionsV2.v1beta1.QueryParamsResponse") @@ -1229,6 +1333,8 @@ func init() { proto.RegisterType((*QueryLimitBidProtocolDataWithUserResponse)(nil), "comdex.auctionsV2.v1beta1.QueryLimitBidProtocolDataWithUserResponse") proto.RegisterType((*QueryBidsFilterRequest)(nil), "comdex.auctionsV2.v1beta1.QueryBidsFilterRequest") proto.RegisterType((*QueryBidsFilterResponse)(nil), "comdex.auctionsV2.v1beta1.QueryBidsFilterResponse") + proto.RegisterType((*QueryAuctionsHistoryRequest)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionsHistoryRequest") + proto.RegisterType((*QueryAuctionsHistoryResponse)(nil), "comdex.auctionsV2.v1beta1.QueryAuctionsHistoryResponse") } func init() { @@ -1236,102 +1342,107 @@ func init() { } var fileDescriptor_5270c3f1c79728ac = []byte{ - // 1520 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4d, 0x6c, 0x1b, 0x55, - 0x10, 0xce, 0xb3, 0x43, 0x7e, 0x26, 0x4d, 0x69, 0x5e, 0xd2, 0xfc, 0x98, 0xd4, 0x4e, 0x5e, 0x21, - 0x4d, 0x5b, 0xe2, 0x4d, 0xd2, 0x96, 0x56, 0x85, 0xa6, 0xd4, 0x6d, 0x03, 0x29, 0xa8, 0x94, 0x55, - 0xda, 0x4a, 0x48, 0xc5, 0x5a, 0x7b, 0x37, 0xce, 0xaa, 0x6b, 0xaf, 0xeb, 0xdd, 0x94, 0x46, 0x51, - 0x0e, 0x70, 0x05, 0x89, 0x4a, 0x48, 0x9c, 0xb8, 0xf4, 0x82, 0x38, 0x70, 0xe2, 0xc8, 0x81, 0x03, - 0x42, 0xa8, 0xe2, 0x14, 0x89, 0x0b, 0xe2, 0x10, 0xa1, 0x16, 0xc4, 0xa9, 0x42, 0xe4, 0xc0, 0x85, - 0x0b, 0xda, 0xf7, 0x66, 0x6d, 0xaf, 0xb3, 0xde, 0xdd, 0x04, 0xa7, 0x42, 0x9c, 0xe2, 0xdd, 0x9d, - 0x37, 0xf3, 0x7d, 0xf3, 0xcd, 0xbc, 0xbf, 0xc0, 0x0b, 0x79, 0xb3, 0xa8, 0x6a, 0xf7, 0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9, 0x30, 0x74, 0x2e, 0xeb, 0x96, 0x6d, 0x56, 0x56, 0x87, 0x63, 0x63, - 0x64, 0xb2, 0x4b, 0x76, 0x1f, 0x99, 0x01, 0x03, 0x5e, 0x7f, 0x08, 0x74, 0x11, 0x3a, 0x71, 0x38, - 0x22, 0x65, 0x01, 0x48, 0x71, 0x70, 0x66, 0xd0, 0x81, 0xba, 0xb5, 0x99, 0xda, 0xbf, 0xaa, 0x14, - 0x8d, 0xb3, 0x0c, 0x2d, 0x99, 0xec, 0xba, 0x62, 0x5f, 0x11, 0x6f, 0x38, 0x37, 0x5d, 0x74, 0x1c, - 0xf6, 0xb9, 0xf8, 0xed, 0xd5, 0xb2, 0x86, 0x0c, 0x7a, 0xf0, 0xdd, 0xe2, 0x6a, 0x59, 0x6b, 0xce, - 0x81, 0xde, 0x02, 0xa8, 0xd5, 0xc2, 0x70, 0x9c, 0xc3, 0x9d, 0x48, 0x8b, 0xc2, 0x49, 0x3b, 0x85, - 0x93, 0x16, 0x05, 0x5a, 0x4b, 0x6c, 0x41, 0xc3, 0xc0, 0x99, 0x83, 0x5b, 0x9b, 0xa9, 0x3e, 0x01, - 0xb7, 0xe6, 0x83, 0xc9, 0x75, 0x0e, 0xd9, 0x06, 0x81, 0x83, 0x0d, 0xa0, 0x31, 0x49, 0x37, 0xa1, - 0xcb, 0xcd, 0xc6, 0x30, 0x19, 0x8b, 0x47, 0xcc, 0xd2, 0x10, 0x66, 0xe9, 0x59, 0x4f, 0x96, 0x2c, - 0x26, 0x57, 0x9d, 0xd1, 0x77, 0x3d, 0x8c, 0x62, 0x9c, 0xd1, 0x91, 0x50, 0x46, 0x02, 0x55, 0x14, - 0x4a, 0xdf, 0x10, 0x38, 0xc0, 0x29, 0x65, 0x74, 0xb5, 0xaa, 0xc1, 0x20, 0x74, 0xe4, 0x74, 0x55, - 0xd5, 0x2a, 0x3c, 0xfb, 0xdd, 0x32, 0x3e, 0xd1, 0x11, 0xe8, 0xca, 0xe9, 0xaa,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x6b, 0x71, - 0x99, 0x3c, 0x6a, 0x04, 0xf8, 0xdd, 0x73, 0xb9, 0xbf, 0x73, 0x17, 0x1f, 0x67, 0xea, 0x9f, 0xd7, - 0x0d, 0x3b, 0x5c, 0xdc, 0xff, 0xe2, 0x51, 0xe1, 0x09, 0x81, 0xa1, 0x6d, 0x34, 0xfe, 0xbf, 0x07, - 0x86, 0xd9, 0xad, 0x03, 0xf0, 0x0c, 0xe7, 0x4b, 0x3f, 0x24, 0xd0, 0x21, 0x76, 0xe6, 0x74, 0x2a, - 0x00, 0xef, 0xf6, 0xdb, 0x8b, 0x44, 0x3a, 0xaa, 0xb9, 0x80, 0xc5, 0xd8, 0x07, 0x3f, 0xfe, 0xfa, - 0x49, 0x6c, 0x94, 0x26, 0xa4, 0x86, 0x1b, 0x13, 0xe9, 0xee, 0x2c, 0xde, 0xbd, 0xd0, 0xcf, 0x09, - 0x74, 0xe2, 0x24, 0x49, 0x43, 0xfd, 0x7b, 0xaf, 0x37, 0x12, 0x52, 0x64, 0x7b, 0x04, 0x74, 0x96, - 0x03, 0x3a, 0x49, 0x67, 0xfd, 0x00, 0xe1, 0x6f, 0x69, 0xad, 0x76, 0x65, 0xb2, 0x2e, 0xad, 0x61, - 0x39, 0xae, 0xd3, 0x2f, 0x09, 0x74, 0xb9, 0x47, 0x7d, 0x1a, 0x35, 0x72, 0x35, 0x75, 0xd3, 0xd1, - 0x07, 0x20, 0xd6, 0x73, 0x1c, 0xeb, 0x69, 0x7a, 0x2a, 0x00, 0xab, 0x55, 0x03, 0xeb, 0x34, 0x57, - 0x3d, 0xdc, 0x07, 0x04, 0xda, 0xf9, 0xe6, 0xec, 0x78, 0x58, 0xe4, 0xba, 0xcd, 0x70, 0xe2, 0xc5, - 0x68, 0xc6, 0x08, 0x71, 0x8e, 0x43, 0x3c, 0x43, 0x5f, 0xf2, 0x83, 0xe8, 0x54, 0xb5, 0xb4, 0x26, - 0xda, 0x64, 0x9d, 0xff, 0xd8, 0x86, 0xf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2, 0xbf, - 0x73, 0x82, 0x94, 0xe7, 0x39, 0xe5, 0x57, 0xe9, 0xdc, 0x0e, 0xe4, 0xad, 0x6d, 0xf2, 0xaa, 0x5d, - 0xea, 0xec, 0x45, 0xa1, 0xb6, 0x45, 0xa1, 0x33, 0x51, 0x26, 0x68, 0xcf, 0xae, 0x2c, 0x31, 0xbb, - 0x93, 0x21, 0x51, 0x04, 0x73, 0x1a, 0x2f, 0xbb, 0xc4, 0x07, 0x04, 0x4f, 0xf0, 0x99, 0xab, 0x0f, - 0x1f, 0x25, 0xc9, 0xc6, 0xa3, 0x24, 0xf9, 0xe5, 0x51, 0x92, 0xdc, 0x7f, 0x9c, 0x6c, 0xdb, 0x78, - 0x9c, 0x6c, 0xfb, 0xe9, 0x71, 0xb2, 0xed, 0x9d, 0x93, 0x9e, 0x0b, 0x2b, 0x27, 0xc4, 0x94, 0xb9, - 0xb4, 0xa4, 0xe7, 0x75, 0xc5, 0x70, 0x43, 0x7a, 0xfe, 0xc1, 0xc2, 0xaf, 0xb0, 0x72, 0x1d, 0x3c, - 0x5d, 0x27, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x6a, 0xcb, 0x68, 0xab, 0x75, 0x1a, 0x00, 0x00, + // 1597 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4d, 0x6c, 0xdc, 0xc4, + 0x17, 0xcf, 0x6c, 0xf2, 0xcf, 0xc7, 0x4b, 0xd3, 0x36, 0x93, 0x34, 0x1f, 0x6e, 0xba, 0x49, 0xdc, + 0x3f, 0x69, 0xfa, 0x91, 0x75, 0x92, 0x7e, 0xaa, 0xa5, 0x29, 0xdd, 0xb6, 0xa1, 0x29, 0xa8, 0x14, + 0x2b, 0x6d, 0x25, 0xa4, 0xb2, 0xf2, 0xae, 0x9d, 0xc4, 0xaa, 0x77, 0xbd, 0x5d, 0x3b, 0xa5, 0x51, + 0x94, 0x03, 0x5c, 0x41, 0xa2, 0x12, 0x12, 0x27, 0x24, 0xd4, 0x0b, 0xe2, 0xc0, 0x09, 0x71, 0xe2, + 0x00, 0x12, 0x42, 0xa8, 0xe2, 0x14, 0x89, 0x0b, 0xe2, 0x10, 0x41, 0x0b, 0xe2, 0x54, 0x21, 0x72, + 0xe0, 0xc2, 0x05, 0x79, 0xe6, 0x79, 0x77, 0xed, 0x78, 0x6d, 0x6f, 0xd9, 0x54, 0x15, 0xa7, 0xac, + 0xed, 0x37, 0x6f, 0x7e, 0xbf, 0xf7, 0x7b, 0x6f, 0x66, 0xde, 0x04, 0x5e, 0xc8, 0x99, 0x79, 0x55, + 0xbb, 0x27, 0x29, 0xcb, 0x39, 0x5b, 0x37, 0x0b, 0xd6, 0x8d, 0x69, 0xe9, 0xee, 0x54, 0x56, 0xb3, + 0x95, 0x29, 0xe9, 0xce, 0xb2, 0x56, 0x5a, 0x49, 0x15, 0x4b, 0xa6, 0x6d, 0xd2, 0x41, 0x6e, 0x96, + 0xaa, 0x98, 0xa5, 0xd0, 0x4c, 0xe8, 0x5d, 0x34, 0x17, 0x4d, 0x66, 0x25, 0x39, 0xbf, 0xf8, 0x00, + 0x61, 0x68, 0xd1, 0x34, 0x17, 0x0d, 0x4d, 0x52, 0x8a, 0xba, 0xa4, 0x14, 0x0a, 0xa6, 0xad, 0xb0, + 0x71, 0xf8, 0xf5, 0x50, 0xce, 0xb4, 0xf2, 0xa6, 0x25, 0x65, 0x15, 0x4b, 0xe3, 0xf3, 0x94, 0x67, + 0x2d, 0x2a, 0x8b, 0x7a, 0x81, 0x19, 0xa3, 0xed, 0x58, 0x6d, 0x84, 0x45, 0xa5, 0xa4, 0xe4, 0x5d, + 0x9f, 0x07, 0x6a, 0xdb, 0xe1, 0x2b, 0x34, 0xdc, 0x5f, 0xdb, 0x30, 0xab, 0xab, 0xdc, 0x48, 0xec, + 0x05, 0xfa, 0xba, 0x83, 0xeb, 0x1a, 0x9b, 0x42, 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 0xec, + 0xf1, 0x81, 0xc6, 0x20, 0xdd, 0x84, 0x76, 0x37, 0x1a, 0x03, 0x64, 0xa4, 0x39, 0x66, 0x94, 0xfa, + 0x31, 0x4a, 0xbb, 0x3c, 0x51, 0xb2, 0x44, 0xb9, 0xec, 0x8c, 0xbe, 0xe9, 0x61, 0x94, 0x60, 0x8c, + 0x0e, 0x44, 0x32, 0xe2, 0xa8, 0xe2, 0x50, 0xfa, 0x8a, 0xc0, 0x6e, 0x46, 0x29, 0xad, 0xab, 0x65, + 0x0d, 0xfa, 0xa0, 0x35, 0xab, 0xab, 0xaa, 0x56, 0x62, 0xd1, 0xef, 0x90, 0xf1, 0x89, 0x0e, 0x42, + 0x7b, 0x56, 0x57, 0xb9, 0x2e, 0x09, 0xa6, 0x4b, 0x5b, 0x56, 0x57, 0xfd, 0x9a, 0x34, 0x87, 0x69, + 0xd2, 0xd2, 0x68, 0x4d, 0x7e, 0x27, 0xd0, 0x5d, 0x45, 0x00, 0xf5, 0x38, 0xe8, 0x65, 0x90, 0xee, + 0xde, 0xdc, 0x18, 0xee, 0xe2, 0x8e, 0xf8, 0x7b, 0xb1, 0x4c, 0xea, 0x65, 0x68, 0xc9, 0xea, 0xaa, + 0x35, 0x90, 0x60, 0xb2, 0x25, 0x43, 0x64, 0x4b, 0xeb, 0x6a, 0xba, 0x07, 0x25, 0xeb, 0x2c, 0x3b, + 0xb3, 0x44, 0x99, 0x39, 0xf0, 0x49, 0xd5, 0xdc, 0x70, 0xa9, 0xf6, 0xc2, 0x60, 0x75, 0xf2, 0x79, + 0x57, 0x99, 0xf7, 0x08, 0x08, 0x41, 0x5f, 0x31, 0x1e, 0x05, 0xd8, 0xe9, 0x56, 0x95, 0x67, 0xd5, + 0x19, 0x8f, 0xce, 0x52, 0x5c, 0x7c, 0xf6, 0x21, 0xf1, 0x3d, 0x9e, 0x5c, 0x45, 0x6f, 0xa2, 0xdc, + 0xa5, 0x54, 0x5b, 0x8b, 0x7f, 0x10, 0x10, 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, 0x40, 0x47, 0x79, 0x76, 0x1a, 0x99, 0xc6, 0xfe, 0x26, 0x57, 0x98, 0xaa, 0x63, 0x04, 0x32, + 0xba, 0xc6, 0x18, 0x5d, 0xa1, 0x97, 0x83, 0x18, 0xf9, 0xd9, 0xc4, 0x22, 0xf1, 0x1d, 0x81, 0xde, + 0xa0, 0x23, 0x11, 0x3d, 0x13, 0x17, 0x5d, 0x40, 0xdf, 0x27, 0xbc, 0xf8, 0x74, 0x83, 0x91, 0xe5, + 0x51, 0xc6, 0x72, 0x82, 0x1e, 0xae, 0xc9, 0x72, 0xeb, 0x59, 0x8c, 0xfe, 0x4d, 0x60, 0x30, 0xf0, + 0x60, 0xcf, 0xd8, 0x5c, 0x89, 0x59, 0x07, 0x31, 0x5a, 0x24, 0xe1, 0x95, 0x86, 0xf8, 0x42, 0xae, + 0x97, 0x18, 0xd7, 0x73, 0xf4, 0x6c, 0x58, 0xa5, 0x45, 0x76, 0x1d, 0xf4, 0x4f, 0x02, 0x43, 0x61, + 0x27, 0x5b, 0x7a, 0xe1, 0x69, 0x14, 0xf1, 0x35, 0x0a, 0xc2, 0xc5, 0x7f, 0xe7, 0x04, 0x29, 0xcf, + 0x32, 0xca, 0x2f, 0xd1, 0x99, 0x3a, 0xe4, 0xad, 0x1c, 0xb5, 0xcb, 0x55, 0xea, 0x74, 0x04, 0x50, + 0x39, 0x28, 0xd2, 0xa9, 0x38, 0x0b, 0xb4, 0xe7, 0x6c, 0x2c, 0x4c, 0xd7, 0x33, 0x24, 0x8e, 0x60, + 0x4e, 0xe1, 0x65, 0x16, 0xd8, 0x80, 0x88, 0x05, 0xfe, 0x6b, 0x02, 0xbb, 0x7c, 0x67, 0x2a, 0x7a, + 0x22, 0xee, 0x4e, 0xe8, 0x3d, 0x26, 0x0a, 0x27, 0xeb, 0x1e, 0x87, 0x5c, 0xce, 0x30, 0x2e, 0xc7, + 0xe9, 0xd1, 0xb0, 0x8d, 0x34, 0x83, 0x98, 0x7d, 0x1b, 0x6a, 0xfa, 0xea, 0xc3, 0x47, 0x49, 0xb2, + 0xfe, 0x28, 0x49, 0x7e, 0x7e, 0x94, 0x24, 0xf7, 0x1f, 0x27, 0x9b, 0xd6, 0x1f, 0x27, 0x9b, 0x7e, + 0x7c, 0x9c, 0x6c, 0x7a, 0xe3, 0x98, 0xe7, 0xe2, 0xd3, 0x71, 0x3c, 0x61, 0x2e, 0x2c, 0xe8, 0x39, + 0x5d, 0x31, 0xdc, 0x89, 0x3c, 0xff, 0xa8, 0x63, 0x57, 0xa1, 0xd9, 0x56, 0x26, 0xf8, 0xd1, 0x7f, + 0x02, 0x00, 0x00, 0xff, 0xff, 0xc9, 0xc0, 0x24, 0x17, 0xbd, 0x1c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1357,6 +1468,7 @@ type QueryClient interface { AuctionFeesCollectionData(ctx context.Context, in *QueryAuctionFeesCollectionFromLimitBidTxRequest, opts ...grpc.CallOption) (*QueryAuctionFeesCollectionFromLimitBidTxResponse, error) LimitBidProtocolDataWithUser(ctx context.Context, in *QueryLimitBidProtocolDataWithUserRequest, opts ...grpc.CallOption) (*QueryLimitBidProtocolDataWithUserResponse, error) BidsFilter(ctx context.Context, in *QueryBidsFilterRequest, opts ...grpc.CallOption) (*QueryBidsFilterResponse, error) + AuctionsHistory(ctx context.Context, in *QueryAuctionsHistoryRequest, opts ...grpc.CallOption) (*QueryAuctionsHistoryResponse, error) } type queryClient struct { @@ -1466,6 +1578,15 @@ func (c *queryClient) BidsFilter(ctx context.Context, in *QueryBidsFilterRequest return out, nil } +func (c *queryClient) AuctionsHistory(ctx context.Context, in *QueryAuctionsHistoryRequest, opts ...grpc.CallOption) (*QueryAuctionsHistoryResponse, error) { + out := new(QueryAuctionsHistoryResponse) + err := c.cc.Invoke(ctx, "/comdex.auctionsV2.v1beta1.Query/AuctionsHistory", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) @@ -1479,6 +1600,7 @@ type QueryServer interface { AuctionFeesCollectionData(context.Context, *QueryAuctionFeesCollectionFromLimitBidTxRequest) (*QueryAuctionFeesCollectionFromLimitBidTxResponse, error) LimitBidProtocolDataWithUser(context.Context, *QueryLimitBidProtocolDataWithUserRequest) (*QueryLimitBidProtocolDataWithUserResponse, error) BidsFilter(context.Context, *QueryBidsFilterRequest) (*QueryBidsFilterResponse, error) + AuctionsHistory(context.Context, *QueryAuctionsHistoryRequest) (*QueryAuctionsHistoryResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1518,6 +1640,9 @@ func (*UnimplementedQueryServer) LimitBidProtocolDataWithUser(ctx context.Contex func (*UnimplementedQueryServer) BidsFilter(ctx context.Context, req *QueryBidsFilterRequest) (*QueryBidsFilterResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BidsFilter not implemented") } +func (*UnimplementedQueryServer) AuctionsHistory(ctx context.Context, req *QueryAuctionsHistoryRequest) (*QueryAuctionsHistoryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AuctionsHistory not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1721,6 +1846,24 @@ func _Query_BidsFilter_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Query_AuctionsHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAuctionsHistoryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AuctionsHistory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.auctionsV2.v1beta1.Query/AuctionsHistory", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AuctionsHistory(ctx, req.(*QueryAuctionsHistoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.auctionsV2.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -1769,6 +1912,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "BidsFilter", Handler: _Query_BidsFilter_Handler, }, + { + MethodName: "AuctionsHistory", + Handler: _Query_AuctionsHistory_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/auctionsV2/v1beta1/query.proto", @@ -2753,6 +2900,95 @@ func (m *QueryBidsFilterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *QueryAuctionsHistoryRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAuctionsHistoryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAuctionsHistoryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.AuctionType != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AuctionType)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAuctionsHistoryResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAuctionsHistoryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAuctionsHistoryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Auctions) > 0 { + for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -3146,6 +3382,41 @@ func (m *QueryBidsFilterResponse) Size() (n int) { return n } +func (m *QueryAuctionsHistoryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AuctionType != 0 { + n += 1 + sovQuery(uint64(m.AuctionType)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAuctionsHistoryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Auctions) > 0 { + for _, e := range m.Auctions { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -5689,6 +5960,231 @@ func (m *QueryBidsFilterResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryAuctionsHistoryRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAuctionsHistoryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAuctionsHistoryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionType", wireType) + } + m.AuctionType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AuctionType |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAuctionsHistoryResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAuctionsHistoryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAuctionsHistoryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auctions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Auctions = append(m.Auctions, AuctionHistorical{}) + if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auctionsV2/types/query.pb.gw.go b/x/auctionsV2/types/query.pb.gw.go index fb9dda46d..a44c803f9 100644 --- a/x/auctionsV2/types/query.pb.gw.go +++ b/x/auctionsV2/types/query.pb.gw.go @@ -825,6 +825,78 @@ func local_request_Query_BidsFilter_0(ctx context.Context, marshaler runtime.Mar } +var ( + filter_Query_AuctionsHistory_0 = &utilities.DoubleArray{Encoding: map[string]int{"auction_type": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_AuctionsHistory_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAuctionsHistoryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["auction_type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_type") + } + + protoReq.AuctionType, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_type", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AuctionsHistory_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AuctionsHistory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AuctionsHistory_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAuctionsHistoryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["auction_type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "auction_type") + } + + protoReq.AuctionType, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "auction_type", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AuctionsHistory_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AuctionsHistory(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -1084,6 +1156,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_AuctionsHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AuctionsHistory_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AuctionsHistory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1345,6 +1440,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_AuctionsHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AuctionsHistory_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AuctionsHistory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1370,6 +1485,8 @@ var ( pattern_Query_LimitBidProtocolDataWithUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "auctions", "v2", "limit_bid_protocol_data_with_user", "bidder"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_BidsFilter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"comdex", "auctions", "v2", "bids_filter", "bidder", "bid_type", "history"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AuctionsHistory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "auctions", "v2", "auctions_history", "auction_type"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1394,4 +1511,6 @@ var ( forward_Query_LimitBidProtocolDataWithUser_0 = runtime.ForwardResponseMessage forward_Query_BidsFilter_0 = runtime.ForwardResponseMessage + + forward_Query_AuctionsHistory_0 = runtime.ForwardResponseMessage )