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

Refactor rpc handlers and tests #1768

Merged
merged 4 commits into from
Apr 21, 2024

Conversation

pnowosie
Copy link
Contributor

@pnowosie pnowosie commented Mar 27, 2024

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 pnowosie requested a review from kirugan March 27, 2024 10:38
Copy link

codecov bot commented Mar 27, 2024

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 ⚠️
rpc/trace.go 44.17% 78 Missing and 13 partials ⚠️
rpc/estimate_fee.go 0.00% 74 Missing ⚠️
rpc/events.go 44.44% 60 Missing and 5 partials ⚠️
rpc/simulation.go 24.41% 61 Missing and 4 partials ⚠️
rpc/block.go 73.84% 29 Missing and 5 partials ⚠️
rpc/helpers.go 78.70% 17 Missing and 6 partials ⚠️
rpc/class.go 92.59% 3 Missing and 1 partial ⚠️
rpc/sync.go 91.66% 1 Missing and 1 partial ⚠️
rpc/state_update.go 98.50% 1 Missing ⚠️
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     

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

rpc/chain.go Outdated Show resolved Hide resolved
rpc/chain.go Outdated Show resolved Hide resolved
rpc/chain.go Outdated Show resolved Hide resolved
rpc/chain.go Outdated Show resolved Hide resolved
rpc/chain.go Outdated Show resolved Hide resolved
@pnowosie pnowosie force-pushed the pnowosie/refactor-rpc-handlers-and-tests branch from ce7d56a to 255e1d4 Compare March 28, 2024 15:33
rpc/transaction.go Outdated Show resolved Hide resolved
@pnowosie pnowosie force-pushed the pnowosie/refactor-rpc-handlers-and-tests branch from 255e1d4 to 6b98993 Compare March 29, 2024 10:10
@pnowosie pnowosie force-pushed the pnowosie/refactor-rpc-handlers-and-tests branch from 6b98993 to 3322f60 Compare March 29, 2024 11:03
@pnowosie pnowosie force-pushed the pnowosie/refactor-rpc-handlers-and-tests branch from 3322f60 to d5ec5cf Compare April 5, 2024 15:21
rpc/events.go Show resolved Hide resolved
@pnowosie pnowosie force-pushed the pnowosie/refactor-rpc-handlers-and-tests branch 2 times, most recently from cca5653 to aa06293 Compare April 8, 2024 18:46
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`
- `helpers.go` - which contains helper functionality used in more than one
  "category".
@pnowosie pnowosie force-pushed the pnowosie/refactor-rpc-handlers-and-tests branch from aa06293 to 4ab9c04 Compare April 8, 2024 18:51
@IronGauntlets IronGauntlets merged commit c04fa8e into main Apr 21, 2024
8 of 10 checks passed
@IronGauntlets IronGauntlets deleted the pnowosie/refactor-rpc-handlers-and-tests branch April 21, 2024 22:43
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.

Juno RPC handler code tidying
4 participants