mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 10:05:18 +00:00
451bc05f47
* module files * proto types * types and generated proto types * keeper * client scaffold * add savings module to app * remove placeholder types file * implement rest and add to module * update proto types * validation for supported denoms * generate updates proto types * update comments * update comments * remove unused imports from proto files * regenerate proto files * remove abci * remove refs to other modules * remove endblocker call * genesis init test for module account * update genesis test with params * add get/set params test
45 lines
1.0 KiB
Go
45 lines
1.0 KiB
Go
package keeper_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
|
tmtime "github.com/tendermint/tendermint/types/time"
|
|
|
|
"github.com/kava-labs/kava/app"
|
|
"github.com/kava-labs/kava/x/savings/keeper"
|
|
)
|
|
|
|
// Test suite used for all keeper tests
|
|
type KeeperTestSuite struct {
|
|
suite.Suite
|
|
keeper keeper.Keeper
|
|
app app.TestApp
|
|
ctx sdk.Context
|
|
addrs []sdk.AccAddress
|
|
}
|
|
|
|
// The default state used by each test
|
|
func (suite *KeeperTestSuite) SetupTest() {
|
|
config := sdk.GetConfig()
|
|
app.SetBech32AddressPrefixes(config)
|
|
|
|
tApp := app.NewTestApp()
|
|
ctx := tApp.NewContext(true, tmproto.Header{Height: 1, Time: tmtime.Now()})
|
|
tApp.InitializeFromGenesisStates()
|
|
_, addrs := app.GeneratePrivKeyAddressPairs(1)
|
|
keeper := tApp.GetSavingsKeeper()
|
|
suite.app = tApp
|
|
suite.ctx = ctx
|
|
suite.keeper = keeper
|
|
suite.addrs = addrs
|
|
}
|
|
|
|
func TestKeeperTestSuite(t *testing.T) {
|
|
suite.Run(t, new(KeeperTestSuite))
|
|
}
|