From 01311e77f6cd1c68f2972a0078df9c9c6e9e7b9f Mon Sep 17 00:00:00 2001 From: Kevin Davis Date: Thu, 3 Dec 2020 16:05:56 -0700 Subject: [PATCH] Kd fix interest test (#728) * fix: fix go 1.15 build * fix: correct highest apy test --- x/harvest/keeper/interest_test.go | 4 ++-- x/harvest/keeper/keeper_test.go | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/x/harvest/keeper/interest_test.go b/x/harvest/keeper/interest_test.go index 920e1b12..b922ba24 100644 --- a/x/harvest/keeper/interest_test.go +++ b/x/harvest/keeper/interest_test.go @@ -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, }, diff --git a/x/harvest/keeper/keeper_test.go b/x/harvest/keeper/keeper_test.go index d2565aef..9c42a43a 100644 --- a/x/harvest/keeper/keeper_test.go +++ b/x/harvest/keeper/keeper_test.go @@ -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) }) }