Skip to content

Commit

Permalink
refactor: disable all modules deprecated txs
Browse files Browse the repository at this point in the history
  • Loading branch information
scorpioborn committed Nov 4, 2024
1 parent 5fae06a commit 86d6d49
Show file tree
Hide file tree
Showing 24 changed files with 474 additions and 332 deletions.
4 changes: 2 additions & 2 deletions app/upgrades/v10/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/sge-network/sge/app/upgrades"
)

// UpgradeName defines the on-chain upgrade name for the v1.7.4 upgrade.
const UpgradeName = "v1.7.4"
// UpgradeName defines the on-chain upgrade name for the v1.7.5 upgrade.
const UpgradeName = "v1.7.5"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
Expand Down
4 changes: 2 additions & 2 deletions proto/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 8bc2c51e08c447cd8886cdea48a73e14
digest: shake256:a969155953a5cedc5b2df5b42c368f2bc66ff8ce1804bc96e0f14ff2ee8a893687963058909df844d1643cdbc98ff099d2daa6bc9f9f5b8886c49afdc60e19af
commit: f52d4f76a8434cc5966798b1d3b4f110
digest: shake256:71566dd80e39b7d85fdaa9b7f82107385181d5b6d17ea56c0aacce61099b35f9f1bcf7333ad9838ca19d24d7f076b039de7c9c09c55d23bb4c2fddfceff4d2c2
- remote: buf.build
owner: protocolbuffers
repository: wellknowntypes
Expand Down
13 changes: 7 additions & 6 deletions proto/sgenetwork/sge/bet/tx.proto
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
syntax = "proto3";
package sgenetwork.sge.bet;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";
import "sgenetwork/sge/bet/wager.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "sgenetwork/sge/bet/params.proto";
import "sgenetwork/sge/bet/wager.proto";

option go_package = "github.com/sge-network/sge/x/bet/types";

// Msg defines the Msg service.
service Msg {
// Wager defines a method to place a bet with the given data.
rpc Wager(MsgWager) returns (MsgWagerResponse);
rpc Wager(MsgWager) returns (MsgWagerResponse) { option deprecated = true; }

// UpdateParams defines a governance operation for updating the x/bet module
// parameters. The authority is defined in the keeper.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse) {
option (cosmos_proto.method_added_in) = "sge-network 1.7.1";
option deprecated = true;
}
}

Expand Down Expand Up @@ -54,4 +55,4 @@ message MsgUpdateParams {
// MsgUpdateParams message.
message MsgUpdateParamsResponse {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
}
}
19 changes: 12 additions & 7 deletions proto/sgenetwork/sge/house/tx.proto
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
syntax = "proto3";
package sgenetwork.sge.house;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";
import "sgenetwork/sge/house/withdraw.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "sgenetwork/sge/house/params.proto";
import "sgenetwork/sge/house/withdraw.proto";

option go_package = "github.com/sge-network/sge/x/house/types";

Expand All @@ -15,16 +15,21 @@ service Msg {
// Deposit defines a method for performing a deposit of tokens to become part
// of the order book or be the house for an order book corresponding to a
// market.
rpc Deposit(MsgDeposit) returns (MsgDepositResponse);
rpc Deposit(MsgDeposit) returns (MsgDepositResponse) {
option deprecated = true;
}

// Withdraw defines a method for performing a withdrawal of tokens of unused
// amount corresponding to a deposit.
rpc Withdraw(MsgWithdraw) returns (MsgWithdrawResponse);
rpc Withdraw(MsgWithdraw) returns (MsgWithdrawResponse) {
option deprecated = true;
}

// UpdateParams defines a governance operation for updating the x/house module
// parameters. The authority is defined in the keeper.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse) {
option (cosmos_proto.method_added_in) = "sge-network 1.7.1";
option deprecated = true;
}
}

Expand Down Expand Up @@ -138,4 +143,4 @@ message MsgUpdateParams {
// MsgUpdateParams message.
message MsgUpdateParamsResponse {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
}
}
19 changes: 12 additions & 7 deletions proto/sgenetwork/sge/market/tx.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package sgenetwork.sge.market;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "sgenetwork/sge/market/market.proto";
import "sgenetwork/sge/market/params.proto";

Expand All @@ -13,15 +13,20 @@ option go_package = "github.com/sge-network/sge/x/market/types";
// Msg defines the Msg service.
service Msg {
// Add defines a method to add the market with the given data.
rpc Add(MsgAdd) returns (MsgAddResponse);
rpc Add(MsgAdd) returns (MsgAddResponse) { option deprecated = true; }
// Resolve defines a method to resolve the market.
rpc Resolve(MsgResolve) returns (MsgResolveResponse);
rpc Resolve(MsgResolve) returns (MsgResolveResponse) {
option deprecated = true;
}
// Update defines a method to update a market.
rpc Update(MsgUpdate) returns (MsgUpdateResponse);
rpc Update(MsgUpdate) returns (MsgUpdateResponse) {
option deprecated = true;
}
// UpdateParams defines a governance operation for updating the x/market
// module parameters. The authority is defined in the keeper.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse) {
option (cosmos_proto.method_added_in) = "sge-network 1.7.1";
option deprecated = true;
}
}

Expand Down Expand Up @@ -99,4 +104,4 @@ message MsgUpdateParams {
// MsgUpdateParams message.
message MsgUpdateParamsResponse {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
}
}
9 changes: 5 additions & 4 deletions proto/sgenetwork/sge/orderbook/tx.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package sgenetwork.sge.orderbook;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "sgenetwork/sge/orderbook/params.proto";

option go_package = "github.com/sge-network/sge/x/orderbook/types";
Expand All @@ -15,6 +15,7 @@ service Msg {
// module parameters. The authority is defined in the keeper.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse) {
option (cosmos_proto.method_added_in) = "sge-network 1.7.1";
option deprecated = true;
}
}

Expand All @@ -36,4 +37,4 @@ message MsgUpdateParams {
// MsgUpdateParams message.
message MsgUpdateParamsResponse {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
}
}
17 changes: 11 additions & 6 deletions proto/sgenetwork/sge/ovm/tx.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package sgenetwork.sge.ovm;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "sgenetwork/sge/ovm/params.proto";

option go_package = "github.com/sge-network/sge/x/ovm/types";
Expand All @@ -14,15 +14,20 @@ service Msg {
// PubkeysChangeProposal defines a method to submit a proposal for changing
// the allowed public keys.
rpc SubmitPubkeysChangeProposal(MsgSubmitPubkeysChangeProposalRequest)
returns (MsgSubmitPubkeysChangeProposalResponse);
returns (MsgSubmitPubkeysChangeProposalResponse) {
option deprecated = true;
}
// VotePubkeysChange defines a method to vote for a proposal for changing the
// allowed public keys.
rpc VotePubkeysChange(MsgVotePubkeysChangeRequest)
returns (MsgVotePubkeysChangeResponse);
returns (MsgVotePubkeysChangeResponse) {
option deprecated = true;
}
// UpdateParams defines a governance operation for updating the x/ovm module
// parameters. The authority is defined in the keeper.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse) {
option (cosmos_proto.method_added_in) = "sge-network 1.7.1";
option deprecated = true;
}
}

Expand Down Expand Up @@ -77,4 +82,4 @@ message MsgUpdateParams {
// MsgUpdateParams message.
message MsgUpdateParamsResponse {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
}
}
33 changes: 23 additions & 10 deletions proto/sgenetwork/sge/reward/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,45 @@ syntax = "proto3";

package sgenetwork.sge.reward;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "sgenetwork/sge/reward/params.proto";

option go_package = "github.com/sge-network/sge/x/reward/types";

// Msg defines the Msg service.
service Msg {
// SetPromoterConf is a method to set the configurations of a promoter.
rpc SetPromoterConf(MsgSetPromoterConf) returns (MsgSetPromoterConfResponse);
rpc SetPromoterConf(MsgSetPromoterConf) returns (MsgSetPromoterConfResponse) {
option deprecated = true;
}
// CreatePromoter is a method to create a promoter
rpc CreatePromoter(MsgCreatePromoter) returns (MsgCreatePromoterResponse);
rpc CreatePromoter(MsgCreatePromoter) returns (MsgCreatePromoterResponse) {
option deprecated = true;
}
// CreateCampaign is a method to create a campaign
rpc CreateCampaign(MsgCreateCampaign) returns (MsgCreateCampaignResponse);
rpc CreateCampaign(MsgCreateCampaign) returns (MsgCreateCampaignResponse) {
option deprecated = true;
}
// UpdateCampaign is a method to update campaign
rpc UpdateCampaign(MsgUpdateCampaign) returns (MsgUpdateCampaignResponse);
rpc UpdateCampaign(MsgUpdateCampaign) returns (MsgUpdateCampaignResponse) {
option deprecated = true;
}
// WithdrawCampaignFunds is method to withdraw funds from the campaign
rpc WithdrawFunds(MsgWithdrawFunds) returns (MsgWithdrawFundsResponse);
rpc WithdrawFunds(MsgWithdrawFunds) returns (MsgWithdrawFundsResponse) {
option deprecated = true;
}
// GrantReward is method to allocate rewards
rpc GrantReward(MsgGrantReward) returns (MsgGrantRewardResponse);
rpc GrantReward(MsgGrantReward) returns (MsgGrantRewardResponse) {
option deprecated = true;
}
// UpdateParams defines a governance operation for updating the x/ovm module
// parameters. The authority is defined in the keeper.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse) {
option (cosmos_proto.method_added_in) = "sge-network 1.7.1";
option deprecated = true;
}
}

Expand Down Expand Up @@ -157,4 +170,4 @@ message MsgUpdateParams {
// MsgUpdateParams message.
message MsgUpdateParamsResponse {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
}
}
33 changes: 21 additions & 12 deletions proto/sgenetwork/sge/subaccount/tx.proto
Original file line number Diff line number Diff line change
@@ -1,44 +1,53 @@
syntax = "proto3";
package sgenetwork.sge.subaccount;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "amino/amino.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "sgenetwork/sge/bet/tx.proto";
import "sgenetwork/sge/house/tx.proto";
import "sgenetwork/sge/subaccount/balance.proto";
import "sgenetwork/sge/subaccount/params.proto";
import "sgenetwork/sge/house/tx.proto";
import "sgenetwork/sge/bet/tx.proto";

option go_package = "github.com/sge-network/sge/x/subaccount/types";

// Msg defines the Msg service.
service Msg {
// Create defines a method for creating a subaccount.
rpc Create(MsgCreate) returns (MsgCreateResponse);
rpc Create(MsgCreate) returns (MsgCreateResponse) {
option deprecated = true;
}

// TopUp defines a method for topping up a subaccount.
rpc TopUp(MsgTopUp) returns (MsgTopUpResponse);
rpc TopUp(MsgTopUp) returns (MsgTopUpResponse) { option deprecated = true; }

// WithdrawUnlockedBalances defines a method for withdrawing unlocked
// balances.
rpc WithdrawUnlockedBalances(MsgWithdrawUnlockedBalances)
returns (MsgWithdrawUnlockedBalancesResponse);
returns (MsgWithdrawUnlockedBalancesResponse) {
option deprecated = true;
}

// PlaceBet defines a method for placing a bet using a subaccount.
rpc Wager(MsgWager) returns (MsgWagerResponse);
rpc Wager(MsgWager) returns (MsgWagerResponse) { option deprecated = true; }

// HouseDeposit defines a method for depositing funds to provide liquidity to
// a market.
rpc HouseDeposit(MsgHouseDeposit) returns (MsgHouseDepositResponse);
rpc HouseDeposit(MsgHouseDeposit) returns (MsgHouseDepositResponse) {
option deprecated = true;
}

// HouseWithdraw defines a method for withdrawing funds from a market.
rpc HouseWithdraw(MsgHouseWithdraw) returns (MsgHouseWithdrawResponse);
rpc HouseWithdraw(MsgHouseWithdraw) returns (MsgHouseWithdrawResponse) {
option deprecated = true;
}

// UpdateParams defines a governance operation for updating the x/subaccount
// module parameters. The authority is defined in the keeper.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse) {
option (cosmos_proto.method_added_in) = "sge-network 1.7.1";
option deprecated = true;
}
}

Expand Down Expand Up @@ -141,4 +150,4 @@ message MsgUpdateParams {
// MsgUpdateParams message.
message MsgUpdateParamsResponse {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
}
}
15 changes: 13 additions & 2 deletions x/bet/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"testing"

"github.com/gorilla/mux"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
Expand Down Expand Up @@ -81,7 +82,14 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *r
}

// GetTxCmd returns the module's root tx command.
func (AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd() }
func (AppModuleBasic) GetTxCmd() *cobra.Command {
// transactions deprecated in favor of v2
if testing.Testing() {
return cli.GetTxCmd()
} else {

Check failure on line 89 in x/bet/module.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
return nil
}
}

// GetQueryCmd returns the module's root query command.
func (AppModuleBasic) GetQueryCmd() *cobra.Command { return cli.GetQueryCmd(types.StoreKey) }
Expand Down Expand Up @@ -132,7 +140,10 @@ func (AppModule) QuerierRoute() string { return types.QuerierRoute }
// RegisterServices registers a GRPC query service to respond to the
// module-specific GRPC queries.
func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
// transactions deprecated in favor of v2
if testing.Testing() {
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
}
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
}

Expand Down
Loading

0 comments on commit 86d6d49

Please sign in to comment.