Skip to content

Commit

Permalink
Removed Oracle, fixes memory alln issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shawayush committed Oct 12, 2022
1 parent 765cf3d commit a5ddcf9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
40 changes: 25 additions & 15 deletions app/app.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app

import (
"fmt"
"io"
"net/http"
"os"
Expand Down Expand Up @@ -98,7 +99,7 @@ import (
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/prometheus/client_golang/prometheus"

oracletypes "github.com/konstellation/konstellation/x/oracle/types"
//oracletypes "github.com/konstellation/konstellation/x/oracle/types"

"github.com/tendermint/spm-extras/wasmcmd"
"github.com/tendermint/spm/cosmoscmd"
Expand Down Expand Up @@ -198,7 +199,7 @@ func New(
ibctransfertypes.StoreKey,
capabilitytypes.StoreKey,
// this line is used by starport scaffolding # stargate/app/storeKey
oracletypes.StoreKey,
//oracletypes.StoreKey,
wasm.StoreKey,
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
Expand Down Expand Up @@ -464,7 +465,7 @@ func New(
ibchost.ModuleName,
ibctransfertypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/initGenesis
oracletypes.ModuleName,
//oracletypes.ModuleName,
wasm.ModuleName,
)

Expand All @@ -486,23 +487,29 @@ func New(
app.MountTransientStores(tkeys)
app.MountMemoryStores(memKeys)

// initialize BaseApp
app.SetInitChainer(app.InitChainer)
app.SetBeginBlocker(app.BeginBlocker)

anteHandler, err := ante.NewAnteHandler(ante.HandlerOptions{
AccountKeeper: app.AccountKeeper,
BankKeeper: app.BankKeeper,
FeegrantKeeper: nil,
SignModeHandler: encodingConfig.TxConfig.SignModeHandler(),
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
})
anteHandler, err := NewAnteHandler(
HandlerOptions{
HandlerOptions: ante.HandlerOptions{
AccountKeeper: app.AccountKeeper,
BankKeeper: app.BankKeeper,
FeegrantKeeper: nil,
SignModeHandler: encodingConfig.TxConfig.SignModeHandler(),
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
},
IBCKeeper: app.IBCKeeper,
TxCounterStoreKey: keys[wasm.StoreKey],
WasmConfig: wasmConfig,
Cdc: appCodec,
},
)
if err != nil {
panic(err)
}

app.SetInitChainer(app.InitChainer)
app.SetBeginBlocker(app.BeginBlocker)
// initialize BaseApp
app.SetAnteHandler(anteHandler)
app.SetEndBlocker(app.EndBlocker)

Expand Down Expand Up @@ -550,7 +557,10 @@ func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.Res
if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
}
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
fmt.Println("app code normal:", app.appCodec)
fmt.Println("app code address:", &app.appCodec)
fmt.Println(app.mm.InitGenesis(ctx, app.appCodec, genesisState))
//app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
return app.mm.InitGenesis(ctx, app.appCodec, genesisState)
}

Expand Down Expand Up @@ -718,7 +728,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibchost.ModuleName)
// this line is used by starport scaffolding # stargate/app/paramSubspace
paramsKeeper.Subspace(oracletypes.ModuleName)
//paramsKeeper.Subspace(oracletypes.ModuleName)
paramsKeeper.Subspace(wasm.ModuleName)

return paramsKeeper
Expand Down
3 changes: 1 addition & 2 deletions app/struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
oraclekeeper "github.com/konstellation/konstellation/x/oracle/keeper"
)

// App extends an ABCI application, but with most of its parameters exported.
Expand Down Expand Up @@ -74,7 +73,7 @@ type App struct {

// this line is used by starport scaffolding # stargate/app/keeperDeclaration

OracleKeeper oraclekeeper.Keeper
//OracleKeeper oraclekeeper.Keeper
wasmKeeper wasm.Keeper
scopedWasmKeeper capabilitykeeper.ScopedKeeper

Expand Down
3 changes: 1 addition & 2 deletions app/var.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
transfer "github.com/cosmos/ibc-go/v3/modules/apps/transfer"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v3/modules/core"
"github.com/konstellation/konstellation/x/oracle"
"github.com/tendermint/spm/cosmoscmd"
)

Expand Down Expand Up @@ -75,7 +74,7 @@ var (
transfer.AppModuleBasic{},
vesting.AppModuleBasic{},
// this line is used by starport scaffolding # stargate/app/moduleBasic
oracle.AppModuleBasic{},
//oracle.AppModuleBasic{},
wasm.AppModuleBasic{},
)

Expand Down

0 comments on commit a5ddcf9

Please sign in to comment.