Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tkernell committed Dec 2, 2024
1 parent 197962e commit 25d37e2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions x/bridge/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ import (
func setupKeeper(tb testing.TB) (keeper.Keeper, *mocks.AccountKeeper, *mocks.BankKeeper, *mocks.OracleKeeper, *mocks.ReporterKeeper, *mocks.StakingKeeper, context.Context) {
tb.Helper()
k, ak, bk, ok, rk, sk, ctx := keepertest.BridgeKeeper(tb)

// Initialize genesis state with default snapshot limit
err := k.SnapshotLimit.Set(ctx, types.SnapshotLimit{
Limit: types.DefaultSnapshotLimit,
})
require.NoError(tb, err)

// Initialize default params
err = k.Params.Set(ctx, types.DefaultParams())
require.NoError(tb, err)

return k, ak, bk, ok, rk, sk, ctx
}

Expand Down
3 changes: 3 additions & 0 deletions x/bridge/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ func SetupBridgeApp(t *testing.T) (AppModule, keeper.Keeper, sdk.Context, *mocks
ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger())
require.NoError(t, k.Params.Set(ctx, types.DefaultParams()))

require.NoError(t, k.SnapshotLimit.Set(ctx, types.SnapshotLimit{
Limit: types.DefaultSnapshotLimit,
}))
return app, k, ctx, sk, ok
}

Expand Down
3 changes: 2 additions & 1 deletion x/bridge/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ package types

// DefaultIndex is the default global index
const DefaultIndex uint64 = 1
const DefaultSnapshotLimit uint64 = 1000

// DefaultGenesis returns the default genesis state
func DefaultGenesis() *GenesisState {
return &GenesisState{
// this line is used by starport scaffolding # genesis/types/default
Params: DefaultParams(),
SnapshotLimit: 1000,
SnapshotLimit: DefaultSnapshotLimit,
}
}

Expand Down

0 comments on commit 25d37e2

Please sign in to comment.