Skip to content

Commit

Permalink
Fix x/mint MOduleAccount test
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed May 11, 2023
1 parent 41bbab5 commit c37f4fb
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions x/mint/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@ package mint_test
import (
"testing"

abcitypes "github.com/cometbft/cometbft/abci/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
"github.com/stretchr/testify/require"

"github.com/CosmosContracts/juno/v15/app"
"github.com/CosmosContracts/juno/v15/x/mint/types"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/nft/testutil"
)

func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
app := app.Setup(t)
ctx := app.BaseApp.NewContext(false, tmproto.Header{})
var accountKeeper authkeeper.AccountKeeper

app.InitChain(
abcitypes.RequestInitChain{
AppStateBytes: []byte("{}"),
},
)
app, err := simtestutil.SetupAtGenesis(testutil.AppConfig, &accountKeeper)
require.NoError(t, err)

acc := app.AppKeepers.AccountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.ModuleName))
ctx := app.BaseApp.NewContext(false, tmproto.Header{})
acc := accountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.ModuleName))
require.NotNil(t, acc)
}

0 comments on commit c37f4fb

Please sign in to comment.