From 4a2b9dca97c5f07273341e71292ed266a1f6f0e4 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Tue, 26 Sep 2023 14:02:01 +0300 Subject: [PATCH 1/2] rpc/client: Propagate `rpc_methods` method to reported methods Signed-off-by: Alexandru Vasile --- substrate/client/rpc-servers/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/substrate/client/rpc-servers/src/lib.rs b/substrate/client/rpc-servers/src/lib.rs index 92b31937a0cb..292751ade410 100644 --- a/substrate/client/rpc-servers/src/lib.rs +++ b/substrate/client/rpc-servers/src/lib.rs @@ -145,6 +145,9 @@ fn hosts_filtering(enabled: bool, addrs: &[SocketAddr]) -> AllowHosts { fn build_rpc_api(mut rpc_api: RpcModule) -> RpcModule { let mut available_methods = rpc_api.method_names().collect::>(); + // The "rpc_methods" method name is guaranteed to not be registered in the rpc module + // by `register_method`. + available_methods.push("rpc_methods"); available_methods.sort(); rpc_api From e4e677f5e42e0c0a9655e98f8c4d2a032a904f56 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Tue, 26 Sep 2023 14:35:48 +0300 Subject: [PATCH 2/2] rpc/client: Update comment Signed-off-by: Alexandru Vasile --- substrate/client/rpc-servers/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/substrate/client/rpc-servers/src/lib.rs b/substrate/client/rpc-servers/src/lib.rs index 292751ade410..dc625c3d6c4c 100644 --- a/substrate/client/rpc-servers/src/lib.rs +++ b/substrate/client/rpc-servers/src/lib.rs @@ -145,8 +145,7 @@ fn hosts_filtering(enabled: bool, addrs: &[SocketAddr]) -> AllowHosts { fn build_rpc_api(mut rpc_api: RpcModule) -> RpcModule { let mut available_methods = rpc_api.method_names().collect::>(); - // The "rpc_methods" method name is guaranteed to not be registered in the rpc module - // by `register_method`. + // The "rpc_methods" is defined below and we want it to be part of the reported methods. available_methods.push("rpc_methods"); available_methods.sort();