Skip to content

Commit

Permalink
Fixed symbol formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
carterqw2 committed May 8, 2024
1 parent e898424 commit d61d04f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ defmodule BlockScoutWeb.API.RPC.AddressView do
"confirmations" => "#{transaction.confirmations}",
"gatewayFeeRecipient" => "#{transaction.gas_fee_recipient_hash}",
"gatewayFee" => "#{transaction.gateway_fee}",
"feeCurrency" => Util.contract_name_to_symbol(transaction.fee_currency, true)
"feeCurrency" => Util.fee_currency_token_symbol(transaction.fee_currency)
}
end

Expand Down
9 changes: 3 additions & 6 deletions apps/explorer/lib/explorer/celo/util.ex
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,10 @@ defmodule Explorer.Celo.Util do
Map.values(@celo_token_contract_symbols)
end

def contract_name_to_symbol(name, use_celo_instead_cgld?) do
def fee_currency_token_symbol(name) do
case name do
n when n in [nil, "goldToken"] ->
if(use_celo_instead_cgld?, do: "CELO", else: "cGLD")

_ ->
@celo_token_contract_symbols[name]
n when n in [nil, "cGLD"] -> "CELO"
_ -> name
end
end
end

0 comments on commit d61d04f

Please sign in to comment.