rpc/client: Propagate `rpc_methods` method to reported methods (#1713)
The PR exposes the `rpc_methods` name in the `rpc_methods` response.
This feature is useful for servers that only forward requests to methods
that are reported by the `rpc_methods`.
Jsonrpsee exposes the available methods registered so far. Registering
the `rpc_methods` requires a closure that already stores the result. As
such, the `rpc_methods` method name is manually added to the available
methods.
Closes: https://github.com/paritytech/polkadot-sdk/issues/1627
### Testing Done
```
$> curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "rpc_methods", "params":[]}' http://localhost:9944
{"jsonrpc":"2.0","result":{"methods":["account_nextIndex",... "rpc_methods",..."unsubscribe_newHead"]},"id":1}⏎
```
@paritytech/subxt-team
---------
Signed-off-by: Alexandru Vasile <[email protected]>
Please register or sign in to comment