now it creates the module account on InitChain

This commit is contained in:
Jonathan Gimeno
2020-03-05 11:45:51 +01:00
parent b9ab834732
commit e01c99d019
5 changed files with 45 additions and 6 deletions
+29
View File
@@ -0,0 +1,29 @@
package mint_test
import (
"testing"
"github.com/cosmos/cosmos-sdk/x/mint"
"github.com/cosmos/cosmos-sdk/x/supply"
"github.com/stretchr/testify/assert"
"github.com/tendermint/tendermint/abci/types"
"github.com/cosmos/cosmos-sdk/simapp"
)
func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
app := simapp.Setup(false)
ctx := app.BaseApp.NewContext(false, types.Header{})
app.InitChain(
types.RequestInitChain{
AppStateBytes: []byte("{}"),
ChainId: "test-chain-id",
},
)
acc := app.AccountKeeper.GetAccount(ctx, supply.NewModuleAddress(mint.ModuleName))
assert.NotNil(t, acc)
}