Skip to content

Commit

Permalink
Merge pull request #129 from kevinheavey/fix-127
Browse files Browse the repository at this point in the history
Fix missing sanitization in to_json methods
  • Loading branch information
kevinheavey authored Jul 20, 2023
2 parents 23e7b0b + 3082389 commit ae8ea8e
Show file tree
Hide file tree
Showing 3 changed files with 1,475 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [0.18.0] - 2023-07-20

### Changed

Client-gen: add support for optional accounts [#(128)](https://github.com/kevinheavey/anchorpy/pull/128)

### Fixed

Client-gen: fix missing sanitization in to_json method generation [#(129)](https://github.com/kevinheavey/anchorpy/pull/129)

## [0.17.2] - 2023-06-02

### Changed
Expand Down
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 ae8ea8e

Please sign in to comment.