Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
May 8, 2024

Conversation

carterqw2
Copy link

@carterqw2 carterqw2 commented May 8, 2024

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",

The txlist RPC endpoint uses the CeloParams table to fetch names of stable
tokens used as gas currencies. It can take it from the Tokens table instead.
@carterqw2 carterqw2 force-pushed the carterqw2/fix-txlist-feecurrency branch from 637a4df to f8a1496 Compare May 8, 2024 12:22
Copy link

github-actions bot commented May 8, 2024

Unit Test Results

       5 files  ±0     363 suites  ±0   3m 40s ⏱️ -6s
2 636 tests ±0  2 562 ✔️ ±0  74 💤 ±0  0 ±0 
2 650 runs  ±0  2 574 ✔️ ±0  76 💤 ±0  0 ±0 

Results for commit d61d04f. ± Comparison against base commit 7cee218.

♻️ This comment has been updated with latest results.

@carterqw2 carterqw2 marked this pull request as ready for review May 8, 2024 15:03
@carterqw2 carterqw2 requested a review from a team as a code owner May 8, 2024 15:03
@carterqw2 carterqw2 requested a review from lvpeschke May 8, 2024 15:03
@carterqw2 carterqw2 merged commit 0d33ce2 into master May 8, 2024
23 checks passed
@carterqw2 carterqw2 deleted the carterqw2/fix-txlist-feecurrency branch May 8, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants