Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: mempool overrides #2823

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions app/default_overrides_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
"github.com/stretchr/testify/assert"
tmcfg "github.com/tendermint/tendermint/config"
)

// Test_newGovModule verifies that the gov module's genesis state has defaults
Expand Down Expand Up @@ -63,3 +64,28 @@ func TestDefaultAppConfig(t *testing.T) {
assert.Equal(t, uint32(2), cfg.StateSync.SnapshotKeepRecent)
assert.Equal(t, "0.1utia", cfg.MinGasPrices)
}

func TestDefaultConsensusConfig(t *testing.T) {
got := DefaultConsensusConfig()

t.Run("mempool overrides", func(t *testing.T) {
want := tmcfg.MempoolConfig{
// defaults
Broadcast: tmcfg.DefaultMempoolConfig().Broadcast,
CacheSize: tmcfg.DefaultMempoolConfig().CacheSize,
KeepInvalidTxsInCache: tmcfg.DefaultMempoolConfig().KeepInvalidTxsInCache,
Recheck: tmcfg.DefaultMempoolConfig().Recheck,
RootDir: tmcfg.DefaultMempoolConfig().RootDir,
Size: tmcfg.DefaultMempoolConfig().Size,
WalPath: tmcfg.DefaultMempoolConfig().WalPath,

// overrides
MaxTxBytes: 7_897_088,
MaxTxsBytes: 39_485_440,
TTLDuration: 75 * time.Second,
TTLNumBlocks: 5,
Version: "v1",
}
assert.Equal(t, want, *got.Mempool)
})
}
Loading