-
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
Fix encode signed numbers. #6
Conversation
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.
🚀
multiversx_sdk/core/codec_test.py
Outdated
from multiversx_sdk.core import codec | ||
|
||
test_vectors_1 = [ | ||
[-1, 0XFF], |
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.
just to keep it consistent use lowercase value for the hex prefix. 0xFF
instead of 0XFF
. Apply this change to all test vectors.
assert codec.encode_signed_number(127) == bytes([0x7F]) | ||
assert codec.encode_signed_number(0x11) == bytes([0x11]) | ||
assert codec.encode_signed_number(255) == bytes([0x00, 0xFF]) | ||
for [input_data, expected_data] in test_vectors_1: |
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.
Just for readability, maybe add an empty line between the last assert
statement and the first for
statement, but also between each for
staments.
No description provided.