Skip to content

Commit

Permalink
test: attempt to fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Jul 9, 2024
1 parent c4be6a8 commit 9e0f501
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion core/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ import (
tmconfig "github.com/tendermint/tendermint/config"
tmrand "github.com/tendermint/tendermint/libs/rand"

"github.com/celestiaorg/celestia-app/v2/test/util/genesis"
"github.com/celestiaorg/celestia-app/v2/test/util/testnode"
)

const chainID = "private"

// DefaultTestConfig returns the default testing configuration for Tendermint + Celestia App tandem.
//
// It fetches free ports from OS and sets them into configs, s.t.
Expand All @@ -32,9 +35,16 @@ func DefaultTestConfig() *testnode.Config {

cfg.TmConfig.Consensus.TimeoutCommit = time.Millisecond * 200

genesis := genesis.NewDefaultGenesis().
WithChainID(chainID).
WithValidators(genesis.NewDefaultValidator(testnode.DefaultValidatorAccountName)).
WithConsensusParams(testnode.DefaultConsensusParams())

cfg = cfg.
WithChainID(chainID).
WithFundedAccounts(accounts...).
WithSuppressLogs(true)
WithSuppressLogs(true).
WithGenesis(genesis)

return cfg
}
Expand Down
4 changes: 4 additions & 0 deletions state/core_access_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ func extractPort(addr string) string {
}

func buildAccessor(t *testing.T) (*CoreAccessor, []string) {
chainID := "private"

t.Helper()
accounts := []genesis.KeyringAccount{
{
Expand Down Expand Up @@ -238,10 +240,12 @@ func buildAccessor(t *testing.T) (*CoreAccessor, []string) {
appConf.MinGasPrices = fmt.Sprintf("0.002%s", app.BondDenom)

g := genesis.NewDefaultGenesis().
WithChainID(chainID).
WithValidators(genesis.NewDefaultValidator(testnode.DefaultValidatorAccountName)).
WithConsensusParams(testnode.DefaultConsensusParams()).WithKeyringAccounts(accounts...)

config := testnode.DefaultConfig().
WithChainID(chainID).
WithTendermintConfig(tmCfg).
WithAppConfig(appConf).
WithGenesis(g)
Expand Down

0 comments on commit 9e0f501

Please sign in to comment.