Kd fix interest test (#728)

* fix: fix go 1.15 build

* fix: correct highest apy test
This commit is contained in:
Kevin Davis 2020-12-03 16:05:56 -07:00 committed by GitHub
parent 49d62dd076
commit 01311e77f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -363,8 +363,8 @@ func (suite *InterestTestSuite) TestAPYToSPY() {
{
"highest apy",
args{
apy: sdk.MustNewDecFromStr("170"),
expectedValue: sdk.MustNewDecFromStr("1.000000162855113371"),
apy: sdk.MustNewDecFromStr("177"),
expectedValue: sdk.MustNewDecFromStr("1.000002441641340532"),
},
false,
},

View File

@ -1,6 +1,7 @@
package keeper_test
import (
"fmt"
"strconv"
"testing"
@ -92,7 +93,7 @@ func (suite *KeeperTestSuite) TestGetSetDeleteDeposit() {
func (suite *KeeperTestSuite) TestIterateDeposits() {
for i := 0; i < 5; i++ {
dep := types.NewDeposit(sdk.AccAddress("test"+string(i)), sdk.NewCoin("bnb", sdk.NewInt(100)))
dep := types.NewDeposit(sdk.AccAddress("test"+fmt.Sprint(i)), sdk.NewCoin("bnb", sdk.NewInt(100)))
suite.Require().NotPanics(func() { suite.keeper.SetDeposit(suite.ctx, dep) })
}
var deposits []types.Deposit
@ -105,11 +106,11 @@ func (suite *KeeperTestSuite) TestIterateDeposits() {
func (suite *KeeperTestSuite) TestIterateDepositsByDenom() {
for i := 0; i < 5; i++ {
depA := types.NewDeposit(sdk.AccAddress("test"+string(i)), sdk.NewCoin("bnb", sdk.NewInt(100)))
depA := types.NewDeposit(sdk.AccAddress("test"+fmt.Sprint(i)), sdk.NewCoin("bnb", sdk.NewInt(100)))
suite.Require().NotPanics(func() { suite.keeper.SetDeposit(suite.ctx, depA) })
depB := types.NewDeposit(sdk.AccAddress("test"+string(i)), sdk.NewCoin("bnb", sdk.NewInt(100)))
depB := types.NewDeposit(sdk.AccAddress("test"+fmt.Sprint(i)), sdk.NewCoin("bnb", sdk.NewInt(100)))
suite.Require().NotPanics(func() { suite.keeper.SetDeposit(suite.ctx, depB) })
depC := types.NewDeposit(sdk.AccAddress("test"+string(i)), sdk.NewCoin("btcb", sdk.NewInt(100)))
depC := types.NewDeposit(sdk.AccAddress("test"+fmt.Sprint(i)), sdk.NewCoin("btcb", sdk.NewInt(100)))
suite.Require().NotPanics(func() { suite.keeper.SetDeposit(suite.ctx, depC) })
}