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

feat: added support for eth_getTransactionReceipt() to the WS server (#2274) #2297

Conversation

quiet-node
Copy link
Member

@quiet-node quiet-node commented Apr 5, 2024

Description:

  • adds support and test coverage for eth_getTransactionReceipt(txHash) endpoint to the websocket server.
  • slightly modify utils functions in ws-server package to better suit the new API
  • removed socketId in logs as dauplicated with connectionID
  • removed validateParamsLength() method as not neccessary
  • reworked handleSendingRequestsToRelay() by reducing the amount of requests sent to sendTiClient() method.
  • fixed conflicts with getCode & estimateGas

Related issue(s):

Fixes #2274

Notes for reviewer:

Checklist

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

Copy link

github-actions bot commented Apr 5, 2024

Tests

    1 files    35 suites   3s ⏱️
194 tests 193 ✔️ 1 💤 0
197 runs  196 ✔️ 1 💤 0

Results for commit edd503b.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.15%. Comparing base (7b073fb) to head (0b9f72a).

❗ Current head 0b9f72a differs from pull request most recent head bcbf4c6. Consider uploading reports for the commit bcbf4c6 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2297   +/-   ##
=======================================
  Coverage   75.15%   75.15%           
=======================================
  Files          13       13           
  Lines         644      644           
  Branches      118      118           
=======================================
  Hits          484      484           
  Misses        115      115           
  Partials       45       45           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Apr 5, 2024

Acceptance Tests

  13 files  158 suites   16m 3s ⏱️
438 tests 431 ✔️ 4 💤 3
462 runs  455 ✔️ 4 💤 3

Results for commit edd503b.

♻️ This comment has been updated with latest results.

@quiet-node quiet-node marked this pull request as draft April 8, 2024 13:44
@quiet-node quiet-node added enhancement New feature or request P1 labels Apr 8, 2024
@quiet-node quiet-node marked this pull request as ready for review April 8, 2024 16:53
@quiet-node quiet-node force-pushed the 2274-implement-gettransactionreceipttransactionhashin-the-websocket-server branch from 77265d4 to 4d48758 Compare April 8, 2024 17:20
@quiet-node quiet-node force-pushed the 2274-implement-gettransactionreceipttransactionhashin-the-websocket-server branch from 4d48758 to fbe4c78 Compare April 9, 2024 18:48
afterEach(async () => {
if (wsProvider) {
await wsProvider.destroy();
await new Promise((resolve) => setTimeout(resolve, 1000));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are we waiting for here? Can this be replaced by some kind of check such as the wsProvider being destroyed or undefined?

afterEach(async () => {
if (wsProvider) {
await wsProvider.destroy();
await new Promise((resolve) => setTimeout(resolve, 1000));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as above.

Copy link
Contributor

@ebadiere ebadiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, just one question.

Signed-off-by: Logan Nguyen <[email protected]>

Revert "fix: removed timer after connecting and disconnecting wsProvider"

This reverts commit 8cc42b8.

a

Signed-off-by: Logan Nguyen <[email protected]>
@quiet-node quiet-node force-pushed the 2274-implement-gettransactionreceipttransactionhashin-the-websocket-server branch from 8cc42b8 to edd503b Compare April 9, 2024 20:36
Copy link

sonarqubecloud bot commented Apr 9, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
23.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@ebadiere ebadiere self-requested a review April 10, 2024 00:23
Copy link
Contributor

@ebadiere ebadiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG.

@ebadiere ebadiere merged commit 7e18c53 into main Apr 10, 2024
31 of 32 checks passed
@ebadiere ebadiere deleted the 2274-implement-gettransactionreceipttransactionhashin-the-websocket-server branch April 10, 2024 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement getTransactionReceipt(transactionHash):in the websocket server
3 participants