diff --git a/wasmbindings/types/types.go b/wasmbindings/types/types.go index 15006f2d9..eca1536c0 100644 --- a/wasmbindings/types/types.go +++ b/wasmbindings/types/types.go @@ -237,26 +237,17 @@ type ElysMsg struct { // accountedpool messages // amm messages - AmmCreatePool *ammtypes.MsgCreatePool `json:"amm_create_pool,omitempty"` - AmmJoinPool *ammtypes.MsgJoinPool `json:"amm_join_pool,omitempty"` - AmmExitPool *ammtypes.MsgExitPool `json:"amm_exit_pool,omitempty"` - AmmSwapExactAmountIn *ammtypes.MsgSwapExactAmountIn `json:"amm_swap_exact_amount_in,omitempty"` - AmmSwapExactAmountOut *ammtypes.MsgSwapExactAmountOut `json:"amm_swap_exact_amount_out,omitempty"` - AmmSwapByDenom *ammtypes.MsgSwapByDenom `json:"amm_swap_by_denom,omitempty"` - AmmFeedMultipleExternalLiquidity *ammtypes.MsgFeedMultipleExternalLiquidity `json:"amm_feed_multiple_external_liquidity,omitempty"` - AmmUpdatePoolParams *ammtypes.MsgUpdatePoolParams `json:"amm_update_pool_params,omitempty"` + AmmCreatePool *ammtypes.MsgCreatePool `json:"amm_create_pool,omitempty"` + AmmJoinPool *ammtypes.MsgJoinPool `json:"amm_join_pool,omitempty"` + AmmExitPool *ammtypes.MsgExitPool `json:"amm_exit_pool,omitempty"` + AmmSwapExactAmountIn *ammtypes.MsgSwapExactAmountIn `json:"amm_swap_exact_amount_in,omitempty"` + AmmSwapExactAmountOut *ammtypes.MsgSwapExactAmountOut `json:"amm_swap_exact_amount_out,omitempty"` + AmmSwapByDenom *ammtypes.MsgSwapByDenom `json:"amm_swap_by_denom,omitempty"` // assetprofile messages - AssetProfileCreateEntry *assetprofiletypes.MsgCreateEntry `json:"asset_profile_create_entry,omitempty"` - AssetProfileUpdateEntry *assetprofiletypes.MsgUpdateEntry `json:"asset_profile_update_entry,omitempty"` - AssetProfileDeleteEntry *assetprofiletypes.MsgDeleteEntry `json:"asset_profile_delete_entry,omitempty"` - // auth messages - // burner messages - // clock messages - ClockUpdateParams *clocktypes.MsgUpdateParams `json:"clock_update_params,omitempty"` // commitment messages CommitmentCommitLiquidTokens *commitmenttypes.MsgCommitLiquidTokens `json:"commitment_commit_liquid_tokens,omitempty"` @@ -279,30 +270,16 @@ type ElysMsg struct { IncentiveWithdrawValidatorCommission *incentivetypes.MsgWithdrawValidatorCommission `json:"incentive_withdraw_validator_commission"` // leveragelp messages - LeveragelpOpen *leveragelptypes.MsgOpen `json:"leveragelp_open,omitempty"` - LeveragelpClose *leveragelptypes.MsgClose `json:"leveragelp_close,omitempty"` - LeveragelpUpdateParams *leveragelptypes.MsgUpdateParams `json:"leveragelp_update_params,omitempty"` - LeveragelpUpdatePools *leveragelptypes.MsgUpdatePools `json:"leveragelp_update_pools,omitempty"` - LeveragelpWhitelist *leveragelptypes.MsgWhitelist `json:"leveragelp_whitelist,omitempty"` - LeveragelpDewhitelist *leveragelptypes.MsgDewhitelist `json:"leveragelp_dewhitelist,omitempty"` + LeveragelpOpen *leveragelptypes.MsgOpen `json:"leveragelp_open,omitempty"` + 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"` - MarginUpdateParams *margintypes.MsgUpdateParams `json:"margin_update_params,omitempty"` - MarginUpdatePools *margintypes.MsgUpdatePools `json:"margin_update_pools,omitempty"` - MarginWhitelist *margintypes.MsgWhitelist `json:"margin_whitelist,omitempty"` - MarginDewhitelist *margintypes.MsgDewhitelist `json:"margin_dewhitelist,omitempty"` + 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"` // oracle messages - OracleFeedPrice *oracletypes.MsgFeedPrice `json:"oracle_feed_price,omitempty"` - OracleFeedMultiplePrices *oracletypes.MsgFeedMultiplePrices `json:"oracle_feed_multiple_price,omitempty"` - OracleRequestBandPrice *oracletypes.MsgRequestBandPrice `json:"oracle_request_band_price,omitempty"` - OracleSetPriceFeeder *oracletypes.MsgSetPriceFeeder `json:"oracle_set_price_feeder,omitempty"` - OracleDeletePriceFeeder *oracletypes.MsgDeletePriceFeeder `json:"oracle_delete_price_feeder,omitempty"` - // parameter messages // stablestake messages @@ -310,14 +287,6 @@ type ElysMsg struct { StakestakeUnbond *stablestaketypes.MsgUnbond `json:"stablestake_unbond,omitempty"` // tokenomics messages - TokenomicsCreateAirdrop *tokenomicstypes.MsgCreateAirdrop `json:"tokenomics_create_airdrop,omitempty"` - TokenomicsUpdateAirdrop *tokenomicstypes.MsgUpdateAirdrop `json:"tokenomics_update_airdrop,omitempty"` - TokenomicsDeleteAirdrop *tokenomicstypes.MsgDeleteAirdrop `json:"tokenomics_delete_airdrop,omitempty"` - TokenomicsUpdateGenesisInflation *tokenomicstypes.MsgUpdateGenesisInflation `json:"tokenomics_update_genesis_inflation,omitempty"` - TokenomicsCreateTimeBasedInflation *tokenomicstypes.MsgCreateTimeBasedInflation `json:"tokenomics_create_time_based_inflation,omitempty"` - TokenomicsUpdateTimeBasedInflation *tokenomicstypes.MsgUpdateTimeBasedInflation `json:"tokenomics_update_time_based_inflation,omitempty"` - TokenomicsDeleteTimeBasedInflation *tokenomicstypes.MsgDeleteTimeBasedInflation `json:"tokenomics_delete_time_based_inflation,omitempty"` - // transferhook messages } diff --git a/x/amm/client/wasm/messenger.go b/x/amm/client/wasm/messenger.go index 3824c2164..01a5a624c 100644 --- a/x/amm/client/wasm/messenger.go +++ b/x/amm/client/wasm/messenger.go @@ -29,10 +29,6 @@ func (m *Messenger) HandleMsg(ctx sdk.Context, contractAddr sdk.AccAddress, cont return m.msgSwapExactAmountOut(ctx, contractAddr, msg.AmmSwapExactAmountOut) case msg.AmmSwapByDenom != nil: return m.msgSwapByDenom(ctx, contractAddr, msg.AmmSwapByDenom) - case msg.AmmFeedMultipleExternalLiquidity != nil: - return m.msgFeedMultipleExternalLiquidity(ctx, contractAddr, msg.AmmFeedMultipleExternalLiquidity) - case msg.AmmUpdatePoolParams != nil: - return m.msgUpdatePoolParams(ctx, contractAddr, msg.AmmUpdatePoolParams) default: // This handler cannot handle the message return nil, nil, wasmbindingstypes.ErrCannotHandleMsg diff --git a/x/amm/client/wasm/msg_feed_multiple_external_liquidity.go b/x/amm/client/wasm/msg_feed_multiple_external_liquidity.go deleted file mode 100644 index e4f41baa5..000000000 --- a/x/amm/client/wasm/msg_feed_multiple_external_liquidity.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - ammkeeper "github.com/elys-network/elys/x/amm/keeper" - ammtypes "github.com/elys-network/elys/x/amm/types" -) - -func (m *Messenger) msgFeedMultipleExternalLiquidity(ctx sdk.Context, contractAddr sdk.AccAddress, msg *ammtypes.MsgFeedMultipleExternalLiquidity) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "FeedMultipleExternalLiquidity null msg"} - } - - if msg.Sender != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "FeedMultipleExternalLiquidity wrong sender"} - } - - msgServer := ammkeeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.FeedMultipleExternalLiquidity( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "FeedMultipleExternalLiquidity msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize FeedMultipleExternalLiquidity response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/amm/client/wasm/msg_update_pool_params.go b/x/amm/client/wasm/msg_update_pool_params.go deleted file mode 100644 index 0a9f8e9c4..000000000 --- a/x/amm/client/wasm/msg_update_pool_params.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - ammkeeper "github.com/elys-network/elys/x/amm/keeper" - ammtypes "github.com/elys-network/elys/x/amm/types" -) - -func (m *Messenger) msgUpdatePoolParams(ctx sdk.Context, contractAddr sdk.AccAddress, msg *ammtypes.MsgUpdatePoolParams) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "update pool params null msg"} - } - - if msg.Sender != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "update pool params wrong sender"} - } - - msgServer := ammkeeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.UpdatePoolParams( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "update pool params msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize update pool params response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/assetprofile/client/wasm/messenger.go b/x/assetprofile/client/wasm/messenger.go index 0a6873375..e74a4d63b 100644 --- a/x/assetprofile/client/wasm/messenger.go +++ b/x/assetprofile/client/wasm/messenger.go @@ -17,12 +17,6 @@ func NewMessenger(keeper *keeper.Keeper) *Messenger { func (m *Messenger) HandleMsg(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmbindingstypes.ElysMsg) ([]sdk.Event, [][]byte, error) { switch { - case msg.AssetProfileCreateEntry != nil: - return m.msgCreateEntry(ctx, contractAddr, msg.AssetProfileCreateEntry) - case msg.AssetProfileUpdateEntry != nil: - return m.msgUpdateEntry(ctx, contractAddr, msg.AssetProfileUpdateEntry) - case msg.AssetProfileDeleteEntry != nil: - return m.msgDeleteEntry(ctx, contractAddr, msg.AssetProfileDeleteEntry) default: // This handler cannot handle the message return nil, nil, wasmbindingstypes.ErrCannotHandleMsg diff --git a/x/assetprofile/client/wasm/msg_create_entry.go b/x/assetprofile/client/wasm/msg_create_entry.go deleted file mode 100644 index a0988c379..000000000 --- a/x/assetprofile/client/wasm/msg_create_entry.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/assetprofile/keeper" - types "github.com/elys-network/elys/x/assetprofile/types" -) - -func (m *Messenger) msgCreateEntry(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgCreateEntry) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "CreateEntry null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "create entry wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.CreateEntry( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "CreateEntry msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize CreateEntry response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/assetprofile/client/wasm/msg_delete_entry.go b/x/assetprofile/client/wasm/msg_delete_entry.go deleted file mode 100644 index 7d5df4b5f..000000000 --- a/x/assetprofile/client/wasm/msg_delete_entry.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/assetprofile/keeper" - types "github.com/elys-network/elys/x/assetprofile/types" -) - -func (m *Messenger) msgDeleteEntry(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgDeleteEntry) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "DeleteEntry null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "delete entry wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.DeleteEntry( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "DeleteEntry msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize DeleteEntry response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/assetprofile/client/wasm/msg_update_entry.go b/x/assetprofile/client/wasm/msg_update_entry.go deleted file mode 100644 index a786a77b1..000000000 --- a/x/assetprofile/client/wasm/msg_update_entry.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/assetprofile/keeper" - types "github.com/elys-network/elys/x/assetprofile/types" -) - -func (m *Messenger) msgUpdateEntry(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgUpdateEntry) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "UpdateEntry null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "update entry wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.UpdateEntry( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "UpdateEntry msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize UpdateEntry response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/clock/client/wasm/messenger.go b/x/clock/client/wasm/messenger.go index 4e51adc3e..f1373458c 100644 --- a/x/clock/client/wasm/messenger.go +++ b/x/clock/client/wasm/messenger.go @@ -17,8 +17,6 @@ func NewMessenger(keeper *keeper.Keeper) *Messenger { func (m *Messenger) HandleMsg(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmbindingstypes.ElysMsg) ([]sdk.Event, [][]byte, error) { switch { - case msg.ClockUpdateParams != nil: - return m.msgUpdateParams(ctx, contractAddr, msg.ClockUpdateParams) default: // This handler cannot handle the message return nil, nil, wasmbindingstypes.ErrCannotHandleMsg diff --git a/x/clock/client/wasm/msg_update_params.go b/x/clock/client/wasm/msg_update_params.go deleted file mode 100644 index 6d56bd0da..000000000 --- a/x/clock/client/wasm/msg_update_params.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/clock/keeper" - types "github.com/elys-network/elys/x/clock/types" -) - -func (m *Messenger) msgUpdateParams(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgUpdateParams) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "UpdateParams null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "update params wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.UpdateParams( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "UpdateParams msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize UpdateParams response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/leveragelp/client/wasm/messenger.go b/x/leveragelp/client/wasm/messenger.go index 83aeca293..159556003 100644 --- a/x/leveragelp/client/wasm/messenger.go +++ b/x/leveragelp/client/wasm/messenger.go @@ -29,14 +29,6 @@ func (m *Messenger) HandleMsg(ctx sdk.Context, contractAddr sdk.AccAddress, cont return m.msgOpen(ctx, contractAddr, msg.LeveragelpOpen) case msg.LeveragelpClose != nil: return m.msgClose(ctx, contractAddr, msg.LeveragelpClose) - case msg.LeveragelpUpdateParams != nil: - return m.msgUpdateParams(ctx, contractAddr, msg.LeveragelpUpdateParams) - case msg.LeveragelpUpdatePools != nil: - return m.msgUpdatePools(ctx, contractAddr, msg.LeveragelpUpdatePools) - case msg.LeveragelpWhitelist != nil: - return m.msgWhitelist(ctx, contractAddr, msg.LeveragelpWhitelist) - case msg.LeveragelpDewhitelist != nil: - return m.msgDewhitelist(ctx, contractAddr, msg.LeveragelpDewhitelist) default: // This handler cannot handle the message return nil, nil, wasmbindingstypes.ErrCannotHandleMsg diff --git a/x/leveragelp/client/wasm/msg_dewhitelist.go b/x/leveragelp/client/wasm/msg_dewhitelist.go deleted file mode 100644 index 0b5f56dde..000000000 --- a/x/leveragelp/client/wasm/msg_dewhitelist.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/leveragelp/keeper" - types "github.com/elys-network/elys/x/leveragelp/types" -) - -func (m *Messenger) msgDewhitelist(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgDewhitelist) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "Dewhitelist null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "dewhitelist wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.Dewhitelist( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "Dewhitelist msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize Dewhitelist response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/leveragelp/client/wasm/msg_update_params.go b/x/leveragelp/client/wasm/msg_update_params.go deleted file mode 100644 index 61df01492..000000000 --- a/x/leveragelp/client/wasm/msg_update_params.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/leveragelp/keeper" - types "github.com/elys-network/elys/x/leveragelp/types" -) - -func (m *Messenger) msgUpdateParams(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgUpdateParams) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "UpdateParams null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "update params wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.UpdateParams( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "UpdateParams msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize UpdateParams response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/leveragelp/client/wasm/msg_update_pools.go b/x/leveragelp/client/wasm/msg_update_pools.go deleted file mode 100644 index 55fb9862a..000000000 --- a/x/leveragelp/client/wasm/msg_update_pools.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/leveragelp/keeper" - types "github.com/elys-network/elys/x/leveragelp/types" -) - -func (m *Messenger) msgUpdatePools(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgUpdatePools) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "UpdatePools null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "update pools wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.UpdatePools( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "UpdatePools msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize UpdatePools response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/leveragelp/client/wasm/msg_whitelist.go b/x/leveragelp/client/wasm/msg_whitelist.go deleted file mode 100644 index 284ad7134..000000000 --- a/x/leveragelp/client/wasm/msg_whitelist.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/leveragelp/keeper" - types "github.com/elys-network/elys/x/leveragelp/types" -) - -func (m *Messenger) msgWhitelist(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgWhitelist) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "Whitelist null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "whitelist wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.Whitelist( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "Whitelist msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize Whitelist response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/margin/client/wasm/messenger.go b/x/margin/client/wasm/messenger.go index 7c06cd1b4..10147c2f3 100644 --- a/x/margin/client/wasm/messenger.go +++ b/x/margin/client/wasm/messenger.go @@ -33,14 +33,6 @@ func (m *Messenger) HandleMsg(ctx sdk.Context, contractAddr sdk.AccAddress, cont return m.msgBrokerOpen(ctx, contractAddr, msg.MarginBrokerOpen) case msg.MarginBrokerClose != nil: return m.msgBrokerClose(ctx, contractAddr, msg.MarginBrokerClose) - case msg.MarginUpdateParams != nil: - return m.msgUpdateParams(ctx, contractAddr, msg.MarginUpdateParams) - case msg.MarginUpdatePools != nil: - return m.msgUpdatePools(ctx, contractAddr, msg.MarginUpdatePools) - case msg.MarginWhitelist != nil: - return m.msgWhitelist(ctx, contractAddr, msg.MarginWhitelist) - case msg.MarginDewhitelist != nil: - return m.msgDewhitelist(ctx, contractAddr, msg.MarginDewhitelist) default: // This handler cannot handle the message return nil, nil, wasmbindingstypes.ErrCannotHandleMsg diff --git a/x/margin/client/wasm/msg_dewhitelist.go b/x/margin/client/wasm/msg_dewhitelist.go deleted file mode 100644 index a800ea2e2..000000000 --- a/x/margin/client/wasm/msg_dewhitelist.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/margin/keeper" - types "github.com/elys-network/elys/x/margin/types" -) - -func (m *Messenger) msgDewhitelist(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgDewhitelist) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "Dewhitelist null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "dewhitelist wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.Dewhitelist( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "Dewhitelist msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize Dewhitelist response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/margin/client/wasm/msg_update_params.go b/x/margin/client/wasm/msg_update_params.go deleted file mode 100644 index baa85d6ef..000000000 --- a/x/margin/client/wasm/msg_update_params.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/margin/keeper" - types "github.com/elys-network/elys/x/margin/types" -) - -func (m *Messenger) msgUpdateParams(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgUpdateParams) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "UpdateParams null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "update params wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.UpdateParams( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "UpdateParams msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize UpdateParams response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/margin/client/wasm/msg_update_pools.go b/x/margin/client/wasm/msg_update_pools.go deleted file mode 100644 index 8044054ee..000000000 --- a/x/margin/client/wasm/msg_update_pools.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/margin/keeper" - types "github.com/elys-network/elys/x/margin/types" -) - -func (m *Messenger) msgUpdatePools(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgUpdatePools) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "UpdatePools null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "update pools wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.UpdatePools( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "UpdatePools msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize UpdatePools response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/margin/client/wasm/msg_whitelist.go b/x/margin/client/wasm/msg_whitelist.go deleted file mode 100644 index 40b791af9..000000000 --- a/x/margin/client/wasm/msg_whitelist.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/margin/keeper" - types "github.com/elys-network/elys/x/margin/types" -) - -func (m *Messenger) msgWhitelist(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgWhitelist) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "Whitelist null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "whitelist wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.Whitelist( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "Whitelist msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize Whitelist response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/oracle/client/wasm/messenger.go b/x/oracle/client/wasm/messenger.go index 7c91b8c8d..fa9ee2693 100644 --- a/x/oracle/client/wasm/messenger.go +++ b/x/oracle/client/wasm/messenger.go @@ -17,16 +17,6 @@ func NewMessenger(keeper *keeper.Keeper) *Messenger { func (m *Messenger) HandleMsg(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmbindingstypes.ElysMsg) ([]sdk.Event, [][]byte, error) { switch { - case msg.OracleFeedPrice != nil: - return m.msgFeedPrice(ctx, contractAddr, msg.OracleFeedPrice) - case msg.OracleFeedMultiplePrices != nil: - return m.msgFeedMultiplePrices(ctx, contractAddr, msg.OracleFeedMultiplePrices) - case msg.OracleRequestBandPrice != nil: - return m.msgRequestBandPrice(ctx, contractAddr, msg.OracleRequestBandPrice) - case msg.OracleSetPriceFeeder != nil: - return m.msgSetPriceFeeder(ctx, contractAddr, msg.OracleSetPriceFeeder) - case msg.OracleDeletePriceFeeder != nil: - return m.msgDeletePriceFeeder(ctx, contractAddr, msg.OracleDeletePriceFeeder) default: // This handler cannot handle the message return nil, nil, wasmbindingstypes.ErrCannotHandleMsg diff --git a/x/oracle/client/wasm/msg_delete_price_feeder.go b/x/oracle/client/wasm/msg_delete_price_feeder.go deleted file mode 100644 index 922b436b3..000000000 --- a/x/oracle/client/wasm/msg_delete_price_feeder.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/oracle/keeper" - types "github.com/elys-network/elys/x/oracle/types" -) - -func (m *Messenger) msgDeletePriceFeeder(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgDeletePriceFeeder) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "DeletePriceFeeder null msg"} - } - - if msg.Feeder != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "delete price feeder wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.DeletePriceFeeder( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "DeletePriceFeeder msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize DeletePriceFeeder response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/oracle/client/wasm/msg_feed_multiple_prices.go b/x/oracle/client/wasm/msg_feed_multiple_prices.go deleted file mode 100644 index aed58e41c..000000000 --- a/x/oracle/client/wasm/msg_feed_multiple_prices.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/oracle/keeper" - types "github.com/elys-network/elys/x/oracle/types" -) - -func (m *Messenger) msgFeedMultiplePrices(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgFeedMultiplePrices) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "FeedMultiplePrices null msg"} - } - - if msg.Creator != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "feed multiple prices wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.FeedMultiplePrices( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "FeedMultiplePrices msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize FeedMultiplePrices response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/oracle/client/wasm/msg_feed_price.go b/x/oracle/client/wasm/msg_feed_price.go deleted file mode 100644 index 0d99caa7f..000000000 --- a/x/oracle/client/wasm/msg_feed_price.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/oracle/keeper" - types "github.com/elys-network/elys/x/oracle/types" -) - -func (m *Messenger) msgFeedPrice(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgFeedPrice) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "FeedPrice null msg"} - } - - if msg.Provider != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "feed price wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.FeedPrice( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "FeedPrice msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize FeedPrice response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/oracle/client/wasm/msg_request_band_price.go b/x/oracle/client/wasm/msg_request_band_price.go deleted file mode 100644 index 433f71c04..000000000 --- a/x/oracle/client/wasm/msg_request_band_price.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/oracle/keeper" - types "github.com/elys-network/elys/x/oracle/types" -) - -func (m *Messenger) msgRequestBandPrice(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgRequestBandPrice) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "RequestBandPrice null msg"} - } - - if msg.Creator != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "request band price wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.RequestBandPrice( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "RequestBandPrice msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize RequestBandPrice response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/oracle/client/wasm/msg_set_price_feeder.go b/x/oracle/client/wasm/msg_set_price_feeder.go deleted file mode 100644 index 4f084ed5f..000000000 --- a/x/oracle/client/wasm/msg_set_price_feeder.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/oracle/keeper" - types "github.com/elys-network/elys/x/oracle/types" -) - -func (m *Messenger) msgSetPriceFeeder(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgSetPriceFeeder) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "SetPriceFeeder null msg"} - } - - if msg.Feeder != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "set price feeder wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.SetPriceFeeder( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "SetPriceFeeder msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize SetPriceFeeder response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/tokenomics/client/wasm/messenger.go b/x/tokenomics/client/wasm/messenger.go index 696bc05a4..4fe8ff016 100644 --- a/x/tokenomics/client/wasm/messenger.go +++ b/x/tokenomics/client/wasm/messenger.go @@ -17,18 +17,6 @@ func NewMessenger(keeper *keeper.Keeper) *Messenger { func (m *Messenger) HandleMsg(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmbindingstypes.ElysMsg) ([]sdk.Event, [][]byte, error) { switch { - case msg.TokenomicsCreateAirdrop != nil: - return m.msgCreateAirdrop(ctx, contractAddr, msg.TokenomicsCreateAirdrop) - case msg.TokenomicsUpdateAirdrop != nil: - return m.msgUpdateAirdrop(ctx, contractAddr, msg.TokenomicsUpdateAirdrop) - case msg.TokenomicsDeleteAirdrop != nil: - return m.msgDeleteAirdrop(ctx, contractAddr, msg.TokenomicsDeleteAirdrop) - case msg.TokenomicsCreateTimeBasedInflation != nil: - return m.msgCreateTimeBasedInflation(ctx, contractAddr, msg.TokenomicsCreateTimeBasedInflation) - case msg.TokenomicsUpdateTimeBasedInflation != nil: - return m.msgUpdateTimeBasedInflation(ctx, contractAddr, msg.TokenomicsUpdateTimeBasedInflation) - case msg.TokenomicsDeleteTimeBasedInflation != nil: - return m.msgDeleteTimeBasedInflation(ctx, contractAddr, msg.TokenomicsDeleteTimeBasedInflation) default: // This handler cannot handle the message return nil, nil, wasmbindingstypes.ErrCannotHandleMsg diff --git a/x/tokenomics/client/wasm/msg_create_airdrop.go b/x/tokenomics/client/wasm/msg_create_airdrop.go deleted file mode 100644 index d584ce38a..000000000 --- a/x/tokenomics/client/wasm/msg_create_airdrop.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/tokenomics/keeper" - types "github.com/elys-network/elys/x/tokenomics/types" -) - -func (m *Messenger) msgCreateAirdrop(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgCreateAirdrop) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "CreateAirdrop null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "create airdrop wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.CreateAirdrop( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "CreateAirdrop msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize CreateAirdrop response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/tokenomics/client/wasm/msg_create_time_based_inflation.go b/x/tokenomics/client/wasm/msg_create_time_based_inflation.go deleted file mode 100644 index ccca9068a..000000000 --- a/x/tokenomics/client/wasm/msg_create_time_based_inflation.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/tokenomics/keeper" - types "github.com/elys-network/elys/x/tokenomics/types" -) - -func (m *Messenger) msgCreateTimeBasedInflation(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgCreateTimeBasedInflation) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "CreateTimeBasedInflation null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "create time based inflation wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.CreateTimeBasedInflation( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "CreateTimeBasedInflation msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize CreateTimeBasedInflation response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/tokenomics/client/wasm/msg_delete_airdrop.go b/x/tokenomics/client/wasm/msg_delete_airdrop.go deleted file mode 100644 index e0eb543ce..000000000 --- a/x/tokenomics/client/wasm/msg_delete_airdrop.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/tokenomics/keeper" - types "github.com/elys-network/elys/x/tokenomics/types" -) - -func (m *Messenger) msgDeleteAirdrop(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgDeleteAirdrop) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "DeleteAirdrop null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "create airdrop wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.DeleteAirdrop( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "DeleteAirdrop msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize DeleteAirdrop response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/tokenomics/client/wasm/msg_delete_time_based_inflation.go b/x/tokenomics/client/wasm/msg_delete_time_based_inflation.go deleted file mode 100644 index bd5ef05c0..000000000 --- a/x/tokenomics/client/wasm/msg_delete_time_based_inflation.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/tokenomics/keeper" - types "github.com/elys-network/elys/x/tokenomics/types" -) - -func (m *Messenger) msgDeleteTimeBasedInflation(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgDeleteTimeBasedInflation) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "DeleteTimeBasedInflation null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "delete time based inflation wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.DeleteTimeBasedInflation( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "DeleteTimeBasedInflation msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize DeleteTimeBasedInflation response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/tokenomics/client/wasm/msg_update_airdrop.go b/x/tokenomics/client/wasm/msg_update_airdrop.go deleted file mode 100644 index fcf0df8ca..000000000 --- a/x/tokenomics/client/wasm/msg_update_airdrop.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/tokenomics/keeper" - types "github.com/elys-network/elys/x/tokenomics/types" -) - -func (m *Messenger) msgUpdateAirdrop(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgUpdateAirdrop) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "UpdateAirdrop null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "update airdrop wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.UpdateAirdrop( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "UpdateAirdrop msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize UpdateAirdrop response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/tokenomics/client/wasm/msg_update_genesis_inflation.go b/x/tokenomics/client/wasm/msg_update_genesis_inflation.go deleted file mode 100644 index 8ceba0323..000000000 --- a/x/tokenomics/client/wasm/msg_update_genesis_inflation.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/tokenomics/keeper" - types "github.com/elys-network/elys/x/tokenomics/types" -) - -func (m *Messenger) msgUpdateGenesisInflation(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgUpdateGenesisInflation) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "UpdateGenesisInflation null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "update genesis inflation wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.UpdateGenesisInflation( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "UpdateGenesisInflation msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize UpdateGenesisInflation response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -} diff --git a/x/tokenomics/client/wasm/msg_update_time_based_inflation.go b/x/tokenomics/client/wasm/msg_update_time_based_inflation.go deleted file mode 100644 index eb56407f7..000000000 --- a/x/tokenomics/client/wasm/msg_update_time_based_inflation.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - keeper "github.com/elys-network/elys/x/tokenomics/keeper" - types "github.com/elys-network/elys/x/tokenomics/types" -) - -func (m *Messenger) msgUpdateTimeBasedInflation(ctx sdk.Context, contractAddr sdk.AccAddress, msg *types.MsgUpdateTimeBasedInflation) ([]sdk.Event, [][]byte, error) { - if msg == nil { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "UpdateTimeBasedInflation null msg"} - } - - if msg.Authority != contractAddr.String() { - return nil, nil, wasmvmtypes.InvalidRequest{Err: "update time based inflation wrong sender"} - } - - msgServer := keeper.NewMsgServerImpl(*m.keeper) - - if err := msg.ValidateBasic(); err != nil { - return nil, nil, errorsmod.Wrap(err, "failed validating msg") - } - - res, err := msgServer.UpdateTimeBasedInflation( - sdk.WrapSDKContext(ctx), - msg, - ) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "UpdateTimeBasedInflation msg") - } - - responseBytes, err := json.Marshal(*res) - if err != nil { - return nil, nil, errorsmod.Wrap(err, "failed to serialize UpdateTimeBasedInflation response") - } - - resp := [][]byte{responseBytes} - - return nil, resp, nil -}