Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode/Decode custom types using ABI #183

Merged
merged 4 commits into from
Jan 20, 2025
Merged

Encode/Decode custom types using ABI #183

merged 4 commits into from
Jan 20, 2025

Conversation

popenta
Copy link
Collaborator

@popenta popenta commented Jan 17, 2025

Added support for encoding and decoding custom types (structs and enums) using the Abi.

Also added cookbook examples.

@popenta popenta self-assigned this Jan 17, 2025
Copy link

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  multiversx_sdk/abi
  abi.py
Project Total  

This report was generated by python-coverage-comment-action

@@ -250,6 +250,24 @@ def decode_event(self, event_name: str, topics: list[bytes], additional_data: li

return result

def encode_custom_type(self, name: str, values: list[Any]):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if using _get_custom_type_prototype() would have been better 💭

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. We can think about it. I'll merge it as it is and we'll see.

@popenta popenta merged commit f201736 into feat/next Jan 20, 2025
6 checks passed
@popenta popenta deleted the decode-custom-type branch January 20, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants