public void RoundTripBitcoinSerializedTransactions(
            Transaction expectedTx,
            byte[] expectedSerializedTx)
        {
            var tx = new Transaction(expectedSerializedTx, 0);

            Assert.AreEqual(expectedTx, tx);
            BitcoinSerializableTest.AssertThatSerializedArrayMatches(expectedSerializedTx, expectedTx);
        }
示例#2
0
        public void RoundTripBitcoinSerializedBlocks(
            byte[] serializedBlock,
            int offset,
            Block expectedHeader,
            Hash256 expectedHash,
            IEnumerable <Hash256> expectedMerkleTree)
        {
            var block = new Block(serializedBlock, offset);

            BlockTest.AssertThatMerkleTreeMatches(block.MerkleTree, expectedMerkleTree);
            BlockTest.AssertThatBlockHeaderMatches(block, expectedHeader);
            BitcoinObjectTest.AssertThatHashMatches(block, expectedHash);
            BitcoinSerializableTest.AssertThatSerializedArrayMatches(serializedBlock, block);
        }