Skip to content

Commit

Permalink
Merge pull request #377 from comdex-official/feature/dev
Browse files Browse the repository at this point in the history
Feature/dev
  • Loading branch information
dheerajkd30 authored Aug 5, 2022
2 parents a2d03e0 + ce98d74 commit 6f1dd16
Show file tree
Hide file tree
Showing 298 changed files with 17,381 additions and 10,125 deletions.
9 changes: 5 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ linters:
- bodyclose
- deadcode
- depguard
- dogsled
# - dogsled
#- dupl
- errcheck
- funlen
#- funlen
- forcetypeassert
#- gochecknoglobals
#- gochecknoinits
#- gocognit
Expand All @@ -58,7 +59,7 @@ linters:
- nakedret
#- nestif
#- nolintlint
- prealloc
#- prealloc
- rowserrcheck
- scopelint
- staticcheck
Expand All @@ -67,7 +68,7 @@ linters:
- testpackage
- typecheck
- unconvert
- unparam
#- unparam
- unused
- varcheck
- whitespace
Expand Down
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@ endif

all: install test

go-mod-cache: go.sum
@echo "--> Download go modules to local cache"
@go mod download

go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
@go mod verify

clean:
rm -rf $(CURDIR)/artifacts/

distclean: clean
rm -rf vendor/

install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/comdex

Expand Down
26 changes: 17 additions & 9 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package app

import (
"fmt"
"net/http"
"sort"

icacontrollertypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types"
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"net/http"

ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts"
icahost "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host"
Expand Down Expand Up @@ -192,10 +194,10 @@ func GetGovProposalHandlers() []govclient.ProposalHandler {
proposalHandlers := []govclient.ProposalHandler{
bandoraclemoduleclient.AddFetchPriceHandler,
lendclient.AddLendPairsHandler,
lendclient.UpdateLendPairsHandler,
lendclient.AddPoolHandler,
lendclient.AddAssetToPairHandler,
lendclient.AddAssetRatesStatsHandler,
lendclient.AddAuctionParamsHandler,
paramsclient.ProposalHandler,
distrclient.ProposalHandler,
upgradeclient.ProposalHandler,
Expand Down Expand Up @@ -551,7 +553,7 @@ func New(
&app.MarketKeeper,
)

app.LendKeeper = *lendkeeper.NewKeeper(
app.LendKeeper = lendkeeper.NewKeeper(
app.cdc,
app.keys[lendtypes.StoreKey],
app.keys[lendtypes.StoreKey],
Expand All @@ -562,7 +564,7 @@ func New(
&app.MarketKeeper,
)

app.EsmKeeper = *esmkeeper.NewKeeper(
app.EsmKeeper = esmkeeper.NewKeeper(
app.cdc,
app.keys[esmtypes.StoreKey],
app.keys[esmtypes.StoreKey],
Expand Down Expand Up @@ -613,7 +615,7 @@ func New(
app.IbcKeeper.ChannelKeeper,
)

app.MarketKeeper = *marketkeeper.NewKeeper(
app.MarketKeeper = marketkeeper.NewKeeper(
app.cdc,
app.keys[markettypes.StoreKey],
app.GetSubspace(markettypes.ModuleName),
Expand All @@ -622,7 +624,7 @@ func New(
&app.BandoracleKeeper,
)

app.LiquidationKeeper = *liquidationkeeper.NewKeeper(
app.LiquidationKeeper = liquidationkeeper.NewKeeper(
app.cdc,
keys[liquidationtypes.StoreKey],
keys[liquidationtypes.MemStoreKey],
Expand All @@ -637,7 +639,7 @@ func New(
&app.LendKeeper,
)

app.AuctionKeeper = *auctionkeeper.NewKeeper(
app.AuctionKeeper = auctionkeeper.NewKeeper(
app.cdc,
keys[auctiontypes.StoreKey],
keys[auctiontypes.MemStoreKey],
Expand All @@ -654,7 +656,7 @@ func New(
&app.LendKeeper,
)

app.CollectorKeeper = *collectorkeeper.NewKeeper(
app.CollectorKeeper = collectorkeeper.NewKeeper(
app.cdc,
app.keys[collectortypes.StoreKey],
app.keys[collectortypes.MemStoreKey],
Expand Down Expand Up @@ -699,7 +701,7 @@ func New(
&app.Rewardskeeper,
)

app.Rewardskeeper = *rewardskeeper.NewKeeper(
app.Rewardskeeper = rewardskeeper.NewKeeper(
app.cdc,
app.keys[rewardstypes.StoreKey],
app.keys[rewardstypes.MemStoreKey],
Expand Down Expand Up @@ -995,7 +997,13 @@ func (a *App) LoadHeight(height int64) error {
// ModuleAccountAddrs returns all the app's module account addresses.
func (a *App) ModuleAccountAddrs() map[string]bool {
accounts := make(map[string]bool)

names := make([]string, 0)
for name := range a.ModuleAccountsPermissions() {
names = append(names, name)
}
sort.Strings(names)
for _, name := range names {
accounts[authtypes.NewModuleAddress(name).String()] = true
}

Expand Down
1 change: 1 addition & 0 deletions app/wasm/bindings/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type MsgSetAuctionMappingForApp struct {
AssetIDs []uint64 `json:"asset_id"`
IsSurplusAuctions []bool `json:"is_surplus_auction"`
IsDebtAuctions []bool `json:"is_debt_auction"`
IsDistributor []bool `json:"is_distributor"`
AssetOutOraclePrices []bool `json:"asset_out_oracle_price"`
AssetOutPrices []uint64 `json:"asset_out_price"`
}
Expand Down
9 changes: 3 additions & 6 deletions app/wasm/message_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ func WhiteListAsset(lockerKeeper lockerkeeper.Keeper, ctx sdk.Context, contractA
AppId: whiteListAsset.AppID,
AssetId: whiteListAsset.AssetID,
}
msgServer := lockerkeeper.NewMsgServer(lockerKeeper)
_, err := msgServer.MsgAddWhiteListedAsset(sdk.WrapSDKContext(ctx), &msg)
_, err := lockerKeeper.AddWhiteListedAsset(sdk.WrapSDKContext(ctx), &msg)

if err != nil {
return err
Expand All @@ -150,8 +149,7 @@ func WhitelistAppIDLockerRewards(rewardsKeeper rewardskeeper.Keeper, ctx sdk.Con
AppMappingId: whiteListAsset.AppID,
AssetId: whiteListAsset.AssetIDs,
}
msgServer := rewardskeeper.NewMsgServerImpl(rewardsKeeper)
_, err := msgServer.Whitelist(sdk.WrapSDKContext(ctx), &msg)
_, err := rewardsKeeper.Whitelist(sdk.WrapSDKContext(ctx), &msg)

if err != nil {
return err
Expand All @@ -175,8 +173,7 @@ func WhitelistAppIDVaultInterest(rewardsKeeper rewardskeeper.Keeper, ctx sdk.Con
From: contractAddr,
AppMappingId: whiteListAsset.AppID,
}
msgServer := rewardskeeper.NewMsgServerImpl(rewardsKeeper)
_, err := msgServer.WhitelistAppVault(sdk.WrapSDKContext(ctx), &msg)
_, err := rewardsKeeper.WhitelistAppVault(sdk.WrapSDKContext(ctx), &msg)

if err != nil {
return err
Expand Down
Loading

0 comments on commit 6f1dd16

Please sign in to comment.