mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
drop legacy NewDefaultEnvironment method
This commit is contained in:
parent
4033ad56e2
commit
1d8e0bff5a
|
@ -10,9 +10,7 @@ import (
|
|||
"github.com/jmoiron/sqlx"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/c9s/bbgo/pkg/cmd/cmdutil"
|
||||
"github.com/c9s/bbgo/pkg/service"
|
||||
"github.com/c9s/bbgo/pkg/store"
|
||||
"github.com/c9s/bbgo/pkg/types"
|
||||
|
@ -88,23 +86,6 @@ type Environment struct {
|
|||
tradeReporter *TradeReporter
|
||||
}
|
||||
|
||||
// NewDefaultEnvironment prepares the exchange sessions from the viper settings.
|
||||
func NewDefaultEnvironment() *Environment {
|
||||
environment := NewEnvironment()
|
||||
|
||||
for _, n := range SupportedExchanges {
|
||||
if viper.IsSet(string(n) + "-api-key") {
|
||||
exchange, err := cmdutil.NewExchange(n)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
environment.AddExchange(string(n), exchange)
|
||||
}
|
||||
}
|
||||
|
||||
return environment
|
||||
}
|
||||
|
||||
func NewEnvironment() *Environment {
|
||||
return &Environment{
|
||||
|
|
Loading…
Reference in New Issue
Block a user