From bab2c9213aea06afd9acc0b6acaa780eb7eccc9c Mon Sep 17 00:00:00 2001 From: Rootul Patel Date: Wed, 8 Nov 2023 12:32:35 +0100 Subject: [PATCH] test: mempool overrides --- app/default_overrides_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/default_overrides_test.go b/app/default_overrides_test.go index 944343f70e..159a4eed8f 100644 --- a/app/default_overrides_test.go +++ b/app/default_overrides_test.go @@ -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 @@ -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) + }) +}