Returns the block publisher based on the consensus module set by the
        "sawtooth_settings" transaction family.

        Args:
            state_hash (str): The current state root hash for reading settings.

        Raises:
            InvalidGenesisStateError: if any errors occur getting the
                BlockPublisher.

def _get_block_publisher(self, state_hash):
        """Returns the block publisher based on the consensus module set by the
        "sawtooth_settings" transaction family.

        Args:
            state_hash (str): The current state root hash for reading settings.

        Raises:
            InvalidGenesisStateError: if any errors occur getting the
                BlockPublisher.
        """
        state_view = self._state_view_factory.create_view(state_hash)
        try:
            class BatchPublisher:
                def send(self, transactions):
                    # Consensus implementations are expected to have handling
                    # in place for genesis operation. This should includes
                    # adding any authorization and registrations required
                    # for the genesis node to the Genesis Batch list and
                    # detecting validation of the Genesis Block and handle it
                    # correctly. Batch publication is not allowed during
                    # genesis operation since there is no network to validate
                    # the batch yet.
                    raise InvalidGenesisConsensusError(
                        'Consensus cannot send transactions during genesis.')

            consensus = ConsensusFactory.get_configured_consensus_module(
                NULL_BLOCK_IDENTIFIER,
                state_view)
            return consensus.BlockPublisher(
                BlockCache(self._block_store),
                state_view_factory=self._state_view_factory,
                batch_publisher=BatchPublisher(),
                data_dir=self._data_dir,
                config_dir=self._config_dir,
                validator_id=self._identity_signer.get_public_key().as_hex())
        except UnknownConsensusModuleError as e:
            raise InvalidGenesisStateError(e)