Merge pull request #629 from hermeznetwork/feature/indivisual-token-config

Allow price update configuration to be specified per token
This commit is contained in:
Eduard S
2021-03-10 14:11:57 +01:00
committed by GitHub
9 changed files with 258 additions and 119 deletions

View File

@@ -425,8 +425,13 @@ func NewNode(mode Mode, cfg *config.Node) (*Node, error) {
if cfg.Debug.APIAddress != "" {
debugAPI = debugapi.NewDebugAPI(cfg.Debug.APIAddress, stateDB, sync)
}
priceUpdater, err := priceupdater.NewPriceUpdater(cfg.PriceUpdater.URL,
priceupdater.APIType(cfg.PriceUpdater.Type), historyDB)
priceUpdater, err := priceupdater.NewPriceUpdater(
cfg.PriceUpdater.DefaultUpdateMethod,
cfg.PriceUpdater.TokensConfig,
historyDB,
cfg.PriceUpdater.URLBitfinexV2,
cfg.PriceUpdater.URLCoinGeckoV3,
)
if err != nil {
return nil, tracerr.Wrap(err)
}