示例#1
0
        public DiscoveryTestBuilder WithStepProposal(IHastingsOriginator stateCandidate = default,
                                                     bool mock                  = false,
                                                     PeerId peer                = default,
                                                     INeighbours neighbours     = default,
                                                     ICorrelationId expectedPnr = default)
        {
            var pnrCorrelationId = expectedPnr ?? CorrelationId.GenerateCorrelationId();

            _currentState = mock
                ? stateCandidate ?? DiscoveryHelper.MockOriginator(peer, neighbours)
                : stateCandidate ?? DiscoveryHelper.SubOriginator(peer, neighbours, pnrCorrelationId);

            return(this);
        }