mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-25 15:55:18 +00:00
7c58fb5303
* 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
40 lines
876 B
Go
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)
|
|
}
|