Skip to content

Move the Encoder/Encode/Decode traits from Storage to a different crate #2403

@acerone85

Description

@acerone85

Context:

The storage crate defines three traits, Encoder Encode and Decode to encode and decode data that can be serialized/deserialized with Serde. See

pub trait Encoder {

In #2388, a similar approach is taken in the p2p service, where similar are defined and implemented. These traits serve the same purpose as the storage ones, but they have a slightly different interface. See

pub trait Encoder: Send {
.

Proposal:

  • Move the Encoder, Encode and Decode trait from storage to a separate crate (maybe fuel_types?)
  • Change the interface to be compatible with the traits used both in the P2P service and in the storage crate,
  • Refactor P2P service and Storage crate to implement the new traits, and deprecate the old ones.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions