예제 #1
0
        public void Solve()
        {
            byte[] solution = null;
            var    d        = new Difficulty(_difficulty);

            var result = BeamHash3.Solve(_input, _nonce, x =>
            {
                BeamHash3.IsValidSolution(_input, _nonce, x).Should().BeTrue();

                if (!Difficulty.TestDifficulty(x, _difficulty))
                {
                    return(false);
                }

                solution = x;
                return(true);
            });

            result.Should().BeTrue();
            solution.SequenceEqual(_solution).Should().BeTrue();
        }
예제 #2
0
 public void CheckValidationOfInvalidSolution()
 {
     _solution[0] = 0;
     BeamHash3.IsValidSolution(_input, _nonce, _solution).Should().BeFalse();
 }
예제 #3
0
 public void CheckIsValidSolution()
 {
     BeamHash3.IsValidSolution(_input, _nonce, _solution).Should().BeTrue();
 }