Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 public void Test(DifficultyTests test)
 {
     RunTest(test, new SingleReleaseSpecProvider(Frontier.Instance, 1));
 }
Ejemplo n.º 3
0
 public void Test_main(DifficultyTests test)
 {
     RunTest(test, MainNetSpecProvider.Instance);
 }
Ejemplo n.º 4
0
 public void Test(DifficultyTests test)
 {
     RunTest(test, new SingleReleaseSpecProvider(Olympic.Instance, 0));
 }
Ejemplo n.º 5
0
 public void Test(DifficultyTests test)
 {
     RunTest(test, new MordenSpecProvider());
 }
Ejemplo n.º 6
0
 public void Test_basic(DifficultyTests test)
 {
     RunTest(test, MainnetSpecProvider.Instance);
 }
Ejemplo n.º 7
0
 public void Test(DifficultyTests test)
 {
     RunTest(test, new SingleReleaseSpecProvider(Constantinople.Instance, 1));
 }
Ejemplo n.º 8
0
 public void Test(DifficultyTests test)
 {
     RunTest(test, RopstenSpecProvider.Instance);
 }