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

Add address bytes length check in encodeAddress #809

Merged
merged 3 commits into from
Aug 9, 2023
Merged

Conversation

algochoi
Copy link
Contributor

@algochoi algochoi commented Aug 8, 2023

Adds check when encoding address to string that address is 32 bytes. Also fixes an example that would fail this check because it passes an empty bytearray to encode. Targets the v3 branch.

#805

algosdk.base64ToBytes(globalState.value.bytes)
);
// show global value
const globalValue = globalState.value.bytes;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seemed to be a zero-length byte array in the example test

@algochoi algochoi marked this pull request as ready for review August 9, 2023 12:50
@algochoi algochoi requested a review from a team August 9, 2023 13:09
Copy link
Contributor

@winder winder left a comment

Choose a reason for hiding this comment

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

LGTM.

Does this SDK have non-cucumber unit tests? If yes, I'd add a test.

@algochoi
Copy link
Contributor Author

algochoi commented Aug 9, 2023

@winder good point -- added a unit test to check for correct error throwing: 5bdd1f1

@algochoi algochoi merged commit 81ab6eb into 3.0.0 Aug 9, 2023
1 check passed
@algochoi algochoi deleted the check-encode branch August 9, 2023 18:11
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.

2 participants