Unverified Commit b5a0708f authored by Alexandru Vasile's avatar Alexandru Vasile Committed by GitHub
Browse files

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: default avatarAlexandru Vasile <[email protected]>
parent 50242a61
Pipeline #395554 canceled with stages
in 1 minute and 25 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment