mirror of
				https://github.com/0glabs/0g-chain.git
				synced 2025-11-04 04:37:26 +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",
 | 
			
		||||
			args{
 | 
			
		||||
				apy:           sdk.MustNewDecFromStr("170"),
 | 
			
		||||
				expectedValue: sdk.MustNewDecFromStr("1.000000162855113371"),
 | 
			
		||||
				apy:           sdk.MustNewDecFromStr("177"),
 | 
			
		||||
				expectedValue: sdk.MustNewDecFromStr("1.000002441641340532"),
 | 
			
		||||
			},
 | 
			
		||||
			false,
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
@ -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) })
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user