From 40b3192e55957ade6dd7e4ad4778e4d25569d478 Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 19 May 2022 10:01:21 +0800 Subject: [PATCH] use config.GetAccount to avoid error --- pkg/backtest/exchange.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pkg/backtest/exchange.go b/pkg/backtest/exchange.go index b5a1acf76..d0703c282 100644 --- a/pkg/backtest/exchange.go +++ b/pkg/backtest/exchange.go @@ -83,16 +83,7 @@ func NewExchange(sourceName types.ExchangeName, sourceExchange types.Exchange, s endTime = time.Now() } - configAccount, ok := config.Accounts[sourceName.String()] - if !ok { - // fallback to the legacy account syntax - configAccount, ok = config.Account[sourceName.String()] - if !ok { - return nil, fmt.Errorf("config backtest.accounts[%s] is not defined, please check your config file.", sourceName.String()) - } else { - log.Warnf("config backtest.account is deprecated, please use backtest.accounts instead.") - } - } + configAccount := config.GetAccount(sourceName.String()) account := &types.Account{ MakerFeeRate: configAccount.MakerFeeRate,