Skip to content

Commit

Permalink
Merge pull request #817 from comdex-official/feature/dev
Browse files Browse the repository at this point in the history
Feature/dev
  • Loading branch information
dheerajkd30 authored Aug 14, 2023
2 parents e0d445d + a7c948d commit 257821c
Show file tree
Hide file tree
Showing 155 changed files with 38,222 additions and 226 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/[email protected]
with:
go-version: 1.19
go-version: 1.20.5
id: go

- name: Check out code into the Go module directory˛˜
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.19
go-version: 1.20.5
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: 1.19 # we run the linter with go 1.19 to match dev laptops even though we use 1.18 for the chain (don't update the chain to 1.19 please-- there is an issue in golang causing 1.19 to output some hashes differently from 1.18)
go-version: 1.20.5 # we run the linter with go 1.20 to match dev laptops even though we use 1.18 for the chain (don't update the chain to 1.19 please-- there is an issue in golang causing 1.19 to output some hashes differently from 1.18)
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ jobs:
labeler:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4.2.0
- uses: actions/labeler@v4.3.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/[email protected]
with:
go-version: 1.19
go-version: 1.20.5
id: go

- name: Check out code into the Go module directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
name: Setup Golang
uses: actions/[email protected]
with:
go-version: 1.19
go-version: 1.20.5
-
name: Display go version
run: go version
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ endif
#$(info $$BUILD_FLAGS is [$(BUILD_FLAGS)])

check_version:
ifneq ($(GO_MINOR_VERSION),19)
@echo "ERROR: Please upgrade Go version to 1.19+"
ifneq ($(GO_MINOR_VERSION),20)
@echo "ERROR: Please upgrade Go version to 1.20+"
exit 1
endif

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ If you have technical questions or concerns, ask a developer or community member

### Installation

Requires [Go 1.19+](https://golang.org/dl/)
Requires [Go 1.20+](https://golang.org/dl/)

### Linux

Expand Down
84 changes: 75 additions & 9 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,15 @@ import (
liquiditykeeper "github.com/comdex-official/comdex/x/liquidity/keeper"
liquiditytypes "github.com/comdex-official/comdex/x/liquidity/types"

"github.com/comdex-official/comdex/x/liquidationsV2"
liquidationsV2client "github.com/comdex-official/comdex/x/liquidationsV2/client"
liquidationsV2keeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper"
liquidationsV2types "github.com/comdex-official/comdex/x/liquidationsV2/types"

"github.com/comdex-official/comdex/x/auctionsV2"
auctionsV2client "github.com/comdex-official/comdex/x/auctionsV2/client"
auctionsV2keeper "github.com/comdex-official/comdex/x/auctionsV2/keeper"
auctionsV2types "github.com/comdex-official/comdex/x/auctionsV2/types"
icq "github.com/cosmos/ibc-apps/modules/async-icq/v4"
icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v4/keeper"
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v4/types"
Expand Down Expand Up @@ -230,6 +239,9 @@ func GetGovProposalHandlers() []govclient.ProposalHandler {
proposalHandlers = append(proposalHandlers, wasmclient.ProposalHandlers...)
proposalHandlers = append(proposalHandlers, assetclient.AddAssetsHandler...)
proposalHandlers = append(proposalHandlers, liquidityclient.LiquidityProposalHandler...)
proposalHandlers = append(proposalHandlers, liquidationsV2client.LiquidationsV2Handler...)
proposalHandlers = append(proposalHandlers, auctionsV2client.AuctionsV2Handler...)

return proposalHandlers
}

Expand Down Expand Up @@ -282,6 +294,8 @@ var (
liquidity.AppModuleBasic{},
rewards.AppModuleBasic{},
ica.AppModuleBasic{},
liquidationsV2.AppModuleBasic{},
auctionsV2.AppModuleBasic{},
ibchooks.AppModuleBasic{},
ibcratelimitmodule.AppModuleBasic{},
packetforward.AppModuleBasic{},
Expand Down Expand Up @@ -361,6 +375,8 @@ type App struct {
TokenmintKeeper tokenmintkeeper.Keeper
LiquidityKeeper liquiditykeeper.Keeper
Rewardskeeper rewardskeeper.Keeper
NewliqKeeper liquidationsV2keeper.Keeper
NewaucKeeper auctionsV2keeper.Keeper

// IBC modules
// transfer module
Expand Down Expand Up @@ -408,7 +424,7 @@ func New(
markettypes.StoreKey, bandoraclemoduletypes.StoreKey, lockertypes.StoreKey,
wasm.StoreKey, authzkeeper.StoreKey, auctiontypes.StoreKey, tokenminttypes.StoreKey,
rewardstypes.StoreKey, feegrant.StoreKey, liquiditytypes.StoreKey, esmtypes.ModuleName, lendtypes.StoreKey,
ibchookstypes.StoreKey, icqtypes.StoreKey, packetforwardtypes.StoreKey,
liquidationsV2types.StoreKey, auctionsV2types.StoreKey, ibchookstypes.StoreKey, packetforwardtypes.StoreKey, icqtypes.StoreKey,
)
)

Expand Down Expand Up @@ -462,6 +478,8 @@ func New(
app.ParamsKeeper.Subspace(tokenminttypes.ModuleName)
app.ParamsKeeper.Subspace(liquiditytypes.ModuleName)
app.ParamsKeeper.Subspace(rewardstypes.ModuleName)
app.ParamsKeeper.Subspace(liquidationsV2types.ModuleName)
app.ParamsKeeper.Subspace(auctionsV2types.ModuleName)
app.ParamsKeeper.Subspace(ibcratelimittypes.ModuleName)
app.ParamsKeeper.Subspace(icqtypes.ModuleName)
app.ParamsKeeper.Subspace(packetforwardtypes.ModuleName).WithKeyTable(packetforwardtypes.ParamKeyTable())
Expand Down Expand Up @@ -767,6 +785,38 @@ func New(
&app.LendKeeper,
)

app.NewliqKeeper = liquidationsV2keeper.NewKeeper(
app.cdc,
app.keys[liquidationsV2types.StoreKey],
app.keys[liquidationsV2types.MemStoreKey],
app.GetSubspace(liquidationsV2types.ModuleName),
app.AccountKeeper,
app.BankKeeper,
&app.AssetKeeper,
&app.VaultKeeper,
&app.MarketKeeper,
&app.EsmKeeper,
&app.Rewardskeeper,
&app.LendKeeper,
&app.NewaucKeeper,
&app.CollectorKeeper,
)

app.NewaucKeeper = auctionsV2keeper.NewKeeper(
app.cdc,
app.keys[auctionsV2types.StoreKey],
app.keys[auctionsV2types.MemStoreKey],
app.GetSubspace(auctionsV2types.ModuleName),
&app.NewliqKeeper,
app.BankKeeper,
&app.MarketKeeper,
&app.AssetKeeper,
&app.EsmKeeper,
&app.VaultKeeper,
&app.CollectorKeeper,
&app.TokenmintKeeper,
)

// ICQ Keeper
icqKeeper := icqkeeper.NewKeeper(
appCodec,
Expand All @@ -775,7 +825,7 @@ func New(
app.IbcKeeper.ChannelKeeper, // may be replaced with middleware
app.IbcKeeper.ChannelKeeper,
&app.IbcKeeper.PortKeeper,
app.ScopedICQKeeper,
scopedICQKeeper,
app.GRPCQueryRouter(),
)
app.ICQKeeper = &icqKeeper
Expand Down Expand Up @@ -830,7 +880,9 @@ func New(
AddRoute(bandoraclemoduletypes.RouterKey, bandoraclemodule.NewFetchPriceHandler(app.BandoracleKeeper)).
AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IbcKeeper.ClientKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IbcKeeper.ClientKeeper)).
AddRoute(liquiditytypes.RouterKey, liquidity.NewLiquidityProposalHandler(app.LiquidityKeeper))
AddRoute(liquiditytypes.RouterKey, liquidity.NewLiquidityProposalHandler(app.LiquidityKeeper)).
AddRoute(liquidationsV2types.RouterKey, liquidationsV2.NewLiquidationsV2Handler(app.NewliqKeeper)).
AddRoute(auctionsV2types.RouterKey, auctionsV2.NewAuctionsV2Handler(app.NewaucKeeper))

if len(wasmEnabledProposals) != 0 {
govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, wasmEnabledProposals))
Expand Down Expand Up @@ -913,6 +965,8 @@ func New(
tokenmint.NewAppModule(app.cdc, app.TokenmintKeeper, app.AccountKeeper, app.BankKeeper),
liquidity.NewAppModule(app.cdc, app.LiquidityKeeper, app.AccountKeeper, app.BankKeeper, app.AssetKeeper),
rewards.NewAppModule(app.cdc, app.Rewardskeeper, app.AccountKeeper, app.BankKeeper),
liquidationsV2.NewAppModule(app.cdc, app.NewliqKeeper, app.AccountKeeper, app.BankKeeper),
auctionsV2.NewAppModule(app.cdc, app.NewaucKeeper, app.BankKeeper),
ibcratelimitmodule.NewAppModule(*app.RateLimitingICS4Wrapper),
ibchooks.NewAppModule(app.AccountKeeper),
icq.NewAppModule(*app.ICQKeeper),
Expand Down Expand Up @@ -957,6 +1011,8 @@ func New(
liquiditytypes.ModuleName,
lendtypes.ModuleName,
esmtypes.ModuleName,
liquidationsV2types.ModuleName,
auctionsV2types.ModuleName,
ibcratelimittypes.ModuleName,
ibchookstypes.ModuleName,
icqtypes.ModuleName,
Expand Down Expand Up @@ -997,6 +1053,8 @@ func New(
rewardstypes.ModuleName,
liquiditytypes.ModuleName,
esmtypes.ModuleName,
liquidationsV2types.ModuleName,
auctionsV2types.ModuleName,
ibcratelimittypes.ModuleName,
ibchookstypes.ModuleName,
icqtypes.ModuleName,
Expand Down Expand Up @@ -1041,6 +1099,8 @@ func New(
liquiditytypes.ModuleName,
rewardstypes.ModuleName,
crisistypes.ModuleName,
liquidationsV2types.ModuleName,
auctionsV2types.ModuleName,
ibcratelimittypes.ModuleName,
ibchookstypes.ModuleName,
icqtypes.ModuleName,
Expand Down Expand Up @@ -1362,13 +1422,19 @@ func (a *App) ModuleAccountsPermissions() map[string][]string {
lendtypes.ModuleAcc5: {authtypes.Minter, authtypes.Burner},
lendtypes.ModuleAcc6: {authtypes.Minter, authtypes.Burner},
lendtypes.ModuleAcc7: {authtypes.Minter, authtypes.Burner},
lendtypes.ModuleAcc8: {authtypes.Minter, authtypes.Burner},
lendtypes.ModuleAcc9: {authtypes.Minter, authtypes.Burner},
lendtypes.ModuleAcc10: {authtypes.Minter, authtypes.Burner},
lendtypes.ModuleAcc11: {authtypes.Minter, authtypes.Burner},
liquidationtypes.ModuleName: {authtypes.Minter, authtypes.Burner},
auctiontypes.ModuleName: {authtypes.Minter, authtypes.Burner},
lockertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
esmtypes.ModuleName: {authtypes.Burner},
wasm.ModuleName: {authtypes.Burner},
liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
rewardstypes.ModuleName: {authtypes.Minter, authtypes.Burner},
liquidationsV2types.ModuleName: {authtypes.Minter, authtypes.Burner},
auctionsV2types.ModuleName: {authtypes.Minter, authtypes.Burner},
icatypes.ModuleName: nil,
assettypes.ModuleName: nil,
icqtypes.ModuleName: nil,
Expand All @@ -1388,7 +1454,7 @@ func (a *App) registerUpgradeHandlers() {
case upgradeInfo.Name == mv12.UpgradeName:
a.UpgradeKeeper.SetUpgradeHandler(
mv12.UpgradeName,
mv12.CreateUpgradeHandlerV12(a.mm, a.configurator, a.ICQKeeper),
mv12.CreateUpgradeHandlerV12(a.mm, a.configurator, a.ICQKeeper, a.NewliqKeeper, a.NewaucKeeper, a.BankKeeper, a.CollectorKeeper, a.LendKeeper, a.AuctionKeeper, a.LiquidationKeeper, a.AssetKeeper),
)
}

Expand All @@ -1407,11 +1473,11 @@ func upgradeHandlers(upgradeInfo storetypes.UpgradeInfo, a *App, storeUpgrades *

case upgradeInfo.Name == mv12.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{icqtypes.StoreKey},
}
case upgradeInfo.Name == mv12.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{},
Added: []string{
icqtypes.StoreKey,
liquidationsV2types.ModuleName,
auctionsV2types.ModuleName,
},
}
}
return storeUpgrades
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/mainnet/v12/constants.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v12

const (
UpgradeName = "v12.0.0"
UpgradeName = "v12.rc3"
UpgradeHeight = ""
UpgradeInfo = `'{
"binaries": {
Expand Down
Loading

0 comments on commit 257821c

Please sign in to comment.