2021-08-06 01:43:55 +00:00
|
|
|
package swap_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/kava-labs/kava/x/swap/testutil"
|
2022-01-08 00:39:27 +00:00
|
|
|
"github.com/kava-labs/kava/x/swap/types"
|
2021-08-06 01:43:55 +00:00
|
|
|
|
2022-01-08 00:39:27 +00:00
|
|
|
crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper"
|
2021-08-06 01:43:55 +00:00
|
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
)
|
|
|
|
|
|
|
|
type moduleTestSuite struct {
|
|
|
|
testutil.Suite
|
2022-01-08 00:39:27 +00:00
|
|
|
crisisKeeper crisiskeeper.Keeper
|
2021-08-06 01:43:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (suite *moduleTestSuite) SetupTest() {
|
|
|
|
suite.Suite.SetupTest()
|
|
|
|
suite.crisisKeeper = suite.App.GetCrisisKeeper()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (suite *moduleTestSuite) TestRegisterInvariants() {
|
|
|
|
swapRoutes := []string{}
|
|
|
|
|
|
|
|
for _, route := range suite.crisisKeeper.Routes() {
|
2022-01-08 00:39:27 +00:00
|
|
|
if route.ModuleName == types.ModuleName {
|
2021-08-06 01:43:55 +00:00
|
|
|
swapRoutes = append(swapRoutes, route.Route)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
suite.Contains(swapRoutes, "pool-records")
|
|
|
|
suite.Contains(swapRoutes, "share-records")
|
|
|
|
suite.Contains(swapRoutes, "pool-reserves")
|
|
|
|
suite.Contains(swapRoutes, "pool-shares")
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestModuleTestSuite(t *testing.T) {
|
|
|
|
suite.Run(t, new(moduleTestSuite))
|
|
|
|
}
|