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

00622 Ethereum transaction details may fail to display contract result #624

Merged
merged 5 commits into from
Jun 5, 2023

Conversation

ericleponner
Copy link
Collaborator

Description:

Root cause of this issue is located in ContractResultByTsCache.

This class fetches contract result details for a given transaction timestamp. It does this in two steps:

  1. first it uses api/v1/contracts/results/?timestamp=TTT to retrieve contract id
  2. next it uses api/v1/contracts/{contractId}/results/TTT to retrieve full details of contract result

In the case of transaction 1685737274.278536163, first call returns contract_id == null and causes fetching to stop.

Changes below enhance logic above: when first call returns contract_id == null, ContractResultByTsCache checks if hash value is available and uses it to retrieve contract result details.

Changes below also include:

  • extra unit test for ContractResultByTsCache
  • some imports cleaning,
  • some fixes to e2e tests to adapt to mainnet latest data

Related issue(s):

Fixes #622

Notes for reviewer:

See PR for transaction test URL.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

…when result has no associated contract id.

Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
@ericleponner ericleponner requested a review from svienot June 5, 2023 15:30
@github-actions
Copy link

github-actions bot commented Jun 5, 2023

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
79.49% (+0.01% 🔼)
5959/7497
🟡 Branches
60.58% (+0.04% 🔼)
2439/4026
🟡 Functions 75.86% 1147/1512
🟡 Lines
79.55% (+0.01% 🔼)
5643/7094

Test suite run success

315 tests passing in 71 suites.

Report generated by 🧪jest coverage report action from 7093c72

@sonarcloud
Copy link

sonarcloud bot commented Jun 5, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@svienot svienot merged commit 9fa7f2d into main Jun 5, 2023
@svienot svienot deleted the 00622_fail_to_display_contract_result branch June 5, 2023 15:40
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.

Ethereum transaction details may fail to display contract result.
2 participants