public void ValidateBlockCalculations( Block actual, Block expectedHeader, Hash256 expectedHash, Hash256[] expectedMerkleTree) { BlockTest.AssertThatMerkleTreeMatches(actual.MerkleTree, expectedMerkleTree); BlockTest.AssertThatBlockHeaderMatches(actual, expectedHeader); BitcoinObjectTest.AssertThatHashMatches(actual, expectedHash); }
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); }
public void VerifyTransactionHash( Hash256 txHash, Transaction tx) { BitcoinObjectTest.AssertThatHashMatches(tx, txHash); }