aztec-packages
aztec-packages copied to clipboard
feat: key validation request key type runtime check
When passing around keys in aztec-nr it's very easy to make a mistake and pass e.g. ivpk to a function instead of ovpk. This has recently happened in Nico's PR and it was quite a pain to debug. For this reason I added a check that verifies that either nsk_app or ovsk_app is requested.
When I was coding this it came to my mind that insted of having this runtime check we could use type system to have a compile time check. This would require creating a type for each of the key types we currently have. I think this is the way to go so I would probably not merge this and do the compile time check instead.