Open
Description
Issue to be solved
The Crypto contract's functions to construct a signature algorithm and hash algorithm current return nil
if an invalid input is provided. This is definitely good to have, but additionally, it would be nice to have additional constructors that panic with a helpful error message so users can easily see what has gone wrong. An attempt at an error message like this is included here but it would make much more sense for this to be in the Crypto contract so we can have a standard format and not have to hard code the error message in transactions.
Suggested Solution
- Include new constructors for HashAlgorithm and SignatureAlgorithm that panic with a helpful error message like what was linked above if invalid inputs were provided.
- Constructors like this might also be useful for other types in the Crypto contract