juno
juno copied to clipboard
`felt.SetHex` allows setting invalid hexadecimal strings
Describe the bug
The *felt.SetHex function will allow setting an invalid hexadecimal string for some inputs i.e. "0xabcdefg" (where g is an invalid character).
Expected behavior
This should panic or return nil.
Additional context
The current implementation does not validate the string so a better approach might be to parse the string into a *big.Int and use the *felt.Felt.ToBigInt method to set the number similar to how *felt.Felt.SetString does.