Skip to content

Commit

Permalink
wip external kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Sep 7, 2021
1 parent 36f2e09 commit aef37f7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vyper/old_codegen/function_definitions/external_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ def _generate_kwarg_handlers(context: Context, sig):
ret = []

def handler_for(calldata_kwargs, default_kwargs):
default_kwargs = [Expr(x, context).lll_node for x in default_kwargs]

calldata_args = base_args + calldata_kwargs
calldata_args_t = TupleType(list(arg.typ for arg in calldata_args))

sig = func_name + canonicalize_type(calldata_args_t)
method_id = util.method_id(sig)

calldata_args_location = LLLnode(4, location="calldata", typ=calldata_args_t)

calldata_args = lazy_abi_decode(calldata_args_t, base_args_location)

assert calldata_args.value == "multi" # sanity check
Expand All @@ -62,6 +65,10 @@ def handler_for(calldata_kwargs, default_kwargs):
# a sequence of statements to strictify kwargs into memory
ret = ["seq"]

all_kwargs_t = TupleType(list(arg.typ for arg in sig_kwargs))

all_kwargs_src = LLLnode.from_list(["multi"] + calldata_args + default_args, typ=all_kwargs_t)

for x in calldata_args:
context.new_variable(argname, argtype, mutable=False)
ret.append(make_setter(context.lookup_var(x.name), x, "memory"))
Expand Down

0 comments on commit aef37f7

Please sign in to comment.