public IPeerAllocationStrategy Create(BlocksRequest request) { IPeerAllocationStrategy baseStrategy = new BlocksSyncPeerAllocationStrategy(request.NumberOfLatestBlocksToBeIgnored); TotalDiffStrategy totalDiffStrategy = new TotalDiffStrategy(baseStrategy); return(totalDiffStrategy); }
public IPeerAllocationStrategy Create(BlocksRequest?request) { // because of the way the generics cannot handle T / T? if (request == null) { throw new ArgumentNullException( $"NULL received for allocation in {nameof(BlocksSyncPeerAllocationStrategyFactory)}"); } IPeerAllocationStrategy baseStrategy = new BlocksSyncPeerAllocationStrategy(request.NumberOfLatestBlocksToBeIgnored); TotalDiffStrategy totalDiffStrategy = new(baseStrategy); return(totalDiffStrategy); }