Skip to content

Commit

Permalink
(BIDS-2841) cleaning temporary changes which were necessary to test l…
Browse files Browse the repository at this point in the history
…ocally
  • Loading branch information
thib-wien committed Jan 23, 2024
1 parent 34f9237 commit 971d427
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 49 deletions.
3 changes: 1 addition & 2 deletions cmd/explorer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ func main() {
router.HandleFunc("/api/healthz-loadbalancer", handlers.ApiHealthzLoadbalancer).Methods("GET", "HEAD")

logrus.Infof("initializing prices")
utils.Config.Frontend.ClCurrency = "GNO"
utils.Config.Frontend.ElCurrency = "xDAI"

price.Init(utils.Config.Chain.ClConfig.DepositChainID, utils.Config.Eth1ErigonEndpoint, utils.Config.Frontend.ClCurrency, utils.Config.Frontend.ElCurrency)

logrus.Infof("prices initialized")
Expand Down
17 changes: 2 additions & 15 deletions price/price.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ func Init(chainId uint64, eth1Endpoint, clCurrencyParam, elCurrencyParam string)
setPrice(clCurrency, "USD", 2000.0)
setPrice(elCurrency, elCurrency, 1)
setPrice(clCurrency, clCurrency, 1)
availableCurrencies = []string{"ETH", "USD"}
logger.Warnf("chainId not supported for fetching prices: %v", chainId)
runOnce.Do(func() { runOnceWg.Done() })
//return
return
}

clCurrency = clCurrencyParam
Expand All @@ -77,20 +78,6 @@ func Init(chainId uint64, eth1Endpoint, clCurrencyParam, elCurrencyParam string)
calcPairs[elCurrency] = true
calcPairs[clCurrency] = true

setPrice("xDAI", "GNO", 1.0/200.0)
setPrice("GNO", "xDAI", 200.0)
setPrice("GNO", "USD", 200.0)
setPrice("GNO", "ETH", 200.0/2000.0)
setPrice("mGNO", "GNO", float64(1)/float64(32))
setPrice("GNO", "mGNO", 32)
setPrice("mGNO", "mGNO", float64(1)/float64(32))
setPrice("GNO", "GNO", 1)

calcPairs["GNO"] = true

availableCurrencies = []string{"GNO", "mGNO", "xDAI", "ETH", "USD"}
return

eClient, err := ethclient.Dial(eth1Endpoint)
if err != nil {
logger.Errorf("error dialing pricing eth1 endpoint: %v", err)
Expand Down
30 changes: 15 additions & 15 deletions templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,23 @@
</div>
</div>
<div class="info-banner-right">
<div class="dropdown">
<a class="btn btn-transparent btn-sm dropdown-toggle currency-dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<div id="currencyFlagDropdown">
<img class="currency-flag-dropdown-image" src="/img/{{ .Rates.SelectedCurrency }}.svg" />
</div>
<div id="currencyDropdown">{{ .Rates.SelectedCurrency }}</div>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="currencyDropdown">
{{ range .AvailableCurrencies }}
<a tabindex="1" class="dropdown-item cursor-pointer" onClick="updateCurrency({{ . }})">
<img class="currency-flag-option" src="/img/{{ . }}.svg" />
<span class="currency-name">{{ getCurrencyLabel . }}</span>
<span class="currency-symbol">{{ . }}</span>
</a>
{{ end }}
<div class="dropdown">
<a class="btn btn-transparent btn-sm dropdown-toggle currency-dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<div id="currencyFlagDropdown">
<img class="currency-flag-dropdown-image" src="/img/{{ .Rates.SelectedCurrency }}.svg" />
</div>
<div id="currencyDropdown">{{ .Rates.SelectedCurrency }}</div>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="currencyDropdown">
{{ range .AvailableCurrencies }}
<a tabindex="1" class="dropdown-item cursor-pointer" onClick="updateCurrency({{ . }})">
<img class="currency-flag-option" src="/img/{{ . }}.svg" />
<span class="currency-name">{{ getCurrencyLabel . }}</span>
<span class="currency-symbol">{{ . }}</span>
</a>
{{ end }}
</div>
</div>
{{ if .User.Authenticated }}
<div class="dropdown">
<a class="btn btn-transparent btn-sm dropdown-toggle" id="userDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand Down
4 changes: 2 additions & 2 deletions templates/slot/execTransactions.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ define "execution_transactions" }}
{{ $data := .Data}}
{{ $data := .Data }}
{{ if eq $.Active "blockchain" }}
{{ $data = .Data.ExecutionData}}
{{ $data = .Data.ExecutionData }}
{{ end }}
{{ with $data }}
<style>
Expand Down
30 changes: 15 additions & 15 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,31 +708,31 @@ func ReadConfig(cfg *types.Config, path string) error {
}

if cfg.Frontend.ClCurrency == "" {
//switch cfg.Chain.Name {
//case "gnosis":
cfg.Frontend.MainCurrency = "GNO"
cfg.Frontend.ClCurrency = "mGNO"
cfg.Frontend.ClCurrencyDecimals = 18
cfg.Frontend.ClCurrencyDivisor = 1e9
/*default:
switch cfg.Chain.Name {
case "gnosis":
cfg.Frontend.MainCurrency = "GNO"
cfg.Frontend.ClCurrency = "mGNO"
cfg.Frontend.ClCurrencyDecimals = 18
cfg.Frontend.ClCurrencyDivisor = 1e9
default:
cfg.Frontend.MainCurrency = "ETH"
cfg.Frontend.ClCurrency = "ETH"
cfg.Frontend.ClCurrencyDecimals = 18
cfg.Frontend.ClCurrencyDivisor = 1e9
}*/
}
}

if cfg.Frontend.ElCurrency == "" {
//switch cfg.Chain.Name {
//case "gnosis":
cfg.Frontend.ElCurrency = "xDAI"
cfg.Frontend.ElCurrencyDecimals = 18
cfg.Frontend.ElCurrencyDivisor = 1e18
/*default:
switch cfg.Chain.Name {
case "gnosis":
cfg.Frontend.ElCurrency = "xDAI"
cfg.Frontend.ElCurrencyDecimals = 18
cfg.Frontend.ElCurrencyDivisor = 1e18
default:
cfg.Frontend.ElCurrency = "ETH"
cfg.Frontend.ElCurrencyDecimals = 18
cfg.Frontend.ElCurrencyDivisor = 1e18
}*/
}
}

if cfg.Frontend.SiteTitle == "" {
Expand Down

0 comments on commit 971d427

Please sign in to comment.