def _verify_common(self, block: 'Block', prev_block: 'Block', **kwargs):
    generator: 'ExternalAddress' = kwargs.get('generator')
    header: BlockHeader = block.header
    body: BlockBody = block.body
    builder = BlockBuilder.new(self.version, self._tx_versioner)
    builder.height = header.height
    builder.prev_hash = header.prev_hash
    builder.fixed_timestamp = header.timestamp
    for tx in body.transactions.values():
        builder.transactions[tx.hash] = tx
    invoke_result = None
    if self.invoke_func:
        self.verify_invoke(builder, block, prev_block)
    builder.build_merkle_tree_root_hash()
    if (header.merkle_tree_root_hash != builder.merkle_tree_root_hash):
        exception = RuntimeError(f'Block({header.height}, {header.hash.hex()}, MerkleTreeRootHash({header.merkle_tree_root_hash.hex()}), Expected({builder.merkle_tree_root_hash.hex()}).')
        self._handle_exception(exception)
    builder.build_hash()
    if (header.hash != builder.hash):
        exception = RuntimeError(f'Block({header.height}, {header.hash.hex()}, Hash({header.hash.hex()}, Expected({builder.hash.hex()}).')
        self._handle_exception(exception)
    if generator:
        self.verify_generator(block, generator)
    return invoke_result
def _verify_common(self, block: 'Block', prev_block: 'Block', **kwargs):
    generator: 'ExternalAddress' = kwargs.get('generator')
    header: BlockHeader = block.header
    body: BlockBody = block.body
    builder = BlockBuilder.new(self.version, self._tx_versioner)
    builder.height = header.height
    builder.prev_hash = header.prev_hash
    builder.fixed_timestamp = header.timestamp
    for tx in body.transactions.values():
        builder.transactions[tx.hash] = tx
    invoke_result = None
    if self.invoke_func:
        self.verify_invoke(builder, block, prev_block)
    builder.build_merkle_tree_root_hash()
    if (header.merkle_tree_root_hash != builder.merkle_tree_root_hash):
        exception = RuntimeError(f'Block({header.height}, {header.hash.hex()}, MerkleTreeRootHash({header.merkle_tree_root_hash.hex()}), Expected({builder.merkle_tree_root_hash.hex()}).')
        self._handle_exception(exception)
    builder.build_hash()
    if (header.hash != builder.hash):
        exception = RuntimeError(f'Block({header.height}, {header.hash.hex()}, Hash({header.hash.hex()}, Expected({builder.hash.hex()}).')
        self._handle_exception(exception)
    if generator:
        self.verify_generator(block, generator)
    return invoke_result