massa
massa copied to clipboard
Encapsulate the different states of the `SecureSend` wrapper into a state-machine of some sort.
Is your feature request related to a problem? Please describe.
Right now, the SecureSend
wrapper does not communicate which step of the process is current.
- Signed data for sending
- received data yet to be deserialized
- deserialized data but not yet verified
- verified data
Describe the solution you'd like
A state-machine of some sort, which encapsulates the appropriate states
Describe alternatives you've considered
none yet
Additional context
critically important to not allow mutability of the data. Will probably need to think of an api and pub
model.
Encapsulating state introduces data overhead unless the optimiser is able to do its thing. I don't think it would be an issue in the general case, but could contribute to "death by a thousand cuts", particularly if the overhead is included in data-transfer channels
I came across this discussion on reddit about dependent typing that made me think of this: https://old.reddit.com/r/rust/comments/104md0s/is_coding_in_rust_as_bad_as_in_c_a_practical/j37v4z5/
I'm not too good with GAT, and other type-system wizzardries that you'll find a lot in languages like Haskell. I'm wondering if this would be a good use-case for such a type-system.