Skip to content

Conversation

thiagodeev
Copy link

@thiagodeev thiagodeev commented Aug 21, 2025

Solves #136

This PR allows a user to specify a method name formatter for a client handler on the client side.
Although we can create a client handler to accept reversed calls from the server, it wasn't possible to configure a method name format for it (like WithMethodNameFormatter). This restricts the use of reverse calls to the default method name formatter, so it wasn't possible to accept a reverse call with a different method name format (like the eth_subscription method name).

Note: while creating a test for this new method, I studied other tests and found an undocumented feature: method name alias. This can also solve the above issue, but it requires creating an alias for every method name. The new solution proposed by this PR is applied to the entire client handler. I've updated the docs to improve DX.

Note: in the server, the formatter specified by the WithServerMethodNameFormatter config is also applied to the reverse calls. Do you want me to change this?

Regards

@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@bbbae86). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #138   +/-   ##
=========================================
  Coverage          ?   72.39%           
=========================================
  Files             ?       13           
  Lines             ?     2003           
  Branches          ?        0           
=========================================
  Hits              ?     1450           
  Misses            ?      453           
  Partials          ?      100           
Files with missing lines Coverage Δ
client.go 79.95% <100.00%> (ø)
options.go 70.31% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thiagodeev thiagodeev marked this pull request as ready for review August 21, 2025 03:35
@thiagodeev thiagodeev changed the title feat: add reverseHandlersFormatter to Config feat: add method name formatter option for client handlers Aug 21, 2025
@BigLep BigLep added this to FilOz Aug 26, 2025
@github-project-automation github-project-automation bot moved this to 📌 Triage in FilOz Aug 26, 2025
@BigLep BigLep requested a review from rvagg August 26, 2025 03:21
@BigLep
Copy link
Member

BigLep commented Aug 26, 2025

Thanks for the contribution @thiagodeev . Just letting you know it may be a couple of weeks before maintainers can get to this given other balls that are being juggled currently.

@BigLep BigLep moved this from 📌 Triage to 🔎 Awaiting Review in FilOz Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 Awaiting Review

Development

Successfully merging this pull request may close these issues.

3 participants