From 1b55b4eb3bf647bdb11462f22d5061877138a771 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 3 May 2024 23:25:47 +0200 Subject: [PATCH 1/4] remove consensus as a direct import in a few places --- .../e2e/auth/keeper}/account_retriever_test.go | 5 ++--- {x/auth/testutil => tests/e2e/auth/keeper}/app_config.go | 2 +- {x => tests/e2e}/auth/keeper/keeper_bench_test.go | 7 +++---- {x/auth => tests/e2e/auth/keeper}/module_test.go | 3 +-- x/auth/go.mod | 4 ++-- x/auth/go.sum | 2 ++ x/gov/common_test.go | 1 - x/gov/go.mod | 3 +-- 8 files changed, 12 insertions(+), 15 deletions(-) rename {x/auth/types => tests/e2e/auth/keeper}/account_retriever_test.go (89%) rename {x/auth/testutil => tests/e2e/auth/keeper}/app_config.go (98%) rename {x => tests/e2e}/auth/keeper/keeper_bench_test.go (94%) rename {x/auth => tests/e2e/auth/keeper}/module_test.go (92%) diff --git a/x/auth/types/account_retriever_test.go b/tests/e2e/auth/keeper/account_retriever_test.go similarity index 89% rename from x/auth/types/account_retriever_test.go rename to tests/e2e/auth/keeper/account_retriever_test.go index 4e257e716fcb..3a98cb9373d0 100644 --- a/x/auth/types/account_retriever_test.go +++ b/tests/e2e/auth/keeper/account_retriever_test.go @@ -1,18 +1,17 @@ -package types_test +package keeper import ( "testing" "github.com/stretchr/testify/require" - "cosmossdk.io/x/auth/testutil" "cosmossdk.io/x/auth/types" "github.com/cosmos/cosmos-sdk/testutil/network" ) func TestAccountRetriever(t *testing.T) { - cfg, err := network.DefaultConfigWithAppConfig(testutil.AppConfig) + cfg, err := network.DefaultConfigWithAppConfig(AppConfig) require.NoError(t, err) cfg.NumValidators = 1 diff --git a/x/auth/testutil/app_config.go b/tests/e2e/auth/keeper/app_config.go similarity index 98% rename from x/auth/testutil/app_config.go rename to tests/e2e/auth/keeper/app_config.go index 748ed3374563..526d19acba92 100644 --- a/x/auth/testutil/app_config.go +++ b/tests/e2e/auth/keeper/app_config.go @@ -1,4 +1,4 @@ -package testutil +package keeper import ( _ "cosmossdk.io/x/accounts" // import as blank for app wiring diff --git a/x/auth/keeper/keeper_bench_test.go b/tests/e2e/auth/keeper/keeper_bench_test.go similarity index 94% rename from x/auth/keeper/keeper_bench_test.go rename to tests/e2e/auth/keeper/keeper_bench_test.go index c45ccdf43c7f..a8c370ca3dfc 100644 --- a/x/auth/keeper/keeper_bench_test.go +++ b/tests/e2e/auth/keeper/keeper_bench_test.go @@ -1,4 +1,4 @@ -package keeper_test +package keeper import ( "testing" @@ -8,7 +8,6 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" "cosmossdk.io/x/auth/keeper" - "cosmossdk.io/x/auth/testutil" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,7 +19,7 @@ func BenchmarkAccountMapperGetAccountFound(b *testing.B) { app, err := simtestutil.Setup( depinject.Configs( depinject.Supply(log.NewNopLogger()), - testutil.AppConfig, + AppConfig, ), &accountKeeper, ) @@ -49,7 +48,7 @@ func BenchmarkAccountMapperSetAccount(b *testing.B) { app, err := simtestutil.Setup( depinject.Configs( depinject.Supply(log.NewNopLogger()), - testutil.AppConfig, + AppConfig, ), &accountKeeper) require.NoError(b, err) diff --git a/x/auth/module_test.go b/tests/e2e/auth/keeper/module_test.go similarity index 92% rename from x/auth/module_test.go rename to tests/e2e/auth/keeper/module_test.go index 5c2d8402f787..fcc7cc75ba4e 100644 --- a/x/auth/module_test.go +++ b/tests/e2e/auth/keeper/module_test.go @@ -8,7 +8,6 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" "cosmossdk.io/x/auth/keeper" - "cosmossdk.io/x/auth/testutil" "cosmossdk.io/x/auth/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -18,7 +17,7 @@ func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { var accountKeeper keeper.AccountKeeper app, err := simtestutil.SetupAtGenesis( depinject.Configs( - testutil.AppConfig, + AppConfig, depinject.Supply(log.NewNopLogger()), ), &accountKeeper) diff --git a/x/auth/go.mod b/x/auth/go.mod index 5295e74c11fd..0afce6e7be96 100644 --- a/x/auth/go.mod +++ b/x/auth/go.mod @@ -12,9 +12,7 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.0 cosmossdk.io/x/accounts v0.0.0-20240226161501-23359a0b6d91 - cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 cosmossdk.io/x/tx v0.13.3 github.com/cometbft/cometbft v0.38.7 github.com/cosmos/cosmos-proto v1.0.0-beta.5 @@ -40,6 +38,8 @@ require ( buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20240130113600-88ef6483f90f.1 // indirect buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 // indirect cosmossdk.io/x/accounts/defaults/lockup v0.0.0-20240417181816-5e7aae0db1f5 // indirect + cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect + cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/x/auth/go.sum b/x/auth/go.sum index 3ca29d0ef3e2..673562bbac76 100644 --- a/x/auth/go.sum +++ b/x/auth/go.sum @@ -15,6 +15,8 @@ cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= cosmossdk.io/x/accounts/defaults/lockup v0.0.0-20240417181816-5e7aae0db1f5 h1:eb0kcGyaYHSS0do7+MIWg7UKlskSH01biRNENbm/zDA= cosmossdk.io/x/accounts/defaults/lockup v0.0.0-20240417181816-5e7aae0db1f5/go.mod h1:drzY4oVisyWvSgpsM7ccQ7IX3efMuVIvd9Eij1Gm/6o= +cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 h1:pVUfk/FJ5kIyXWma9UL0HgPWX+OoVKVK74Lf64oqVM8= +cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91/go.mod h1:3WvOZSOMJR1NHudlw116khC3fm2RQHo7qSf/JsOVkRA= cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= diff --git a/x/gov/common_test.go b/x/gov/common_test.go index 8594f9962ec5..5aeaf19cfaf0 100644 --- a/x/gov/common_test.go +++ b/x/gov/common_test.go @@ -2,7 +2,6 @@ package gov_test import ( "cosmossdk.io/math" - _ "cosmossdk.io/x/consensus" "cosmossdk.io/x/gov/types/v1beta1" stakingtypes "cosmossdk.io/x/staking/types" ) diff --git a/x/gov/go.mod b/x/gov/go.mod index b7181304486b..942e24914e79 100644 --- a/x/gov/go.mod +++ b/x/gov/go.mod @@ -39,6 +39,7 @@ require ( require ( cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 + cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -164,8 +165,6 @@ require ( sigs.k8s.io/yaml v1.4.0 // indirect ) -require cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 - require cosmossdk.io/x/accounts/defaults/lockup v0.0.0-20240417181816-5e7aae0db1f5 // indirect replace github.com/cosmos/cosmos-sdk => ../../. From d63d9fcc9fb8e17fd7b1c88e44de763e00aae1f3 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 6 May 2024 11:24:41 +0200 Subject: [PATCH 2/4] fix pacakge --- tests/e2e/auth/keeper/module_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/auth/keeper/module_test.go b/tests/e2e/auth/keeper/module_test.go index fcc7cc75ba4e..7154aaac454f 100644 --- a/tests/e2e/auth/keeper/module_test.go +++ b/tests/e2e/auth/keeper/module_test.go @@ -1,4 +1,4 @@ -package auth_test +package keeper import ( "testing" From 848b46086f9bad6929de26a33be6eac27219d981 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 6 May 2024 11:33:49 +0200 Subject: [PATCH 3/4] fix error --- tests/e2e/auth/suite.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/e2e/auth/suite.go b/tests/e2e/auth/suite.go index 1d5e6b7f2a34..9bd0c62bd4a7 100644 --- a/tests/e2e/auth/suite.go +++ b/tests/e2e/auth/suite.go @@ -16,7 +16,6 @@ import ( "cosmossdk.io/math" authcli "cosmossdk.io/x/auth/client/cli" authclitestutil "cosmossdk.io/x/auth/client/testutil" - authtestutil "cosmossdk.io/x/auth/testutil" banktypes "cosmossdk.io/x/bank/types" govtestutil "cosmossdk.io/x/gov/client/testutil" govtypes "cosmossdk.io/x/gov/types/v1beta1" @@ -1293,7 +1292,7 @@ func TestGetBroadcastCommandOfflineFlag(t *testing.T) { func TestGetBroadcastCommandWithoutOfflineFlag(t *testing.T) { var txCfg client.TxConfig - err := depinject.Inject(authtestutil.AppConfig, &txCfg) + err := depinject.Inject(AppConfig, &txCfg) require.NoError(t, err) clientCtx := client.Context{} clientCtx = clientCtx.WithTxConfig(txCfg) From 21a6c5de6cd9af3d930d4713c1411aefadddc035 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 6 May 2024 11:34:36 +0200 Subject: [PATCH 4/4] fix error --- tests/e2e/auth/suite.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/auth/suite.go b/tests/e2e/auth/suite.go index 9bd0c62bd4a7..8e288f355115 100644 --- a/tests/e2e/auth/suite.go +++ b/tests/e2e/auth/suite.go @@ -27,6 +27,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + authtestkeeper "github.com/cosmos/cosmos-sdk/tests/e2e/auth/keeper" "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" @@ -1292,7 +1293,7 @@ func TestGetBroadcastCommandOfflineFlag(t *testing.T) { func TestGetBroadcastCommandWithoutOfflineFlag(t *testing.T) { var txCfg client.TxConfig - err := depinject.Inject(AppConfig, &txCfg) + err := depinject.Inject(authtestkeeper.AppConfig, &txCfg) require.NoError(t, err) clientCtx := client.Context{} clientCtx = clientCtx.WithTxConfig(txCfg)