Closed nrempel closed 6 years ago
Indy-sdk throws a CommonInvalidStructure on a raw value that is not a string.
The raw value is just a noise as far as indy-sdk is concerned. The encoded value is the authoritative payload, and the way to get its true original corresponding raw value is codec.decode()
.
Ok, good to know. Thanks.
Can you modify cred_attr_value
to encode None values as an empty string instead of the string 'None'?
https://github.com/PSPC-SPAC-buyandsell/von_agent/blob/master/von_agent/codec.py#L101
>>> str(None) == 'None'
True
Sure, I can do that for the next release.
But the Right Thing is to use util.decode() on the encoded value. Otherwise you cannot tell between None and its sentinel. For that matter, the Right Thing is always to use util.decode(), otherwise you will not be able to tell between numbers and numeric strings, among other things.
It seems that sending null values to create_cred results in those claims containing the string value 'None'. Is it possible to encode these as null?
https://github.com/PSPC-SPAC-buyandsell/von_agent/blob/master/von_agent/agents.py#L1065