예제 #1
0
        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);
        }