Skip to content

Need to clean up network::encodable and network::serialize #155

@apoelstra

Description

@apoelstra

I think in the next major release we should fix the module names for the consensus encodable/decodable traits. Specifically I propose removing the serialize, encodable and consensus_params modules

  • network::encodable::VarInt -> consensus::encode::VarInt and expose it at the crate level
  • network::encodable::VarInt -> consensus::encode::CheckedData
  • network::consensus_params -> consensus::params
  • network::consensus_params::ConsensusParams -> consensus::params::Params
  • network::encodable::ConsensusEncodable -> consensus::encode::Encodable but expose it as consensus::Encodable
  • network::encodable::ConsensusDecodable -> consensus::encode::Decodable but expose it as consensus::Decodable
  • network::seriailize::Error -> consensus::encode::Error
  • network::serialize::BitcoinHash -> util::hash::BitcoinHash and expose it at crate level
  • network::serialize::RawEncoder -> consensus::encode::RawEncoder and expose it as consensus::RawEncoder
  • network::serialize::RawDecoder -> consensus::encode::RawDecoder and expose it as consensus::RawDecoder
  • network::serialize::SimpleEncoder -> consensus::encode::Encoder and expose it as consensus::Encoder
  • network::serialize::SimpleDecoder -> consensus::encode::Decoder and expose it as consensus::Decoder

Finally, we should deprecate everything in network::socket and network::listener because low-level networking is out of scope for this library. That leaves only p2p network messages under network, which is good. (Though we should also rename/restructure the modules there - I'll open yet another issue about that.)

Unrelatedly, we should also delete nu_select from macros.rs because this is horribly bitrotted and I doubt it even compiles anymore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions