0g-chain/x/community/genesis_test.go
Robert Pirtle 7c58fb5303
Add x/community Lend proposals (#1425)
* implement & register x/community lend proposals

* register proposals in x/community codec

* allow x/community macc to receive funds

* init lend from genesis in proposal tests

* test CommunityLendWithdrawProposal

* helpful comment on x/community keeper deps

* use RouteKey in module.go
2022-12-12 16:38:27 -08:00

40 lines
876 B
Go

package community_test
import (
"testing"
"github.com/stretchr/testify/suite"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/kava-labs/kava/x/community"
"github.com/kava-labs/kava/x/community/testutil"
)
type genesisTestSuite struct {
testutil.Suite
}
func (suite *genesisTestSuite) SetupTest() {
suite.Suite.SetupTest()
}
func TestGenesisTestSuite(t *testing.T) {
suite.Run(t, new(genesisTestSuite))
}
func (suite *genesisTestSuite) TestInitGenesis() {
suite.SetupTest()
accountKeeper := suite.App.GetAccountKeeper()
suite.NotPanics(func() {
community.InitGenesis(suite.Ctx, suite.Keeper, accountKeeper)
})
// check for module account this way b/c GetModuleAccount creates if not existing.
acc := accountKeeper.GetAccount(suite.Ctx, suite.MaccAddress)
suite.NotNil(acc)
_, ok := acc.(authtypes.ModuleAccountI)
suite.True(ok)
}