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

Fix nock compilation and builtin evaluation of sha256 stdilb #3175

Merged
merged 6 commits into from
Nov 14, 2024

Conversation

paulcadman
Copy link
Collaborator

This PR:

  1. Fixes the compilation of the sha256 builtin anoma lib call

A sha256 hash is 32 bytes long, not 64 bytes. This number is used when constructing the ByteArray representation (i.e [length payload] cell) of the output of Anoma stdlib sha256 call. The Anoma stdlib sha256 call just returns the atom payload.

  1. Fixes the evaluation of the sha256 stdlib call

Previously we were converting the sha256 hash bytestring to Base16 format. This is convenient when displaying the ByteString hash. However the Anoma nock interpreter outputs the raw bytes so we must change the builtin evaluator to match this behaviour.

After these fixes we can re-enable the test084 anoma compilation test.

A sha256 hash is 32 bytes, not 64 bytes.
The builtin nock evaluator must match the behaviour of the anoma nock evaluator
lukaszcz
lukaszcz previously approved these changes Nov 14, 2024
janmasrovira
janmasrovira previously approved these changes Nov 14, 2024
The output of sha256 hash is no longer Base16 encoded
@paulcadman
Copy link
Collaborator Author

I forgot to update the other sha256 tests, this is now done.

@janmasrovira janmasrovira merged commit 49c14be into main Nov 14, 2024
4 checks passed
@janmasrovira janmasrovira deleted the fix-nock-sha256 branch November 14, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants