Skip to content

Commit

Permalink
test(integration): port x/evidence tests to server v2 (#22709)
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilkumarpilli authored Dec 3, 2024
1 parent 2964c5e commit 0e31188
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 211 deletions.
28 changes: 0 additions & 28 deletions tests/integration/evidence/app_config.go

This file was deleted.

3 changes: 2 additions & 1 deletion tests/integration/v2/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ func (a *App) Deliver(
resp, state, err := a.DeliverBlock(ctx, req)
require.NoError(t, err)
a.lastHeight++
// update block heigh if integeration context is present

// update block height if integration context is present
iCtx, ok := ctx.Value(contextKey).(*integrationContext)
if ok {
iCtx.header.Height = int64(a.lastHeight)
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/v2/distribution/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package distribution
import (
"testing"

"gotest.tools/v3/assert"

"cosmossdk.io/x/distribution/types"

authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"gotest.tools/v3/assert"
)

func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,33 @@
package evidence_test
package evidence

import (
"context"
"fmt"
"testing"
"time"

"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"

"cosmossdk.io/depinject"
"cosmossdk.io/log"
"cosmossdk.io/x/evidence"
"cosmossdk.io/x/evidence/exported"
"cosmossdk.io/x/evidence/keeper"
"cosmossdk.io/x/evidence/types"

"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
)

type GenesisTestSuite struct {
suite.Suite

ctx sdk.Context
ctx context.Context
keeper keeper.Keeper
}

func (suite *GenesisTestSuite) SetupTest() {
var evidenceKeeper keeper.Keeper

app, err := simtestutil.Setup(
depinject.Configs(
depinject.Supply(log.NewNopLogger()),
AppConfig,
),
&evidenceKeeper)
require.NoError(suite.T(), err)

suite.ctx = app.BaseApp.NewContext(false)
suite.keeper = evidenceKeeper
f := initFixture(suite.T())

suite.ctx = f.ctx
suite.keeper = f.evidenceKeeper
}

func (suite *GenesisTestSuite) TestInitGenesis() {
Expand Down
Loading

0 comments on commit 0e31188

Please sign in to comment.