near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.32k stars 623 forks source link

reconsider CryptoHash interfaces #471

Closed azban closed 5 years ago

azban commented 5 years ago

From<Vec<u8>> for CryptoHash is confusing because it silently truncates a longer vector.. the hash function is actually what i was looking for, but this isn't really clear

cc: @ilblackdragon , @bowenwang1996

azban commented 5 years ago

i think signature interface also needs a little polish.. froms and new on everything seems wonky and panics rather than returning results

bowenwang1996 commented 5 years ago

What's the plan for this? Should we implement TryFrom instead?