From a5e134e98d8b5188fbbb038f713e9d57d72eb3cf Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 17 Feb 2023 17:32:43 +0800 Subject: [PATCH] grid2: fix calculateMinimalQuoteInvestment tests --- pkg/strategy/grid2/strategy_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/strategy/grid2/strategy_test.go b/pkg/strategy/grid2/strategy_test.go index bcafd4ad7..0e5408c13 100644 --- a/pkg/strategy/grid2/strategy_test.go +++ b/pkg/strategy/grid2/strategy_test.go @@ -895,7 +895,7 @@ func TestStrategy_checkMinimalQuoteInvestment(t *testing.T) { s.QuoteInvestment = number(10_000) s.GridNum = 10 minQuoteInvestment := calculateMinimalQuoteInvestment(s.Market, s.LowerPrice, s.UpperPrice, s.GridNum) - assert.Equal(t, "200", minQuoteInvestment.String()) + assert.Equal(t, "180", minQuoteInvestment.String()) err := s.checkMinimalQuoteInvestment() assert.NoError(t, err) @@ -905,11 +905,11 @@ func TestStrategy_checkMinimalQuoteInvestment(t *testing.T) { s.QuoteInvestment = number(10_000) s.GridNum = 1000 minQuoteInvestment := calculateMinimalQuoteInvestment(s.Market, s.LowerPrice, s.UpperPrice, s.GridNum) - assert.Equal(t, "20000", minQuoteInvestment.String()) + assert.Equal(t, "19980", minQuoteInvestment.String()) err := s.checkMinimalQuoteInvestment() assert.Error(t, err) - assert.EqualError(t, err, "need at least 20000.000000 USDT for quote investment, 10000.000000 USDT given") + assert.EqualError(t, err, "need at least 19980.000000 USDT for quote investment, 10000.000000 USDT given") }) }