Skip to content

Conversation

@antazoey
Copy link
Member

@antazoey antazoey commented Oct 1, 2025

What I did

Allow you to implement mixin hooks for a custom class to be convertible to different types.
I have a weird wrapper type that can't easily inherit from ContractInstance and I am constantly accidentally passing it to transactions but i of course get conversion errors. With this, I can implement these hooks and my class will work as arguments much like a regular ContractInstance does.

fixes: #2624

How I did it

How to verify it

Checklist

  • All changes are completed
  • Change is covered in tests
  • Documentation is complete

fubuloubu
fubuloubu previously approved these changes Oct 1, 2025
Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

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

I like this! Perhaps we can do something in v0.9/v1.x series to make this more generalizable/performant, but for now this works well!

fubuloubu
fubuloubu previously approved these changes Oct 1, 2025
@antazoey antazoey merged commit 354bf09 into ApeWorX:main Oct 6, 2025
18 checks passed
@antazoey antazoey deleted the fix/convert-cls-hook branch October 6, 2025 13:36
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.

Ability to register custom classes to convert to certain types when used as inputs

2 participants