Implement proper deserialization instead of just FromStr for things that should be passable by both blob and CLI input #26

Open
opened 2024-12-21 00:27:39 +00:00 by ryan · 0 comments
Owner

Currently we have to .to_string() the decimals count of sol get-token-info to get it as a string, which is what transfer-token expects. We should have a mechanism that tries to deserialize the given type from the deserializer directly, and if that doesn't work, deserialize using std::str::FromStr.

This means that a JSON input passing a number, would use the native deserializer for u8. Passing a CLI argument would pass u8::from_str().

Currently we have to .to_string() the decimals count of `sol get-token-info` to get it as a string, which is what `transfer-token` expects. We should have a mechanism that tries to deserialize the given type from the deserializer directly, and if that doesn't work, deserialize using std::str::FromStr. This means that a JSON input passing a number, would use the native deserializer for `u8`. Passing a CLI argument would pass `u8::from_str()`.
ryan added this to the Icepick v0.2.0 milestone 2024-12-21 00:27:39 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: public/icepick#26
No description provided.