Skip to content

💥 Off-chain messages: Naming conventions and type export for wire serialization #302

@manoranjith

Description

@manoranjith

Location

[client, wire]

Problem

Currently, multiple conventions are used for naming structs that represent off-chain messages.

  1. Exported types and suffix Msg (see wire/controlmsgs.go): ShutdownMsg, PingMsg etc.,
  2. Exported types with no suffix or prefix (see client/proposalmsgs.go): LedgerChannelProposal, LedgerChannelProposalAcc etc.,
  3. Unexported types with no suffix or prefix (see client/updatemsgs.go): virtualChannelFundingProposal and virtualChannelSettlementProposal
  4. Unexported types with prefix msg (see client/updatemsgs.go): msgChannelUpdate, msgChannelUpdateAcc

The has two issues:

  1. For implementing the protobuff adapter, all the types that represent off-chain messages must be exported.
  2. It would be better to use a uniform naming convention, to make it more readable.

Proposal

My proposal is to consistently use the first style (exported types with suffix Msg for all the types.

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