From 197732edf98ca7aeca395c6812201701f14aafa3 Mon Sep 17 00:00:00 2001 From: atheesh Date: Tue, 14 Jun 2022 16:42:32 +0530 Subject: [PATCH 1/5] wip: update tests --- x/authz/client/testutil/cli_test.go | 6 +++- x/authz/testutil/app.yaml | 43 +++++++++++++++++++++++++++++ x/authz/testutil/app_config.go | 12 ++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 x/authz/testutil/app.yaml create mode 100644 x/authz/testutil/app_config.go diff --git a/x/authz/client/testutil/cli_test.go b/x/authz/client/testutil/cli_test.go index 5b3ef61c5a45..10771e3144e4 100644 --- a/x/authz/client/testutil/cli_test.go +++ b/x/authz/client/testutil/cli_test.go @@ -4,15 +4,19 @@ package testutil import ( + _ "embed" "testing" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/testutil/network" + "github.com/cosmos/cosmos-sdk/x/authz/testutil" ) 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/authz/testutil/app.yaml b/x/authz/testutil/app.yaml new file mode 100644 index 000000000000..df7261adc0f0 --- /dev/null +++ b/x/authz/testutil/app.yaml @@ -0,0 +1,43 @@ +modules: + - name: runtime + config: + "@type": cosmos.app.runtime.v1alpha1.Module + app_name: AuthzApp + begin_blockers: [staking, auth, bank, genutil, authz, params] + end_blockers: [staking, auth, bank, genutil, authz, params] + init_genesis: [auth, bank, staking, genutil, authz, 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: authz + config: + "@type": cosmos.authz.module.v1.Module + + - name: genutil + config: + "@type": cosmos.genutil.module.v1.Module \ No newline at end of file diff --git a/x/authz/testutil/app_config.go b/x/authz/testutil/app_config.go new file mode 100644 index 000000000000..1f01697aa019 --- /dev/null +++ b/x/authz/testutil/app_config.go @@ -0,0 +1,12 @@ +package testutil + +import ( + _ "embed" + + "cosmossdk.io/core/appconfig" +) + +//go:embed app.yaml +var appConfig []byte + +var AppConfig = appconfig.LoadYAML(appConfig) From 128b403ecd41f6108586d0a96b3ccd8828474e42 Mon Sep 17 00:00:00 2001 From: atheesh Date: Wed, 15 Jun 2022 18:28:25 +0530 Subject: [PATCH 2/5] update tests --- x/authz/client/testutil/cli_test.go | 3 --- x/authz/testutil/app.yaml | 8 +++++--- x/authz/testutil/app_config.go | 9 +++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/x/authz/client/testutil/cli_test.go b/x/authz/client/testutil/cli_test.go index 10771e3144e4..4a21a7fed3f7 100644 --- a/x/authz/client/testutil/cli_test.go +++ b/x/authz/client/testutil/cli_test.go @@ -1,6 +1,3 @@ -//go:build norace -// +build norace - package testutil import ( diff --git a/x/authz/testutil/app.yaml b/x/authz/testutil/app.yaml index df7261adc0f0..4151062eafa8 100644 --- a/x/authz/testutil/app.yaml +++ b/x/authz/testutil/app.yaml @@ -3,9 +3,9 @@ modules: config: "@type": cosmos.app.runtime.v1alpha1.Module app_name: AuthzApp - begin_blockers: [staking, auth, bank, genutil, authz, params] - end_blockers: [staking, auth, bank, genutil, authz, params] - init_genesis: [auth, bank, staking, genutil, authz, params] + begin_blockers: [staking, auth, bank,gov, genutil, authz, params] + end_blockers: [gov, staking, auth, bank, genutil, authz, params] + init_genesis: [auth, bank, staking, gov, genutil, authz, params] - name: auth config: @@ -17,6 +17,8 @@ modules: permissions: [burner, staking] - account: not_bonded_tokens_pool permissions: [burner, staking] + - account: gov + permissions: [burner] - name: bank config: diff --git a/x/authz/testutil/app_config.go b/x/authz/testutil/app_config.go index 1f01697aa019..3dc03128a796 100644 --- a/x/authz/testutil/app_config.go +++ b/x/authz/testutil/app_config.go @@ -3,6 +3,15 @@ package testutil import ( _ "embed" + _ "github.com/cosmos/cosmos-sdk/x/auth" + _ "github.com/cosmos/cosmos-sdk/x/auth/tx/module" + _ "github.com/cosmos/cosmos-sdk/x/authz" + _ "github.com/cosmos/cosmos-sdk/x/bank" + _ "github.com/cosmos/cosmos-sdk/x/genutil" + _ "github.com/cosmos/cosmos-sdk/x/gov" + _ "github.com/cosmos/cosmos-sdk/x/params" + _ "github.com/cosmos/cosmos-sdk/x/staking" + "cosmossdk.io/core/appconfig" ) From fd579d8ee1cb8d66ce1bcb6a8ff6cd38e18dcf4f Mon Sep 17 00:00:00 2001 From: atheesh Date: Wed, 15 Jun 2022 18:32:21 +0530 Subject: [PATCH 3/5] changes --- x/authz/testutil/app.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/authz/testutil/app.yaml b/x/authz/testutil/app.yaml index 4151062eafa8..c26a3bd9753f 100644 --- a/x/authz/testutil/app.yaml +++ b/x/authz/testutil/app.yaml @@ -4,7 +4,7 @@ modules: "@type": cosmos.app.runtime.v1alpha1.Module app_name: AuthzApp begin_blockers: [staking, auth, bank,gov, genutil, authz, params] - end_blockers: [gov, staking, auth, bank, genutil, authz, params] + end_blockers: [staking, auth, bank, gov, genutil, authz, params] init_genesis: [auth, bank, staking, gov, genutil, authz, params] - name: auth From 28e864b1e98d7fbc632fbf0d61085d351b0cd507 Mon Sep 17 00:00:00 2001 From: atheesh Date: Tue, 21 Jun 2022 10:36:30 +0530 Subject: [PATCH 4/5] review changes --- x/authz/client/testutil/cli_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/x/authz/client/testutil/cli_test.go b/x/authz/client/testutil/cli_test.go index 4a21a7fed3f7..83fb361e435f 100644 --- a/x/authz/client/testutil/cli_test.go +++ b/x/authz/client/testutil/cli_test.go @@ -1,7 +1,6 @@ package testutil import ( - _ "embed" "testing" "github.com/stretchr/testify/require" From f60606ab3a5014793e0821dcdf2b098e9a243fcb Mon Sep 17 00:00:00 2001 From: atheesh Date: Tue, 21 Jun 2022 10:57:12 +0530 Subject: [PATCH 5/5] changes --- x/authz/client/testutil/cli_test.go | 3 +++ x/authz/testutil/app.yaml | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/x/authz/client/testutil/cli_test.go b/x/authz/client/testutil/cli_test.go index 83fb361e435f..8f18a9332f3b 100644 --- a/x/authz/client/testutil/cli_test.go +++ b/x/authz/client/testutil/cli_test.go @@ -1,3 +1,6 @@ +//go:build norace +// +build norace + package testutil import ( diff --git a/x/authz/testutil/app.yaml b/x/authz/testutil/app.yaml index eb895de06381..2ab648a08c34 100644 --- a/x/authz/testutil/app.yaml +++ b/x/authz/testutil/app.yaml @@ -3,9 +3,9 @@ modules: config: "@type": cosmos.app.runtime.v1alpha1.Module app_name: AuthzApp - begin_blockers: [mint, staking, auth, bank, gov, genutil, authz, params] - end_blockers: [mint, staking, auth, bank, gov, genutil, authz, params] - init_genesis: [auth, bank, staking, mint, gov, genutil, authz, params] + begin_blockers: [mint, staking, auth, bank, genutil, authz, params] + end_blockers: [mint, staking, auth, bank, genutil, authz, params] + init_genesis: [auth, bank, staking, mint, genutil, authz, params] - name: auth config: