sdk-core icon indicating copy to clipboard operation
sdk-core copied to clipboard

Implement dataconverter-esque facility for prototype SDK

Open Sushisource opened this issue 3 years ago • 0 comments

We need a more ergonomic way to deal with payloads in testing (and of course eventually in the real Rust SDK).

My initial inclination is to use serde traits as a requirement on all types which are eventually turned into payloads. Then there would also be a dataconverter trait which allows creating a series of layers like so:

serde::Serialize -> DCSerializer (chooses a format, ex: serde_json or bincode) -> Payload -> DCRaw (operates on raw payloads to allow things like compression or encryption) -> Payload

Then in reverse, outputting a serde::Deserialize when reading payloads in.

Sushisource avatar Aug 20 '21 16:08 Sushisource