Skip to content

Commit

Permalink
Merge pull request #409 from scorpioborn/feat/msg-params
Browse files Browse the repository at this point in the history
Feature / Implement `MsgUpdateParams`
  • Loading branch information
scorpioborn authored Jun 3, 2024
2 parents f3c7882 + ab4c060 commit bf42ed0
Show file tree
Hide file tree
Showing 81 changed files with 4,787 additions and 210 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* @sge-network/chain-core-reviewer

# PRs including changes in protos
*.proto @3eyedraga
*.proto @scorpioborn
8 changes: 8 additions & 0 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ func NewAppKeeper(
BankKeeper: appKeepers.BankKeeper,
},
authtypes.FeeCollectorName,
govModAddress,
)

appKeepers.DistrKeeper = distrkeeper.NewKeeper(
Expand Down Expand Up @@ -486,20 +487,23 @@ func NewAppKeeper(
AccountKeeper: appKeepers.AccountKeeper,
FeeGrantKeeper: appKeepers.FeeGrantKeeper,
},
govModAddress,
)

appKeepers.OVMKeeper = ovmmodulekeeper.NewKeeper(
appCodec,
appKeepers.keys[ovmmoduletypes.StoreKey],
appKeepers.keys[ovmmoduletypes.MemStoreKey],
appKeepers.GetSubspace(ovmmoduletypes.ModuleName),
govModAddress,
)

appKeepers.MarketKeeper = marketmodulekeeper.NewKeeper(
appCodec,
appKeepers.keys[marketmoduletypes.StoreKey],
appKeepers.keys[marketmoduletypes.MemStoreKey],
appKeepers.GetSubspace(marketmoduletypes.ModuleName),
govModAddress,
)
appKeepers.MarketKeeper.SetOVMKeeper(appKeepers.OVMKeeper)
appKeepers.MarketKeeper.SetOrderbookKeeper(appKeepers.OrderbookKeeper)
Expand All @@ -509,6 +513,7 @@ func NewAppKeeper(
appKeepers.keys[betmoduletypes.StoreKey],
appKeepers.keys[betmoduletypes.MemStoreKey],
appKeepers.GetSubspace(betmoduletypes.ModuleName),
govModAddress,
)
appKeepers.BetKeeper.SetMarketKeeper(appKeepers.MarketKeeper)
appKeepers.BetKeeper.SetOrderbookKeeper(appKeepers.OrderbookKeeper)
Expand All @@ -527,6 +532,7 @@ func NewAppKeeper(
housemodulekeeper.SdkExpectedKeepers{
AuthzKeeper: appKeepers.AuthzKeeper,
},
govModAddress,
)
appKeepers.OrderbookKeeper.SetHouseKeeper(appKeepers.HouseKeeper)

Expand All @@ -540,6 +546,7 @@ func NewAppKeeper(
appKeepers.BetKeeper,
appKeepers.OrderbookKeeper,
appKeepers.HouseKeeper,
govModAddress,
)

appKeepers.RewardKeeper = rewardmodulekeeper.NewKeeper(
Expand All @@ -555,6 +562,7 @@ func NewAppKeeper(
BankKeeper: appKeepers.BankKeeper,
AccountKeeper: appKeepers.AccountKeeper,
},
govModAddress,
)

// ** Hooks ** \\
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: 1f6ed065c9f04b5cb843d6e7603d6454
digest: shake256:7149cf5e9955c692d381e557830555d4e93f205a0f1b8e2dfdae46d029369aa3fc1980e35df0d310f7cc3b622f93e19ad276769a283a967dd3065ddfd3a40e13
commit: f0e53af8f2fc4556b94f482688b57223
digest: shake256:de26a277fc28b8b411ecf58729d78d32fcf15090ffd998a4469225b17889bfb51442eaab04bb7a8d88d203ecdf0a9febd4ffd52c18ed1c2229160c7bd353ca95
- remote: buf.build
owner: protocolbuffers
repository: wellknowntypes
Expand Down
32 changes: 31 additions & 1 deletion proto/sgenetwork/sge/bet/tx.proto
Original file line number Diff line number Diff line change
@@ -1,15 +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 "sgenetwork/sge/bet/params.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);

// 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";
}
}

// MsgWager defines a message to place a bet with the given data.
Expand All @@ -23,3 +33,23 @@ message MsgWager {
// MsgWagerResponse is the returning value in the response
// of MsgWagerResponse request.
message MsgWagerResponse { WagerProps props = 1; }

// MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
option (cosmos.msg.v1.signer) = "authority";

// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// params defines the x/bet parameters.
Params params = 2
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
}

// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
message MsgUpdateParamsResponse {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
}
30 changes: 30 additions & 0 deletions proto/sgenetwork/sge/house/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ 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 "sgenetwork/sge/house/params.proto";

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

Expand All @@ -16,6 +20,12 @@ service Msg {
// Withdraw defines a method for performing a withdrawal of tokens of unused
// amount corresponding to a deposit.
rpc Withdraw(MsgWithdraw) returns (MsgWithdrawResponse);

// 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";
}
}

// MsgDeposit defines a SDK message for performing a deposit of coins to become
Expand Down Expand Up @@ -104,3 +114,23 @@ message MsgWithdrawResponse {
uint64 participation_index = 3
[ (gogoproto.moretags) = "yaml:\"participation_index\"" ];
}

// MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
option (cosmos.msg.v1.signer) = "authority";

// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// params defines the x/bet parameters.
Params params = 2
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
}

// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
message MsgUpdateParamsResponse {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
}
29 changes: 29 additions & 0 deletions proto/sgenetwork/sge/market/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ 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 "sgenetwork/sge/market/market.proto";
import "sgenetwork/sge/market/params.proto";

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

Expand All @@ -14,6 +18,11 @@ service Msg {
rpc Resolve(MsgResolve) returns (MsgResolveResponse);
// Update defines a method to update a market.
rpc Update(MsgUpdate) returns (MsgUpdateResponse);
// 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";
}
}

// MsgAdd is the message type for adding the market into the
Expand Down Expand Up @@ -65,3 +74,23 @@ message MsgUpdateResponse {
// data is the data of market
Market data = 2 [ (gogoproto.nullable) = true ];
}

// MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
option (cosmos.msg.v1.signer) = "authority";

// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// params defines the x/bet parameters.
Params params = 2
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
}

// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
message MsgUpdateParamsResponse {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
}
39 changes: 39 additions & 0 deletions proto/sgenetwork/sge/orderbook/tx.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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 "sgenetwork/sge/orderbook/params.proto";

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

// Msg defines the Msg service.
service Msg {
// 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";
}
}

// MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
option (cosmos.msg.v1.signer) = "authority";

// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// params defines the x/bet parameters.
Params params = 2
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
}

// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
message MsgUpdateParamsResponse {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
}
31 changes: 31 additions & 0 deletions proto/sgenetwork/sge/ovm/tx.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
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 "sgenetwork/sge/ovm/params.proto";

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

// Msg defines the Msg service.
Expand All @@ -13,6 +19,11 @@ service Msg {
// allowed public keys.
rpc VotePubkeysChange(MsgVotePubkeysChangeRequest)
returns (MsgVotePubkeysChangeResponse);
// 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";
}
}

// MsgPubkeysChangeProposalRequest is the type of request for modification of
Expand Down Expand Up @@ -43,3 +54,23 @@ message MsgVotePubkeysChangeRequest {
// MsgVotePubkeysChangeResponse is the type of response vote for public keys
// modification.
message MsgVotePubkeysChangeResponse { bool success = 1; }

// MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
option (cosmos.msg.v1.signer) = "authority";

// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// params defines the x/bet parameters.
Params params = 2
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
}

// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
message MsgUpdateParamsResponse {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
}
29 changes: 29 additions & 0 deletions proto/sgenetwork/sge/reward/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ 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 "sgenetwork/sge/reward/params.proto";

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

Expand All @@ -20,6 +24,11 @@ service Msg {
rpc WithdrawFunds(MsgWithdrawFunds) returns (MsgWithdrawFundsResponse);
// GrantReward is method to allocate rewards
rpc GrantReward(MsgGrantReward) returns (MsgGrantRewardResponse);
// 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";
}
}

// MsgCreatePromoter is msg to create a promoter.
Expand Down Expand Up @@ -117,3 +126,23 @@ message MsgWithdrawFunds {

// MsgWithdrawFundsResponse withdraw funds message response type.
message MsgWithdrawFundsResponse {}

// MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
option (cosmos.msg.v1.signer) = "authority";

// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// params defines the x/bet parameters.
Params params = 2
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
}

// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
message MsgUpdateParamsResponse {
option (cosmos_proto.message_added_in) = "sge-network 1.7.1";
}
Loading

0 comments on commit bf42ed0

Please sign in to comment.