Skip to content

Commit

Permalink
fix missing sanitization in to_json method generation
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Jul 20, 2023
1 parent 23e7b0b commit eacfd3a
Show file tree
Hide file tree
Showing 2 changed files with 1,465 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/anchorpy/clientgen/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def _field_to_json(
convert_case: bool = True,
) -> str:
ty_type = ty.ty
maybe_converted = snake(ty.name) if convert_case else ty.name
maybe_converted = _sanitize(snake(ty.name)) if convert_case else _sanitize(ty.name)
var_name = f"{val_prefix}{maybe_converted}{val_suffix}"
if ty_type == IdlTypeSimple.PublicKey:
return f"str({var_name})"
Expand Down
Loading

0 comments on commit eacfd3a

Please sign in to comment.