Example #1
0
        public void VarDiff_Should_Honor_MinDiff_When_Adjusting_Down()
        {
            var vdm = new VarDiffManager(config);
            var ctx = new WorkerContextBase {
                Difficulty = 1500, VarDiff = new VarDiffContext()
            };

            var shares = new List <long> {
                2000000000, 3000000000, 4000000000
            };
            var newDiff = vdm.Update(ctx, shares, string.Empty, logger);

            Assert.NotNull(newDiff);
            Assert.True(newDiff.Value.EqualsDigitPrecision3(1000));
        }
        public void VarDiff_Should_Honor_MaxDelta_When_Adjusting_Up()
        {
            var vdm = new VarDiffManager(config, clock);
            var ctx = new WorkerContextBase {
                Difficulty = 7500, VarDiff = new VarDiffContext()
            };

            var shares = new List <long> {
                2, 3, 4
            };
            var newDiff = vdm.Update(ctx, shares, string.Empty, logger);

            Assert.NotNull(newDiff);
            Assert.True(newDiff.Value.EqualsDigitPrecision3(8500));
        }