-
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
Codecs (part 14): abi-based encoding & decoding #63
Conversation
@@ -30,3 +30,22 @@ def decode_top_level(self, data: bytes): | |||
reader = io.BytesIO(data) | |||
self.decode_nested(reader) | |||
|
|||
def set_payload(self, value: Any): |
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.
Forgot about this in previous PRs.
from multiversx_sdk.abi.tuple_value import TupleValue | ||
|
||
|
||
def test_set_payload_and_get_payload(): |
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.
Forgot about tuples in the previous PRs.
multiversx_sdk/abi/abi_test.py
Outdated
assert encoded_values == expected_encoded_values | ||
|
||
|
||
def test_decode_endpoint_output_parameters_real_world_multisig_get_pending_action_full_info(): |
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.
could have skipped _real_world_
from the name here and above, but not a big deal :)
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.
Indeed, removed (remained in the Go test, for the moment).
https://github.com/multiversx/mx-sdk-abi-go/blob/main/abi/serializer_test.go
This is part of a series of pull requests.
See: #32.
Changes:
Abi
component, able to encode & decode endpoint parameters. When the component is initialized, it reads the ABI definitions and prepares value prototypes (typed values) for endpoint parameters & custom types. Then, when appropriate, it clones these prototypes and populates them with native Python values / gets Python values out of them.