Closed concordium-cl closed 3 years ago
So basically this is related to what I was asking here https://github.com/Concordium/concordium-reference-wallet-ios/pull/57#discussion_r716933271 The decoder must ensure that the entire input was decoded, not just that the prefix was.
@abizjak
How does a similar transaction looks on web and/or Android ?
Just for reference here is the library func that does the decoding
It should look like displayed in this screenshot https://github.com/Concordium/concordium-reference-wallet-android/issues/33
Essentially, it should fall back to displaying hex (the same as if the decoding fails currently).
This seems to have been fixed. But a new issue related to memos has appeared: https://github.com/Concordium/concordium-reference-wallet-ios/issues/77
Related to task https://github.com/Concordium/concordium-reference-wallet-ios/issues/34
Bug Description For a memo.txt with content this is a memo text in a file some characters are wrongly interpreted as type and length.
Below is the file and the old network dashboard output.
The iOS output is exactly the same:
@abizjak explanation: The letter t's ASCII code is 116 which is 01110100 in binary. The way CBOR encoding works is it looks at the first 3 bits to determine the type, in this case the type is determined to be (3=011 ) which is string. The remaining 5 bits are 10100 which is 20 in decimal, which is interpreted as the lenght of the remaining string. Hence the remaining 20 bytes are decoded.
Steps to Reproduce
--memo-raw memo.txt
Expected Result The memo should be printed as hex value in case of invalid CBOR.
Actual Result See above.
Versions