Example #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);
        }
 public void Test(DifficultyTests test)
 {
     RunTest(test, new SingleReleaseSpecProvider(Frontier.Instance, 1));
 }
 public void Test_main(DifficultyTests test)
 {
     RunTest(test, MainNetSpecProvider.Instance);
 }
 public void Test(DifficultyTests test)
 {
     RunTest(test, new SingleReleaseSpecProvider(Olympic.Instance, 0));
 }
Example #5
0
 public void Test(DifficultyTests test)
 {
     RunTest(test, new MordenSpecProvider());
 }
 public void Test_basic(DifficultyTests test)
 {
     RunTest(test, MainnetSpecProvider.Instance);
 }
Example #7
0
 public void Test(DifficultyTests test)
 {
     RunTest(test, new SingleReleaseSpecProvider(Constantinople.Instance, 1));
 }
 public void Test(DifficultyTests test)
 {
     RunTest(test, RopstenSpecProvider.Instance);
 }