<s> import io <EOL> import unittest <EOL> from pycoin . block import Block <EOL> from pycoin . serialize import b2h_rev , h2b <EOL> class BlockTest ( unittest . TestCase ) : <EOL> def test_block ( self ) : <EOL> expected_checksum = '<STR_LIT>' . lower ( ) <EOL> block_data = h2b ( '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' ) <EOL> block = Block . parse ( io . BytesIO ( block_data ) ) <EOL> print ( block ) <EOL> assert b2h_rev ( block . hash ( ) ) == expected_checksum <EOL> for tx in block . txs : <EOL> print ( tx ) <EOL> for t in tx . txs_in : <EOL> print ( "<STR_LIT>" % t ) <EOL> for t in tx . txs_out : <EOL> print ( "<STR_LIT>" % t ) <EOL> block . check_merkle_hash ( ) <EOL> def main ( ) : <EOL> unittest . main ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
