ockam icon indicating copy to clipboard operation
ockam copied to clipboard

Stop deriving Message trait implementation for all Serialize&Deserialize structs

Open SanjoDeundiak opened this issue 4 years ago • 1 comments
trafficstars

We probably want to be derive Message trait only explicitly using

#[derive(Message)]

Without that, it's very easy to send things not intended to be Messages (happened few times)

SanjoDeundiak avatar Sep 09 '21 14:09 SanjoDeundiak

Hey @SanjoDeundiak, I could try to help with this.

After looking through the code, I think this could be approached in the following steps:

  • Introduce a new crate for proc macro, something like ockam_message_derive.
  • By default implement the trait for types like ockam_core::Any, String, Vec<8u> etc.
  • Go through the codebase deriving Message for existing custom message types.

Let me know what do you think about it. Thanks!

Szymongib avatar Oct 23 '21 12:10 Szymongib