cosmos-sdk/tests/integration/distribution/module_test.go
Facundo Medica 0024a0bf44
refactor: use mocks for x/distribution (#12889)
* initial commit

* add mocks

* TestAllocateTokensToManyValidators

* one file more in, like a hundred left

* progress

* progress

* move tests to integration

* finally got TestCalculateRewardsMultiDelegator right lol

* small fixes

* progress

* progress

* progress

* progress

* revert test panic

* progress

* progress

* more progress

* fix go.mod

* merge

* merge

* cache issue?

* fix go.sum

* fix tests

* make mocks

* move back simulations

Co-authored-by: Marko <marbar3778@yahoo.com>
2022-08-29 20:15:51 -03:00

26 lines
809 B
Go

package distribution_test
import (
"testing"
"github.com/stretchr/testify/require"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/distribution/testutil"
"github.com/cosmos/cosmos-sdk/x/distribution/types"
)
func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
var accountKeeper authkeeper.AccountKeeper
app, err := simtestutil.SetupAtGenesis(testutil.AppConfig, &accountKeeper)
require.NoError(t, err)
ctx := app.BaseApp.NewContext(false, tmproto.Header{})
acc := accountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(types.ModuleName))
require.NotNil(t, acc)
}