Пример #1
0
        private static void Test(long head, Keccak genesisHash, string forkHashHex, long next, string description, ISpecProvider specProvider)
        {
            byte[] expectedForkHash = Bytes.FromHexString(forkHashHex);
            byte[] forkHash         = ForkInfo.CalculateForkHash(specProvider, head, genesisHash);
            forkHash.Should().BeEquivalentTo(expectedForkHash, description);

            ForkId forkId = ForkInfo.CalculateForkId(specProvider, head, genesisHash);

            forkId.Next.Should().Be(next);
            forkId.ForkHash.Should().BeEquivalentTo(expectedForkHash);
        }
Пример #2
0
 protected override void EnrichStatusMessage(StatusMessage statusMessage)
 {
     base.EnrichStatusMessage(statusMessage);
     statusMessage.ForkId =
         ForkInfo.CalculateForkId(_specProvider, SyncServer.Head.Number, SyncServer.Genesis.Hash);
 }