Skip to content

Commit

Permalink
Merge pull request #66 from okp4/fix/order-modules
Browse files Browse the repository at this point in the history
fix: references all modules in SetOrder* functions
  • Loading branch information
amimart authored May 11, 2022
2 parents 6bdaae4 + 81ddc23 commit 62650a5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ linters:
- sqlclosecheck
- stylecheck
- tenv
- testpackage
- tparallel
- unconvert
- unparam
Expand Down
46 changes: 43 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
"github.com/cosmos/cosmos-sdk/x/bank"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
Expand Down Expand Up @@ -411,12 +412,47 @@ func New(
// CanWithdrawInvariant invariant.
// NOTE: staking module is required if HistoricalEntries param > 0
app.mm.SetOrderBeginBlockers(
upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName,
evidencetypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName,
upgradetypes.ModuleName,
capabilitytypes.ModuleName,
minttypes.ModuleName,
distrtypes.ModuleName,
slashingtypes.ModuleName,
evidencetypes.ModuleName,
stakingtypes.ModuleName,
ibchost.ModuleName,
feegrant.ModuleName,
knowledgemoduletypes.ModuleName,
genutiltypes.ModuleName,
banktypes.ModuleName,
crisistypes.ModuleName,
ibctransfertypes.ModuleName,
govtypes.ModuleName,
authtypes.ModuleName,
paramstypes.ModuleName,
authtypes.ModuleName,
vestingtypes.ModuleName,
)

app.mm.SetOrderEndBlockers(crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName)
app.mm.SetOrderEndBlockers(
crisistypes.ModuleName,
govtypes.ModuleName,
stakingtypes.ModuleName,
distrtypes.ModuleName,
upgradetypes.ModuleName,
ibctransfertypes.ModuleName,
knowledgemoduletypes.ModuleName,
capabilitytypes.ModuleName,
feegrant.ModuleName,
evidencetypes.ModuleName,
ibchost.ModuleName,
vestingtypes.ModuleName,
minttypes.ModuleName,
slashingtypes.ModuleName,
genutiltypes.ModuleName,
authtypes.ModuleName,
paramstypes.ModuleName,
banktypes.ModuleName,
)

// NOTE: The genutils module must occur after staking so that pools are
// properly initialized with tokens from genesis accounts.
Expand All @@ -438,6 +474,10 @@ func New(
evidencetypes.ModuleName,
ibctransfertypes.ModuleName,
knowledgemoduletypes.ModuleName,
vestingtypes.ModuleName,
paramstypes.ModuleName,
upgradetypes.ModuleName,
feegrant.ModuleName,
// this line is used by starport scaffolding # stargate/app/initGenesis
)

Expand Down
4 changes: 2 additions & 2 deletions x/knowledge/client/cli/tx_trigger_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func CmdTriggerService() *cobra.Command {
Short: "Trigger a service execution from an invocation URI",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) (err error) {
argUri := args[0]
argURI := args[0]

clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
Expand All @@ -27,7 +27,7 @@ func CmdTriggerService() *cobra.Command {

msg := types.NewMsgTriggerService(
clientCtx.GetFromAddress().String(),
argUri,
argURI,
)
if err := msg.ValidateBasic(); err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions x/knowledge/module_simulation.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (
// TODO: Determine the simulation weight value
defaultWeightMsgBangDataspace int = 100

//nolint:gosec
opWeightMsgTriggerService = "op_weight_msg_create_chain"
// TODO: Determine the simulation weight value
defaultWeightMsgTriggerService int = 100
Expand Down

0 comments on commit 62650a5

Please sign in to comment.