removed dead mntx dependency + dead settings
This commit is contained in:
@@ -27,22 +27,6 @@ func buildCardGatewayRoutes(src map[string]cardGatewayRouteConfig) map[string]or
|
||||
return result
|
||||
}
|
||||
|
||||
func buildFeeLedgerAccounts(src map[string]string) map[string]string {
|
||||
if len(src) == 0 {
|
||||
return nil
|
||||
}
|
||||
result := make(map[string]string, len(src))
|
||||
for key, account := range src {
|
||||
k := strings.ToLower(strings.TrimSpace(key))
|
||||
v := strings.TrimSpace(account)
|
||||
if k == "" || v == "" {
|
||||
continue
|
||||
}
|
||||
result[k] = v
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func buildGatewayRegistry(logger mlogger.Logger, src []gatewayInstanceConfig, registry *discovery.Registry) orchestrator.GatewayRegistry {
|
||||
if logger != nil {
|
||||
logger = logger.Named("gateway_registry")
|
||||
|
||||
@@ -13,24 +13,9 @@ import (
|
||||
|
||||
type config struct {
|
||||
*grpcapp.Config `yaml:",inline"`
|
||||
Fees clientConfig `yaml:"fees"`
|
||||
Ledger clientConfig `yaml:"ledger"`
|
||||
Gateway clientConfig `yaml:"gateway"`
|
||||
PaymentGateway clientConfig `yaml:"payment_gateway"`
|
||||
Mntx clientConfig `yaml:"mntx"`
|
||||
Oracle clientConfig `yaml:"oracle"`
|
||||
CardGateways map[string]cardGatewayRouteConfig `yaml:"card_gateways"`
|
||||
FeeAccounts map[string]string `yaml:"fee_ledger_accounts"`
|
||||
GatewayInstances []gatewayInstanceConfig `yaml:"gateway_instances"`
|
||||
QuoteRetentionHrs int `yaml:"quote_retention_hours"`
|
||||
MaxFXQuoteTTLMs int64 `yaml:"max_fx_quote_ttl_ms"`
|
||||
}
|
||||
|
||||
type clientConfig struct {
|
||||
Address string `yaml:"address"`
|
||||
DialTimeoutSecs int `yaml:"dial_timeout_seconds"`
|
||||
CallTimeoutSecs int `yaml:"call_timeout_seconds"`
|
||||
InsecureTransport bool `yaml:"insecure"`
|
||||
}
|
||||
|
||||
type cardGatewayRouteConfig struct {
|
||||
@@ -79,18 +64,6 @@ type limitsOverrideCfg struct {
|
||||
MaxOps int `yaml:"max_ops"`
|
||||
}
|
||||
|
||||
const (
|
||||
defaultMaxFXQuoteTTL = 10 * time.Minute
|
||||
defaultMaxFXQuoteTTLMillis = int64(defaultMaxFXQuoteTTL / time.Millisecond)
|
||||
)
|
||||
|
||||
func (c clientConfig) callTimeout() time.Duration {
|
||||
if c.CallTimeoutSecs <= 0 {
|
||||
return 3 * time.Second
|
||||
}
|
||||
return time.Duration(c.CallTimeoutSecs) * time.Second
|
||||
}
|
||||
|
||||
func (c *config) quoteRetention() time.Duration {
|
||||
if c == nil || c.QuoteRetentionHrs <= 0 {
|
||||
return 72 * time.Hour
|
||||
@@ -98,13 +71,6 @@ func (c *config) quoteRetention() time.Duration {
|
||||
return time.Duration(c.QuoteRetentionHrs) * time.Hour
|
||||
}
|
||||
|
||||
func (c *config) maxFXQuoteTTLMillis() int64 {
|
||||
if c == nil || c.MaxFXQuoteTTLMs <= 0 {
|
||||
return defaultMaxFXQuoteTTLMillis
|
||||
}
|
||||
return c.MaxFXQuoteTTLMs
|
||||
}
|
||||
|
||||
func (i *Imp) loadConfig() (*config, error) {
|
||||
data, err := os.ReadFile(i.file)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user