-
Notifications
You must be signed in to change notification settings - Fork 259
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 safe API for ripemd160 #643
Comments
This will be made very easy after #646 comes in |
@austinabell While trying to implement a safe API call for RIPEMD-160 (based on top of #646 as per your last comment), I encountered this error:
At first, I thought this was because of the old nearcore crate (as ripemd160 seems to have been introduced fairly recently) so I tried rebasing on top of #639. Unfortunately the issue did not go away and I am not sure what I am doing wrong... Maybe I need to re-generate something? My branch is here: https://github.com/near/near-sdk-rs/tree/safe-api-ripemd-160 |
Nevermind, just took a look at literally the next issue in the list (#631) and instantly realized what went wrong 🤦 I was missing a mocked implementation of |
My apologies, forgot to link to that PR! You only need this for mocked implementation and you are trying to write a unit test |
This could have use cases, so we should support this interface. Unlike the APIs that exist within the SDK for other hash functions, an array of 20 bytes should be returned (
[u8; 20])
, since it is guaranteed this is always the length and fixed.API should look roughly like:
and live in
near_sdk::env
The text was updated successfully, but these errors were encountered: