mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 16:25:21 +00:00
37 lines
780 B
Go
37 lines
780 B
Go
|
package keeper_test
|
||
|
|
||
|
import (
|
||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||
|
"github.com/stretchr/testify/suite"
|
||
|
abci "github.com/tendermint/tendermint/abci/types"
|
||
|
tmtime "github.com/tendermint/tendermint/types/time"
|
||
|
|
||
|
"github.com/kava-labs/kava/app"
|
||
|
"github.com/kava-labs/kava/x/cdp/keeper"
|
||
|
)
|
||
|
|
||
|
type KeeperTestSuite struct {
|
||
|
suite.Suite
|
||
|
|
||
|
keeper keeper.Keeper
|
||
|
app app.TestApp
|
||
|
ctx sdk.Context
|
||
|
}
|
||
|
|
||
|
func (suite *KeeperTestSuite) SetupTest() {
|
||
|
config := sdk.GetConfig()
|
||
|
app.SetBech32AddressPrefixes(config)
|
||
|
suite.ResetChain()
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (suite *KeeperTestSuite) ResetChain() {
|
||
|
tApp := app.NewTestApp()
|
||
|
ctx := tApp.NewContext(true, abci.Header{Height: 1, Time: tmtime.Now()})
|
||
|
keeper := tApp.GetCDPKeeper()
|
||
|
|
||
|
suite.app = tApp
|
||
|
suite.ctx = ctx
|
||
|
suite.keeper = keeper
|
||
|
}
|