Skip to content

Commit

Permalink
Fixed incorrect inflation timestamp and added cosmwasm_1_1 as capability
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Dec 10, 2022
1 parent 29d4099 commit d214838
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
35 changes: 16 additions & 19 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,18 @@ var (
_ servertypes.Application = (*App)(nil)
)

func GetWasmEnabledProposals() []wasm.ProposalType {
func GetWasmEnabledProposals() []wasmtypes.ProposalType {
if WasmEnableSpecificProposals == "" {
if WasmProposalsEnabled == "true" {
return wasm.EnableAllProposals
return wasmtypes.EnableAllProposals
}

return wasm.DisableAllProposals
return wasmtypes.DisableAllProposals
}

chunks := strings.Split(WasmEnableSpecificProposals, ",")

proposals, err := wasm.ConvertToProposals(chunks)
proposals, err := wasmtypes.ConvertToProposals(chunks)
if err != nil {
panic(err)
}
Expand All @@ -190,14 +190,13 @@ func GetWasmEnabledProposals() []wasm.ProposalType {
type App struct {
*baseapp.BaseApp

invarCheckPeriod uint
invCheckPeriod uint
amino *codec.LegacyAmino
cdc codec.Codec
interfaceRegistry codectypes.InterfaceRegistry

keys map[string]*sdk.KVStoreKey
tkeys map[string]*sdk.TransientStoreKey
mkeys map[string]*sdk.MemoryStoreKey
keys map[string]*sdk.KVStoreKey
tkeys map[string]*sdk.TransientStoreKey
mkeys map[string]*sdk.MemoryStoreKey

accountKeeper authkeeper.AccountKeeper
authzKeeper authzkeeper.Keeper
Expand Down Expand Up @@ -238,7 +237,7 @@ func NewApp(
loadLatest bool,
skipUpgradeHeights map[int64]bool,
homePath string,
invarCheckPeriod uint,
invCheckPeriod uint,
encodingConfig hubparams.EncodingConfig,
enabledProposals []wasmtypes.ProposalType,
appOpts servertypes.AppOptions,
Expand Down Expand Up @@ -273,7 +272,7 @@ func NewApp(
tkeys: tkeys,
mkeys: mkeys,
interfaceRegistry: interfaceRegistry,
invarCheckPeriod: invarCheckPeriod,
invCheckPeriod: invCheckPeriod,
}

app.paramsKeeper = paramskeeper.NewKeeper(
Expand Down Expand Up @@ -320,7 +319,7 @@ func NewApp(
app.keys[authtypes.StoreKey],
app.GetSubspace(authtypes.ModuleName),
authtypes.ProtoBaseAccount,
app.ModuleAccountsPermissions(),
app.ModuleAccountPermissions(),
)
app.bankKeeper = bankkeeper.NewBaseKeeper(
app.cdc,
Expand Down Expand Up @@ -373,7 +372,7 @@ func NewApp(
)
app.crisisKeeper = crisiskeeper.NewKeeper(
app.GetSubspace(crisistypes.ModuleName),
app.invarCheckPeriod,
app.invCheckPeriod,
app.bankKeeper,
authtypes.FeeCollectorName,
)
Expand Down Expand Up @@ -471,7 +470,7 @@ func NewApp(
panic("error while reading wasm config: " + err.Error())
}

supportedFeatures := "iterator,staking,stargate"
wasmCapabilities := "iterator,staking,stargate,cosmwasm_1_1"
app.wasmKeeper = wasmkeeper.NewKeeper(
app.cdc,
keys[wasmtypes.StoreKey],
Expand All @@ -488,7 +487,7 @@ func NewApp(
app.GRPCQueryRouter(),
wasmDir,
wasmConfig,
supportedFeatures,
wasmCapabilities,
wasmOpts...,
)

Expand All @@ -503,7 +502,6 @@ func NewApp(
AddRoute(paramsproposal.RouterKey, params.NewParamChangeProposalHandler(app.paramsKeeper)).
AddRoute(distributiontypes.RouterKey, distribution.NewCommunityPoolSpendProposalHandler(app.distributionKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.ibcKeeper.ClientKeeper)).
AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.ibcKeeper.ClientKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.upgradeKeeper))

if len(enabledProposals) != 0 {
Expand Down Expand Up @@ -751,7 +749,6 @@ func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.Res
}

app.upgradeKeeper.SetModuleVersionMap(ctx, app.moduleManager.GetVersionMap())

return app.moduleManager.InitGenesis(ctx, app.cdc, state)
}

Expand Down Expand Up @@ -790,7 +787,7 @@ func (app *App) LoadHeight(height int64) error {
return app.LoadVersion(height)
}

func (app *App) ModuleAccountsPermissions() map[string][]string {
func (app *App) ModuleAccountPermissions() map[string][]string {
return map[string][]string{
authtypes.FeeCollectorName: nil,
distributiontypes.ModuleName: nil,
Expand All @@ -809,7 +806,7 @@ func (app *App) ModuleAccountsPermissions() map[string][]string {

func (app *App) ModuleAccountAddrs() map[string]bool {
accounts := make(map[string]bool)
for name := range app.ModuleAccountsPermissions() {
for name := range app.ModuleAccountPermissions() {
accounts[authtypes.NewModuleAddress(name).String()] = true
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/sentinelhub/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (ac appCreator) newApp(
panic(err)
}

var wasmOpts []wasm.Option
var wasmOpts []wasmkeeper.Option
if cast.ToBool(appOpts.Get("telemetry.enabled")) {
wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer))
}
Expand Down Expand Up @@ -264,7 +264,7 @@ func (ac appCreator) appExport(
ac.encCfg,
hub.GetWasmEnabledProposals(),
appOpts,
[]wasm.Option{},
[]wasmkeeper.Option{},
)

if height != -1 {
Expand Down
2 changes: 1 addition & 1 deletion upgrades/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func Handler(
Max: sdk.NewDecWithPrec(25, 2),
Min: sdk.NewDecWithPrec(13, 2),
RateChange: sdk.NewDecWithPrec(12, 2),
Timestamp: time.Date(2023, 3, 27, 12, 0, 0, 0, time.UTC),
Timestamp: time.Date(2023, 9, 27, 12, 0, 0, 0, time.UTC),
},
}

Expand Down

0 comments on commit d214838

Please sign in to comment.