From d08f61ca6a50fd739933c57df293186e232fc8d6 Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Thu, 22 Aug 2024 01:36:33 -0700 Subject: [PATCH] Pass context through --- src/typed.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/typed.jl b/src/typed.jl index 20ac38c7..72e22bc3 100644 --- a/src/typed.jl +++ b/src/typed.jl @@ -99,7 +99,11 @@ macro message_dispatcher(name, body) param_type = get_param_type($(esc(i.args[2]))) params = param_type === Nothing ? nothing : param_type <: NamedTuple ? convert(param_type,(;(Symbol(i[1])=>i[2] for i in msg["params"])...)) : param_type(msg["params"]) - res = $(esc(i.args[3]))(x, params) + if context===nothing + res = $(esc(i.args[3]))(x, params) + else + res = $(esc(i.args[3]))(x, params, context) + end if $(esc(i.args[2])) isa RequestType if res isa JSONRPCError