celo-org / blockscout

A tool for inspecting and analyzing EVM based blockchains. Blockchain explorer for Ethereum networks.
https://blockscout.com
GNU General Public License v3.0
45 stars 19 forks source link

Fix txlist RPC endpoint to use the token info for fee currencies #1047

Closed carterqw2 closed 1 month ago

carterqw2 commented 1 month ago

Description

The txlist RPC endpoint uses the CeloParams table to fetch names of stable tokens used as gas currencies. The way the feeCurrency mapping is implemented is a bit cumbersome and requires manual population of the table with the parameters. It can take it from the Tokens table instead.

Before:

curl -s https://explorer.celo.org/mainnet/api\?module\=account\&action\=txlist\&address\=0xccc9576F841de93Cd32bEe7B98fE8B9BD3070e3D | jq '.' | grep -i "0xcb625dd58eb29e8df606276927375ea8aa9c983cb09812aa5784b5da28d6e149" -A 10 -B 10 | grep feeCurrency
      "feeCurrency": "CELO",

After:

curl -s https://explorer.celo.org/mainnet/api\?module\=account\&action\=txlist\&address\=0xccc9576F841de93Cd32bEe7B98fE8B9BD3070e3D | jq '.' | grep -i "0xcb625dd58eb29e8df606276927375ea8aa9c983cb09812aa5784b5da28d6e149" -A 10 -B 10 | grep feeCurrency
      "feeCurrency": "USDC",
github-actions[bot] commented 1 month ago

Unit Test Results

       5 files  ±0     363 suites  ±0   3m 40s :stopwatch: -6s 2 636 tests ±0  2 562 :heavy_check_mark: ±0  74 :zzz: ±0  0 :x: ±0  2 650 runs  ±0  2 574 :heavy_check_mark: ±0  76 :zzz: ±0  0 :x: ±0 

Results for commit d61d04ff. ± Comparison against base commit 7cee2188.

:recycle: This comment has been updated with latest results.