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

Allow overriding RPC #118

Merged
merged 3 commits into from
Jan 6, 2025
Merged

Allow overriding RPC #118

merged 3 commits into from
Jan 6, 2025

Conversation

0xFirekeeper
Copy link
Member

@0xFirekeeper 0xFirekeeper commented Jan 6, 2025

TOOL-2920

Pass optional rpcOverrides mapping to client


PR-Codex overview

This PR introduces enhancements to the ThirdwebClient and ThirdwebRPC classes, adding support for custom RPC URLs via a Dictionary<BigInteger, string> RpcOverrides. It also includes tests for verifying the functionality of these overrides.

Detailed summary

  • Added internal Dictionary<BigInteger, string> RpcOverrides to ThirdwebClient.
  • Updated ThirdwebClient constructor and Create method to accept rpcOverrides.
  • Introduced internal Uri RpcUrl in ThirdwebRPC.
  • Modified RPC instance retrieval to use custom RPC from RpcOverrides.
  • Added unit tests for various scenarios involving RPC overrides.
  • Removed commented-out test for caching behavior.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.72%. Comparing base (1ff3a70) to head (6b87a56).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #118      +/-   ##
==========================================
+ Coverage   76.64%   76.72%   +0.07%     
==========================================
  Files          28       28              
  Lines        4788     4799      +11     
  Branches      662      665       +3     
==========================================
+ Hits         3670     3682      +12     
  Misses        945      945              
+ Partials      173      172       -1     

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

@0xFirekeeper 0xFirekeeper merged commit 718cb6a into main Jan 6, 2025
1 check passed
@0xFirekeeper 0xFirekeeper deleted the firekeeper/custom-rpc branch January 6, 2025 10:33
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