コード例 #1
0
ファイル: Program_simulating.cs プロジェクト: MaxDZ8/fastdee
        static Stratum.Response.MiningSubscribe MakeSubscribe(ReplicationData.Subscribe repl)
        {
            var nonce1   = HexHelp.DecodeHex(repl.extraNonce1);
            var nonce2sz = GoodNonce2SizeOrThrow(repl.nonce2sz);

            return(new Stratum.Response.MiningSubscribe("abcdef0123456789", nonce1, nonce2sz));
        }
コード例 #2
0
ファイル: Program_simulating.cs プロジェクト: MaxDZ8/fastdee
        static Stratum.Notification.NewJob MakeJob(ReplicationData.Job repl)
        {
            var jobid        = "abcd";
            var cbHead       = HexHelp.DecodeHex(repl.cbHead);
            var cbTail       = HexHelp.DecodeHex(repl.cbTail);
            var parsedMerkle = DecodeMerkles(repl.merkles);
            var bver         = HexHelp.DecodeHex(repl.blockVersion);
            var ndiff        = HexHelp.DecodeHex(repl.networkDiff);
            var ntime        = HexHelp.DecodeHex(repl.networkTime);
            var res          = new Stratum.Notification.NewJob(jobid, bver, null, cbHead, cbTail, ndiff, ntime, true);

            HexHelp.DecodeInto(res.prevBlock.blob, repl.prevHash);
            res.merkles.AddRange(parsedMerkle);
            return(res);
        }
コード例 #3
0
 public void BytesComeInStringOrder(string hex, byte[] expected)
 {
     Assert.Equal(expected, HexHelp.DecodeHex(hex));
 }
コード例 #4
0
 public void HexStringsMustHaveEvenLength(string hex)
 {
     Assert.Throws <BadParseException>(() => HexHelp.DecodeHex(hex));
 }
コード例 #5
0
 public void HexStringCannotBeEmpty()
 {
     Assert.Throws <BadParseException>(() => HexHelp.DecodeHex(""));
 }