juno icon indicating copy to clipboard operation
juno copied to clipboard

Refactor rpc handlers and tests

Open pnowosie opened this issue 5 months ago • 1 comments

Fixes #1750

All handlers and related helper methods was moved from rpc/handlers to the corresponding "category" file, e.g. block, transaction, trace...

Handlers tests were refactor the same way.

I introduced new files in rpc/ folder:

  • chain.go - with ChainId handler
  • class.go - Class* handlers
  • contract.go - Nonce & StorageAt
  • estimate_fee.go
  • rpc/helpers.go which contains helper functionality used in more than one "category".

pnowosie avatar Mar 27 '24 10:03 pnowosie

Codecov Report

Attention: Patch coverage is 59.87762% with 459 lines in your changes are missing coverage. Please review.

Project coverage is 74.53%. Comparing base (e43b0f3) to head (19169ee).

Files Patch % Lines
rpc/transaction.go 66.77% 83 Missing and 17 partials :warning:
rpc/trace.go 44.17% 78 Missing and 13 partials :warning:
rpc/estimate_fee.go 0.00% 74 Missing :warning:
rpc/events.go 44.44% 60 Missing and 5 partials :warning:
rpc/simulation.go 24.41% 61 Missing and 4 partials :warning:
rpc/block.go 73.84% 29 Missing and 5 partials :warning:
rpc/helpers.go 78.70% 17 Missing and 6 partials :warning:
rpc/class.go 92.59% 3 Missing and 1 partial :warning:
rpc/sync.go 91.66% 1 Missing and 1 partial :warning:
rpc/state_update.go 98.50% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1768      +/-   ##
==========================================
- Coverage   74.81%   74.53%   -0.29%     
==========================================
  Files          90       96       +6     
  Lines        8177     8177              
==========================================
- Hits         6118     6095      -23     
- Misses       1543     1565      +22     
- Partials      516      517       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 27 '24 10:03 codecov[bot]