Skip to content

Commit

Permalink
test: export genesis (#1871)
Browse files Browse the repository at this point in the history
* Add export test

* Add unit test for app export

* Refactor gaia helpers setup

Co-authored-by: Danilo Pantani <[email protected]>
  • Loading branch information
glnro and Pantani authored Nov 9, 2022
1 parent 12f5c85 commit 3259ba7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
db "github.com/tendermint/tm-db"

gaia "github.com/cosmos/gaia/v8/app"
gaiahelpers "github.com/cosmos/gaia/v8/app/helpers"
)

type EmptyAppOptions struct{}
Expand All @@ -32,7 +33,12 @@ func TestGaiaApp_BlockedModuleAccountAddrs(t *testing.T) {
)
blockedAddrs := app.BlockedModuleAccountAddrs()

// TODO: Blocked on updating to v0.46.x
// require.NotContains(t, blockedAddrs, authtypes.NewModuleAddress(grouptypes.ModuleName).String())
require.NotContains(t, blockedAddrs, authtypes.NewModuleAddress(govtypes.ModuleName).String())
}

func TestGaiaApp_Export(t *testing.T) {
app := gaiahelpers.Setup(t)

_, err := app.ExportAppStateAndValidators(true, []string{})
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
}
2 changes: 1 addition & 1 deletion app/helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type EmptyAppOptions struct{}

func (EmptyAppOptions) Get(o string) interface{} { return nil }

func Setup(t *testing.T, isCheckTx bool, invCheckPeriod uint) *gaiaapp.GaiaApp {
func Setup(t *testing.T) *gaiaapp.GaiaApp {
t.Helper()

privVal := mock.NewPV()
Expand Down
2 changes: 1 addition & 1 deletion x/globalfee/ante/antetest/fee_test_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type IntegrationTestSuite struct {
}

func (s *IntegrationTestSuite) SetupTest() {
app := gaiahelpers.Setup(s.T(), false, 1)
app := gaiahelpers.Setup(s.T())
ctx := app.BaseApp.NewContext(false, tmproto.Header{
ChainID: fmt.Sprintf("test-chain-%s", tmrand.Str(4)),
Height: 1,
Expand Down

0 comments on commit 3259ba7

Please sign in to comment.