Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zale144 committed Nov 4, 2024
1 parent c9c36e2 commit ce187db
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
5 changes: 4 additions & 1 deletion testutil/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,11 +774,14 @@ func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Respo
// InitChainer application update at chain initialization
func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
var genesisState GenesisState

if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
}

genesisInfo := app.HubGenesisKeeper.GetGenesisInfo(ctx)
genesisInfo.GenesisChecksum = req.GenesisChecksum
app.HubGenesisKeeper.SetGenesisInfo(ctx, genesisInfo)

// Passing the dymint sequencers to the sequencer module from RequestInitChain
app.SequencersKeeper.MustSetDymintValidatorUpdates(ctx, req.Validators)

Expand Down
31 changes: 13 additions & 18 deletions testutil/utils/test_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,27 @@ import (
"testing"
"time"

tmprotocrypto "github.com/tendermint/tendermint/proto/tendermint/crypto"

"github.com/CosmWasm/wasmd/x/wasm"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
"github.com/stretchr/testify/require"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/dymensionxyz/dymension-rdk/x/hub-genesis/types"

app "github.com/dymensionxyz/dymension-rdk/testutil/app"

hubgenesistypes "github.com/dymensionxyz/dymension-rdk/x/hub-genesis/types"

"github.com/stretchr/testify/require"

tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"

cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"

abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmprotocrypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/dymensionxyz/dymension-rdk/testutil/app"
"github.com/dymensionxyz/dymension-rdk/x/hub-genesis/types"
hubgenesistypes "github.com/dymensionxyz/dymension-rdk/x/hub-genesis/types"
)

var DefaultConsensusParams = &abci.ConsensusParams{
Expand Down Expand Up @@ -131,8 +125,9 @@ func setGenesisAndInitChain(t *testing.T, app *app.App, genesisState map[string]
Validators: []abci.ValidatorUpdate{
{PubKey: ProposerTMCons(), Power: 1},
},
AppStateBytes: stateBytes,
InitialHeight: 0,
AppStateBytes: stateBytes,
InitialHeight: 0,
GenesisChecksum: "notempty",
},
)
}
Expand Down

0 comments on commit ce187db

Please sign in to comment.