mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-24 23:35:19 +00:00
Kd fix interest test (#728)
* fix: fix go 1.15 build * fix: correct highest apy test
This commit is contained in:
parent
49d62dd076
commit
01311e77f6
@ -363,8 +363,8 @@ func (suite *InterestTestSuite) TestAPYToSPY() {
|
|||||||
{
|
{
|
||||||
"highest apy",
|
"highest apy",
|
||||||
args{
|
args{
|
||||||
apy: sdk.MustNewDecFromStr("170"),
|
apy: sdk.MustNewDecFromStr("177"),
|
||||||
expectedValue: sdk.MustNewDecFromStr("1.000000162855113371"),
|
expectedValue: sdk.MustNewDecFromStr("1.000002441641340532"),
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package keeper_test
|
package keeper_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@ -92,7 +93,7 @@ func (suite *KeeperTestSuite) TestGetSetDeleteDeposit() {
|
|||||||
|
|
||||||
func (suite *KeeperTestSuite) TestIterateDeposits() {
|
func (suite *KeeperTestSuite) TestIterateDeposits() {
|
||||||
for i := 0; i < 5; i++ {
|
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) })
|
suite.Require().NotPanics(func() { suite.keeper.SetDeposit(suite.ctx, dep) })
|
||||||
}
|
}
|
||||||
var deposits []types.Deposit
|
var deposits []types.Deposit
|
||||||
@ -105,11 +106,11 @@ func (suite *KeeperTestSuite) TestIterateDeposits() {
|
|||||||
|
|
||||||
func (suite *KeeperTestSuite) TestIterateDepositsByDenom() {
|
func (suite *KeeperTestSuite) TestIterateDepositsByDenom() {
|
||||||
for i := 0; i < 5; i++ {
|
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) })
|
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) })
|
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) })
|
suite.Require().NotPanics(func() { suite.keeper.SetDeposit(suite.ctx, depC) })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user