Пример #1
0
        protected void RunTest(DifficultyTests test, ISpecProvider specProvider)
        {
            IDifficultyCalculator calculator = new DifficultyCalculator(specProvider);

            UInt256 difficulty = calculator.Calculate(
                test.ParentDifficulty,
                test.ParentTimestamp,
                test.CurrentTimestamp,
                test.CurrentBlockNumber,
                test.ParentHasUncles);

            Assert.AreEqual(test.CurrentDifficulty, difficulty, test.Name);
        }
Пример #2
0
 public void Test(DifficultyTests test)
 {
     RunTest(test, new SingleReleaseSpecProvider(Frontier.Instance, 1));
 }
Пример #3
0
 public void Test_main(DifficultyTests test)
 {
     RunTest(test, MainNetSpecProvider.Instance);
 }
Пример #4
0
 public void Test(DifficultyTests test)
 {
     RunTest(test, new SingleReleaseSpecProvider(Olympic.Instance, 0));
 }
Пример #5
0
 public void Test(DifficultyTests test)
 {
     RunTest(test, new MordenSpecProvider());
 }
Пример #6
0
 public void Test_basic(DifficultyTests test)
 {
     RunTest(test, MainnetSpecProvider.Instance);
 }
Пример #7
0
 public void Test(DifficultyTests test)
 {
     RunTest(test, new SingleReleaseSpecProvider(Constantinople.Instance, 1));
 }
 public void Test(DifficultyTests test)
 {
     RunTest(test, RopstenSpecProvider.Instance);
 }