Open FabijanC opened 4 months ago
I updated the steps to reproduce with more info.
Not opening a new issue because the following finding is relevant to this topic:
The expecting
method of FeltVisitor
is not implemented properly:
https://github.com/starknet-io/types-rs/blob/a6bcf4a5471d3673d23fda30fc55f7b333f4ec14/crates/starknet-types-core/src/felt/mod.rs#L963
It results in errors like this:
Invalid block ID: invalid type: number, expected Failed to deserialize hexadecimal string at line 1 column 33'
Bug Report
types-rs version:
0.1.5
Current behavior:
When using
Felt::from_hex
or deserializing, if the input is too long, the code panics.Expected behavior:
I'd prefer it to return
Err
rather than panic because I can do nothing about that except write my own wrapper, which beats the purpose of having a unified Felt type.Steps to reproduce:
E.g.:
But not just that, if you replace
65
with63
, it doesn't panic but gives this output:Other information: