2020-03-04 09:49:59 -08:00
|
|
|
package types_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2020-09-28 03:46:49 -07:00
|
|
|
"github.com/stretchr/testify/suite"
|
2020-03-04 09:49:59 -08:00
|
|
|
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
)
|
|
|
|
|
2020-09-28 03:46:49 -07:00
|
|
|
type stakingTestSuite struct {
|
|
|
|
suite.Suite
|
2020-03-04 09:49:59 -08:00
|
|
|
}
|
|
|
|
|
2020-09-28 03:46:49 -07:00
|
|
|
func TestStakingTestSuite(t *testing.T) {
|
|
|
|
suite.Run(t, new(stakingTestSuite))
|
|
|
|
}
|
|
|
|
|
2020-09-29 04:29:10 -07:00
|
|
|
func (s *stakingTestSuite) SetupSuite() {
|
|
|
|
s.T().Parallel()
|
|
|
|
}
|
|
|
|
|
2020-09-28 03:46:49 -07:00
|
|
|
func (s *stakingTestSuite) TestTokensToConsensusPower() {
|
2021-01-27 02:24:00 -08:00
|
|
|
s.Require().Equal(int64(0), sdk.TokensToConsensusPower(sdk.NewInt(999_999), sdk.DefaultPowerReduction))
|
|
|
|
s.Require().Equal(int64(1), sdk.TokensToConsensusPower(sdk.NewInt(1_000_000), sdk.DefaultPowerReduction))
|
2020-03-04 09:49:59 -08:00
|
|
|
}
|