Skip to content

Commit

Permalink
Merge pull request #748 from comdex-official/feature/dev
Browse files Browse the repository at this point in the history
update go.mod, added upgrade handler, update rewards fix, replace tendermint with skip-mev
  • Loading branch information
dheerajkd30 authored Apr 19, 2023
2 parents 585ffe8 + e1885d3 commit 09bdf88
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# within `super-linter`.
fetch-depth: 0
- name: Run documentation linter
uses: github/super-linter@v4
uses: github/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_MARKDOWN: true
Expand Down
57 changes: 4 additions & 53 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/gorilla/mux"
"github.com/spf13/cast"

icacontrollertypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types"
"github.com/rakyll/statik/fs"

ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts"
Expand Down Expand Up @@ -166,12 +165,7 @@ import (

cwasm "github.com/comdex-official/comdex/app/wasm"

mv10 "github.com/comdex-official/comdex/app/upgrades/mainnet/v10"
mv5 "github.com/comdex-official/comdex/app/upgrades/mainnet/v5"
mv6 "github.com/comdex-official/comdex/app/upgrades/mainnet/v6"
mv7 "github.com/comdex-official/comdex/app/upgrades/mainnet/v7"
mv8 "github.com/comdex-official/comdex/app/upgrades/mainnet/v8"
mv9 "github.com/comdex-official/comdex/app/upgrades/mainnet/v9"
tv10 "github.com/comdex-official/comdex/app/upgrades/testnet/v10"
)

const (
Expand Down Expand Up @@ -1218,8 +1212,8 @@ func (a *App) ModuleAccountsPermissions() map[string][]string {

func (a *App) registerUpgradeHandlers() {
a.UpgradeKeeper.SetUpgradeHandler(
mv10.UpgradeName,
mv10.CreateUpgradeHandlerV10(a.mm, a.configurator, a.LiquidityKeeper, a.AssetKeeper, a.BankKeeper, a.AccountKeeper, a.Rewardskeeper, a.ICAHostKeeper),
tv10.UpgradeName,
tv10.CreateUpgradeHandlerV10(a.mm, a.configurator),
)
// When a planned update height is reached, the old binary will panic
// writing on disk the height and name of the update that triggered it
Expand All @@ -1241,51 +1235,8 @@ func (a *App) registerUpgradeHandlers() {

func upgradeHandlers(upgradeInfo storetypes.UpgradeInfo, a *App, storeUpgrades *storetypes.StoreUpgrades) *storetypes.StoreUpgrades {
switch {
// prepare store for main net upgrade v5.0.0
case upgradeInfo.Name == mv5.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{
assettypes.ModuleName,
auctiontypes.ModuleName,
bandoraclemoduletypes.ModuleName,
collectortypes.ModuleName,
esmtypes.ModuleName,
liquidationtypes.ModuleName,
liquiditytypes.ModuleName,
lockertypes.ModuleName,
markettypes.ModuleName,
rewardstypes.ModuleName,
tokenminttypes.ModuleName,
vaulttypes.ModuleName,
feegrant.ModuleName,
icacontrollertypes.StoreKey,
icahosttypes.StoreKey,
authz.ModuleName,
},
}
case upgradeInfo.Name == mv6.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
storeUpgrades = &storetypes.StoreUpgrades{
Deleted: []string{"lendV1"},
Added: []string{
lendtypes.ModuleName,
},
}
case upgradeInfo.Name == mv7.UpgradeName700 && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
storeUpgrades = &storetypes.StoreUpgrades{}

case upgradeInfo.Name == mv8.UpgradeName800 && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
storeUpgrades = &storetypes.StoreUpgrades{}

case upgradeInfo.Name == mv8.UpgradeName810 && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
storeUpgrades = &storetypes.StoreUpgrades{}

case upgradeInfo.Name == mv8.UpgradeName811 && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
storeUpgrades = &storetypes.StoreUpgrades{}

case upgradeInfo.Name == mv9.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
storeUpgrades = &storetypes.StoreUpgrades{}

case upgradeInfo.Name == mv10.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
case upgradeInfo.Name == tv10.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
storeUpgrades = &storetypes.StoreUpgrades{}
}

Expand Down
15 changes: 15 additions & 0 deletions app/upgrades/testnet/v10/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package v10

const (
UpgradeName = "v10.1.0"
UpgradeHeight = ""
UpgradeInfo = `'{
"binaries": {
"darwin/arm64":"",
"darwin/x86_64":"",
"linux/arm64":"",
"linux/x86_64":"",
"windows/x86_64":""
}
}'`
)
21 changes: 21 additions & 0 deletions app/upgrades/testnet/v10/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package v10

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateUpgradeHandlerV10(
mm *module.Manager,
configurator module.Configurator,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
vm, err := mm.RunMigrations(ctx, configurator, fromVM)

if err != nil {
return vm, err
}
return vm, err
}
}
10 changes: 2 additions & 8 deletions cmd/comdex/genwasm.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
package main

import (
wasmcli "github.com/CosmWasm/wasmd/x/wasm/client/cli"
"github.com/cosmos/cosmos-sdk/client"
"github.com/spf13/cobra"
)

func AddGenesisWasmMsgCmd(defaultNodeHome string) *cobra.Command {
/*func AddGenesisWasmMsgCmd(defaultNodeHome string) *cobra.Command {
txCmd := &cobra.Command{
Use: "add-wasm-genesis-message",
Short: "Wasm genesis subcommands",
Expand All @@ -23,4 +17,4 @@ func AddGenesisWasmMsgCmd(defaultNodeHome string) *cobra.Command {
wasmcli.GenesisListCodesCmd(defaultNodeHome, genesisIO),
)
return txCmd
}
}*/
2 changes: 1 addition & 1 deletion cmd/comdex/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func initRootCmd(rootCmd *cobra.Command, encoding comdex.EncodingConfig) {
genutilcli.GenTxCmd(comdex.ModuleBasics, encoding.TxConfig, banktypes.GenesisBalancesIterator{}, comdex.DefaultNodeHome),
genutilcli.ValidateGenesisCmd(comdex.ModuleBasics),
AddGenesisAccountCmd(comdex.DefaultNodeHome),
AddGenesisWasmMsgCmd(comdex.DefaultNodeHome),
//AddGenesisWasmMsgCmd(comdex.DefaultNodeHome),
tmcli.NewCompletionCmd(rootCmd, true),
testnetCmd(comdex.ModuleBasics, banktypes.GenesisBalancesIterator{}),
debug.Cmd(),
Expand Down
28 changes: 15 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/comdex-official/comdex
go 1.19

require (
github.com/CosmWasm/wasmd v0.30.0
github.com/CosmWasm/wasmvm v1.1.1
github.com/CosmWasm/wasmd v0.31.0
github.com/CosmWasm/wasmvm v1.2.3
github.com/bandprotocol/bandchain-packet v0.0.3
github.com/cosmos/cosmos-sdk v0.46.7
github.com/cosmos/cosmos-sdk v0.46.11
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
Expand All @@ -15,11 +15,11 @@ require (
github.com/prometheus/client_golang v1.14.0
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.6.1
github.com/stretchr/testify v1.8.1
github.com/tendermint/tendermint v0.34.24
github.com/stretchr/testify v1.8.2
github.com/tendermint/tendermint v0.34.26
github.com/tendermint/tm-db v0.6.7
google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e
google.golang.org/grpc v1.50.1
google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa
google.golang.org/grpc v1.53.0
google.golang.org/protobuf v1.30.0
)

Expand Down Expand Up @@ -69,11 +69,11 @@ require (
github.com/coinbase/rosetta-sdk-go v0.7.0 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
github.com/cosmos/btcutil v1.0.4 // indirect
github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogoproto v1.4.3 // indirect
github.com/cosmos/gogoproto v1.4.6 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/cosmos/iavl v0.19.4 // indirect
github.com/cosmos/iavl v0.19.5 // indirect
github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
github.com/curioswitch/go-reassign v0.2.0 // indirect
Expand Down Expand Up @@ -251,7 +251,7 @@ require (
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.23.0 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/exp v0.0.0-20230131160201-f062dba9d201 // indirect
golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.6.0 // indirect
Expand All @@ -272,8 +272,10 @@ require (
replace (
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/cosmos-sdk => github.com/comdex-official/cosmos-sdk v0.45.9-comdex.3
//breaking changes
github.com/cosmos/iavl v0.19.5 => github.com/cosmos/iavl v0.19.4
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
// Informal Tendermint fork
github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.24
// Informal Tendermint fork to be replaced with skip-mev tendermint
github.com/tendermint/tendermint => github.com/skip-mev/mev-tendermint v0.34.24-mev.17
google.golang.org/grpc => google.golang.org/grpc v1.33.2
)
Loading

0 comments on commit 09bdf88

Please sign in to comment.