add metadata to call_remote

This commit is contained in:
Aiden McClelland
2026-01-14 12:43:02 -07:00
parent 81d18147fd
commit a19624fc78

View File

@@ -78,6 +78,7 @@ pub trait CallRemote<RemoteContext, Extra = Empty>: crate::Context {
fn call_remote( fn call_remote(
&self, &self,
method: &str, method: &str,
metadata: OrdMap<&'static str, Value>,
params: Value, params: Value,
extra: Extra, extra: Extra,
) -> impl Future<Output = Result<Value, RpcError>> + Send; ) -> impl Future<Output = Result<Value, RpcError>> + Send;
@@ -239,12 +240,13 @@ where
let full_method = handle_args let full_method = handle_args
.parent_method .parent_method
.into_iter() .into_iter()
.chain(handle_args.method) .chain(handle_args.method.clone())
.collect::<Vec<_>>(); .collect::<Vec<_>>();
match handle_args match handle_args
.context .context
.call_remote( .call_remote(
&full_method.join("."), &full_method.join("."),
self.handler.metadata(handle_args.method),
without(handle_args.raw_params.clone(), &handle_args.params.1) without(handle_args.raw_params.clone(), &handle_args.params.1)
.map_err(invalid_params)?, .map_err(invalid_params)?,
handle_args.params.1, handle_args.params.1,