From a3ea60c13d0b717c222f3fe68e99d649044c417d Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 9 Sep 2022 12:20:39 +0200 Subject: [PATCH] fix: remove newly introduced simapp dependency --- go.mod | 1 - go.sum | 2 -- x/bank/app_test.go | 20 ++++++++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 0ba3493ac44f..5f0cf336634f 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.2 cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.0-beta.3 - cosmossdk.io/simapp v0.0.0-20220908203654-84d4bf5accad github.com/99designs/keyring v1.2.1 github.com/armon/go-metrics v0.4.1 github.com/bgentry/speakeasy v0.1.0 diff --git a/go.sum b/go.sum index 750a3018a34e..fe8773f800c0 100644 --- a/go.sum +++ b/go.sum @@ -67,8 +67,6 @@ cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= cosmossdk.io/math v1.0.0-beta.3 h1:TbZxSopz2LqjJ7aXYfn7nJSb8vNaBklW6BLpcei1qwM= cosmossdk.io/math v1.0.0-beta.3/go.mod h1:3LYasri3Zna4XpbrTNdKsWmD5fHHkaNAod/mNT9XdE4= -cosmossdk.io/simapp v0.0.0-20220908203654-84d4bf5accad h1:5y0F7FHvbJ/uE8L2Ab+0AtKvy5nUyFfxPEAAIy62T/Y= -cosmossdk.io/simapp v0.0.0-20220908203654-84d4bf5accad/go.mod h1://fc0lbQ4/I2Gm2xQkzq1U6SjZP+UMomSBFw/nodk9U= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/x/bank/app_test.go b/x/bank/app_test.go index d23f5362381e..40d21304051c 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -7,7 +7,6 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "cosmossdk.io/simapp" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -22,6 +21,7 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" + _ "github.com/cosmos/cosmos-sdk/x/gov" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" @@ -109,7 +109,9 @@ func createTestSuite(t *testing.T, genesisAccounts []authtypes.GenesisAccount) s configurator.AuthModule(), configurator.StakingModule(), configurator.TxModule(), - configurator.BankModule()), + configurator.BankModule(), + configurator.GovModule(), + ), startupCfg, &res.BankKeeper, &res.AccountKeeper) res.App = app @@ -340,12 +342,14 @@ func TestMsgMultiSendDependent(t *testing.T) { func TestMsgSetSendEnabled(t *testing.T) { acc1 := authtypes.NewBaseAccountWithAddress(addr1) + genAccs := []authtypes.GenesisAccount{acc1} - app := simapp.SetupWithGenesisAccounts(t, genAccs) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 101)))) + s := createTestSuite(t, genAccs) + + ctx := s.App.BaseApp.NewContext(false, tmproto.Header{}) + require.NoError(t, testutil.FundAccount(s.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 101)))) addr1Str := addr1.String() - govAddr := app.BankKeeper.GetAuthority() + govAddr := s.BankKeeper.GetAuthority() goodGovProp, err := govv1.NewMsgSubmitProposal( []sdk.Msg{ types.NewMsgSetSendEnabled(govAddr, nil, nil), @@ -423,9 +427,9 @@ func TestMsgSetSendEnabled(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(tt *testing.T) { - header := tmproto.Header{Height: app.LastBlockHeight() + 1} + header := tmproto.Header{Height: s.App.LastBlockHeight() + 1} txGen := moduletestutil.MakeTestEncodingConfig().TxConfig - _, _, err = simtestutil.SignCheckDeliver(tt, txGen, app.BaseApp, header, tc.msgs, "", []uint64{0}, tc.accSeqs, tc.expSimPass, tc.expPass, priv1) + _, _, err = simtestutil.SignCheckDeliver(tt, txGen, s.App.BaseApp, header, tc.msgs, "", []uint64{0}, tc.accSeqs, tc.expSimPass, tc.expPass, priv1) if len(tc.expInError) > 0 { require.Error(tt, err) for _, exp := range tc.expInError {