Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Leaner swarm/network and p2p/simulations #1076

Closed
wants to merge 18 commits into from
Closed

Commits on Dec 24, 2018

  1. swarm/network: remove unused opts param of AddNodes* function

    Only AddNode() had some valid use cases for AddNodeOption, but yet
    the params were propagated everywhere.
    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    44a9741 View commit details
    Browse the repository at this point in the history
  2. p2p/simulations: add more test cases for ConnectNodesFull()

    As I surprised myself it works even with 0 or 1 nodes.
    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    b407261 View commit details
    Browse the repository at this point in the history
  3. swarm/network: remove AddNodesAndConnectFull() method

    Added no useful functionality as it was just combining 2 simple
    methods and the function was only used in its own test.
    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    eec450b View commit details
    Browse the repository at this point in the history
  4. swarm/network: remove AddNodesAndConnectStar() method

    The method was used only its own test.
    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    a899495 View commit details
    Browse the repository at this point in the history
  5. p2p/simulations: remove everything related to pivot from connect.go

    As the concept and the related functionality was not used anywhere.
    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    248b46e View commit details
    Browse the repository at this point in the history
  6. p2p/simulations: remove unused Err and private method

    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    9d76ab0 View commit details
    Browse the repository at this point in the history
  7. swarm/network: remove everything related to pivot from Simulation

    As the concept and the related functionality was not used anywhere.
    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    28cdb50 View commit details
    Browse the repository at this point in the history
  8. swarm/network: remove unused Start/StopRandomNode()

    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    7c8b0b8 View commit details
    Browse the repository at this point in the history
  9. swarm/network: remove unused AddNodeWithMsgEvents()

    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    9a6ea0d View commit details
    Browse the repository at this point in the history
  10. swarm/network: remove unused AddNodeWithService()

    That also makes AddNodeOption type and the AddNode's AddNodeOptions
    parameter unnecessary.
    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    242cd7b View commit details
    Browse the repository at this point in the history
  11. swarm/network: remove unused Start/StopNode()

    As we can just call Stop() on Network.
    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    2808be2 View commit details
    Browse the repository at this point in the history
  12. swarm/network: remove AddNodesAndConnectRing() method

    The utility of this function was very low. The method just combined
    two simple calls into one and was used in only one place.
    
    Note: verifyRing() now can be private.
    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    5decff8 View commit details
    Browse the repository at this point in the history
  13. swarm/network: remove AddNodesAndConnectChain() method

    This was the lat mixed responsibility function in node.go, i.e.,
    not just adding but connecting nodes. As the responsibility of
    connecting nodes belongs to p2p/simulations/connect.go I removed the
    method.
    
    Note: there was just one complex use case for AddNodesAndConnectChain
    in testSwarmNetwork where we actually added nodes more than once and
    we still wanted to keep them in chain topology. There I introduced
    a test helper function.
    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    fa98d4e View commit details
    Browse the repository at this point in the history
  14. swarm/network: fix unused method parameters inspections

    Ferenc Szabo committed Dec 24, 2018
    Configuration menu
    Copy the full SHA
    fc44737 View commit details
    Browse the repository at this point in the history

Commits on Dec 26, 2018

  1. p2p/simulations: drop unused Connect* methods from connect.go

    The deleted methods were all unused. So I don't want to maintain them
    during refactor.
    Ferenc Szabo committed Dec 26, 2018
    Configuration menu
    Copy the full SHA
    999f79a View commit details
    Browse the repository at this point in the history
  2. p2p/simulations: fix code inspection problems

    - typos
    - unused global variable
    - unused function parameters
    - redundant import alias
    - code style issue: snake case
    Ferenc Szabo committed Dec 26, 2018
    Configuration menu
    Copy the full SHA
    b56ecc2 View commit details
    Browse the repository at this point in the history
  3. swarm/network: fix code inspection problems

    - typos
    - redundant import alias
    Ferenc Szabo committed Dec 26, 2018
    Configuration menu
    Copy the full SHA
    75eeaa0 View commit details
    Browse the repository at this point in the history

Commits on Dec 28, 2018

  1. swarm/network: bring back AddNodeOption for AddNode()

    During my code cleanup efforts I removed the AddNodeOption type and
    related functionality. As that was not used anywhere.
    
    However, during code review I was asked to bring back the functionality.
    Here I'm doing that; still, I would prefer to follow YAGNI.
    Ferenc Szabo committed Dec 28, 2018
    Configuration menu
    Copy the full SHA
    93c5c3f View commit details
    Browse the repository at this point in the history