Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
fassadlr committed Sep 1, 2021
2 parents 7bac980 + 8992048 commit 05c99e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -83,7 +84,7 @@ public override async Task RunAsync(RuleContext context)
}

// Look at the last round of blocks to find the previous time that the miner mined.
var roundTime = this.slotsManager.GetRoundLength(federation.Count);
TimeSpan roundTime = this.slotsManager.GetRoundLength(federation.Count);
int blockCounter = 0;

for (ChainedHeader prevHeader = chainedHeader.Previous; prevHeader.Previous != null; prevHeader = prevHeader.Previous)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Text;
using System.Xml;
using Microsoft.Build.Construction;
using Microsoft.Extensions.DependencyInjection;
using Xunit;

namespace Stratis.Bitcoin.Tests.PackagesAndVersions
Expand Down Expand Up @@ -36,6 +38,8 @@ public void EnsureVersionsBumpedWhenChangingPublishedPackages()
var referencedVersions = projectFiles.ToDictionary(p => p.Key, p => p.Value.SelectSingleNode("Project/PropertyGroup/Version")?.InnerText);
var projectsToCheck = new List<string>(projectsByPath.Keys);

var debugLog = new StringBuilder();

while (projectsToCheck.Count > 0)
{
string projectFolder = projectsToCheck.First();
Expand Down Expand Up @@ -135,6 +139,8 @@ public void EnsureVersionsBumpedWhenChangingPublishedPackages()

if (cmpVersion != referencedVersions[includeFullPath])
{
string msg = $"Comparing the local project '{project.ProjectName}' version {version} with its published package, '{targetName}', the published package references version '{cmpVersion}' of '{name3}' while the local project references version '{referencedVersions[includeFullPath]}'.";
debugLog.AppendLine(msg);
versionsMatch = false;
break;
}
Expand All @@ -148,7 +154,7 @@ public void EnsureVersionsBumpedWhenChangingPublishedPackages()
referencedVersions[projectFolder] = "mismatch";
}

Assert.Empty(modifiedPackages);
Assert.True(modifiedPackages.Count == 0, $"{debugLog.ToString()} Affected packages: {string.Join(", ", modifiedPackages)}");
}

static bool DirectoryEquals(string directory1, string directory2)
Expand Down

0 comments on commit 05c99e1

Please sign in to comment.