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

feat: macros that decoding arguments can set custom decoder using decode_with #544

Merged
merged 4 commits into from
Jan 10, 2025

Conversation

lwshang
Copy link
Contributor

@lwshang lwshang commented Jan 9, 2025

SDK-1924

Description

  • Add decode_with hook for customizing arguments decoding.
  • When the argument is empty, the macros won't generate the code which get msg_arg_data then decode as Candid.
    • The callee can send any arguments to such entry-points. And the entry-point won't waste any cycles on decoding it into '()'.
    • If it's needed, developer can still use decode_with to decode the arguments data.
  • Some code cleanup for better maintainability.

How Has This Been Tested?

Added a macros e2e test.

Checklist:

  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@lwshang lwshang marked this pull request as ready for review January 9, 2025 19:17
@lwshang lwshang requested a review from a team as a code owner January 9, 2025 19:17
@lwshang lwshang merged commit 3184c9c into next Jan 10, 2025
13 checks passed
@lwshang lwshang deleted the lwshang/macros_overhaul branch January 10, 2025 20:14
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.

1 participant