Skip to content

Commit

Permalink
fix lint + add upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
arijitAD committed Nov 2, 2021
1 parent 7c159b7 commit 349cdbc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ func (app *AkashApp) registerUpgradeHandlers() {

if upgradeInfo.Name == "akash_v0.15.0_cosmos_v0.44.x" && !app.keeper.upgrade.IsSkipHeight(upgradeInfo.Height) {
storeUpgrades := storetypes.StoreUpgrades{
Added: []string{"authz"},
Added: []string{"authz", "inflation"},
}

// configure store loader that checks if version == upgradeHeight and applies store upgrades
Expand Down
4 changes: 2 additions & 2 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func TestAppExport(t *testing.T) {
db := dbm.NewMemDB()
app1 := NewApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)),
db, nil, true, 0, map[int64]bool{}, DefaultHome, AppOptsWithGenesisTime(0))
db, nil, true, 0, map[int64]bool{}, DefaultHome, OptsWithGenesisTime(0))

for acc := range MacPerms() {
require.Equal(t, !allowedReceivingModAcc[acc], app1.keeper.bank.BlockedAddr(app1.keeper.acct.GetModuleAddress(acc)),
Expand All @@ -36,7 +36,7 @@ func TestAppExport(t *testing.T) {
app1.Commit()

// Making a new app object with the db, so that initchain hasn't been called
app2 := NewApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0, map[int64]bool{}, DefaultHome, AppOptsWithGenesisTime(0))
app2 := NewApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0, map[int64]bool{}, DefaultHome, OptsWithGenesisTime(0))
_, err = app2.ExportAppStateAndValidators(false, []string{})
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
}
4 changes: 2 additions & 2 deletions app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func Setup(isCheckTx bool) *AkashApp {
db := dbm.NewMemDB()

// TODO: make this configurable via config or flag.
app := NewApp(logger.NewNopLogger(), db, nil, true, 5, map[int64]bool{}, DefaultHome, AppOptsWithGenesisTime(0))
app := NewApp(logger.NewNopLogger(), db, nil, true, 5, map[int64]bool{}, DefaultHome, OptsWithGenesisTime(0))
if !isCheckTx {
// init chain must be called to stop deliverState from being nil
genesisState := NewDefaultGenesisState()
Expand All @@ -228,7 +228,7 @@ func Setup(isCheckTx bool) *AkashApp {
return app
}

func AppOptsWithGenesisTime(seed int64) servertypes.AppOptions {
func OptsWithGenesisTime(seed int64) servertypes.AppOptions {
r := rand.New(rand.NewSource(seed))
genTime := simulation.RandTimestamp(r)

Expand Down
12 changes: 6 additions & 6 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestFullAppSimulation(t *testing.T) {
require.NoError(t, os.RemoveAll(dir))
}()

app1 := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, DefaultHome, AppOptsWithGenesisTime(config.Seed), fauxMerkleModeOpt)
app1 := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, DefaultHome, OptsWithGenesisTime(config.Seed), fauxMerkleModeOpt)
require.Equal(t, "akash", app1.Name())

fmt.Printf("config-------- %v", config)
Expand Down Expand Up @@ -112,7 +112,7 @@ func TestAppImportExport(t *testing.T) {
require.NoError(t, os.RemoveAll(dir))
}()

app := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, DefaultHome, AppOptsWithGenesisTime(config.Seed), fauxMerkleModeOpt)
app := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, DefaultHome, OptsWithGenesisTime(config.Seed), fauxMerkleModeOpt)
require.Equal(t, AppName, app.Name())

// Run randomized simulation
Expand Down Expand Up @@ -142,7 +142,7 @@ func TestAppImportExport(t *testing.T) {
require.NoError(t, os.RemoveAll(newDir))
}()

newApp := NewApp(log.NewNopLogger(), newDB, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, DefaultHome, AppOptsWithGenesisTime(config.Seed), fauxMerkleModeOpt)
newApp := NewApp(log.NewNopLogger(), newDB, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, DefaultHome, OptsWithGenesisTime(config.Seed), fauxMerkleModeOpt)
require.Equal(t, AppName, newApp.Name())

var genesisState simapp.GenesisState
Expand Down Expand Up @@ -202,7 +202,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
require.NoError(t, os.RemoveAll(dir))
}()

app := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, DefaultHome, AppOptsWithGenesisTime(config.Seed), fauxMerkleModeOpt)
app := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, DefaultHome, OptsWithGenesisTime(config.Seed), fauxMerkleModeOpt)
require.Equal(t, AppName, app.Name())

// Run randomized simulation
Expand Down Expand Up @@ -237,7 +237,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
require.NoError(t, os.RemoveAll(newDir))
}()

newApp := NewApp(log.NewNopLogger(), newDB, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, DefaultHome, AppOptsWithGenesisTime(config.Seed), fauxMerkleModeOpt)
newApp := NewApp(log.NewNopLogger(), newDB, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, DefaultHome, OptsWithGenesisTime(config.Seed), fauxMerkleModeOpt)
require.Equal(t, AppName, newApp.Name())

newApp.InitChain(abci.RequestInitChain{
Expand Down Expand Up @@ -277,7 +277,7 @@ func TestAppStateDeterminism(t *testing.T) {

db := dbm.NewMemDB()

app := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, DefaultHome, AppOptsWithGenesisTime(config.Seed), interBlockCacheOpt())
app := NewApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, DefaultHome, OptsWithGenesisTime(config.Seed), interBlockCacheOpt())

fmt.Printf(
"running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n",
Expand Down

0 comments on commit 349cdbc

Please sign in to comment.