mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-27 00:35:18 +00:00
d04aad5cc9
* fix: remove redundant debt limit param * wip: test pricefeed genesis * fix: pricefeed querier * fix: comments, naming * fix: query path * fix: store methods * fix: query methods * fix: standardize genesis validation
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))
|
|
}
|