mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 00:05:18 +00:00
40 lines
724 B
Go
40 lines
724 B
Go
|
package pricefeed_test
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||
|
"github.com/kava-labs/kava/app"
|
||
|
"github.com/kava-labs/kava/x/pricefeed"
|
||
|
|
||
|
"github.com/stretchr/testify/suite"
|
||
|
)
|
||
|
|
||
|
type GenesisTestSuite struct {
|
||
|
suite.Suite
|
||
|
|
||
|
ctx sdk.Context
|
||
|
keeper pricefeed.Keeper
|
||
|
}
|
||
|
|
||
|
func (suite *GenesisTestSuite) TestValidGenState() {
|
||
|
tApp := app.NewTestApp()
|
||
|
|
||
|
suite.NotPanics(func() {
|
||
|
tApp.InitializeFromGenesisStates(
|
||
|
NewPricefeedGenStateMulti(),
|
||
|
)
|
||
|
})
|
||
|
_, addrs := app.GeneratePrivKeyAddressPairs(10)
|
||
|
|
||
|
suite.NotPanics(func() {
|
||
|
tApp.InitializeFromGenesisStates(
|
||
|
NewPricefeedGenStateWithOracles(addrs),
|
||
|
)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
func TestGenesisTestSuite(t *testing.T) {
|
||
|
suite.Run(t, new(GenesisTestSuite))
|
||
|
}
|