linera-protocol icon indicating copy to clipboard operation
linera-protocol copied to clipboard

Serialize `MessageId` as a string if `is_human_readable`. Revisit other `bcs_scalar!` types.

Open afck opened this issue 8 months ago • 0 comments

If one uses MessageId as a field in a struct returned from a GraphQL query, that field will be a string with the hexadecimal representation of the message ID's BCS serialization. Using serde_json to deserialize the struct will fail, because it will expect MessageId as a struct.

We should probably revisit all types where we are using bcs_scalar!, and change them so that the serde serialization implementation also uses a string if is_human_readable().

afck avatar Mar 05 '25 10:03 afck