Skip to content

Better types for NodeToClientProtocols #1799

Open
@erikd

Description

@erikd

The code in cardano-node was incorrectly updated to:

      nodeToClientProtocols $ NodeToClientProtocols
      { localChainSyncProtocol = InitiatorProtocolOnly $
                                   MuxPeer
                                     nullTracer
                                     localTxSubmissionCodec
                                     (localTxSubmissionClientPeer localTxSubmissionClientNull)
      , localTxSubmissionProtocol = InitiatorProtocolOnly $
                                      MuxPeer
                                        nullTracer
                                        localChainSyncCodec
                                        (chainSyncClientPeer chainSyncClient)
      }

where the chain sync codec and peer was switched with the tx submission codec and peer. This code compiles without errors, in spite of being obviously incorrect.

Can this not be made type safe (preferably with Haskell98 types) so that something like this results in a compile error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    apithing related exposed apis

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions