51 lines
1.2 KiB
Go
51 lines
1.2 KiB
Go
package mint
|
|
|
|
import (
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
"cosmossdk.io/math"
|
|
minttypes "cosmossdk.io/x/mint/types"
|
|
|
|
"github.com/cosmos/cosmos-sdk/testutil/network"
|
|
)
|
|
|
|
type E2ETestSuite struct {
|
|
suite.Suite
|
|
|
|
cfg network.Config
|
|
network network.NetworkI
|
|
}
|
|
|
|
func NewE2ETestSuite(cfg network.Config) *E2ETestSuite {
|
|
return &E2ETestSuite{cfg: cfg}
|
|
}
|
|
|
|
func (s *E2ETestSuite) SetupSuite() {
|
|
s.T().Log("setting up e2e test suite")
|
|
|
|
genesisState := s.cfg.GenesisState
|
|
|
|
var mintData minttypes.GenesisState
|
|
s.Require().NoError(s.cfg.Codec.UnmarshalJSON(genesisState[minttypes.ModuleName], &mintData))
|
|
|
|
inflation := math.LegacyMustNewDecFromStr("1.0")
|
|
mintData.Minter.Inflation = inflation
|
|
mintData.Params.InflationMin = inflation
|
|
mintData.Params.InflationMax = inflation
|
|
|
|
mintDataBz, err := s.cfg.Codec.MarshalJSON(&mintData)
|
|
s.Require().NoError(err)
|
|
genesisState[minttypes.ModuleName] = mintDataBz
|
|
s.cfg.GenesisState = genesisState
|
|
|
|
s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg)
|
|
s.Require().NoError(err)
|
|
|
|
s.Require().NoError(s.network.WaitForNextBlock())
|
|
}
|
|
|
|
func (s *E2ETestSuite) TearDownSuite() {
|
|
s.T().Log("tearing down e2e test suite")
|
|
s.network.Cleanup()
|
|
}
|