From e3658d9bce27b24573d5b6ad2ad021b10abab46f Mon Sep 17 00:00:00 2001 From: jelysn Date: Sat, 2 Dec 2023 00:04:12 +0800 Subject: [PATCH] remove margin broker messages --- proto/elys/margin/tx.proto | 33 - wasmbindings/types/types.go | 6 +- x/margin/client/cli/tx.go | 2 - x/margin/client/cli/tx_broker_close.go | 64 - x/margin/client/cli/tx_broker_open.go | 99 - x/margin/client/wasm/messenger.go | 4 - x/margin/client/wasm/msg_broker_close.go | 58 - x/margin/client/wasm/msg_broker_open.go | 59 - x/margin/client/wasm/query_get_status.go | 2 +- x/margin/client/wasm/query_get_whitelist.go | 2 +- x/margin/client/wasm/query_is_whitelisted.go | 2 +- x/margin/client/wasm/query_mtp.go | 2 +- x/margin/client/wasm/query_params.go | 2 +- x/margin/client/wasm/query_pool.go | 2 +- x/margin/client/wasm/query_pools.go | 2 +- x/margin/client/wasm/query_positions.go | 2 +- .../client/wasm/query_positions_by_pool.go | 2 +- .../wasm/query_positions_for_address.go | 2 +- x/margin/keeper/broker_close.go | 19 - x/margin/keeper/broker_open.go | 19 - x/margin/keeper/msg_server_broker_close.go | 24 - x/margin/keeper/msg_server_broker_open.go | 24 - x/margin/types/msgs.go | 92 - x/margin/types/tx.pb.go | 1593 ++--------------- 24 files changed, 185 insertions(+), 1931 deletions(-) delete mode 100644 x/margin/client/cli/tx_broker_close.go delete mode 100644 x/margin/client/cli/tx_broker_open.go delete mode 100644 x/margin/client/wasm/msg_broker_close.go delete mode 100644 x/margin/client/wasm/msg_broker_open.go delete mode 100644 x/margin/keeper/broker_close.go delete mode 100644 x/margin/keeper/broker_open.go delete mode 100644 x/margin/keeper/msg_server_broker_close.go delete mode 100644 x/margin/keeper/msg_server_broker_open.go diff --git a/proto/elys/margin/tx.proto b/proto/elys/margin/tx.proto index bba09e2c2..59ce0c6d2 100644 --- a/proto/elys/margin/tx.proto +++ b/proto/elys/margin/tx.proto @@ -13,8 +13,6 @@ import "elys/margin/types.proto"; service Msg { rpc Open (MsgOpen ) returns (MsgOpenResponse ); rpc Close (MsgClose ) returns (MsgCloseResponse ); - rpc BrokerOpen (MsgBrokerOpen ) returns (MsgBrokerOpenResponse ); - rpc BrokerClose (MsgBrokerClose ) returns (MsgBrokerCloseResponse ); rpc UpdateParams (MsgUpdateParams) returns (MsgUpdateParamsResponse); rpc UpdatePools (MsgUpdatePools ) returns (MsgUpdatePoolsResponse ); rpc Whitelist (MsgWhitelist ) returns (MsgWhitelistResponse ); @@ -49,37 +47,6 @@ message MsgCloseResponse { ]; } -message MsgBrokerOpen { - string creator = 1; - string collateral_asset = 2; - string collateral_amount = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string borrow_asset = 4; - Position position = 5; - string leverage = 6 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - string take_profit_price = 7 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - string owner = 8; -} - -message MsgBrokerOpenResponse { - uint64 id = 1; -} - -message MsgBrokerClose { - string creator = 1; - uint64 id = 2; - string owner = 3; - cosmos.base.v1beta1.Coin amount = 4 [ - (gogoproto.nullable) = false - ]; -} - -message MsgBrokerCloseResponse { - uint64 id = 1; - cosmos.base.v1beta1.Coin amount = 3 [ - (gogoproto.nullable) = false - ]; -} - message MsgUpdateParams { // authority is the address that controls the module (defaults to x/gov unless overwritten). diff --git a/wasmbindings/types/types.go b/wasmbindings/types/types.go index eca1536c0..e13ecb953 100644 --- a/wasmbindings/types/types.go +++ b/wasmbindings/types/types.go @@ -274,10 +274,8 @@ type ElysMsg struct { LeveragelpClose *leveragelptypes.MsgClose `json:"leveragelp_close,omitempty"` // margin messages - MarginOpen *margintypes.MsgOpen `json:"margin_open,omitempty"` - MarginClose *margintypes.MsgClose `json:"margin_close,omitempty"` - MarginBrokerOpen *margintypes.MsgBrokerOpen `json:"margin_broker_open,omitempty"` - MarginBrokerClose *margintypes.MsgBrokerClose `json:"margin_broker_close,omitempty"` + MarginOpen *margintypes.MsgOpen `json:"margin_open,omitempty"` + MarginClose *margintypes.MsgClose `json:"margin_close,omitempty"` // oracle messages // parameter messages diff --git a/x/margin/client/cli/tx.go b/x/margin/client/cli/tx.go index 0f87701d8..f021d75de 100644 --- a/x/margin/client/cli/tx.go +++ b/x/margin/client/cli/tx.go @@ -33,8 +33,6 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdOpen()) cmd.AddCommand(CmdClose()) - cmd.AddCommand(CmdBrokerOpen()) - cmd.AddCommand(CmdBrokerClose()) cmd.AddCommand(CmdUpdateParams()) cmd.AddCommand(CmdUpdatePools()) cmd.AddCommand(CmdWhitelist()) diff --git a/x/margin/client/cli/tx_broker_close.go b/x/margin/client/cli/tx_broker_close.go deleted file mode 100644 index 7cbdba99a..000000000 --- a/x/margin/client/cli/tx_broker_close.go +++ /dev/null @@ -1,64 +0,0 @@ -package cli - -import ( - "errors" - "strconv" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/elys-network/elys/x/margin/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdBrokerClose() *cobra.Command { - cmd := &cobra.Command{ - Use: "broker-close [mtp-id] [mtp-owner] [flags]", - Short: "Close margin position as a broker", - Example: `elysd tx margin broker-close 1 sif123 --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000`, - Args: cobra.ExactArgs(3), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - signer := clientCtx.GetFromAddress() - if signer == nil { - return errors.New("signer address is missing") - } - - argMtpId, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return errors.New("invalid mtp id") - } - - argMtpOwner := args[1] - if argMtpOwner == "" { - return errors.New("invalid mtp owner address") - } - - argAmount, err := sdk.ParseCoinNormalized(args[2]) - if err != nil { - return errors.New("invalid amount") - } - - msg := types.NewMsgBrokerClose( - signer.String(), - argMtpId, - argMtpOwner, - argAmount, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/margin/client/cli/tx_broker_open.go b/x/margin/client/cli/tx_broker_open.go deleted file mode 100644 index 2e4c3001c..000000000 --- a/x/margin/client/cli/tx_broker_open.go +++ /dev/null @@ -1,99 +0,0 @@ -package cli - -import ( - "errors" - "strconv" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/elys-network/elys/x/margin/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdBrokerOpen() *cobra.Command { - cmd := &cobra.Command{ - Use: "broker-open [position] [leverage] [collateral-asset] [collateral-amount] [borrow-asset] [flags]", - Short: "Open margin position as a broker", - Example: `Infinte profitability: -elysd tx margin broker-open long 5 uusdc 100000000 uatom sif123 --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000 -Finite profitability: -elysd tx margin broker-open short 5 uusdc 100000000 uatom sif123 --take-profit 100 --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000`, - Args: cobra.ExactArgs(6), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - signer := clientCtx.GetFromAddress() - if signer == nil { - return errors.New("signer address is missing") - } - - argPosition := types.GetPositionFromString(args[0]) - - argLeverage, err := sdk.NewDecFromStr(args[1]) - if err != nil { - return err - } - - argCollateralAsset := args[2] - - argCollateralAmount, ok := sdk.NewIntFromString(args[3]) - if !ok { - return errors.New("invalid collateral amount") - } - - argBorrowAsset := args[4] - - argMtpOwner := args[5] - if argMtpOwner == "" { - return errors.New("invalid mtp owner address") - } - - takeProfitPriceStr, err := cmd.Flags().GetString(flagTakeProfitPrice) - if err != nil { - return err - } - - var takeProfitPrice sdk.Dec - if takeProfitPriceStr != types.InfinitePriceString { - takeProfitPrice, err = sdk.NewDecFromStr(takeProfitPriceStr) - if err != nil { - return errors.New("invalid take profit price") - } - } else { - takeProfitPrice, err = sdk.NewDecFromStr(types.TakeProfitPriceDefault) - if err != nil { - return errors.New("failed to set default take profit price") - } - } - - msg := types.NewMsgBrokerOpen( - signer.String(), - argCollateralAsset, - argCollateralAmount, - argBorrowAsset, - argPosition, - argLeverage, - takeProfitPrice, - argMtpOwner, - ) - - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(flagTakeProfitPrice, types.InfinitePriceString, "Optional take profit price") - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/margin/client/wasm/messenger.go b/x/margin/client/wasm/messenger.go index 10147c2f3..f00431564 100644 --- a/x/margin/client/wasm/messenger.go +++ b/x/margin/client/wasm/messenger.go @@ -29,10 +29,6 @@ func (m *Messenger) HandleMsg(ctx sdk.Context, contractAddr sdk.AccAddress, cont return m.msgOpen(ctx, contractAddr, msg.MarginOpen) case msg.MarginClose != nil: return m.msgClose(ctx, contractAddr, msg.MarginClose) - case msg.MarginBrokerOpen != nil: - return m.msgBrokerOpen(ctx, contractAddr, msg.MarginBrokerOpen) - case msg.MarginBrokerClose != nil: - return m.msgBrokerClose(ctx, contractAddr, msg.MarginBrokerClose) default: // This handler cannot handle the message return nil, nil, wasmbindingstypes.ErrCannotHandleMsg diff --git a/x/margin/client/wasm/msg_broker_close.go b/x/margin/client/wasm/msg_broker_close.go deleted file mode 100644 index 1d43d56fa..000000000 --- a/x/margin/client/wasm/msg_broker_close.go +++ /dev/null @@ -1,58 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - marginkeeper "github.com/elys-network/elys/x/margin/keeper" - margintypes "github.com/elys-network/elys/x/margin/types" -) - -func (m *Messenger) msgBrokerClose(ctx sdk.Context, contractAddr sdk.AccAddress, msgBrokerClose *margintypes.MsgBrokerClose) ([]sdk.Event, [][]byte, error) { - if msgBrokerClose == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "Broker Close null msg"} - } - - brokerAddress := m.parameterKeeper.GetParams(ctx).BrokerAddress - if msgBrokerClose.Creator != contractAddr.String() && contractAddr.String() != brokerAddress { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "broker close wrong sender"} - } - - res, err := PerformMsgBrokerClose(m.keeper, ctx, contractAddr, msgBrokerClose) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "perform broker close") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize broker close response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} - -func PerformMsgBrokerClose(f *marginkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, msgBrokerClose *margintypes.MsgBrokerClose) (*margintypes.MsgBrokerCloseResponse, error) { - if msgBrokerClose == nil { - return nil, wasmvmtypes.InvalidRequest{Err: "margin broker close null margin broker close"} - } - msgServer := marginkeeper.NewMsgServerImpl(*f) - - msgMsgBrokerClose := margintypes.NewMsgBrokerClose(msgBrokerClose.Creator, uint64(msgBrokerClose.Id), msgBrokerClose.Owner, msgBrokerClose.Amount) - - if err := msgMsgBrokerClose.ValidateBasic(); err != nil { - return nil, errorsmod.Wrap(err, "failed validating msgMsgBrokerClose") - } - - _, err := msgServer.BrokerClose(sdk.WrapSDKContext(ctx), msgMsgBrokerClose) // Discard the response because it's empty - - if err != nil { - return nil, errorsmod.Wrap(err, "margin broker close msg") - } - - var resp = &margintypes.MsgBrokerCloseResponse{} - return resp, nil -} diff --git a/x/margin/client/wasm/msg_broker_open.go b/x/margin/client/wasm/msg_broker_open.go deleted file mode 100644 index 899b53e3e..000000000 --- a/x/margin/client/wasm/msg_broker_open.go +++ /dev/null @@ -1,59 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - cosmos_sdk_math "cosmossdk.io/math" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - marginkeeper "github.com/elys-network/elys/x/margin/keeper" - margintypes "github.com/elys-network/elys/x/margin/types" -) - -func (m *Messenger) msgBrokerOpen(ctx sdk.Context, contractAddr sdk.AccAddress, msgBrokerOpen *margintypes.MsgBrokerOpen) ([]sdk.Event, [][]byte, error) { - if msgBrokerOpen == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "Broker Open null msg"} - } - - brokerAddress := m.parameterKeeper.GetParams(ctx).BrokerAddress - if msgBrokerOpen.Creator != contractAddr.String() && contractAddr.String() != brokerAddress { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "broker open wrong sender"} - } - - res, err := PerformMsgBrokerOpen(m.keeper, ctx, contractAddr, msgBrokerOpen) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "perform broker open") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize broker open response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} - -func PerformMsgBrokerOpen(f *marginkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, msgBrokerOpen *margintypes.MsgBrokerOpen) (*margintypes.MsgBrokerOpenResponse, error) { - if msgBrokerOpen == nil { - return nil, wasmvmtypes.InvalidRequest{Err: "margin broker open null margin broker open"} - } - msgServer := marginkeeper.NewMsgServerImpl(*f) - - msgMsgBrokerOpen := margintypes.NewMsgBrokerOpen(msgBrokerOpen.Creator, msgBrokerOpen.CollateralAsset, cosmos_sdk_math.Int(msgBrokerOpen.CollateralAmount), msgBrokerOpen.BorrowAsset, msgBrokerOpen.Position, msgBrokerOpen.Leverage, msgBrokerOpen.TakeProfitPrice, msgBrokerOpen.Owner) - - if err := msgMsgBrokerOpen.ValidateBasic(); err != nil { - return nil, errorsmod.Wrap(err, "failed validating msgMsgBrokerOpen") - } - - _, err := msgServer.BrokerOpen(sdk.WrapSDKContext(ctx), msgMsgBrokerOpen) // Discard the response because it's empty - - if err != nil { - return nil, errorsmod.Wrap(err, "margin broker open msg") - } - - var resp = &margintypes.MsgBrokerOpenResponse{} - return resp, nil -} diff --git a/x/margin/client/wasm/query_get_status.go b/x/margin/client/wasm/query_get_status.go index 3a0677abf..d15eb4bcc 100644 --- a/x/margin/client/wasm/query_get_status.go +++ b/x/margin/client/wasm/query_get_status.go @@ -9,7 +9,7 @@ import ( ) func (oq *Querier) queryGetStatus(ctx sdk.Context, query *types.StatusRequest) ([]byte, error) { - res, err := oq.keeper.GetStatus(ctx, query) + res, err := oq.keeper.GetStatus(sdk.WrapSDKContext(ctx), query) if err != nil { return nil, errorsmod.Wrap(err, "failed to get status") } diff --git a/x/margin/client/wasm/query_get_whitelist.go b/x/margin/client/wasm/query_get_whitelist.go index 4a489a8a1..1d65c40be 100644 --- a/x/margin/client/wasm/query_get_whitelist.go +++ b/x/margin/client/wasm/query_get_whitelist.go @@ -9,7 +9,7 @@ import ( ) func (oq *Querier) queryGetWhitelist(ctx sdk.Context, query *types.WhitelistRequest) ([]byte, error) { - res, err := oq.keeper.GetWhitelist(ctx, query) + res, err := oq.keeper.GetWhitelist(sdk.WrapSDKContext(ctx), query) if err != nil { return nil, errorsmod.Wrap(err, "failed to get whitelist") } diff --git a/x/margin/client/wasm/query_is_whitelisted.go b/x/margin/client/wasm/query_is_whitelisted.go index 5e1f4a9d3..71374b235 100644 --- a/x/margin/client/wasm/query_is_whitelisted.go +++ b/x/margin/client/wasm/query_is_whitelisted.go @@ -9,7 +9,7 @@ import ( ) func (oq *Querier) queryIsWhitelisted(ctx sdk.Context, query *types.IsWhitelistedRequest) ([]byte, error) { - res, err := oq.keeper.IsWhitelisted(ctx, query) + res, err := oq.keeper.IsWhitelisted(sdk.WrapSDKContext(ctx), query) if err != nil { return nil, errorsmod.Wrap(err, "failed to get is whitelisted") } diff --git a/x/margin/client/wasm/query_mtp.go b/x/margin/client/wasm/query_mtp.go index ae4a48afe..205082be0 100644 --- a/x/margin/client/wasm/query_mtp.go +++ b/x/margin/client/wasm/query_mtp.go @@ -9,7 +9,7 @@ import ( ) func (oq *Querier) queryMtp(ctx sdk.Context, query *types.MTPRequest) ([]byte, error) { - res, err := oq.keeper.MTP(ctx, query) + res, err := oq.keeper.MTP(sdk.WrapSDKContext(ctx), query) if err != nil { return nil, errorsmod.Wrap(err, "failed to get mtp") } diff --git a/x/margin/client/wasm/query_params.go b/x/margin/client/wasm/query_params.go index b319264ac..0f7d869ba 100644 --- a/x/margin/client/wasm/query_params.go +++ b/x/margin/client/wasm/query_params.go @@ -9,7 +9,7 @@ import ( ) func (oq *Querier) queryParams(ctx sdk.Context, query *types.ParamsRequest) ([]byte, error) { - res, err := oq.keeper.Params(ctx, query) + res, err := oq.keeper.Params(sdk.WrapSDKContext(ctx), query) if err != nil { return nil, errorsmod.Wrap(err, "failed to get params") } diff --git a/x/margin/client/wasm/query_pool.go b/x/margin/client/wasm/query_pool.go index ec4814526..4ca319480 100644 --- a/x/margin/client/wasm/query_pool.go +++ b/x/margin/client/wasm/query_pool.go @@ -9,7 +9,7 @@ import ( ) func (oq *Querier) queryPool(ctx sdk.Context, query *types.QueryGetPoolRequest) ([]byte, error) { - res, err := oq.keeper.Pool(ctx, query) + res, err := oq.keeper.Pool(sdk.WrapSDKContext(ctx), query) if err != nil { return nil, errorsmod.Wrap(err, "failed to get pool") } diff --git a/x/margin/client/wasm/query_pools.go b/x/margin/client/wasm/query_pools.go index 3ffb4a080..21a6f5ef5 100644 --- a/x/margin/client/wasm/query_pools.go +++ b/x/margin/client/wasm/query_pools.go @@ -9,7 +9,7 @@ import ( ) func (oq *Querier) queryPools(ctx sdk.Context, query *types.QueryAllPoolRequest) ([]byte, error) { - res, err := oq.keeper.Pools(ctx, query) + res, err := oq.keeper.Pools(sdk.WrapSDKContext(ctx), query) if err != nil { return nil, errorsmod.Wrap(err, "failed to get pools") } diff --git a/x/margin/client/wasm/query_positions.go b/x/margin/client/wasm/query_positions.go index a31d9a715..2e600045c 100644 --- a/x/margin/client/wasm/query_positions.go +++ b/x/margin/client/wasm/query_positions.go @@ -9,7 +9,7 @@ import ( ) func (oq *Querier) queryPositions(ctx sdk.Context, query *types.PositionsRequest) ([]byte, error) { - res, err := oq.keeper.GetPositions(ctx, query) + res, err := oq.keeper.GetPositions(sdk.WrapSDKContext(ctx), query) if err != nil { return nil, errorsmod.Wrap(err, "failed to get positions") } diff --git a/x/margin/client/wasm/query_positions_by_pool.go b/x/margin/client/wasm/query_positions_by_pool.go index 7e988619e..ff5334c6c 100644 --- a/x/margin/client/wasm/query_positions_by_pool.go +++ b/x/margin/client/wasm/query_positions_by_pool.go @@ -9,7 +9,7 @@ import ( ) func (oq *Querier) queryPositionsByPool(ctx sdk.Context, query *types.PositionsByPoolRequest) ([]byte, error) { - res, err := oq.keeper.GetPositionsByPool(ctx, query) + res, err := oq.keeper.GetPositionsByPool(sdk.WrapSDKContext(ctx), query) if err != nil { return nil, errorsmod.Wrap(err, "failed to get positions by pool") } diff --git a/x/margin/client/wasm/query_positions_for_address.go b/x/margin/client/wasm/query_positions_for_address.go index 5f685c26e..de43398e3 100644 --- a/x/margin/client/wasm/query_positions_for_address.go +++ b/x/margin/client/wasm/query_positions_for_address.go @@ -9,7 +9,7 @@ import ( ) func (oq *Querier) queryPositionsForAddress(ctx sdk.Context, query *types.PositionsForAddressRequest) ([]byte, error) { - res, err := oq.keeper.GetPositionsForAddress(ctx, query) + res, err := oq.keeper.GetPositionsForAddress(sdk.WrapSDKContext(ctx), query) if err != nil { return nil, errorsmod.Wrap(err, "failed to get positions for address") } diff --git a/x/margin/keeper/broker_close.go b/x/margin/keeper/broker_close.go deleted file mode 100644 index d601e54c5..000000000 --- a/x/margin/keeper/broker_close.go +++ /dev/null @@ -1,19 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/elys-network/elys/x/margin/types" -) - -func (k Keeper) BrokerClose(ctx sdk.Context, msg *types.MsgBrokerClose) (*types.MsgBrokerCloseResponse, error) { - msgClose := types.NewMsgClose(msg.Owner, msg.Id, msg.Amount) - - res, err := k.Close(ctx, msgClose) - if err != nil { - return nil, err - } - - return &types.MsgBrokerCloseResponse{ - Id: res.Id, - }, nil -} diff --git a/x/margin/keeper/broker_open.go b/x/margin/keeper/broker_open.go deleted file mode 100644 index 4fb3abf8f..000000000 --- a/x/margin/keeper/broker_open.go +++ /dev/null @@ -1,19 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/elys-network/elys/x/margin/types" -) - -func (k Keeper) BrokerOpen(ctx sdk.Context, msg *types.MsgBrokerOpen) (*types.MsgBrokerOpenResponse, error) { - msgOpen := types.NewMsgOpen(msg.Owner, msg.CollateralAsset, msg.CollateralAmount, msg.BorrowAsset, msg.Position, msg.Leverage, msg.TakeProfitPrice) - - res, err := k.Open(ctx, msgOpen) - if err != nil { - return nil, err - } - - return &types.MsgBrokerOpenResponse{ - Id: res.Id, - }, nil -} diff --git a/x/margin/keeper/msg_server_broker_close.go b/x/margin/keeper/msg_server_broker_close.go deleted file mode 100644 index 212913e32..000000000 --- a/x/margin/keeper/msg_server_broker_close.go +++ /dev/null @@ -1,24 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/elys-network/elys/x/margin/types" -) - -func (k msgServer) BrokerClose(goCtx context.Context, msg *types.MsgBrokerClose) (*types.MsgBrokerCloseResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - // get broker address - brokerAddress := k.parameterKeeper.GetParams(ctx).BrokerAddress - - // check if broker is allowed - if brokerAddress != msg.Creator { - return nil, sdkerrors.Wrapf(govtypes.ErrInvalidSigner, "invalid broker address; expected %s, got %s", brokerAddress, msg.Creator) - } - - return k.Keeper.BrokerClose(ctx, msg) -} diff --git a/x/margin/keeper/msg_server_broker_open.go b/x/margin/keeper/msg_server_broker_open.go deleted file mode 100644 index 3db1ef5cf..000000000 --- a/x/margin/keeper/msg_server_broker_open.go +++ /dev/null @@ -1,24 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/elys-network/elys/x/margin/types" -) - -func (k msgServer) BrokerOpen(goCtx context.Context, msg *types.MsgBrokerOpen) (*types.MsgBrokerOpenResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - // get broker address - brokerAddress := k.parameterKeeper.GetParams(ctx).BrokerAddress - - // check if broker is allowed - if brokerAddress != msg.Creator { - return nil, sdkerrors.Wrapf(govtypes.ErrInvalidSigner, "invalid broker address; expected %s, got %s", brokerAddress, msg.Creator) - } - - return k.Keeper.BrokerOpen(ctx, msg) -} diff --git a/x/margin/types/msgs.go b/x/margin/types/msgs.go index cfea65b59..eb1c0641a 100644 --- a/x/margin/types/msgs.go +++ b/x/margin/types/msgs.go @@ -8,8 +8,6 @@ import ( const ( TypeMsgOpen = "open" TypeMsgClose = "close" - TypeMsgBrokerOpen = "broker_open" - TypeMsgBrokerClose = "broker_close" TypeMsgUpdateParams = "update_params" TypeMsgWhitelist = "whitelist" TypeMsgUpdatePools = "update_pools" @@ -19,8 +17,6 @@ const ( var ( _ sdk.Msg = &MsgClose{} _ sdk.Msg = &MsgOpen{} - _ sdk.Msg = &MsgBrokerClose{} - _ sdk.Msg = &MsgBrokerOpen{} _ sdk.Msg = &MsgUpdateParams{} _ sdk.Msg = &MsgWhitelist{} _ sdk.Msg = &MsgUpdatePools{} @@ -105,94 +101,6 @@ func (msg *MsgOpen) ValidateBasic() error { return nil } -func NewMsgBrokerClose(creator string, id uint64, owner string, amount sdk.Coin) *MsgBrokerClose { - return &MsgBrokerClose{ - Creator: creator, - Id: id, - Owner: owner, - Amount: amount, - } -} - -func (msg *MsgBrokerClose) Route() string { - return RouterKey -} - -func (msg *MsgBrokerClose) Type() string { - return TypeMsgBrokerClose -} - -func (msg *MsgBrokerClose) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgBrokerClose) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgBrokerClose) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - _, err = sdk.AccAddressFromBech32(msg.Owner) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address (%s)", err) - } - return nil -} - -func NewMsgBrokerOpen(creator string, collateralAsset string, collateralAmount sdk.Int, borrowAsset string, position Position, leverage sdk.Dec, takeProfitPrice sdk.Dec, owner string) *MsgBrokerOpen { - return &MsgBrokerOpen{ - Creator: creator, - CollateralAsset: collateralAsset, - CollateralAmount: collateralAmount, - BorrowAsset: borrowAsset, - Position: position, - Leverage: leverage, - TakeProfitPrice: takeProfitPrice, - Owner: owner, - } -} - -func (msg *MsgBrokerOpen) Route() string { - return RouterKey -} - -func (msg *MsgBrokerOpen) Type() string { - return TypeMsgBrokerOpen -} - -func (msg *MsgBrokerOpen) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgBrokerOpen) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgBrokerOpen) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - _, err = sdk.AccAddressFromBech32(msg.Owner) - if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address (%s)", err) - } - return nil -} - func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { creator, err := sdk.AccAddressFromBech32(msg.Authority) if err != nil { diff --git a/x/margin/types/tx.pb.go b/x/margin/types/tx.pb.go index a99397d42..e8e492b24 100644 --- a/x/margin/types/tx.pb.go +++ b/x/margin/types/tx.pb.go @@ -257,249 +257,6 @@ func (m *MsgCloseResponse) GetAmount() types.Coin { return types.Coin{} } -type MsgBrokerOpen struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - CollateralAsset string `protobuf:"bytes,2,opt,name=collateral_asset,json=collateralAsset,proto3" json:"collateral_asset,omitempty"` - CollateralAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=collateral_amount,json=collateralAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"collateral_amount"` - BorrowAsset string `protobuf:"bytes,4,opt,name=borrow_asset,json=borrowAsset,proto3" json:"borrow_asset,omitempty"` - Position Position `protobuf:"varint,5,opt,name=position,proto3,enum=elys.margin.Position" json:"position,omitempty"` - Leverage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=leverage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"leverage"` - TakeProfitPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=take_profit_price,json=takeProfitPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"take_profit_price"` - Owner string `protobuf:"bytes,8,opt,name=owner,proto3" json:"owner,omitempty"` -} - -func (m *MsgBrokerOpen) Reset() { *m = MsgBrokerOpen{} } -func (m *MsgBrokerOpen) String() string { return proto.CompactTextString(m) } -func (*MsgBrokerOpen) ProtoMessage() {} -func (*MsgBrokerOpen) Descriptor() ([]byte, []int) { - return fileDescriptor_01b9dbed35cc5a15, []int{4} -} -func (m *MsgBrokerOpen) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgBrokerOpen) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgBrokerOpen.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgBrokerOpen) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgBrokerOpen.Merge(m, src) -} -func (m *MsgBrokerOpen) XXX_Size() int { - return m.Size() -} -func (m *MsgBrokerOpen) XXX_DiscardUnknown() { - xxx_messageInfo_MsgBrokerOpen.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgBrokerOpen proto.InternalMessageInfo - -func (m *MsgBrokerOpen) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgBrokerOpen) GetCollateralAsset() string { - if m != nil { - return m.CollateralAsset - } - return "" -} - -func (m *MsgBrokerOpen) GetBorrowAsset() string { - if m != nil { - return m.BorrowAsset - } - return "" -} - -func (m *MsgBrokerOpen) GetPosition() Position { - if m != nil { - return m.Position - } - return Position_UNSPECIFIED -} - -func (m *MsgBrokerOpen) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -type MsgBrokerOpenResponse struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *MsgBrokerOpenResponse) Reset() { *m = MsgBrokerOpenResponse{} } -func (m *MsgBrokerOpenResponse) String() string { return proto.CompactTextString(m) } -func (*MsgBrokerOpenResponse) ProtoMessage() {} -func (*MsgBrokerOpenResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_01b9dbed35cc5a15, []int{5} -} -func (m *MsgBrokerOpenResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgBrokerOpenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgBrokerOpenResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgBrokerOpenResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgBrokerOpenResponse.Merge(m, src) -} -func (m *MsgBrokerOpenResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgBrokerOpenResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgBrokerOpenResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgBrokerOpenResponse proto.InternalMessageInfo - -func (m *MsgBrokerOpenResponse) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -type MsgBrokerClose struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` - Amount types.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` -} - -func (m *MsgBrokerClose) Reset() { *m = MsgBrokerClose{} } -func (m *MsgBrokerClose) String() string { return proto.CompactTextString(m) } -func (*MsgBrokerClose) ProtoMessage() {} -func (*MsgBrokerClose) Descriptor() ([]byte, []int) { - return fileDescriptor_01b9dbed35cc5a15, []int{6} -} -func (m *MsgBrokerClose) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgBrokerClose) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgBrokerClose.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgBrokerClose) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgBrokerClose.Merge(m, src) -} -func (m *MsgBrokerClose) XXX_Size() int { - return m.Size() -} -func (m *MsgBrokerClose) XXX_DiscardUnknown() { - xxx_messageInfo_MsgBrokerClose.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgBrokerClose proto.InternalMessageInfo - -func (m *MsgBrokerClose) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgBrokerClose) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *MsgBrokerClose) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *MsgBrokerClose) GetAmount() types.Coin { - if m != nil { - return m.Amount - } - return types.Coin{} -} - -type MsgBrokerCloseResponse struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` -} - -func (m *MsgBrokerCloseResponse) Reset() { *m = MsgBrokerCloseResponse{} } -func (m *MsgBrokerCloseResponse) String() string { return proto.CompactTextString(m) } -func (*MsgBrokerCloseResponse) ProtoMessage() {} -func (*MsgBrokerCloseResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_01b9dbed35cc5a15, []int{7} -} -func (m *MsgBrokerCloseResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgBrokerCloseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgBrokerCloseResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgBrokerCloseResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgBrokerCloseResponse.Merge(m, src) -} -func (m *MsgBrokerCloseResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgBrokerCloseResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgBrokerCloseResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgBrokerCloseResponse proto.InternalMessageInfo - -func (m *MsgBrokerCloseResponse) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *MsgBrokerCloseResponse) GetAmount() types.Coin { - if m != nil { - return m.Amount - } - return types.Coin{} -} - type MsgUpdateParams struct { // authority is the address that controls the module (defaults to x/gov unless overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` @@ -511,7 +268,7 @@ func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParams) ProtoMessage() {} func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_01b9dbed35cc5a15, []int{8} + return fileDescriptor_01b9dbed35cc5a15, []int{4} } func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -561,7 +318,7 @@ func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParamsResponse) ProtoMessage() {} func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_01b9dbed35cc5a15, []int{9} + return fileDescriptor_01b9dbed35cc5a15, []int{5} } func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -600,7 +357,7 @@ func (m *MsgUpdatePools) Reset() { *m = MsgUpdatePools{} } func (m *MsgUpdatePools) String() string { return proto.CompactTextString(m) } func (*MsgUpdatePools) ProtoMessage() {} func (*MsgUpdatePools) Descriptor() ([]byte, []int) { - return fileDescriptor_01b9dbed35cc5a15, []int{10} + return fileDescriptor_01b9dbed35cc5a15, []int{6} } func (m *MsgUpdatePools) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -657,7 +414,7 @@ func (m *MsgUpdatePoolsResponse) Reset() { *m = MsgUpdatePoolsResponse{} func (m *MsgUpdatePoolsResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdatePoolsResponse) ProtoMessage() {} func (*MsgUpdatePoolsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_01b9dbed35cc5a15, []int{11} + return fileDescriptor_01b9dbed35cc5a15, []int{7} } func (m *MsgUpdatePoolsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -695,7 +452,7 @@ func (m *MsgWhitelist) Reset() { *m = MsgWhitelist{} } func (m *MsgWhitelist) String() string { return proto.CompactTextString(m) } func (*MsgWhitelist) ProtoMessage() {} func (*MsgWhitelist) Descriptor() ([]byte, []int) { - return fileDescriptor_01b9dbed35cc5a15, []int{12} + return fileDescriptor_01b9dbed35cc5a15, []int{8} } func (m *MsgWhitelist) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -745,7 +502,7 @@ func (m *MsgWhitelistResponse) Reset() { *m = MsgWhitelistResponse{} } func (m *MsgWhitelistResponse) String() string { return proto.CompactTextString(m) } func (*MsgWhitelistResponse) ProtoMessage() {} func (*MsgWhitelistResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_01b9dbed35cc5a15, []int{13} + return fileDescriptor_01b9dbed35cc5a15, []int{9} } func (m *MsgWhitelistResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -783,7 +540,7 @@ func (m *MsgDewhitelist) Reset() { *m = MsgDewhitelist{} } func (m *MsgDewhitelist) String() string { return proto.CompactTextString(m) } func (*MsgDewhitelist) ProtoMessage() {} func (*MsgDewhitelist) Descriptor() ([]byte, []int) { - return fileDescriptor_01b9dbed35cc5a15, []int{14} + return fileDescriptor_01b9dbed35cc5a15, []int{10} } func (m *MsgDewhitelist) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -833,7 +590,7 @@ func (m *MsgDewhitelistResponse) Reset() { *m = MsgDewhitelistResponse{} func (m *MsgDewhitelistResponse) String() string { return proto.CompactTextString(m) } func (*MsgDewhitelistResponse) ProtoMessage() {} func (*MsgDewhitelistResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_01b9dbed35cc5a15, []int{15} + return fileDescriptor_01b9dbed35cc5a15, []int{11} } func (m *MsgDewhitelistResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -867,10 +624,6 @@ func init() { proto.RegisterType((*MsgOpenResponse)(nil), "elys.margin.MsgOpenResponse") proto.RegisterType((*MsgClose)(nil), "elys.margin.MsgClose") proto.RegisterType((*MsgCloseResponse)(nil), "elys.margin.MsgCloseResponse") - proto.RegisterType((*MsgBrokerOpen)(nil), "elys.margin.MsgBrokerOpen") - proto.RegisterType((*MsgBrokerOpenResponse)(nil), "elys.margin.MsgBrokerOpenResponse") - proto.RegisterType((*MsgBrokerClose)(nil), "elys.margin.MsgBrokerClose") - proto.RegisterType((*MsgBrokerCloseResponse)(nil), "elys.margin.MsgBrokerCloseResponse") proto.RegisterType((*MsgUpdateParams)(nil), "elys.margin.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "elys.margin.MsgUpdateParamsResponse") proto.RegisterType((*MsgUpdatePools)(nil), "elys.margin.MsgUpdatePools") @@ -884,58 +637,52 @@ func init() { func init() { proto.RegisterFile("elys/margin/tx.proto", fileDescriptor_01b9dbed35cc5a15) } var fileDescriptor_01b9dbed35cc5a15 = []byte{ - // 816 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0xcd, 0x4e, 0xeb, 0x46, - 0x14, 0xce, 0x3f, 0xe1, 0x84, 0xf2, 0x63, 0x02, 0x18, 0x43, 0x03, 0xb8, 0x55, 0x4b, 0x85, 0xb0, - 0x05, 0x5d, 0x54, 0xaa, 0xd4, 0x05, 0x81, 0x2e, 0xa8, 0x1a,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7, 0x32, 0xff, 0x3e, 0xd7, 0x32, 0xe7, 0x7b, 0xd2, 0x8b, 0x1e, 0x13, - 0xed, 0x87, 0x88, 0xf5, 0x30, 0xe9, 0xf0, 0x85, 0x79, 0x33, 0xf4, 0x61, 0xd8, 0x2e, 0xf1, 0x2f, - 0xc3, 0x6f, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xa5, 0x47, 0xe7, 0xe7, 0xa7, 0x0a, 0x00, 0x00, + // 714 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcb, 0x4e, 0xdb, 0x40, + 0x14, 0xcd, 0x8b, 0x40, 0x6e, 0x10, 0x0f, 0x13, 0xc0, 0xa4, 0xd4, 0x80, 0x5b, 0x55, 0x54, 0x08, + 0x5b, 0xd0, 0x45, 0xa5, 0x4a, 0x5d, 0xf0, 0xe8, 0x82, 0x4a, 0x11, 0x91, 0xa5, 0xaa, 0x12, 0xb4, + 0x8a, 0x1c, 0x7b, 0x6a, 0x2c, 0x1c, 0x8f, 0x35, 0x33, 0x10, 0xf8, 0x8b, 0xfe, 0x46, 0x3f, 0xa3, + 0x3b, 0x96, 0x2c, 0xab, 0x2e, 0x50, 0x05, 0x3f, 0x52, 0x79, 0x66, 0xe2, 0x4c, 0xc2, 0x4b, 0x54, + 0xea, 0x0a, 0xe6, 0x9e, 0x3b, 0xe7, 0x9c, 0xeb, 0x7b, 0x62, 0x43, 0x0d, 0x45, 0xe7, 0xd4, 0xee, + 0xb8, 0x24, 0x08, 0x63, 0x9b, 0x9d, 0x59, 0x09, 0xc1, 0x0c, 0x6b, 0xd5, 0xb4, 0x6a, 0x89, 0x6a, + 0xbd, 0x16, 0xe0, 0x00, 0xf3, 0xba, 0x9d, 0xfe, 0x27, 0x5a, 0xea, 0x86, 0x87, 0x69, 0x07, 0x53, + 0xbb, 0xed, 0x52, 0x64, 0x9f, 0x6e, 0xb4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, 0x5a, 0x8f, 0x11, 0xeb, 0x62, 0x72, + 0xcc, 0x0f, 0xf6, 0xd9, 0xc0, 0x97, 0xa9, 0x5d, 0xe6, 0x9f, 0xa6, 0x37, 0x7f, 0x03, 0x00, 0x00, + 0xff, 0xff, 0x30, 0xe2, 0xd8, 0x6c, 0x28, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -952,8 +699,6 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { Open(ctx context.Context, in *MsgOpen, opts ...grpc.CallOption) (*MsgOpenResponse, error) Close(ctx context.Context, in *MsgClose, opts ...grpc.CallOption) (*MsgCloseResponse, error) - BrokerOpen(ctx context.Context, in *MsgBrokerOpen, opts ...grpc.CallOption) (*MsgBrokerOpenResponse, error) - BrokerClose(ctx context.Context, in *MsgBrokerClose, opts ...grpc.CallOption) (*MsgBrokerCloseResponse, error) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) UpdatePools(ctx context.Context, in *MsgUpdatePools, opts ...grpc.CallOption) (*MsgUpdatePoolsResponse, error) Whitelist(ctx context.Context, in *MsgWhitelist, opts ...grpc.CallOption) (*MsgWhitelistResponse, error) @@ -986,24 +731,6 @@ func (c *msgClient) Close(ctx context.Context, in *MsgClose, opts ...grpc.CallOp return out, nil } -func (c *msgClient) BrokerOpen(ctx context.Context, in *MsgBrokerOpen, opts ...grpc.CallOption) (*MsgBrokerOpenResponse, error) { - out := new(MsgBrokerOpenResponse) - err := c.cc.Invoke(ctx, "/elys.margin.Msg/BrokerOpen", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) BrokerClose(ctx context.Context, in *MsgBrokerClose, opts ...grpc.CallOption) (*MsgBrokerCloseResponse, error) { - out := new(MsgBrokerCloseResponse) - err := c.cc.Invoke(ctx, "/elys.margin.Msg/BrokerClose", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { out := new(MsgUpdateParamsResponse) err := c.cc.Invoke(ctx, "/elys.margin.Msg/UpdateParams", in, out, opts...) @@ -1044,8 +771,6 @@ func (c *msgClient) Dewhitelist(ctx context.Context, in *MsgDewhitelist, opts .. type MsgServer interface { Open(context.Context, *MsgOpen) (*MsgOpenResponse, error) Close(context.Context, *MsgClose) (*MsgCloseResponse, error) - BrokerOpen(context.Context, *MsgBrokerOpen) (*MsgBrokerOpenResponse, error) - BrokerClose(context.Context, *MsgBrokerClose) (*MsgBrokerCloseResponse, error) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) UpdatePools(context.Context, *MsgUpdatePools) (*MsgUpdatePoolsResponse, error) Whitelist(context.Context, *MsgWhitelist) (*MsgWhitelistResponse, error) @@ -1062,12 +787,6 @@ func (*UnimplementedMsgServer) Open(ctx context.Context, req *MsgOpen) (*MsgOpen func (*UnimplementedMsgServer) Close(ctx context.Context, req *MsgClose) (*MsgCloseResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Close not implemented") } -func (*UnimplementedMsgServer) BrokerOpen(ctx context.Context, req *MsgBrokerOpen) (*MsgBrokerOpenResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BrokerOpen not implemented") -} -func (*UnimplementedMsgServer) BrokerClose(ctx context.Context, req *MsgBrokerClose) (*MsgBrokerCloseResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BrokerClose not implemented") -} func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } @@ -1121,42 +840,6 @@ func _Msg_Close_Handler(srv interface{}, ctx context.Context, dec func(interface return interceptor(ctx, in, info, handler) } -func _Msg_BrokerOpen_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgBrokerOpen) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).BrokerOpen(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/elys.margin.Msg/BrokerOpen", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).BrokerOpen(ctx, req.(*MsgBrokerOpen)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_BrokerClose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgBrokerClose) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).BrokerClose(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/elys.margin.Msg/BrokerClose", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).BrokerClose(ctx, req.(*MsgBrokerClose)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgUpdateParams) if err := dec(in); err != nil { @@ -1241,14 +924,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "Close", Handler: _Msg_Close_Handler, }, - { - MethodName: "BrokerOpen", - Handler: _Msg_BrokerOpen_Handler, - }, - { - MethodName: "BrokerClose", - Handler: _Msg_BrokerClose_Handler, - }, { MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, @@ -1460,7 +1135,7 @@ func (m *MsgCloseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgBrokerOpen) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1470,238 +1145,34 @@ func (m *MsgBrokerOpen) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgBrokerOpen) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgBrokerOpen) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x42 + dAtA[i] = 0x12 } - { - size := m.TakeProfitPrice.Size() - i -= size - if _, err := m.TakeProfitPrice.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - { - size := m.Leverage.Size() - i -= size - if _, err := m.Leverage.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - if m.Position != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Position)) - i-- - dAtA[i] = 0x28 - } - if len(m.BorrowAsset) > 0 { - i -= len(m.BorrowAsset) - copy(dAtA[i:], m.BorrowAsset) - i = encodeVarintTx(dAtA, i, uint64(len(m.BorrowAsset))) - i-- - dAtA[i] = 0x22 - } - { - size := m.CollateralAmount.Size() - i -= size - if _, err := m.CollateralAmount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.CollateralAsset) > 0 { - i -= len(m.CollateralAsset) - copy(dAtA[i:], m.CollateralAsset) - i = encodeVarintTx(dAtA, i, uint64(len(m.CollateralAsset))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgBrokerOpenResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgBrokerOpenResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgBrokerOpenResponse) 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] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgBrokerClose) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgBrokerClose) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgBrokerClose) 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] = 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.Id != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x10 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgBrokerCloseResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgBrokerCloseResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgBrokerCloseResponse) 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 m.Id != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -2005,106 +1476,24 @@ func (m *MsgCloseResponse) Size() (n int) { return n } -func (m *MsgBrokerOpen) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.CollateralAsset) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.CollateralAmount.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.BorrowAsset) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Position != 0 { - n += 1 + sovTx(uint64(m.Position)) - } - l = m.Leverage.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.TakeProfitPrice.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgBrokerOpenResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovTx(uint64(m.Id)) - } - return n -} - -func (m *MsgBrokerClose) Size() (n int) { +func (m *MsgUpdateParams) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Creator) + l = len(m.Authority) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.Id != 0 { - n += 1 + sovTx(uint64(m.Id)) - } - l = len(m.Owner) - if l > 0 { + if m.Params != nil { + l = m.Params.Size() n += 1 + l + sovTx(uint64(l)) } - l = m.Amount.Size() - n += 1 + l + sovTx(uint64(l)) return n } -func (m *MsgBrokerCloseResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovTx(uint64(m.Id)) - } - l = m.Amount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgUpdateParamsResponse) Size() (n int) { +func (m *MsgUpdateParamsResponse) Size() (n int) { if m == nil { return 0 } @@ -2114,670 +1503,98 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { } func (m *MsgUpdatePools) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Pools) > 0 { - for _, s := range m.Pools { - l = len(s) - n += 1 + l + sovTx(uint64(l)) - } - } - if len(m.ClosedPools) > 0 { - for _, s := range m.ClosedPools { - l = len(s) - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgUpdatePoolsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgWhitelist) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.WhitelistedAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgWhitelistResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgDewhitelist) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.WhitelistedAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgDewhitelistResponse) 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 *MsgOpen) Unmarshal(dAtA []byte) 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: MsgOpen: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOpen: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CollateralAsset", 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.CollateralAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CollateralAmount", 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.CollateralAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BorrowAsset", 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.BorrowAsset = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - m.Position = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Position |= Position(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Leverage", 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.Leverage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TakeProfitPrice", 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.TakeProfitPrice.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 *MsgOpenResponse) Unmarshal(dAtA []byte) 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: MsgOpenResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOpenResponse: 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 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 *MsgClose) Unmarshal(dAtA []byte) 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: MsgClose: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgClose: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Pools) > 0 { + for _, s := range m.Pools { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.ClosedPools) > 0 { + for _, s := range m.ClosedPools { + l = len(s) + n += 1 + l + sovTx(uint64(l)) } } + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *MsgUpdatePoolsResponse) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + return n } -func (m *MsgCloseResponse) Unmarshal(dAtA []byte) 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: MsgCloseResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCloseResponse: 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 ErrIntOverflowTx - } - 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 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 - } + +func (m *MsgWhitelist) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.WhitelistedAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *MsgWhitelistResponse) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + return n +} + +func (m *MsgDewhitelist) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.WhitelistedAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgDewhitelistResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n } -func (m *MsgBrokerOpen) Unmarshal(dAtA []byte) error { + +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 *MsgOpen) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2800,10 +1617,10 @@ func (m *MsgBrokerOpen) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgBrokerOpen: wiretype end group for non-group") + return fmt.Errorf("proto: MsgOpen: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBrokerOpen: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgOpen: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3023,38 +1840,6 @@ func (m *MsgBrokerOpen) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 8: - 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 default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -3076,7 +1861,7 @@ func (m *MsgBrokerOpen) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgBrokerOpenResponse) Unmarshal(dAtA []byte) error { +func (m *MsgOpenResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3099,10 +1884,10 @@ func (m *MsgBrokerOpenResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgBrokerOpenResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgOpenResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBrokerOpenResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgOpenResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3145,7 +1930,7 @@ func (m *MsgBrokerOpenResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgBrokerClose) Unmarshal(dAtA []byte) error { +func (m *MsgClose) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3168,10 +1953,10 @@ func (m *MsgBrokerClose) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgBrokerClose: wiretype end group for non-group") + return fmt.Errorf("proto: MsgClose: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBrokerClose: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgClose: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3226,38 +2011,6 @@ func (m *MsgBrokerClose) Unmarshal(dAtA []byte) error { } } 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 Amount", wireType) } @@ -3311,7 +2064,7 @@ func (m *MsgBrokerClose) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgBrokerCloseResponse) Unmarshal(dAtA []byte) error { +func (m *MsgCloseResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3334,10 +2087,10 @@ func (m *MsgBrokerCloseResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgBrokerCloseResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCloseResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBrokerCloseResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCloseResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3359,7 +2112,7 @@ func (m *MsgBrokerCloseResponse) Unmarshal(dAtA []byte) error { break } } - case 3: + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) }