From 464fd1717f636b79734d500535a6ade1b6954808 Mon Sep 17 00:00:00 2001 From: atheeshp <59333759+atheeshp@users.noreply.github.com> Date: Thu, 23 Jun 2022 14:20:20 +0530 Subject: [PATCH] feat: `x/slashing` app wiring integration tests (#12262) --- x/slashing/client/testutil/cli_test.go | 5 ++- x/slashing/testutil/app.yaml | 45 ++++++++++++++++++++++++++ x/slashing/testutil/app_config.go | 19 +++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 x/slashing/testutil/app.yaml create mode 100644 x/slashing/testutil/app_config.go diff --git a/x/slashing/client/testutil/cli_test.go b/x/slashing/client/testutil/cli_test.go index 1035ca7502..64cd56ab94 100644 --- a/x/slashing/client/testutil/cli_test.go +++ b/x/slashing/client/testutil/cli_test.go @@ -7,12 +7,15 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/testutil/network" + "github.com/cosmos/cosmos-sdk/x/slashing/testutil" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) func TestIntegrationTestSuite(t *testing.T) { - cfg := network.DefaultConfig() + cfg, err := network.DefaultConfigWithAppConfig(testutil.AppConfig) + require.NoError(t, err) cfg.NumValidators = 1 suite.Run(t, NewIntegrationTestSuite(cfg)) } diff --git a/x/slashing/testutil/app.yaml b/x/slashing/testutil/app.yaml new file mode 100644 index 0000000000..07c2873106 --- /dev/null +++ b/x/slashing/testutil/app.yaml @@ -0,0 +1,45 @@ +modules: + - name: runtime + config: + "@type": cosmos.app.runtime.v1alpha1.Module + + app_name: SlashApp + + begin_blockers: [staking, auth, bank, genutil, slashing, params] + end_blockers: [staking, auth, bank, genutil, slashing, params] + init_genesis: [auth, bank, staking, slashing, genutil, params] + + - name: auth + config: + "@type": cosmos.auth.module.v1.Module + bech32_prefix: cosmos + module_account_permissions: + - account: fee_collector + - account: bonded_tokens_pool + permissions: [burner, staking] + - account: not_bonded_tokens_pool + permissions: [burner, staking] + + - name: bank + config: + "@type": cosmos.bank.module.v1.Module + + - name: params + config: + "@type": cosmos.params.module.v1.Module + + - name: tx + config: + "@type": cosmos.tx.module.v1.Module + + - name: staking + config: + "@type": cosmos.staking.module.v1.Module + + - name: slashing + config: + "@type": cosmos.slashing.module.v1.Module + + - name: genutil + config: + "@type": cosmos.genutil.module.v1.Module diff --git a/x/slashing/testutil/app_config.go b/x/slashing/testutil/app_config.go new file mode 100644 index 0000000000..32a19ae0e0 --- /dev/null +++ b/x/slashing/testutil/app_config.go @@ -0,0 +1,19 @@ +package testutil + +import ( + _ "embed" + + "cosmossdk.io/core/appconfig" + _ "github.com/cosmos/cosmos-sdk/x/auth" + _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" + _ "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/genutil" + _ "github.com/cosmos/cosmos-sdk/x/params" + _ "github.com/cosmos/cosmos-sdk/x/slashing" + _ "github.com/cosmos/cosmos-sdk/x/staking" +) + +//go:embed app.yaml +var appConfig []byte + +var AppConfig = appconfig.LoadYAML(appConfig)