示例#1
0
        public void EncodeDecodeBlockHeader()
        {
            BlockHeaderEncoder encoder = new BlockHeaderEncoder();
            Hash        hash           = new Hash();
            BlockHeader header         = new BlockHeader(1, hash);

            var result = encoder.Decode(encoder.Encode(header));

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Number);
            Assert.AreEqual(hash, result.ParentHash);
        }
        public void EncodeDecodeBlockHeader()
        {
            BlockHeaderEncoder encoder    = new BlockHeaderEncoder();
            BlockHash          parentHash = new BlockHash(new byte[] { 1, 2, 3 });
            Hash        transactionsHash  = new Hash();
            BlockHeader header            = new BlockHeader(1, parentHash, transactionsHash);

            var result = encoder.Decode(encoder.Encode(header));

            Assert.IsNotNull(result);
            Assert.AreEqual(1ul, result.Number);
            Assert.AreEqual(parentHash, result.ParentHash);
            Assert.AreEqual(transactionsHash, result.TransactionsHash);
        }