-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement explicit enums #116
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
|
||
|
||
class _EnumPayload(SimpleNamespace): | ||
def __int__(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way, people can convert an EnumValue
to an int
(quite useful).
self.value = value | ||
|
||
def __eq__(self, other: Any) -> bool: | ||
return isinstance(other, ExplicitEnumValue) and self.value == other.value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, we don't differentiate between different types of enums (as seen in ABI) if they have the same value / name. We'll brainstorm this a bit (could be perfectly fine in practice).
@@ -6,8 +6,8 @@ | |||
from multiversx_sdk.abi.biguint_value import BigUIntValue | |||
from multiversx_sdk.abi.bool_value import BoolValue | |||
from multiversx_sdk.abi.bytes_value import BytesValue | |||
from multiversx_sdk.abi.code_metadata_value import CodeMetadataValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By mistake 🙈
Fixed.
Implement explicit enums e.g.:
References: