Skip to content

Commit

Permalink
Added currency conversion fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Pubmatic-Supriya-Patil committed Feb 16, 2024
1 parent 25b8f08 commit cc0f527
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions modules/moduledeps/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
// ModuleDeps provides dependencies that custom modules may need for hooks execution.
// Additional dependencies can be added here if modules need something more.
type ModuleDeps struct {
HTTPClient *http.Client
RateConvertor *currency.RateConverter
MetricsCfg *config.Metrics
MetricsRegistry metricsCfg.MetricsRegistry
HTTPClient *http.Client
MetricsCfg *config.Metrics
MetricsRegistry metricsCfg.MetricsRegistry
CurrencyConversion currency.Conversions
}
2 changes: 1 addition & 1 deletion router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func New(cfg *config.Configuration, rateConvertor *currency.RateConverter) (r *R
}

metricsRegistry := metricsConf.NewMetricsRegistry()
moduleDeps := moduledeps.ModuleDeps{HTTPClient: generalHttpClient, MetricsCfg: &cfg.Metrics, MetricsRegistry: metricsRegistry, RateConvertor: rateConvertor}
moduleDeps := moduledeps.ModuleDeps{HTTPClient: generalHttpClient, MetricsCfg: &cfg.Metrics, MetricsRegistry: metricsRegistry, CurrencyConversion: rateConvertor.Rates()}
repo, moduleStageNames, err := modules.NewBuilder().Build(cfg.Hooks.Modules, moduleDeps)
if err != nil {
glog.Fatalf("Failed to init hook modules: %v", err)
Expand Down

0 comments on commit cc0f527

Please sign in to comment.